Florent Xicluna florent.xicl...@gmail.com added the comment:
The behavior seems acceptable in 2.7 too.
int('\0')
Traceback (most recent call last):
File stdin, line 1, in module
ValueError: invalid literal for int() with base 10: ''
int('\01')
Traceback (most recent call last):
File
Florent Xicluna florent.xicl...@gmail.com added the comment:
On 3.2 it is fixed (I didn't find the related changeset).
Not backported to 2.7.
--
versions: -Python 3.1, Python 3.2
___
Python tracker rep...@bugs.python.org
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +ezio.melotti
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7710
___
___
Python-bugs-list
Changes by Florent Xicluna florent.xicl...@gmail.com:
--
nosy: +belopolsky
stage: - unit test needed
type: - behavior
versions: +Python 2.7, Python 3.1
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7710
Changes by Mark Dickinson dicki...@gmail.com:
--
nosy: +mark.dickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7710
___
___
Python-bugs-list
New submission from Florent Xicluna la...@yahoo.fr:
On Python 3:
int('\0')
Traceback (most recent call last):
File stdin, line 1, in module
UnicodeEncodeError: 'decimal' codec can't encode character '\x00' in position
0: invalid decimal Unicode string
int('\01')
Traceback (most recent
Florent Xicluna la...@yahoo.fr added the comment:
The null byte gives UnicodeEncodeError for other conversions too.
Python 3:
int('\0'), float('\0'), complex('\0')
Python 2:
int(u'\0'), long(u'\0'), float(u'\0'), complex(u'0')
Traceback (most recent call last):
File stdin, line 1, in
Jean-Paul Calderone exar...@divmod.com added the comment:
Loosely related to issue4221.
--
nosy: +exarkun
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7710
___