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

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Tue Sep 4 17:11:56 EDT 2018


indygreg accepted this revision.
indygreg added a comment.
This revision is now accepted and ready to land.


  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.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4475

To: pulkit, #hg-reviewers, indygreg
Cc: indygreg, durin42, mercurial-devel


More information about the Mercurial-devel mailing list