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

unicodeobject.c not using PY_FORMAT_SIZE_T #66092

Closed
JohnMalmberg mannequin opened this issue Jul 1, 2014 · 6 comments
Closed

unicodeobject.c not using PY_FORMAT_SIZE_T #66092

JohnMalmberg mannequin opened this issue Jul 1, 2014 · 6 comments

Comments

@JohnMalmberg
Copy link
Mannequin

JohnMalmberg mannequin commented Jul 1, 2014

BPO 21893
Nosy @vstinner, @serhiy-storchaka
Files
  • unicodeobject.gdiff: Patch to use PY_FORMAT_SIZE_T
  • 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 2014-07-04.20:51:59.952>
    created_at = <Date 2014-07-01.04:59:17.188>
    labels = []
    title = 'unicodeobject.c not using PY_FORMAT_SIZE_T'
    updated_at = <Date 2014-07-04.20:51:59.940>
    user = 'https://bugs.python.org/JohnMalmberg'

    bugs.python.org fields:

    activity = <Date 2014-07-04.20:51:59.940>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-07-04.20:51:59.952>
    closer = 'vstinner'
    components = []
    creation = <Date 2014-07-01.04:59:17.188>
    creator = 'John.Malmberg'
    dependencies = []
    files = ['35812']
    hgrepos = []
    issue_num = 21893
    keywords = []
    message_count = 6.0
    messages = ['222009', '222016', '222019', '222311', '222313', '222315']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'python-dev', 'serhiy.storchaka', 'John.Malmberg']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue21893'
    versions = ['Python 3.5']

    @JohnMalmberg
    Copy link
    Mannequin Author

    JohnMalmberg mannequin commented Jul 1, 2014

    unicodeobject.c is using %zd instead of the PY_FORMAT_SIZE_T as set by configure.

    Comments in pymacconfig.h state that this will cause problems on OS-X 10.4 with binaries build on OS-X 10.5.

    The attached patch unicodeobject.giff changes unicodeobject.c to be like the other modules that use PY_FORMAT_SIZE_T.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 1, 2014

    New changeset 4f55e802baf0 by Victor Stinner in branch '3.4':
    Closes bpo-21892, bpo-21893: Use PY_FORMAT_SIZE_T instead of %zi or %zu to format C
    http://hg.python.org/cpython/rev/4f55e802baf0

    New changeset 669b43bffd87 by Victor Stinner in branch 'default':
    (Merge 3.4) Closes bpo-21892, bpo-21893: Use PY_FORMAT_SIZE_T instead of %zi or %zu
    http://hg.python.org/cpython/rev/669b43bffd87

    @vstinner
    Copy link
    Member

    vstinner commented Jul 1, 2014

    Oh, I forgot the mention John Malmberg in the changelog, sorry :-(

    Thanks for your fix John.

    @vstinner vstinner closed this as completed Jul 1, 2014
    @serhiy-storchaka
    Copy link
    Member

    This is incorrect. PY_FORMAT_SIZE_T shouldn't be used in format string of PyErr_Format. On one hand, PyErr_Format understand the "z" modifier. On other hand, it is not understand all platform-specific expansions of PY_FORMAT_SIZE_T (e.g. "I").

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 4, 2014

    New changeset 6fb1e2ce513a by Victor Stinner in branch '3.4':
    Issue bpo-21892, bpo-21893: Partial revert of changeset 4f55e802baf0, PyErr_Format()
    http://hg.python.org/cpython/rev/6fb1e2ce513a

    New changeset 58cd562e3ef9 by Victor Stinner in branch 'default':
    (Merge 3.4) Issue bpo-21892, bpo-21893: Partial revert of changeset 4f55e802baf0,
    http://hg.python.org/cpython/rev/58cd562e3ef9

    @vstinner
    Copy link
    Member

    vstinner commented Jul 4, 2014

    This is incorrect. PY_FORMAT_SIZE_T shouldn't be used in format string of PyErr_Format.

    Oh, I forgot that. Thanks for the careful review Serhiy! Thanks.

    @vstinner vstinner closed this as completed Jul 4, 2014
    @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
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants