When building the www/py-feedgenerator port in FreeBSD using the poudriere tool, the build fails in the "configure" phase with a UnicodeDecodeError traceback in setup.py. This affects multiple versions of Python 3.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "setup.py", line 11, in <module>
LONG_DESCRIPTION = open('README.rst').read()
File "/usr/local/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 422: ordinal not in range(128)
*** Error code 1
Analysis
setup.py populates the contents of the package's long_description parameter by opening and reading the README.rst file. The file appears to be UTF-8 encoded, but setup.py does not specify an encoding, which causes the open function to fall back to guessing the encoding based on the platform and environment. In this case, Python guesses ASCII. Since README.rst includes a RIGHT SINGLE QUOTATION MARK (U+2019) character that cannot be represented in ASCII, the decode fails.
When building the
www/py-feedgenerator
port in FreeBSD using the poudriere tool, the build fails in the "configure" phase with aUnicodeDecodeError
traceback insetup.py
. This affects multiple versions of Python 3.Analysis
setup.py
populates the contents of the package'slong_description
parameter by opening and reading theREADME.rst
file. The file appears to be UTF-8 encoded, butsetup.py
does not specify an encoding, which causes theopen
function to fall back to guessing the encoding based on the platform and environment. In this case, Python guesses ASCII. SinceREADME.rst
includes a RIGHT SINGLE QUOTATION MARK (U+2019) character that cannot be represented in ASCII, the decode fails.