Movatterモバイル変換


[0]ホーム

URL:


[Python-Dev] Fix Unicode-disabled build of Python 2.7

Jim J. Jewettjimjjewett at gmail.com
Tue Jun 24 23:03:27 CEST 2014


On 6/24/2014 4:22 AM, Serhiy Storchaka wrote:> I submitted a number of patches which fixes currently broken> Unicode-disabled build of Python 2.7 (built with --disable-unicode> configure option). I suppose this was broken in 2.7 when C> implementation of the io module was introduced.It has frequently been broken.  Without a buildbot, it will continueto break.  I have given at least a quick look at all your proposedchanges; most are fixes to test code, such as skip decorators.People checked in tests without the right guards because it did workon their own builds, and on all stable buildbots.  That will probablycontinue to happen unless/until a --disable-unicode buildbot is added.It would be good to fix the tests (and actual library issues).Unfortunately, some of the specifically proposed changes (such asdefining and using _unicode instead of unicode within python code)look to me as though they would trigger problems in the normal build(where the unicode object *does* exist, but would no longer be used).Other changes, such as the use of \x escapes, appear correct, but makethe tests harder to read -- and might end up removing a test forcorrect unicode funtionality across different spellings.Even if we assume that the tests are fine, and I'm just an idiot whomisread them, the fact that there is any confusion means that theseparticular changes may be tricky enough to be for a bad tradeoff for 2.7.It *might* work if you could make a more focused change.  For example,instead of leaving the 'unicode' name unbound, provide an object thatsimply returns false for isinstance and raises a UnicodeError for anyother method call.  Even *this* might be too aggressive to 2.7, but thefact that it would only appear in the --disable-unicode builds, andwould make them more similar to the regular build are points in itsfavor.Before doing that, though, please document what the --disable-unicodemode is actually *supposed* to do when interacting with byte-streamsthat a standard defines as UTF-8.  (For example, are the changes to_xml_dumps and _xml_loads athttp://bugs.python.org/file35758/multiprocessing.patchcorrect, or do those functions assume they get bytes as input, orshould the functions raise an exception any time they are called?)-jJ--If there are still threading problems with my replies, pleaseemail me with details, so that I can try to resolve them.  -jJ


More information about the Python-Devmailing list

[8]ページ先頭

©2009-2025 Movatter.jp