Decoding error on license file on macOS
See original GitHub issueSame issue as #35 and #37 but on macOS with a standard Python 3 install, not in a docker container.
Tested on 1.16.1.
$ pip-licenses --from=mixed --with-system --format=rst --with-license-file
Traceback (most recent call last):
File "/Users/user/proj/.tox/licenses/bin/pip-licenses", line 8, in <module>
sys.exit(main())
File "/Users/user/proj/.tox/licenses/site-packages/piplicenses.py", line 638, in main
print(output_string)
File "/Users/user/proj/.tox/licenses/lib-python/3/encodings/ascii.py", line 22, in encode
return codecs.ascii_encode(input, self.errors)[0]
UnicodeEncodeError: 'ascii' codec can't encode character '\xa9' in position 167881: ordinal not in range(128)
Python prompt for reference:
$ python
Python 3.6.9 (5da45ced70e5, Oct 09 2019, 19:13:07)
[PyPy 7.2.0 with GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Decoding Error when reading license file. · Issue #35 - GitHub
I ran pip-licenses inside a docker container of mine, and got the following exception: Traceback (most recent call last): File ...
Read more >macOS - License Verification Error License missing its DBInfo
macOS – Authorization error in macOS – License Verification Error License missing its DBInfo. After a Time Machine file restores in macOS you ......
Read more >Why am I being told "the license file selected appears to be ...
ERROR: The license file selected appears to be invalid. However, the license file I got was sent directly from MathWorks. How can I...
Read more >License decoding failed or License was not accepted error
When I attempt to install a license file for an add on, I see a "License decoding failed" or "License was not accepted"...
Read more >"The file could not be read. It may be corrupt or not licensed ...
1. You're using a file from a Pack which needs to be unlocked · 2. You're using an outdated version of Live on...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I add to the documentation as a frequently asked question about UnicodeEncodeError.
Your report was very helpful. Thanks a lot!
fixed it, thanks!
Still strange though. I suppose that it’s because
tox
doesn’t bring in any ENV variables by default. But, then again lots of Python programs can read Unicode files from withintox
, so I wonder if there is a way to makepip-licenses
work out of the box? It seems like if it’s reading arbitrary license files from PyPI it shouldn’t really need to assume the user has a certain locale?Hmm, not sure, but really appreciate the fix!