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

Abandoned Tools/unicode/mkstringprep.py #59444

Closed
serhiy-storchaka opened this issue Jul 1, 2012 · 17 comments
Closed

Abandoned Tools/unicode/mkstringprep.py #59444

serhiy-storchaka opened this issue Jul 1, 2012 · 17 comments
Assignees
Labels
topic-unicode type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

BPO 15239
Nosy @loewis, @birkenfeld, @ezio-melotti, @serhiy-storchaka
Files
  • mkstringprep.patch
  • mkstringprep_min.patch
  • mkstringprep_cosmetic.patch
  • mkstringprep_check.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 = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2013-06-09.14:21:03.965>
    created_at = <Date 2012-07-01.17:36:08.826>
    labels = ['type-bug', 'expert-unicode']
    title = 'Abandoned Tools/unicode/mkstringprep.py'
    updated_at = <Date 2013-06-09.14:21:03.964>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2013-06-09.14:21:03.964>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2013-06-09.14:21:03.965>
    closer = 'serhiy.storchaka'
    components = ['Demos and Tools', 'Unicode']
    creation = <Date 2012-07-01.17:36:08.826>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['26228', '30402', '30403', '30404']
    hgrepos = []
    issue_num = 15239
    keywords = ['patch', 'needs review']
    message_count = 17.0
    messages = ['164489', '164490', '164510', '167514', '167916', '167931', '178319', '179465', '179470', '190211', '190223', '190229', '190230', '190231', '190405', '190412', '190857']
    nosy_count = 6.0
    nosy_names = ['loewis', 'georg.brandl', 'ezio.melotti', 'Arfrever', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'low'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue15239'
    versions = ['Python 3.4']

    @serhiy-storchaka
    Copy link
    Member Author

    It seems that Tools/unicode/mkstringprep.py has not been used for many years. Now it is not valid Python3 code nor Python2 code. The proposed patch fixes all porting errors.

    Apparently, Lib/stringprep.py would have regenerated. Tools/unicode/mkstringprep.py output is a bit different from Lib/stringprep.py (in b3_exceptions).

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Jul 1, 2012

    Indeed, the code hasn't been run, and really shouldn't have to. If it produces different output today, we should investigate why.

    @serhiy-storchaka
    Copy link
    Member Author

    If it produces different output today, we should investigate why.

    Lib/stringprep.py differs from updated Tools/unicode/mkstringprep.py output only by additional entity 0x130:'i\u0307' in b3_exceptions.

    In 3.2 and lower '\u0130'.lower() == '\u0069', in 3.3 '\u0130'.lower() == '\u0069\u0307'.

    @serhiy-storchaka serhiy-storchaka added the type-bug An unexpected behavior, bug, or error label Aug 5, 2012
    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Aug 5, 2012

    The difference is in the reverse direction, right? I.e. the special case for U+0130 is removed.

    This is harmless: it just means that we don't need to special-case that anymore.

    I'm puzzled though that b3_exceptions doesn't become empty in 3.3. Supposedly, B.3 is CaseFolding.txt, and supposedly, Python 3.3 supports CaseFolding.txt. For example, CaseFolding maps U+00B5 to U+03BC in lower case, yet Python 3.3 maps it to U+00B5.

    @serhiy-storchaka
    Copy link
    Member Author

    To protect themselves from the surprises we need working mkstringprep.py. Martin, what do you say about a patch?

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Aug 11, 2012

    I don't consider it relevant for 3.3; I may have time to review only post-3.3.

    @serhiy-storchaka
    Copy link
    Member Author

    Martin, are you have time to review now?

    @serhiy-storchaka serhiy-storchaka self-assigned this Jan 2, 2013
    @serhiy-storchaka
    Copy link
    Member Author

    Georg, now Tools/unicode/mkstringprep.py is broken in all Python 3 branches (it not usable at all, under 3.2 it even raises SyntaxError). Do you object against fixing it in 3.2 and 3.3?

    @birkenfeld
    Copy link
    Member

    No need to hurry; no one apparently needs it anyway, and if there is a change let Martin review it before commit.

    @serhiy-storchaka
    Copy link
    Member Author

    Is there a chance, Martin?

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented May 28, 2013

    I find the patch too large to review, and it appears to contain unrelated changes. Can you kindly split it up into two patches, namely

    A) changes that are really absolutely necessary to make it work again
    B) patches that are purely cosmetic, and do not affect the behavior at all (such as rewriting .startswith, or replacing %s with %r)

    Possibly, there is also

    C) changes that do change the behavior, but in a way unrelated to the issue at hand; such changes are best left out.

    Sorry it took so long to react.

    @serhiy-storchaka
    Copy link
    Member Author

    Here is a minimal patch.

    @serhiy-storchaka
    Copy link
    Member Author

    Here is a pure cosmetic patch.

    @serhiy-storchaka
    Copy link
    Member Author

    And here is a patch which changes behavior. It adds check for validating end of table detection.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented May 31, 2013

    Ok, these patches all look fine. Thanks for your effort.

    @serhiy-storchaka
    Copy link
    Member Author

    Thank you for review. Should we regenerate Lib/stringprep.py now?

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jun 9, 2013

    New changeset 8f95d77443da by Serhiy Storchaka in branch '3.3':
    Issue bpo-15239: Make mkstringprep.py work again on Python 3.
    http://hg.python.org/cpython/rev/8f95d77443da

    New changeset 4abe61a412be by Serhiy Storchaka in branch 'default':
    Issue bpo-15239: Make mkstringprep.py work again on Python 3.
    http://hg.python.org/cpython/rev/4abe61a412be

    @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
    topic-unicode type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants