[issue1810] AST compile() patch

2008-03-15 Thread Thomas Lee

Thomas Lee <[EMAIL PROTECTED]> added the comment:

Updating the patch to apply cleanly against HEAD.

Added file: http://bugs.python.org/file9672/ast-r03.patch

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2290] [PATCH] Update Lib/distutils/sysconfig.py to handle x64 Windows builds living in pcbuild/amd64.

2008-03-15 Thread Trent Nelson

Trent Nelson <[EMAIL PROTECTED]> added the comment:

Ah, I suspect not.  (Unless the 64-bit python*.exe builds end up in 
pcbuild/amd64.)

--
versions:  -Python 2.5

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2292] Missing *-unpacking generalizations

2008-03-15 Thread Thomas Wouters

New submission from Thomas Wouters <[EMAIL PROTECTED]>:

The attached patch adds the missing *-unpacking generalizations.
Specifically:

>>> a, b, *c = range(5)

>>> *a, b, c = a, b, *c
>>> a, b, c
([0, 1, 2], 3, 4)
>>> [ *a, b, c ]
[0, 1, 2, 3, 4]
>>> L = [ a, (3, 4), {5}, {6: None}, (i for i in range(7, 10)) ]
>>> [ *item for item in L ]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

Also, yielding everything from an iterator:

>>> def flatten(iterables):
... for it in iterables:
... yield *it
... 
>>> L = [ a, (3, 4), {5}, {6: None}, (i for i in range(7, 10)) ]
>>> flatten(L)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

--
assignee: gvanrossum
components: Interpreter Core
files: morestar.diff
keywords: patch, patch
messages: 63548
nosy: gvanrossum, twouters
severity: normal
status: open
title: Missing *-unpacking generalizations
versions: Python 3.0
Added file: http://bugs.python.org/file9673/morestar.diff

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1158] %f format for datetime objects

2008-03-15 Thread Skip Montanaro

Skip Montanaro <[EMAIL PROTECTED]> added the comment:

Checking this in.  All tests pass.  Have for quite awhile.
rev 61402.

--
assignee:  -> skip.montanaro

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2292] Missing *-unpacking generalizations

2008-03-15 Thread Alexander Belopolsky

Alexander Belopolsky <[EMAIL PROTECTED]> added the comment:

This was discussed years ago and never got enough support:

http://mail.python.org/pipermail/python-dev/2005-October/057177.html

--
nosy: +belopolsky
type:  -> feature request

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2292] Missing *-unpacking generalizations

2008-03-15 Thread Guido van Rossum

Guido van Rossum <[EMAIL PROTECTED]> added the comment:

Didn't you say it does sets too?  Does this work?
a = [1, 2, 3]
{1, *a, 0, 4}   # {0, 1, 2, 3, 4}

How about dicts?
kwds = {'z': 0, 'w': 12}
{'x': 1, 'y': 2, **kwds}  # {'x': 1, 'y': 2, 'z': 0, 'w': 12}

Also, now that we support

[*a, b, c]

shouldn't we also support

foo(*a, b, c)

?

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2292] Missing *-unpacking generalizations

2008-03-15 Thread Thomas Wouters

Thomas Wouters <[EMAIL PROTECTED]> added the comment:

On Sat, Mar 15, 2008 at 9:12 AM, Guido van Rossum <[EMAIL PROTECTED]>
wrote:

>
> Guido van Rossum <[EMAIL PROTECTED]> added the comment:
>
> Didn't you say it does sets too?  Does this work?
> a = [1, 2, 3]
> {1, *a, 0, 4}   # {0, 1, 2, 3, 4}

Yes.

>
>
> How about dicts?
> kwds = {'z': 0, 'w': 12}
> {'x': 1, 'y': 2, **kwds}  # {'x': 1, 'y': 2, 'z': 0, 'w': 12}

Not yet.

>
>
> Also, now that we support
>
> [*a, b, c]
>
> shouldn't we also support
>
> foo(*a, b, c)
>

Sure. (And also 'foo(*a, *b, *c)'?) But have you taken a look lately at the
function definition grammar? I need some time to sort it out :)

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

__
Tracker <[EMAIL PROTECTED]>

__On Sat, Mar 15, 2008 at 9:12 AM, Guido van 
Rossum [EMAIL PROTECTED]> 
wrote:

Guido van Rossum [EMAIL 
PROTECTED]> added the comment:

Didn't you say it does sets too?  Does this work?
a = [1, 2, 3]
{1, *a, 0, 4}   # {0, 1, 2, 3, 
4}Yes. 

How about dicts?
kwds = {'z': 0, 'w': 12}
{'x': 1, 'y': 2, **kwds}  # {'x': 1, 'y': 
2, 'z': 0, 'w': 12}Not 
yet. 


Also, now that we support

[*a, b, c]

shouldn't we also support

foo(*a, b, c)
Sure. 
(And also 'foo(*a, *b, *c)'?) But have you taken a look lately at the 
function definition grammar? I need some time to sort it out :)
-- Thomas Wouters [EMAIL PROTECTED]>Hi! I'm a .signature virus! 
copy me into your .signature file to help me spread!
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2292] Missing *-unpacking generalizations

2008-03-15 Thread Guido van Rossum

Guido van Rossum <[EMAIL PROTECTED]> added the comment:

Looking at the flatten() example I'm curious -- how come the output of

>>> flatten(L)

is displayed as a list rather than as  ?

Also, do I understand correctly that

yield *(1, 2, 3)

is equivalent to

yield 1
yield 2
yield 3

? (That's really cool.)

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2292] Missing *-unpacking generalizations

2008-03-15 Thread Thomas Wouters

Thomas Wouters <[EMAIL PROTECTED]> added the comment:

On Sat, Mar 15, 2008 at 9:18 AM, Guido van Rossum <[EMAIL PROTECTED]>
wrote:

>
> Guido van Rossum <[EMAIL PROTECTED]> added the comment:
>
> Looking at the flatten() example I'm curious -- how come the output of
>
> >>> flatten(L)
>
> is displayed as a list rather than as  ?
>

It's a typo. It should've been list(flatten(L)) :-) (see the tests included
in the patch.)

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

__
Tracker <[EMAIL PROTECTED]>

__On Sat, Mar 15, 2008 at 9:18 AM, Guido van 
Rossum [EMAIL PROTECTED]> 
wrote:

Guido van Rossum [EMAIL 
PROTECTED]> added the comment:

Looking at the flatten() example I'm curious -- how come the output 
of

>>> flatten(L)

is displayed as a list rather than as  ?
It's a typo. It should've been list(flatten(L)) 
:-) (see the tests included in the patch.) -- Thomas 
Wouters [EMAIL PROTECTED]>
Hi! I'm a .signature virus! copy me into your .signature file to help 
me spread!
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2292] Missing *-unpacking generalizations

2008-03-15 Thread Guido van Rossum

Changes by Guido van Rossum <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file9674/unnamed

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2292] Missing *-unpacking generalizations

2008-03-15 Thread Guido van Rossum

Changes by Guido van Rossum <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file9675/unnamed

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2293] Missing case / switch / evaluate

2008-03-15 Thread BODIN

New submission from BODIN <[EMAIL PROTECTED]>:

I am not the code :

if toto == 1:
   ...
elsif toto == 2:
  ...
 elsif

In ADA for example :

  case C is--  4 Start a case
statement
 when Red => Result := 1;
 when Blue =>Result := 2;
 when Black .. Brown => Result := 3;
 when Orange | Indigo => Result := 4;
 when  others => Result := 5;required for unspecified cases.
  end case; 

Is it not better?

--
components: Interpreter Core
messages: 63555
nosy: dbodin
severity: normal
status: open
title: Missing case / switch / evaluate
versions: 3rd party

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2293] Missing case / switch / evaluate

2008-03-15 Thread Christian Heimes

Christian Heimes <[EMAIL PROTECTED]> added the comment:

This is a bug tracker and not a help forum. Please use the Python
general mailinglist to get help. Your problem can be solved with a
pattern called "dispatcher dict".

--
nosy: +tiran
resolution:  -> invalid
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2292] Missing *-unpacking generalizations

2008-03-15 Thread Alexander Belopolsky

Alexander Belopolsky <[EMAIL PROTECTED]> added the comment:

It looks like I completely missed PEP 3132.  Sorry for a misleading 
comment above.

At least I am not alone: "A little new feature in Python 3 that many 
overviews don't tell you about: extended unpacking." 
http://pyside.blogspot.com/2007/10/new-in-python-3-extended-
unpacking.html

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2278] [Py30a3] xml.parsers.expat recognizes encoding="utf-8" but not encoding="utf8"

2008-03-15 Thread Mark Summerfield

Mark Summerfield <[EMAIL PROTECTED]> added the comment:

You're right that the parser should not recognise "utf8" since it isn't
correct XML (as per the references you gave).

I made the mistake because I used the etree module and wrote an XML file
with encoding "utf8" which etree accepted. I've now switched to using
"UTF-8".

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2294] Bug in Pickle protocol involving __setstate__

2008-03-15 Thread Greg Kochanski

New submission from Greg Kochanski <[EMAIL PROTECTED]>:

If we have a hierarchy of classes, and we use
__getstate__/__setstate__, the wrong class'
__setstate__ gets called.

Possibly, this is a documentation problem, but here goes:

Take two classes, A and B, where B is the child of A.

Construct a B.   Pickle it.   Unpickle it, and you find
that the __setstate__ function for A is called with the result
produced by B.__getstate__().

This is wrong.


An example follows:

import pickle as P


class A(object):
def __init__(self, a):
print 'A.__init__'
self.a = a

def __getstate__(self):
print 'A.__getstate'
return self.a

def __setstate__(self, upstate):
print 'A.__setstate', upstate
self.a = upstate

class B(A):
def __init__(self, a, b):
print 'B.__init__'
A.__init__(self, a)
self.b = b

def __getstate__(self):
print 'B.__getstate'
return (A.__getstate__(self), self.b)

def __setstate(self, upstate):
# This never gets called!
print 'B.__setstate', upstate
A.__setstate__(self, upstate[0])
self.b = upstate[1]


def __repr__(self):
return '' % (self.a, self.b)


q = B(1,2)
print '---'
r = P.loads(P.dumps(q, 0))
print 'q=', q
print 'r=', r


Now, run it:

$ python foo.py
B.__init__
A.__init__
---
B.__getstate
A.__getstate
A.__setstate (1, 2)
q= 
r= Traceback (most recent call last):
  File "foo.py", line 44, in 
print 'r=', r
  File "foo.py", line 37, in __repr__
return '' % (self.a, self.b)
AttributeError: 'B' object has no attribute 'b'
$


Note that this problem doesn't get noticed in the
common case where you simply pass __dict__ around
from __getstate__ to __setstate__.However, it
exists in many other use cases.

--
components: Library (Lib)
messages: 63559
nosy: gpk
severity: normal
status: open
title: Bug in Pickle protocol involving __setstate__
type: behavior
versions: Python 2.5

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2295] cPickle corner case - docs or bug?

2008-03-15 Thread Greg Kochanski

New submission from Greg Kochanski <[EMAIL PROTECTED]>:

If you attempt to cPickle a class, cPickle checks
that it can get the identical class by importing it.

If that check fails, it reports:
Traceback (most recent call last):
...
"/usr/local/lib/python2.5/site-packages/newstem2-0.12.3-py2.5-linux-i686.egg/newstem2/stepperclient.py",
line 41, in send
s = cPickle.dumps( args, cPickle.HIGHEST_PROTOCOL)
cPickle.PicklingError: Can't pickle : it's
not the same object as test_simple2.aModel
$ 

Normally, this is probably a good thing.   However, if you do
an import using the "imp" module, via
 imp.load_module(name, fd, pn, desc), you get the "same" module
containing the "same" classes, but everything is duplicated at
different addresses.  In other words, you get distinct class
objects from what cPickle
will find.   Consequently, the when cPickle makes the
"is" comparison between what you gave it and what it can find,
it will fail and cause an error.

In this case, the error is wrong. I know that the aModel classes
come from the same file and are member-for-member the same.

This may well be a documentation
error:  it needs to mention this test and note that classes in modules
imported
via imp are not picklable.Or, imp needs to note that its results
are not picklable.   Or both.

Or, maybe it's something that should be fixed, though I'm not
sure if there is a general solution that will always behave
well.

--
assignee: georg.brandl
components: Documentation, Library (Lib)
messages: 63560
nosy: georg.brandl, gpk
severity: normal
status: open
title: cPickle corner case - docs or bug?
type: behavior
versions: Python 2.5

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2294] Bug in Pickle protocol involving __setstate__

2008-03-15 Thread Tim Gordon

Tim Gordon <[EMAIL PROTECTED]> added the comment:

You've missed off the two underscores after the name __setstate__ :p

--
nosy: +QuantumTim

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1810] AST compile() patch

2008-03-15 Thread Georg Brandl

Georg Brandl <[EMAIL PROTECTED]> added the comment:

I'll try to handle it this weekend.

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2292] Missing *-unpacking generalizations

2008-03-15 Thread Georg Brandl

Georg Brandl <[EMAIL PROTECTED]> added the comment:

Just a nit: the syntax error message for invalid starred expressions
should be changed from "can use starred expression only as assignment
target".

--
nosy: +georg.brandl

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2294] Bug in Pickle protocol involving __setstate__

2008-03-15 Thread Georg Brandl

Georg Brandl <[EMAIL PROTECTED]> added the comment:

Closing as invalid.

--
nosy: +georg.brandl
resolution:  -> invalid
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2291] Catching all exceptions with 'object'

2008-03-15 Thread Neal Norwitz

Neal Norwitz <[EMAIL PROTECTED]> added the comment:

See PEP 352.  Currently this is slated for python 2.8.  Perhaps the
schedule should be sped up a bit in light the current release schedule.
 Brett, any comments?  We should add all the warnings from PEP 352 with
the -3 flag to 2.6.

--
nosy: +brett.cannon, nnorwitz
versions: +Python 2.6 -Python 2.5

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2296] [PATCH] Tcl/Tk 8.4.16 patches needed to get an x64 Windows build

2008-03-15 Thread Trent Nelson

New submission from Trent Nelson <[EMAIL PROTECTED]>:

Martin, I've attached two patches required in order to get Tcl/Tk 8.4.16
to successfully compile on Windows x64.  I haven't included the patch to
external-amd64.bat (and pcbuild/readme.txt with updated build
instructions) yet as I wanted to confirm how you apply updates to the
external/ branch such that the buildbots can pick it up as well.

Note that I also dropped a generic standalone sed.exe into
tk-8.4.16/win, which is required for reasons that I couldn't be bothered
digging into in makefile.vc.  You can grab it from
http://svn.onresolve.com/external/tags/tcl-8.4.18.1/win/sed.exe.

Also, wanted to query the role of 'COMPILERFLAGS=-DWINVER=0x0500' in
your recommended nmake flags; do we still need it?  I used the following
for x64 debug builds:

..\tcl8.4.16\win>nmake -f makefile.vc DEBUG=1 MACHINE=AMD64
INSTALLDIR=../../tcltk64 clean all install

And for tk:

..\tk8.4.16\win>nmake -f makefile.vc DEBUG=1 MACHINE=AMD64
TCLDIR=../../tcl8.4.16 INSTALLDIR=../../tcltk64 clean all install

Let me know how you want to deal with the tcl/tk patches and then we can
look at fixing external-amd64.bat and updating pcbuild/readme.txt.

--
components: Tkinter
files: tk-8.4.16.patch
keywords: patch
messages: 63566
nosy: Trent.Nelson, loewis
severity: normal
status: open
title: [PATCH] Tcl/Tk 8.4.16 patches needed to get an x64 Windows build
versions: Python 2.6, Python 3.0
Added file: http://bugs.python.org/file9676/tk-8.4.16.patch

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2296] [PATCH] Tcl/Tk 8.4.16 patches needed to get an x64 Windows build

2008-03-15 Thread Trent Nelson

Trent Nelson <[EMAIL PROTECTED]> added the comment:

And the tcl patch...

Added file: http://bugs.python.org/file9677/tcl-8.4.16.patch

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2185] code objects should conserve memory

2008-03-15 Thread Neal Norwitz

Neal Norwitz <[EMAIL PROTECTED]> added the comment:

Marshal is the wrong place for this sort of thing (the code object is
where it should be done).

I botched the analysis.  The case is common, but only for the empty
tuple which I forgot to ignore.  (None,) was a common case when I
measured it.  We should measure the actual memory savings before
anything is implemented.

To answer your question, the case were this happens is:

  def foo(self):  return self.self

--
resolution:  -> rejected
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2296] [PATCH] Tcl/Tk 8.4.16 patches needed to get an x64 Windows build

2008-03-15 Thread Christian Heimes

Changes by Christian Heimes <[EMAIL PROTECTED]>:


--
assignee:  -> loewis
components: +Windows
keywords: +64bit
priority:  -> normal
type:  -> behavior

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2291] Catching all exceptions with 'object'

2008-03-15 Thread Brett Cannon

Brett Cannon <[EMAIL PROTECTED]> added the comment:

On Sat, Mar 15, 2008 at 5:30 PM, Neal Norwitz <[EMAIL PROTECTED]> wrote:
>
>  Neal Norwitz <[EMAIL PROTECTED]> added the comment:
>
>  See PEP 352.  Currently this is slated for python 2.8.  Perhaps the
>  schedule should be sped up a bit in light the current release schedule.
>   Brett, any comments?  We should add all the warnings from PEP 352 with
>  the -3 flag to 2.6.

We could add warnings for everything slated to go in 3.0. As for 2.x,
I don't think tossing in warnings for 2.6 is good, but it could be
made a PendingDeprecationWarning, with 2.7 being full
DeprecationWarning.

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2297] Patch for fatal stack overflow in Windows caused by -v

2008-03-15 Thread Douglas Greiman

New submission from Douglas Greiman <[EMAIL PROTECTED]>:

When python is invoked with -v or -vv under Windows, the process of
importing the codec for sys.stderr causes a message to be written to
stderr, which in turn causes the codec to be recursively imported. 
Sometimes the stack overflow exception is swallowed, other times it is
not.  The bug depends on the particular locale settings of the Windows
machine.

To reproduce: python_d.exe -v
and look for many repeated imports of encodings.

Patch is attached.

--
components: Interpreter Core
files: py3k-win-codec-recursion-20080315.diff
keywords: patch
messages: 63570
nosy: dgreiman
severity: normal
status: open
title: Patch for fatal stack overflow in Windows caused by -v
type: crash
versions: Python 3.0
Added file: 
http://bugs.python.org/file9678/py3k-win-codec-recursion-20080315.diff

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2297>
__
___
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-15 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



[issue2299] Minor typos in newtypes.rst

2008-03-15 Thread Douglas Greiman

New submission from Douglas Greiman <[EMAIL PROTECTED]>:

Fix three minor typos in Doc/extending/newtypes.rst

--
assignee: georg.brandl
components: Documentation
files: Doc-newtypes-typos-20080315.diff
keywords: patch
messages: 63572
nosy: dgreiman, georg.brandl
severity: minor
status: open
title: Minor typos in newtypes.rst
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file9680/Doc-newtypes-typos-20080315.diff

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2299>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com