This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients exarkun, georg.brandl, terry.reedy
Date 2008-11-01.07:10:40
SpamBayes Score 1.6540436e-11
Marked as misclassified No
Message-id <1225523442.81.0.225108844012.issue4221@psf.upfronthosting.co.za>
In-reply-to
Content
You tested on 2.5.2 but marked this for 2.6.  3.0 gives
>>> int('\0')
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    int('\0')
UnicodeEncodeError: 'decimal' codec can't encode character '\x00' in
position 0: invalid decimal Unicode string

>>> int('\1')
Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    int('\1')
ValueError: invalid literal for int() with base 10: '\x01'

>>> int('\1',256)
Traceback (most recent call last):
  File "<pyshell#6>", line 1, in <module>
    int('\1',256)
ValueError: int() arg 2 must be >= 2 and <= 36

The 3.0 doc on string inputs
"A string must be a base-radix integer literal optionally preceded by
‘+’ or ‘-‘ (with no space in between) and optionally surrounded by
whitespace. A base-n literal consists of the digits 0 to n-1, with ‘a’
to ‘z’ (or ‘A’ to ‘Z’) having values 10 to 35."

in much clearer than the 2.6 doc
"If the argument is a string, it must contain a possibly signed decimal
number representable as a Python integer, possibly embedded in whitespace."

Even so, I do not see any inconsistency.
History
Date User Action Args
2008-11-01 07:10:43terry.reedysetrecipients: + terry.reedy, georg.brandl, exarkun
2008-11-01 07:10:42terry.reedysetmessageid: <1225523442.81.0.225108844012.issue4221@psf.upfronthosting.co.za>
2008-11-01 07:10:42terry.reedylinkissue4221 messages
2008-11-01 07:10:41terry.reedycreate