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

Possible fix to #1334662 (int() wrong answers) #43132

Closed
ivilata mannequin opened this issue Mar 31, 2006 · 6 comments
Closed

Possible fix to #1334662 (int() wrong answers) #43132

ivilata mannequin opened this issue Mar 31, 2006 · 6 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@ivilata
Copy link
Mannequin

ivilata mannequin commented Mar 31, 2006

BPO 1462361
Nosy @birkenfeld
Files
  • 1334662-mystrtoul.c.diff: Fix for int('704he7g4', 18)==0 and family
  • 1334662-test_builtin.py.diff
  • 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 2006-05-31.17:11:28.000>
    created_at = <Date 2006-03-31.19:23:16.000>
    labels = ['interpreter-core']
    title = 'Possible fix to python/cpython#42509 (int() wrong answers)'
    updated_at = <Date 2006-05-31.17:11:28.000>
    user = 'https://bugs.python.org/ivilata'

    bugs.python.org fields:

    activity = <Date 2006-05-31.17:11:28.000>
    actor = 'georg.brandl'
    assignee = 'none'
    closed = True
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2006-03-31.19:23:16.000>
    creator = 'ivilata'
    dependencies = []
    files = ['7120', '7121']
    hgrepos = []
    issue_num = 1462361
    keywords = ['patch']
    message_count = 6.0
    messages = ['49908', '49909', '49910', '49911', '49912', '49913']
    nosy_count = 3.0
    nosy_names = ['georg.brandl', 'titty', 'ivilata']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1462361'
    versions = []

    @ivilata
    Copy link
    Mannequin Author

    ivilata mannequin commented Mar 31, 2006

    This is the patch I talked about in bpo-1334662. I think
    it fixes int() returning zero for non-zero literals
    under some bases.

    @ivilata ivilata mannequin closed this as completed Mar 31, 2006
    @ivilata ivilata mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Mar 31, 2006
    @ivilata ivilata mannequin closed this as completed Mar 31, 2006
    @ivilata ivilata mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Mar 31, 2006
    @ivilata
    Copy link
    Mannequin Author

    ivilata mannequin commented Mar 31, 2006

    Logged In: YES
    user_id=1064183

    I *love* this web interface... Here you have the patch.

    @ivilata
    Copy link
    Mannequin Author

    ivilata mannequin commented Mar 31, 2006

    Logged In: YES
    user_id=1064183

    This is a little modification to test_builtin.py to
    check for the bug. It would be nice for someone to run it
    under a 64-bit platform!

    @titty
    Copy link
    Mannequin

    titty mannequin commented Mar 31, 2006

    Logged In: YES
    user_id=17929

    with patch to tests applied I get:
    
    ===============================================

    =======================
    FAIL: test_int (main.BuiltinTest)
    -----------------------------------------------------------------
    -----

    Traceback (most recent call last):
      File "Lib/test/test_builtin.py", line 685, in test_int
        self.assertEqual(int('c9c336o0mlb7eg', 25), max_uint64)
    AssertionError: 0 != 18446744073709551616L
    
    -----------------------------------------------------------------
    

    Ran 60 tests in 0.118s

    FAILED (failures=1)
    Traceback (most recent call last):
      File "Lib/test/test_builtin.py", line 103, in <module>
        class BuiltinTest(unittest.TestCase):
      File "Lib/test/test_builtin.py", line 1587, in test_main
        run_unittest(*test_classes)
      File "/home/ralf/python-trunk/Lib/test/test_support.py", line 300, in 
    run_unittest
        run_suite(suite, testclass)
      File "/home/ralf/python-trunk/Lib/test/test_support.py", line 285, in 
    run_suite
        raise TestFailed(err)
    test.test_support.TestFailed: Traceback (most recent call last):
      File "Lib/test/test_builtin.py", line 685, in test_int
        self.assertEqual(int('c9c336o0mlb7eg', 25), max_uint64)
    AssertionError: 0 != 18446744073709551616L

    @titty
    Copy link
    Mannequin

    titty mannequin commented Mar 31, 2006

    Logged In: YES
    user_id=17929

    After applying the patch to mystrtoul all tests work.
    tests were run on ubuntu dapper amd64

    @birkenfeld
    Copy link
    Member

    Logged In: YES
    user_id=849994

    Bug bpo-1334662 has now been fixed.

    @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
    interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant