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

Fix unicodeless build of Python #66032

Closed
serhiy-storchaka opened this issue Jun 24, 2014 · 8 comments
Closed

Fix unicodeless build of Python #66032

serhiy-storchaka opened this issue Jun 24, 2014 · 8 comments
Labels
build The build process and cross-build tests Tests in the Lib/test dir topic-IO topic-unicode

Comments

@serhiy-storchaka
Copy link
Member

BPO 21833
Nosy @loewis, @akuchling, @pitrou, @vstinner, @benjaminp, @ned-deily, @ezio-melotti, @voidspace, @serhiy-storchaka
Files
  • main.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2017-04-20.17:06:02.733>
    created_at = <Date 2014-06-24.06:53:22.739>
    labels = ['build', 'tests', 'expert-unicode', 'expert-IO']
    title = 'Fix unicodeless build of Python'
    updated_at = <Date 2017-04-20.17:06:02.731>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2017-04-20.17:06:02.731>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-04-20.17:06:02.733>
    closer = 'serhiy.storchaka'
    components = ['Build', 'Tests', 'Unicode', 'IO']
    creation = <Date 2014-06-24.06:53:22.739>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['35744']
    hgrepos = []
    issue_num = 21833
    keywords = ['patch']
    message_count = 8.0
    messages = ['221402', '221409', '221411', '221430', '221431', '221435', '221438', '240949']
    nosy_count = 10.0
    nosy_names = ['loewis', 'akuchling', 'pitrou', 'vstinner', 'benjamin.peterson', 'ned.deily', 'ezio.melotti', 'michael.foord', 'tshepang', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'rejected'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue21833'
    versions = ['Python 2.7']

    @serhiy-storchaka
    Copy link
    Member Author

    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.

    @serhiy-storchaka serhiy-storchaka added build The build process and cross-build tests Tests in the Lib/test dir topic-IO topic-unicode labels Jun 24, 2014
    @ned-deily
    Copy link
    Member

    Note MvL's comment (msg161191 in bpo-8767) 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?

    @vstinner
    Copy link
    Member

    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.

    @serhiy-storchaka
    Copy link
    Member Author

    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.

    @ned-deily
    Copy link
    Member

    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.

    @serhiy-storchaka
    Copy link
    Member Author

    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 bpo-21834) fixes bugs in
    stdlib, not only in tests (bpo-21835 and bpo-21836 also fixes compile
    errors).

    @vstinner
    Copy link
    Member

    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.

    @akuchling
    Copy link
    Member

    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 https://mail.python.org/pipermail/python-dev/2014-June/135181.html

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    build The build process and cross-build tests Tests in the Lib/test dir topic-IO topic-unicode
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants