forked from raimon49/pip-licenses
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix reading license files with windows newlines
Fixes raimon49#55. By using `open()` rather than `codecs.open()` the newline-fixing behaviour from Python 3 can be used. Presumably `codecs.open()` was used previously to allow proper UTF-8 handling in Python 2, but since that has been dropped the normal `open()` can be used. Also drop some inner imports in tests and empty `setUp()` and `tearDown()` methods. Tested with: ``` $ pip install django-cors-headers==3.2.0 $ python piplicenses.py --with-license-file --no-license-path | grep -C 2 django-cors-headers END OF TERMS AND CONDITIONS django-cors-headers 3.2.0 MIT License Copyright 2017 Otto Yiu and other contributors http://ottoyiu.com ``` This showed the same breakage as in the issue before the fix.
- Loading branch information
1 parent
caca390
commit 6351666
Showing
2 changed files
with
10 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters