[issue2298] Patch for string without null bytes check in getargs.c

2008-03-21 Thread Georg Brandl

Georg Brandl [EMAIL PROTECTED] added the comment:

I've added XXX comments to the code, so this is now tracked by #2322.

--
nosy: +georg.brandl
resolution:  - duplicate
status: open - closed
superseder:  - Clean up getargs.c and its formatting possibilities

__
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



[issue2298] Patch for string without null bytes check in getargs.c

2008-03-17 Thread Alexandre Vassalotti

Alexandre Vassalotti [EMAIL PROTECTED] added the comment:

Yes, that sounds like a good idea. Although I haven't reviewed this
patch yet, I find the naming of the `ustr` variable confusing -- e.g. is
it a bytes object or a unicode object? (It seems to be bytes). Anyway, I
will check this out later today, when I will get the time.

__
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



[issue2298] Patch for string without null bytes check in getargs.c

2008-03-17 Thread Alexander Belopolsky

Alexander Belopolsky [EMAIL PROTECTED] added the comment:

On Mon, Mar 17, 2008 at 9:51 AM, Alexandre Vassalotti 
[EMAIL PROTECTED] wrote:


 Alexandre Vassalotti [EMAIL PROTECTED] added the comment:

 .. Although I haven't reviewed this
 patch yet, I find the naming of the `ustr` variable confusing -- e.g. is
 it a bytes object or a unicode object?

There is no `ustr` variable , you  probably mean  `uarg`.   If so, it  is
not introduced by the patch.   To me the patch looks straightforward and
correct, but a unit test should be added.  Some additional refactoring is
due for getargs.c (does py3k support builds without Py_USING_UNICODE?), but
the bug fix should not wait for that.

Added file: http://bugs.python.org/file9688/unnamed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2298
__brbrdiv class=gmail_quoteOn Mon, Mar 17, 2008 at 9:51 AM, Alexandre 
Vassalotti lt;a href=mailto:[EMAIL PROTECTED][EMAIL PROTECTED]/agt; 
wrote:brblockquote class=gmail_quote style=border-left: 1px solid 
rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;
br
Alexandre Vassalotti lt;a href=mailto:[EMAIL PROTECTED][EMAIL 
PROTECTED]/agt; added the comment:br
br.. Although I haven#39;t reviewed thisbr
patch yet, I find the naming of the `ustr` variable confusing -- e.g. isbr
it a bytes object or a unicode object? /blockquotedivbrThere is no `ustr` 
variable , younbsp; probably meannbsp; `uarg`.nbsp;nbsp; If so, itnbsp; is 
not introduced by the patch.nbsp;nbsp; To me the patch looks straightforward 
and correct, but a unit test should be added.nbsp; Some additional refactoring 
is due for getargs.c (does py3k support builds without Py_USING_UNICODE?), but 
the bug fix should not wait for that.br
/div/divbr
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2298] Patch for string without null bytes check in getargs.c

2008-03-17 Thread Alexander Belopolsky

Alexander Belopolsky [EMAIL PROTECTED] added the comment:

There is now issue2322 (Clean up getargs.c and its formatting 
possibilities) related to this.

__
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



[issue2298] Patch for string without null bytes check in getargs.c

2008-03-16 Thread Douglas Greiman

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



[issue2298] Patch for string without null bytes check in getargs.c

2008-03-16 Thread Alexander Belopolsky

Alexander Belopolsky [EMAIL PROTECTED] added the comment:

Note that this patch will expose a bug fixed in issue1950. (See msg63363.)  I 
suggest that the import.c part of issue1950 and this go 
together.  Alexandre?

--
nosy: +alexandre.vassalotti, belopolsky

__
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