[Python-bugs-list] string bug in atoi (PR#55)

Barry A. Warsaw bwarsaw@cnri.reston.va.us (Barry A. Warsaw)
Thu, 19 Aug 1999 12:08:05 -0400 (EDT)


>>>>> "sergio" ==   <sergio@mnc.md> writes:

    | Full_Name: Sergio Baca
    | Version: 1.52 and JPython last beta
    | OS: Windows NT
    | Submission from: sergio.mnc.md (212.0.192.40)

    | I have found error in string module. This is a test program:
    | ---
    | from string import atoi
    | str1 = "0x8e"
    | print atoi(str1, 16)
    | print atoi(str1)
    | ---

This actually works as expected in CPython; the first one prints 142
and the second raises an exception (as expected, since the default
base is 10).

However, in JPython the first atoi() call does indeed give you a
traceback because it doesn't grok the second argument (i.e. the
optional base).  This has already been reported as PR#153

    http://www.python.org/jpython-bugs/incoming?id=153

so there's no need for you to resubmit it.

-Barry