This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Fix unicodeless build of Python
Type: compile error Stage: resolved
Components: Build, IO, Tests, Unicode Versions: Python 2.7
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: akuchling, benjamin.peterson, ezio.melotti, loewis, michael.foord, ned.deily, pitrou, serhiy.storchaka, tshepang, vstinner
Priority: normal Keywords: patch

Created on 2014-06-24 06:53 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
main.patch serhiy.storchaka, 2014-06-24 06:53 review
Messages (8)
msg221402 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-06-24 06:53
Since 2.2 Python can be compiled without unicode support (built with --disable-unicode configure option). Unfortunately, testing suite depends on the io module, which in 2.7 depends on the _io module, which requires unicode support. So for now testing unicodeless Python is not possible. Some other modules are failed when built without unicode support too.

Proposed patch fixes the io module in unicodeless build and includes also minor fixes fixes of compilation errors for other modules (except sqlite) and changes to auxilary files needed to build Python and run tests.

Patches for other components will be provided in separate issues.
msg221409 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2014-06-24 07:11
Note MvL's comment (msg161191 in Issue8767) about not fixing test cases for --disable-unicode here.  This seems like a tremendous amount of code churn for a problem that has likely been around for years and would affect very few.  How widely is --disable-unicode used anyway?  Why fix these tests now, especially in 2.7?
msg221411 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-06-24 07:16
I don't know anyone building Python without Unicode. I would prefer to modify configure to raise an error, and drop #ifdef in the code.
msg221430 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-06-24 07:56
I think the purpose of this option is similar to --without-doc-strings, this decreases the size of Python binary (-0.5 MB).

Most needed changes are pretty trivial and they are only small fraction of already existing code for supporting --disable-unicode.
msg221431 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2014-06-24 07:58
Serhly, I admire you for all of the obvious effort you put into this but I can't help but think it is misplaced effort.  My original comment was made before you submitted all of the other patches.  As it stands, to proceed with this, there are now tens of thousands of lines of patches to be reviewed.  It will take a lot of effort on a lot of people's part to properly review them.  And even then, no matter how careful you were, there will be new bugs introduced by these patches.  If it takes that much change to properly support --disable-unicode, then it's clearly been a broken feature and fixing it now is on the scale of a large new feature for 2.7.  That just doesn't seem to me like a good choice based on the need for core developers' time and the added risk for the overwhelming majority of Python 2.7 users, who use Unicode-enabled builds.  I think we need to have a discussion on python-dev and a ruling by Benjamin.
msg221435 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-06-24 08:29
Ned, I think you misunderstood Martin. He approved patch which fixes some 
disabled-unicode bugs. He noted that fixing a number of test failures has very 
low priority. This issue is about fixing the possibility of build Python and 
run test suite itself. And all other issues (except issue21834) fixes bugs in 
stdlib, not only in tests (issue21835 and issue21836 also fixes compile 
msg221438 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-06-24 08:50
IMO supporting building Python 2 without Unicode support should be discussed on the python-dev mailing list, it's not an innocent change.

Python is moving strongly to Unicode: Python 3 uses Unicode by default. So to me it sounds really weird to work on building Python 2 without Unicode support. It means that you may have "Python 2" and "Python 2 without Unicode" which are not exactly the same language. IMO u"unicode" is part of the Python 2 language.

--disable-unicode is an old option added while Python 1.5 was very slowly moving to Unicode.


I have the same opinion on --without-thread option (we should stop supporting it, this option is useless). I worked in the embedded world, Python used for the UI of a TV set top box. Even if the hardware was slow and old, Python was compiled with threads and Unicode. Unicode was mandatory to handle correctly letters with diacritics.
msg240949 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2015-04-14 16:55
The subsequent discussion didn't arrive at a consensus. Most commenters wanted to drop --disable-unicode support and thought these patches were too extensive for 2.7, but Serhiy noted that running the tests with --disable-unicode turns up problems in the Unicode enabled code.  There was no pronouncement from the BDFL or a release manager.

The python-dev discussion is archived at
Date User Action Args
2022-04-11 14:58:05adminsetgithub: 66032
2017-04-20 17:06:25serhiy.storchakalinkissue21854 dependencies
2017-04-20 17:06:08serhiy.storchakaunlinkissue21854 dependencies
2017-04-20 17:06:02serhiy.storchakasetstatus: open -> closed
resolution: rejected
stage: patch review -> resolved
2016-01-18 17:41:53serhiy.storchakaunlinkissue21847 dependencies
2015-05-31 05:04:17serhiy.storchakaunlinkissue21853 dependencies
2015-04-14 16:55:33akuchlingsetnosy: + akuchling
messages: + msg240949
2015-02-15 12:05:01serhiy.storchakaunlinkissue21849 dependencies
2015-02-13 10:14:19serhiy.storchakaunlinkissue21840 dependencies
2014-10-14 18:15:20serhiy.storchakaunlinkissue21855 dependencies
2014-10-14 17:28:02skrahsetnosy: - skrah
2014-07-08 15:35:09ezio.melottilinkissue21844 dependencies
2014-07-08 15:34:54ezio.melottiunlinkissue21844 dependencies
2014-06-29 21:12:50tshepangsetnosy: + tshepang
2014-06-24 08:50:39vstinnersetmessages: + msg221438
2014-06-24 08:29:57serhiy.storchakasetmessages: + msg221435
2014-06-24 08:01:03serhiy.storchakalinkissue21844 dependencies
2014-06-24 07:58:01ned.deilysetmessages: + msg221431
2014-06-24 07:56:38serhiy.storchakasetnosy: + skrah
messages: + msg221430
2014-06-24 07:45:55serhiy.storchakasetnosy: + benjamin.peterson
2014-06-24 07:44:32serhiy.storchakalinkissue21855 dependencies
2014-06-24 07:44:24serhiy.storchakalinkissue21854 dependencies
2014-06-24 07:44:13serhiy.storchakalinkissue21853 dependencies
2014-06-24 07:44:07serhiy.storchakalinkissue21852 dependencies
2014-06-24 07:43:56serhiy.storchakalinkissue21851 dependencies
2014-06-24 07:38:08serhiy.storchakalinkissue21850 dependencies
2014-06-24 07:38:00serhiy.storchakalinkissue21849 dependencies
2014-06-24 07:37:48serhiy.storchakalinkissue21847 dependencies
2014-06-24 07:37:44serhiy.storchakalinkissue21848 dependencies
2014-06-24 07:37:18serhiy.storchakalinkissue21846 dependencies
2014-06-24 07:37:01serhiy.storchakalinkissue21845 dependencies
2014-06-24 07:36:33serhiy.storchakalinkissue21843 dependencies
2014-06-24 07:22:05serhiy.storchakalinkissue21842 dependencies
2014-06-24 07:21:43serhiy.storchakalinkissue21841 dependencies
2014-06-24 07:21:24serhiy.storchakalinkissue21840 dependencies
2014-06-24 07:21:10serhiy.storchakalinkissue21839 dependencies
2014-06-24 07:20:55serhiy.storchakalinkissue21838 dependencies
2014-06-24 07:16:17vstinnersetmessages: + msg221411
2014-06-24 07:11:15ned.deilysetnosy: + ned.deily, loewis
messages: + msg221409
2014-06-24 07:09:20serhiy.storchakalinkissue21837 dependencies
2014-06-24 07:09:03serhiy.storchakalinkissue21836 dependencies
2014-06-24 07:08:47serhiy.storchakalinkissue21835 dependencies
2014-06-24 07:01:49serhiy.storchakalinkissue21834 dependencies
2014-06-24 07:01:41serhiy.storchakasetnosy: + vstinner
components: + Unicode
2014-06-24 06:53:22serhiy.storchakacreate