This is an archive of the discontinued Mercurial Phabricator instance.

setup: don't support py 3.5.0, 3.5.1, 3.5.2 because of bug in codecs
ClosedPublic

Authored by pulkit on Sep 4 2018, 4:12 PM.

Details

Summary

codecs.escape_encode() raises SystemError if an empty bytestring is passed. We
do that at some places in our code and because of this bug, things break.
Therefore we can't support the mentioned version. The bug was fixed in 3.5.3,
3.6.0 beta 2. We can't support 3.6.0 anyway because of bug in formatting
bytestrings.

Link to the python bug: https://bugs.python.org/issue25270

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

pulkit created this revision.Sep 4 2018, 4:12 PM
indygreg accepted this revision.Sep 4 2018, 5:11 PM
indygreg added a subscriber: indygreg.

I'm a bit wary of version sniffing for the same reason that User-Agent sniffing is bad in web design: it assumes that version number strings map to behavior. The best way to test for compatibility is to actually test for the feature/behavior and then act appropriately. For example, setup.py would try running codecs.escape_encode(b'') and then bail if the buggy behavior is encountered.

I'm not 100% sure it applies in this case, but it is common for distros to backport Python fixes from future versions. For example, RHEL/CentOS 7 have a Python 2.7.5 with the modern ssl module (which was introduced in 2.7.9). And I know the Debian Python packages also commonly backport fixes.

That being said, we don't yet support Python 3 and we may not even support Python 3.5 by the time we do officially support Python 3. So I'm OK with this patch as a stop-gap. We can always improve detection later if version sniffing is problematic in the wild.

This revision is now accepted and ready to land.Sep 4 2018, 5:11 PM

I'm a bit wary of version sniffing for the same reason that User-Agent sniffing is bad in web design: it assumes that version number strings map to behavior. The best way to test for compatibility is to actually test for the feature/behavior and then act appropriately. For example, setup.py would try running codecs.escape_encode(b'') and then bail if the buggy behavior is encountered.

The version-sniffing here is actually done by pip when considering what wheels etc to download, so it will actually help the user out considerably as I understand it.

This revision was automatically updated to reflect the committed changes.