New submission from Douglas Greiman <[EMAIL PROTECTED]>:
Code in getargs.c:convertsimple incorrectly uses PyUnicode_GetSize
instead of PyString_GET_SIZE when checking whether a bytes object
(encoded string) contains a null byte.
To reproduce: __import__('\u0080')
Incorrect behavior:
TypeError: __import__() argument 1 must be string without null bytes,
not str
Correct behavior:
ImportError
Note the lack of null bytes:
>>> '\u0080'.encode('utf-8')
b'\xc2\x80'
----------
components: Interpreter Core
files: py3k-getargs-null-bytes-20080315.diff
keywords: patch
messages: 63571
nosy: dgreiman
severity: normal
status: open
title: Patch for "string without null bytes" check in getargs.c
type: behavior
versions: Python 3.0
Added file:
http://bugs.python.org/file9679/py3k-getargs-null-bytes-20080315.diff
__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2298>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com