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

test_repr() fails with id() values that appear negative #40491

Closed
freddrake opened this issue Jul 1, 2004 · 4 comments
Closed

test_repr() fails with id() values that appear negative #40491

freddrake opened this issue Jul 1, 2004 · 4 comments
Assignees
Labels
stdlib Python modules in the Lib dir

Comments

@freddrake
Copy link
Member

BPO 983585
Nosy @tim-one, @freddrake
Files
  • patch.txt: Don't assume hex(i) starts with '0x'
  • 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/freddrake'
    closed_at = <Date 2004-07-01.20:29:14.000>
    created_at = <Date 2004-07-01.18:15:44.000>
    labels = ['library']
    title = 'test_repr() fails with id() values that appear negative'
    updated_at = <Date 2004-07-01.20:29:14.000>
    user = 'https://github.com/freddrake'

    bugs.python.org fields:

    activity = <Date 2004-07-01.20:29:14.000>
    actor = 'fdrake'
    assignee = 'fdrake'
    closed = True
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2004-07-01.18:15:44.000>
    creator = 'fdrake'
    dependencies = []
    files = ['1326']
    hgrepos = []
    issue_num = 983585
    keywords = []
    message_count = 4.0
    messages = ['21375', '21376', '21377', '21378']
    nosy_count = 2.0
    nosy_names = ['tim.peters', 'fdrake']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue983585'
    versions = ['Python 2.4']

    @freddrake
    Copy link
    Member Author

    test_repr() fails when memory allocations are handed
    out at high addresses.

    test_repr
    test test_repr failed -- Traceback (most recent call last):
      File
    "/home/fdrake/projects/python/trunk/Lib/test/test_repr.py",
    line 109, in test_instance
        eq(r(i3), ("<ClassWithFailingRepr instance at
    %x>"%id(i3)))
    AssertionError: '<ClassWithFailingRepr instance at
    x42373cf4>' != '<ClassWithFailingRepr instance at
    -42373cf4>'

    @freddrake freddrake self-assigned this Jul 1, 2004
    @freddrake freddrake added the stdlib Python modules in the Lib dir label Jul 1, 2004
    @freddrake freddrake self-assigned this Jul 1, 2004
    @freddrake freddrake added the stdlib Python modules in the Lib dir label Jul 1, 2004
    @freddrake
    Copy link
    Member Author

    Logged In: YES
    user_id=3066

    I'll add that this was run on a Fedora Core 1 system.

    @tim-one
    Copy link
    Member

    tim-one commented Jul 1, 2004

    Logged In: YES
    user_id=31435

    Fred, please try the attached patch. If it works on your box,
    just check it in. repr.py was doing a dumb thing, assuming
    that hex(number) always starts with '0x'. The patch also
    does a dumb thing, but it's the same as the dumb thing
    test_repr.py does <wink>.

    @freddrake
    Copy link
    Member Author

    Logged In: YES
    user_id=3066

    This does the trick, thanks!

    Committed as Lib/repr.py revision 1.20.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants