Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package cannot be built in non utf-8 environments #55

Closed
jaraco opened this issue Feb 24, 2015 · 3 comments
Closed

package cannot be built in non utf-8 environments #55

jaraco opened this issue Feb 24, 2015 · 3 comments

Comments

@jaraco
Copy link
Owner

jaraco commented Feb 24, 2015

On the Ubuntu build daemons, $LC_ALL is C which causes Python 3's sys.getfilesystemencoding() to return 'ascii' instead of 'utf-8'. This breaks setup.py because of the non-ascii characters in CHANGES.txt, so you get a dreaded UnicodeDecodeError:

% LC_ALL=C python3 setup.py --help
Traceback (most recent call last):
  File "setup.py", line 23, in <module>
    long_description = open('README').read() + open('CHANGES.txt').read(),
  File "/usr/lib/python3.2/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 282: ordinal not in range(128)

@jaraco
Copy link
Owner Author

jaraco commented Feb 24, 2015

Let's try that as an attachment to avoid bitbucket wrapping the console output.


Original comment by: Barry Warsaw

@jaraco jaraco closed this as completed Feb 24, 2015
@jaraco
Copy link
Owner Author

jaraco commented Feb 24, 2015

To some extent, this has been fixed in the latest tip. I'm able to run setup.py --help without an error, but if I try to build the distribution or otherwise generate egg_info, it fails with an encode error in distutils.

{{{
jaraco@livid:~/projects/public/keyring$ LC_ALL=C python3 setup.py egg_info
running egg_info
writing requirements to keyring.egg-info/requires.txt
writing keyring.egg-info/PKG-INFO
Traceback (most recent call last):
File "setup.py", line 71, in
setup(**setup_params)
File "/usr/lib/python3.2/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.2/distutils/dist.py", line 917, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.2/distutils/dist.py", line 936, in run_command
cmd_obj.run()
File "/home/jaraco/.local/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/setuptools/command/egg_info.py", line 172, in run
writer(self, ep.name, os.path.join(self.egg_info,ep.name))
File "/home/jaraco/.local/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg/setuptools/command/egg_info.py", line 384, in write_pkg_info
metadata.write_pkg_info(cmd.egg_info)
File "/usr/lib/python3.2/distutils/dist.py", line 1015, in write_pkg_info
self.write_pkg_file(pkg_info)
File "/usr/lib/python3.2/distutils/dist.py", line 1038, in write_pkg_file
file.write('Description: %s\n' % long_desc)
UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 12654: ordinal not in range(128)
}}}

Apparently, [[https://github.com/pypa/virtualenv/issues/201|it's not possible to include international characters in a long description]].


Original comment by: Jason R. Coombs

@jaraco
Copy link
Owner Author

jaraco commented Feb 24, 2015

Removed non-ascii characters from CHANGES.txt. Fixes #55.

→ <>


Original comment by: Jason R. Coombs

jaraco pushed a commit that referenced this issue May 23, 2022
This patch adds a job that is able to accurately signal whether
all the expectations of the required jobs to succeed are met.

This job can then be used as a source of truth for judging whether
"CI passes" and can be used in the branch protection. It also plays
a role of a convenient "gate" — this is the only job that would have
to be listed in the branch protection as opposed to listing every
single job name generated by the test matrix (and they all have
different names — it's not possible to just select one `test` job
name).

Ref: https://github.com/re-actors/alls-green#why
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant