[issue1401] urllib2 302 POST

2007-11-08 Thread Andres Riancho

Andres Riancho added the comment:

As mentioned in the RFC, and quoted by orsenthil, "however, most
existing user agent implementations treat 302 as if it were a 303
response", which is true for urllib2.py too ( see line 585 ):

http_error_301 = http_error_303 = http_error_307 = http_error_302

Which means: "all redirections are treated the same way". So, if we want
to strictly respect the RFC, we should implement 4 different methods:

   - http_error_301
   - http_error_303
   - http_error_307
   - http_error_302

But urllib2 is implementing the RFC "the easy way", this is: "threat all
redirections the same, threat them as 303". 303 redirections perform a
GET on the URI, which urllib2 does here:

return Request(newurl,
   headers=req.headers,
   origin_req_host=req.get_origin_req_host(),
   unverifiable=True)

These line does not clone the old request completely, it creates a GET
request. If we create a GET request (handling 302 as 303) we should
remove the content length header!

__
Tracker <[EMAIL PROTECTED]>

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



[issue1395] py3k: duplicated line endings when using read(1)

2007-11-08 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

OK, I have taken another approach which seems to work (see io4.diff):
It uses an IncrementalNewlineDecoder, which wraps the initial (e.g.
utf-8) decoder.
All the tests in test_io pass on Windows, including those added by
io.diff and io2.diff. This was not the case with the other proposed patches.

While not completely finished, this approach seems much saner to me: it
is simple, does not introduce obscure variables or functions, and is
compatible with the (complex) code in tell() which reconstruct the file
position.

Next steps are:
- move _seennl management inside this decoder, and remove _replacenl
- make the decoder directly inherit from codecs.IncrementalDecoder; code
may be easier to understand.
- fix test_mailbox.

About mailbox.py: it seems that the code cannot work: it uses statements
like
  self._file.read(stop - self._file.tell())
where 'stop' was previously initialized with some other call to
self._file.tell(). But read() counts characters, whereas tell() returns
byte counts. The question is now: how does it work with python2.5? I'll
try to add debug prints to see where the differences are.

Added file: http://bugs.python.org/file8711/io4.diff

__
Tracker <[EMAIL PROTECTED]>

__

io4.diff
Description: Binary data
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1395] py3k: duplicated line endings when using read(1)

2007-11-08 Thread Christian Heimes

Christian Heimes added the comment:

The patch doesn't apply

$ patch -p0 < io4.diff
(Stripping trailing CRs from patch.)
patching file Lib/io.py
patch:  malformed patch at line 41: @@ -1133,7 +1160,10 @@

__
Tracker <[EMAIL PROTECTED]>

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



[issue1395] py3k: duplicated line endings when using read(1)

2007-11-08 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Sorry, I think I corrupted the file by hand. Here is another version

Added file: http://bugs.python.org/file8712/io4.diff

__
Tracker <[EMAIL PROTECTED]>

__

io4.diff
Description: Binary data
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1393] function comparing lacks NotImplemented error

2007-11-08 Thread Christian Heimes

Christian Heimes added the comment:

Additional prints make it easy to understand what happens here:

>>> class Anything:
... def __eq__(self, other):
... print("eq")
... return True
... def __ne__(self, other):
... print("ne")
... return False
...
>>> x = lambda: None
>>> print(x == Anything())
False
>>> print(Anything() == x)
eq
True
>>> y = object()
>>> print(y == Anything())
eq
True
>>> print(Anything() == y)
eq
True

x == Anything() doesn't invoke Anything.__eq__(). It's using
function.__eq__().

--
nosy: +tiran

__
Tracker <[EMAIL PROTECTED]>

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



[issue1395] py3k: duplicated line endings when using read(1)

2007-11-08 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

> About mailbox.py: it seems that the code cannot work

Of course: the file mode was recently changed from rb+ to r+ (revision
57809). This means that every occurrence of os.linesep has to disappear.
Oh my.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1377] test_import breaks on Linux

2007-11-08 Thread Christian Heimes

Changes by Christian Heimes:


--
resolution: accepted -> remind
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



[issue1337] Tools/msi/msi.py does not work with PCBuild8

2007-11-08 Thread Christian Heimes

Christian Heimes added the comment:

PCBuild is still the default compiler for Python but any patches are
appreciated. You could start by writing a new or updating the old
compiler command to support VS 2005. The old distutils.msvccompiler
supports only MSVC 6 and 7 but not 8.

--
nosy: +tiran
priority:  -> low
resolution:  -> later

__
Tracker <[EMAIL PROTECTED]>

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



[issue1400] Py3k's print() flushing problem

2007-11-08 Thread Christian Heimes

Changes by Christian Heimes:


--
keywords: +py3k
priority:  -> high
resolution:  -> accepted

__
Tracker <[EMAIL PROTECTED]>

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



[issue1351] Add getsize() to io instances

2007-11-08 Thread Christian Heimes

Christian Heimes added the comment:

> (a) the SizeInfo class is overkill.  getsize() should just return an int.

But I like overkill :)

> (b) getsize() should check self.seekable() first and raise the
appropriate error if the file isn't seekable.

That's easy to implement

> (c) os.fstat() is much less likely to work than the tell-seek-tell-seek
sequence, so why not use that everywhere?

fstat doesn't have concurrency problems in multi threaded apps. I
haven't profiled it but I would guess that fstat is also faster than
tell seek.

> (d) people will expect to use this on text files, but of course the
outcome will be in bytes, hence useless.

I could rename the method to getfssize, getbytesize, getsizeb ... to
make clear that it doesn't return the amount of chars but the amount of
used bytes.

--
keywords: +patch, py3k
priority:  -> low

__
Tracker <[EMAIL PROTECTED]>

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



[issue1720390] Remove backslash escapes from tokenize.c.

2007-11-08 Thread Christian Heimes

Christian Heimes added the comment:

Can you create a new patch and verify that the problem still exists?
norawescape3.diff doesn't apply cleanly any more.

--
nosy: +tiran

_
Tracker <[EMAIL PROTECTED]>

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



[issue1127] No tests for inspect.getfullargspec()

2007-11-08 Thread Quentin Gallet-Gilles

Quentin Gallet-Gilles added the comment:

Alright, thanks!

__
Tracker <[EMAIL PROTECTED]>

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



[issue1110] Problems with the msi installer - python-3.0a1.msi

2007-11-08 Thread Christian Heimes

Christian Heimes added the comment:

I've validated a) and fixed b) two weeks ago. I'm closing this bug. It
doesn't contain any additional problems for the bug.

I expect the next alpha of Python 3.0 in about two weeks. Please test
the next version, would you? The problems with your localization of
Windows should be fixed as long as you don't install Python into a
directory with non ASCII letters.

--
nosy: +tiran
superseder:  -> io or codecs bug in codecs.getincrementaldecoder

__
Tracker <[EMAIL PROTECTED]>

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



[issue1404] warnings module bug: BytesWarning: str() on a bytes instance

2007-11-08 Thread Christian Heimes

New submission from Christian Heimes:

$ ./python -bb Lib/compileall.py
Listing /home/heimes/dev/python/py3k/Lib ...
Compiling /home/heimes/dev/python/py3k/Lib/pydoc.py ...
Traceback (most recent call last):
  File "Lib/compileall.py", line 162, in 
exit_status = int(not main())
  File "Lib/compileall.py", line 155, in main
success = compile_path()
  File "Lib/compileall.py", line 110, in compile_path
force, quiet=quiet)
  File "Lib/compileall.py", line 65, in compile_dir
ok = py_compile.compile(fullname, None, dfile, True)
  File "/home/heimes/dev/python/py3k/Lib/py_compile.py", line 131, in
compile
encoding = read_encoding(file, "utf-8")
  File "/home/heimes/dev/python/py3k/Lib/py_compile.py", line 91, in
read_encoding
return str(m.group(1))
  File "/home/heimes/dev/python/py3k/Lib/warnings.py", line 62, in warn
globals)
  File "/home/heimes/dev/python/py3k/Lib/warnings.py", line 102, in
warn_explicit
raise message
BytesWarning: str() on a bytes instance

--
assignee: tiran
components: Library (Lib)
keywords: patch
messages: 57245
nosy: tiran
priority: high
severity: normal
status: open
title: warnings module bug: BytesWarning: str() on a bytes instance
type: behavior
versions: Python 3.0

__
Tracker <[EMAIL PROTECTED]>

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



[issue1210] imaplib does not run under Python 3

2007-11-08 Thread Christian Heimes

Christian Heimes added the comment:

The transition is done. Can you work on a patch and maybe add some
tests, too? It helps when you start Python with the -bb flag:

$ ./python -bb -c 'import imaplib; imaplib.Debug=5;
imaplib.IMAP4("mail.rtmq.infosathse.com")'
  52:01.86 imaplib version 2.58
  52:01.86 new IMAP4 connection, tag=PNFO
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/heimes/dev/python/py3k/Lib/imaplib.py", line 184, in __init__
self.welcome = self._get_response()
  File "/home/heimes/dev/python/py3k/Lib/imaplib.py", line 907, in
_get_response
resp = self._get_line()
  File "/home/heimes/dev/python/py3k/Lib/imaplib.py", line 1009, in
_get_line
self._mesg('< %s' % line)
  File "/home/heimes/dev/python/py3k/Lib/warnings.py", line 62, in warn
globals)
  File "/home/heimes/dev/python/py3k/Lib/warnings.py", line 102, in
warn_explicit
raise message
BytesWarning: str() on a bytes instance

--
nosy: +tiran

__
Tracker <[EMAIL PROTECTED]>

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



[issue1127] No tests for inspect.getfullargspec()

2007-11-08 Thread Christian Heimes

Christian Heimes added the comment:

I've applied your patch in r58910. Thanks!

Please open another bug if you have additional tests.

--
nosy: +tiran
resolution:  -> fixed

__
Tracker <[EMAIL PROTECTED]>

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



[issue1042] test_glob fails with UnicodeDecodeError

2007-11-08 Thread Christian Heimes

Christian Heimes added the comment:

I'm unable to reproduce the error and I haven't seen it for a long time.
Closing

--
keywords: +rfe
resolution:  -> out of date
status: open -> closed
type:  -> behavior

__
Tracker <[EMAIL PROTECTED]>

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



[issue1283] PyBytes (buffer) .extend method needs to accept any iterable of ints

2007-11-08 Thread Christian Heimes

Changes by Christian Heimes:


--
components: +Interpreter Core
priority:  -> low
resolution:  -> accepted
type:  -> rfe

__
Tracker <[EMAIL PROTECTED]>

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



[issue1400] Py3k's print() flushing problem

2007-11-08 Thread Wojciech Walczak

Wojciech Walczak added the comment:

2007/11/8, admin <[EMAIL PROTECTED]>:

> --
> keywords: +py3k
> priority:  -> high
> resolution:  -> accepted

Which resolution was accepted?

Wojtek Walczak

__
Tracker <[EMAIL PROTECTED]>

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



[issue1144] parsermodule validation out of sync with Grammar

2007-11-08 Thread Christian Heimes

Christian Heimes added the comment:

It's still breaking but Guido should know how to fix the parser.

--
assignee:  -> gvanrossum
keywords: +patch
nosy: +gvanrossum, tiran
priority: normal -> low
resolution:  -> accepted

__
Tracker <[EMAIL PROTECTED]>

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



[issue1403] io or codecs bug in codecs.getincrementaldecoder

2007-11-08 Thread Christian Heimes

New submission from Christian Heimes:

$ ./python Lib/compileall.py
Listing /home/heimes/dev/python/py3k/Lib ...
Compiling /home/heimes/dev/python/py3k/Lib/pydoc.py ...
Traceback (most recent call last):
  File "Lib/compileall.py", line 162, in 
exit_status = int(not main())
  File "Lib/compileall.py", line 155, in main
success = compile_path()
  File "Lib/compileall.py", line 110, in compile_path
force, quiet=quiet)
  File "Lib/compileall.py", line 65, in compile_dir
ok = py_compile.compile(fullname, None, dfile, True)
  File "/home/heimes/dev/python/py3k/Lib/py_compile.py", line 137, in
compile
codestring = f.read()
  File "/home/heimes/dev/python/py3k/Lib/io.py", line 1243, in read
decoder = self._decoder or self._get_decoder()
  File "/home/heimes/dev/python/py3k/Lib/io.py", line 1132, in _get_decoder
make_decoder = codecs.getincrementaldecoder(self._encoding)
  File "/home/heimes/dev/python/py3k/Lib/codecs.py", line 951, in
getincrementaldecoder
decoder = lookup(encoding).incrementaldecoder
LookupError: unknown encoding: b'Latin-1'

--
components: Library (Lib)
keywords: py3k
messages: 57244
nosy: tiran
priority: high
severity: normal
status: open
title: io or codecs bug in codecs.getincrementaldecoder
type: crash
versions: Python 3.0

__
Tracker <[EMAIL PROTECTED]>

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



[issue1086] test_email failed

2007-11-08 Thread Christian Heimes

Christian Heimes added the comment:

Fixed about two weeks ago

--
keywords: +rfe
nosy: +tiran
resolution:  -> fixed
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



[issue1110] Problems with the msi installer - python-3.0a1.msi

2007-11-08 Thread Christian Heimes

Changes by Christian Heimes:


--
resolution:  -> duplicate
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



[issue1087] py3k os.popen result is not iterable, patch attached

2007-11-08 Thread Christian Heimes

New submission from Christian Heimes:

os.popen was reimplemented a while ago. It's using the subprocess. I've
added a unit test to verify the existence of __iter__() in r58912.

--
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



[issue1020] pyexpat.XMParserType broken (was: pydoc doesn't work on pyexpat)

2007-11-08 Thread Christian Heimes

Christian Heimes added the comment:

It's not a problem with pydoc but a problem in the pyexpat module. I
believe that the C code is broken. See for yourself:

>>> dir(pyexpat.XMLParserType)
['__class__', '__delattr__', '__dir__', '__doc__', '__eq__',
'__format__', '__ge__', '__getattribute__', '__gt__', '__hash__',
'__init__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__',
'__reduce_ex__', '__repr__', '__setattr__', '__str__', 'xZK\x08']

There is an issue in the method list. Since most lines of pyexpat were
written by fdrake I'm assigning the bug to him.

--
assignee:  -> fdrake
keywords: +py3k
nosy: +fdrake, tiran
priority: low -> high
resolution:  -> accepted
title: pydoc doesn't work on pyexpat -> pyexpat.XMParserType broken (was: pydoc 
doesn't work on pyexpat)

__
Tracker <[EMAIL PROTECTED]>

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



[issue1210] imaplib does not run under Python 3

2007-11-08 Thread Raghuram Devarakonda

Raghuram Devarakonda added the comment:

I will see what I can do but it may take a while.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1333] merge urllib and urlparse functionality

2007-11-08 Thread Christian Heimes

Changes by Christian Heimes:


--
keywords: +py3k
priority:  -> normal
resolution:  -> accepted

__
Tracker <[EMAIL PROTECTED]>

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



[issue1282] re module needs to support bytes / memoryview well

2007-11-08 Thread Christian Heimes

Changes by Christian Heimes:


--
keywords: +py3k
priority:  -> normal
resolution:  -> accepted
type:  -> rfe

__
Tracker <[EMAIL PROTECTED]>

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



[issue1395] py3k: duplicated line endings when using read(1)

2007-11-08 Thread Christian Heimes

Christian Heimes added the comment:

The new io4.diff breaks test_io and test_univnewlines on Linux

Added file: http://bugs.python.org/file8713/linux_test.log.gz

__
Tracker <[EMAIL PROTECTED]>

__

linux_test.log.gz
Description: GNU Zip compressed data
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1200] Allow array.array to be parsed by the t# format unit.

2007-11-08 Thread Christian Heimes

Changes by Christian Heimes:


--
keywords: +py3k
priority:  -> normal
type: behavior -> rfe

__
Tracker <[EMAIL PROTECTED]>

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



[issue1404] warnings module bug: BytesWarning: str() on a bytes instance

2007-11-08 Thread Christian Heimes

Christian Heimes added the comment:

No bug at all ;)

--
priority: high -> 
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



[issue1366] popen spawned process may not write to stdout under windows

2007-11-08 Thread Patrick Mézard

Patrick Mézard added the comment:

pythonmeister: I never expected stderr to be redirected, just *all
stdout* to be captured. But...

gagenellina: you are completely right about the failure. Still, this
issue happened with a real world application written in C, and
redirecting manually stderr to :NUL: solved it unexpectedly. I did not
expect spawned process behaviour to differ when its stderr is being
redirected.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1127] No tests for inspect.getfullargspec()

2007-11-08 Thread Christian Heimes

Changes by Christian Heimes:


--
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



[issue1720390] Remove backslash escapes from tokenize.c.

2007-11-08 Thread Ron Adam

Ron Adam added the comment:

Yes, I will update it.

_
Tracker <[EMAIL PROTECTED]>

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



[issue1405] Garbage collection not working correctly in Python 2.3

2007-11-08 Thread Christian Heimes

Christian Heimes added the comment:

I'm sorry but Python 2.3 is long gone. Its maintenance cycle has ended
over a year ago.Nobody is going to fix an outdated version when the new
versions of Python are working fine. Can you update to a new version of
Python?

--
nosy: +tiran
resolution:  -> out of date
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



[issue1398] Can't pickle partial functions

2007-11-08 Thread Christian Heimes

Changes by Christian Heimes:


--
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



[issue1677872] Efficient reverse line iterator

2007-11-08 Thread Mark Russell

Mark Russell added the comment:

Sure - I'll do an updated patch at the weekend.

_
Tracker <[EMAIL PROTECTED]>

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



[issue1081] file.seek allows float arguments

2007-11-08 Thread Christian Heimes

Christian Heimes added the comment:

Fixed in r58914

--
nosy: +tiran
resolution:  -> fixed
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



[issue1401] urllib2 302 POST

2007-11-08 Thread Facundo Batista

Facundo Batista added the comment:

So, for 302 error we should resend the request as POST (header with
lenght and data), and for the others we need to keep current behaviour.

Actually, we just need to code a new handling function for 302, and
leave the existing one as is.

What do you think?

__
Tracker <[EMAIL PROTECTED]>

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



[issue1677872] Efficient reverse line iterator

2007-11-08 Thread Christian Heimes

Christian Heimes added the comment:

Some people like the feature, Guido isn't against the feature ... It
looks as you have a good chance to get it into Python 3.0. :)

Can you come up with a new patch and unit tests? The io module has
changed a lot since your initial patch.

--
nosy: +tiran

_
Tracker <[EMAIL PROTECTED]>

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



[issue1395] py3k: duplicated line endings when using read(1)

2007-11-08 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

> The new io4.diff breaks test_io and test_univnewlines on Linux
oops, I missed this one.

Here is a new version: io5.diff, which should handle the "seen newlines"
better.

Two more bug fixes found by test_univnewlines: 
- write() should return the number of characters written, but before
they are newline-translated.
- a problem in tell(), my decoder can return two characters even when
you feed only one (example: decode(b'\r') holds the \r and returns
nothing. then a decode(b'x') returns both chars "\rx")

Added file: http://bugs.python.org/file8714/io5.diff

__
Tracker <[EMAIL PROTECTED]>

__

io5.diff
Description: Binary data
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1405] Garbage collection not working correctly in Python 2.3

2007-11-08 Thread Stefan Sonnenberg-Carstens

New submission from Stefan Sonnenberg-Carstens:

when running this script:
aList = []
for i in xrange(5E5):
aList += [[]]
for j in xrange(10):
aList[-1].append([])
del aList

It does not give back the memory

even a

import gc
gc.collect()

afterwards does not do it.

In Python 2.5 the memory is freed again correctly, at least under Windows.

The problem came up, because I was parsing a CSV file of 50 MB which
resulted in memory usage of more than 500 MB.

--
components: Interpreter Core
messages: 57256
nosy: pythonmeister
severity: urgent
status: open
title: Garbage collection not working correctly in Python 2.3
type: resource usage
versions: Python 2.3

__
Tracker <[EMAIL PROTECTED]>

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



[issue1406] Use widechar api for os.environ

2007-11-08 Thread Christian Heimes

Christian Heimes added the comment:

Great work! :) I've been waiting for a fix.

Do you have time to rework PC/getpathp.c and other code related to
sys.path? It's still using the ASCII api which causes bugs like
http://bugs.python.org/issue1342

--
nosy: +tiran
priority:  -> high
resolution:  -> accepted

__
Tracker <[EMAIL PROTECTED]>

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



[issue1366] popen spawned process may not write to stdout under windows

2007-11-08 Thread Stefan Sonnenberg-Carstens

Stefan Sonnenberg-Carstens added the comment:

the popen call does not redirect stderr.
If you do something like 2>null (windows) or 2>/dev/null (*nix) it will
_never_ get printed.
If you want to have stderr & stdout getting in via popen and thus stdout,
under *nix and windows you would do that:

command 2>&1

It is not popen to blame.
See this for reference:
http://netbsd.gw.com/cgi-bin/man-cgi?popen++NetBSD-current

--
nosy: +pythonmeister

__
Tracker <[EMAIL PROTECTED]>

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



[issue1403] py_compile and compileall need unit tests

2007-11-08 Thread Christian Heimes

Christian Heimes added the comment:

I've fixed the bug in r58913. The modules need more unit tests.

--
priority: high -> low
resolution:  -> accepted
title: io or codecs bug in codecs.getincrementaldecoder -> py_compile and 
compileall need unit tests

__
Tracker <[EMAIL PROTECTED]>

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



[issue1398] Can't pickle partial functions

2007-11-08 Thread Stefan Sonnenberg-Carstens

Stefan Sonnenberg-Carstens added the comment:

You are using an old protocol version

pickle.dumps(partial_f,2)

does the trick:

>>> pickle.dumps(partial_f,2)
'\x80\x02cfunctools\npartial\nq\x00)\x81q\x01}q\x02b.'

--
nosy: +pythonmeister

__
Tracker <[EMAIL PROTECTED]>

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



[issue1406] Use widechar api for os.environ

2007-11-08 Thread Thomas Heller

New submission from Thomas Heller:

This patch uses the windows widechar apis for os.environ.  In this way,
environment variables that use umlauts can be accessed.

--
components: Interpreter Core, Windows
files: posixmodule.c.diff
keywords: patch, py3k
messages: 57265
nosy: theller
severity: normal
status: open
title: Use widechar api for os.environ
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file8715/posixmodule.c.diff

__
Tracker <[EMAIL PROTECTED]>

__Index: posixmodule.c
===
--- posixmodule.c	(revision 58913)
+++ posixmodule.c	(working copy)
@@ -340,7 +340,11 @@
 convertenviron(void)
 {
 	PyObject *d;
+#ifdef MS_WINDOWS
+	wchar_t **e;
+#else
 	char **e;
+#endif
 	d = PyDict_New();
 	if (d == NULL)
 		return NULL;
@@ -348,6 +352,38 @@
 	if (environ == NULL)
 		environ = *_NSGetEnviron();
 #endif
+#ifdef MS_WINDOWS
+	/* _wenviron must be initialized in this way if the program is started
+	   through main() instead of wmain(). */
+	_wgetenv(L"");
+	if (_wenviron == NULL)
+		return d;
+	/* This part ignores errors */
+	for (e = _wenviron; *e != NULL; e++) {
+		PyObject *k;
+		PyObject *v;
+		wchar_t *p = wcschr(*e, L'=');
+		if (p == NULL)
+			continue;
+		k = PyUnicode_FromWideChar(*e, (Py_ssize_t)(p-*e));
+		if (k == NULL) {
+			PyErr_Clear();
+			continue;
+		}
+		v = PyUnicode_FromWideChar(p+1, wcslen(p+1));
+		if (v == NULL) {
+			PyErr_Clear();
+			Py_DECREF(k);
+			continue;
+		}
+		if (PyDict_GetItem(d, k) == NULL) {
+			if (PyDict_SetItem(d, k, v) != 0)
+PyErr_Clear();
+		}
+		Py_DECREF(k);
+		Py_DECREF(v);
+	}
+#else
 	if (environ == NULL)
 		return d;
 	/* This part ignores errors */
@@ -375,6 +411,7 @@
 		Py_DECREF(k);
 		Py_DECREF(v);
 	}
+#endif
 #if defined(PYOS_OS2)
 {
 APIRET rc;
@@ -4973,12 +5010,23 @@
 static PyObject *
 posix_putenv(PyObject *self, PyObject *args)
 {
+#ifdef MS_WINDOWS
+wchar_t *s1, *s2;
+wchar_t *newenv;
+#else
 char *s1, *s2;
 char *newenv;
+#endif
 	PyObject *newstr;
 	size_t len;
 
-	if (!PyArg_ParseTuple(args, "ss:putenv", &s1, &s2))
+	if (!PyArg_ParseTuple(args,
+#ifdef MS_WINDOWS
+			  "uu:putenv",
+#else
+			  "ss:putenv",
+#endif
+			  &s1, &s2))
 		return NULL;
 
 #if defined(PYOS_OS2)
@@ -4997,14 +5045,27 @@
 return os2_error(rc);
 } else {
 #endif
-
 	/* XXX This can leak memory -- not easy to fix :-( */
-	len = strlen(s1) + strlen(s2) + 2;
 	/* len includes space for a trailing \0; the size arg to
 	   PyString_FromStringAndSize does not count that */
+#ifdef MS_WINDOWS
+	len = wcslen(s1) + wcslen(s2) + 2;
+	newstr = PyUnicode_FromUnicode(NULL, (int)len - 1);
+#else
+	len = strlen(s1) + strlen(s2) + 2;
 	newstr = PyString_FromStringAndSize(NULL, (int)len - 1);
+#endif
 	if (newstr == NULL)
 		return PyErr_NoMemory();
+#ifdef MS_WINDOWS
+	newenv = PyUnicode_AsUnicode(newstr);
+	_snwprintf(newenv, len, L"%s=%s", s1, s2);
+	if (_wputenv(newenv)) {
+Py_DECREF(newstr);
+posix_error();
+return NULL;
+	}
+#else
 	newenv = PyString_AS_STRING(newstr);
 	PyOS_snprintf(newenv, len, "%s=%s", s1, s2);
 	if (putenv(newenv)) {
@@ -5012,6 +5073,7 @@
 posix_error();
 return NULL;
 	}
+#endif
 	/* Install the first arg and newstr in posix_putenv_garbage;
 	 * this will cause previous value to be collected.  This has to
 	 * happen after the real putenv() call because the old value
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1401] urllib2 302 POST

2007-11-08 Thread Andres Riancho

Andres Riancho added the comment:

According to the RFC:

If urllib2 gets a 302 in response to a request, it MUST send the *same*
request to the URI specified in the Location header, without modifying
the method, headers, or any data (urllib2 is not RFC compliant here)

In urllib2, a 301 and a 307 message should be handled just like a 302.

If urllib2 gets a 303 in response to a request, it MUST send a GET
request to the URI specified in the Location header (urllib2 is "half"
RFC compliant here, this only works if the original request WASN'T a
POST request)

I will code a complete patch to make urllib2 work as RFC Compliant as
possible. Whenever it's ready i'll send it.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1395] py3k: duplicated line endings when using read(1)

2007-11-08 Thread Raghuram Devarakonda

Raghuram Devarakonda added the comment:

Considering that test_csv is failing on windows even without any changes
related to this issue, I looked at it and came up with this patch:

-
Index: Lib/test/test_csv.py
===
--- Lib/test/test_csv.py(revision 58914)
+++ Lib/test/test_csv.py(working copy)
@@ -375,7 +375,7 @@
 
 class TestCsvBase(unittest.TestCase):
 def readerAssertEqual(self, input, expected_result):
-with TemporaryFile("w+") as fileobj:
+with TemporaryFile("w+", newline='') as fileobj:
 fileobj.write(input)
 fileobj.seek(0)
 reader = csv.reader(fileobj, dialect = self.dialect)
-

Does this look ok? The tests pass on windows and Linux.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1395] py3k: duplicated line endings when using read(1)

2007-11-08 Thread Raghuram Devarakonda

Raghuram Devarakonda added the comment:

On 11/8/07, Amaury Forgeot d'Arc <[EMAIL PROTECTED]> wrote:
> OK, I have taken another approach which seems to work (see io4.diff):
> It uses an IncrementalNewlineDecoder, which wraps the initial (e.g.
> utf-8) decoder.

I like this approach even though I haven't looked at the patch in detail.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1399] XML codec

2007-11-08 Thread Walter Dörwald

Walter Dörwald added the comment:

OK, I've changed the name of the codec to xml_auto_detect and added
support for EBCDIC.

Added file: http://bugs.python.org/file8717/diff2.txt

__
Tracker <[EMAIL PROTECTED]>

__Index: Include/pyerrors.h
===
--- Include/pyerrors.h  (Revision 55955)
+++ Include/pyerrors.h  (Arbeitskopie)
@@ -30,8 +30,8 @@
 PyObject *args;
 PyObject *encoding;
 PyObject *object;
-PyObject *start;
-PyObject *end;
+Py_ssize_t start;
+Py_ssize_t end;
 PyObject *reason;
 } PyUnicodeErrorObject;
 
Index: Objects/exceptions.c
===
--- Objects/exceptions.c(Revision 55955)
+++ Objects/exceptions.c(Arbeitskopie)
@@ -955,36 +955,6 @@
 SimpleExtendsException(PyExc_ValueError, UnicodeError,
"Unicode related error.");
 
-static int
-get_int(PyObject *attr, Py_ssize_t *value, const char *name)
-{
-if (!attr) {
-PyErr_Format(PyExc_TypeError, "%.200s attribute not set", name);
-return -1;
-}
-
-if (PyLong_Check(attr)) {
-*value = PyLong_AsSsize_t(attr);
-if (*value == -1 && PyErr_Occurred())
-return -1;
-} else {
-PyErr_Format(PyExc_TypeError, "%.200s attribute must be int", name);
-return -1;
-}
-return 0;
-}
-
-static int
-set_ssize_t(PyObject **attr, Py_ssize_t value)
-{
-PyObject *obj = PyInt_FromSsize_t(value);
-if (!obj)
-return -1;
-Py_CLEAR(*attr);
-*attr = obj;
-return 0;
-}
-
 static PyObject *
 get_bytes(PyObject *attr, const char *name)
 {
@@ -1062,40 +1032,35 @@
 int
 PyUnicodeEncodeError_GetStart(PyObject *exc, Py_ssize_t *start)
 {
-if (!get_int(((PyUnicodeErrorObject *)exc)->start, start, "start")) {
-Py_ssize_t size;
-PyObject *obj = get_unicode(((PyUnicodeErrorObject *)exc)->object,
-"object");
-if (!obj) return -1;
-size = PyUnicode_GET_SIZE(obj);
-if (*start<0)
-*start = 0; /*XXX check for values <0*/
-if (*start>=size)
-*start = size-1;
-Py_DECREF(obj);
-return 0;
-}
-return -1;
+PyObject *obj = get_unicode(((PyUnicodeErrorObject *)exc)->object,
+"object");
+Py_ssize_t size;
+if (!obj)
+return -1;
+*start = ((PyUnicodeErrorObject *)exc)->start;
+size = PyUnicode_GET_SIZE(obj);
+if (*start<0)
+*start = 0; /*XXX check for values <0*/
+if (*start>=size)
+*start = size-1;
+return 0;
 }
 
 
 int
 PyUnicodeDecodeError_GetStart(PyObject *exc, Py_ssize_t *start)
 {
-if (!get_int(((PyUnicodeErrorObject *)exc)->start, start, "start")) {
-Py_ssize_t size;
-PyObject *obj = get_bytes(((PyUnicodeErrorObject *)exc)->object,
-   "object");
-if (!obj) return -1;
-size = PyBytes_GET_SIZE(obj);
-if (*start<0)
-*start = 0;
-if (*start>=size)
-*start = size-1;
-Py_DECREF(obj);
-return 0;
-}
-return -1;
+PyObject *obj = get_bytes(((PyUnicodeErrorObject *)exc)->object, "object");
+Py_ssize_t size;
+if (!obj)
+return -1;
+*start = ((PyUnicodeErrorObject *)exc)->start;
+size = PyBytes_GET_SIZE(obj);
+if (*start<0)
+*start = 0;
+if (*start>=size)
+*start = size-1;
+return 0;
 }
 
 
@@ -1109,61 +1074,59 @@
 int
 PyUnicodeEncodeError_SetStart(PyObject *exc, Py_ssize_t start)
 {
-return set_ssize_t(&((PyUnicodeErrorObject *)exc)->start, start);
+((PyUnicodeErrorObject *)exc)->start = start;
+return 0;
 }
 
 
 int
 PyUnicodeDecodeError_SetStart(PyObject *exc, Py_ssize_t start)
 {
-return set_ssize_t(&((PyUnicodeErrorObject *)exc)->start, start);
+((PyUnicodeErrorObject *)exc)->start = start;
+return 0;
 }
 
 
 int
 PyUnicodeTranslateError_SetStart(PyObject *exc, Py_ssize_t start)
 {
-return set_ssize_t(&((PyUnicodeErrorObject *)exc)->start, start);
+((PyUnicodeErrorObject *)exc)->start = start;
+return 0;
 }
 
 
 int
 PyUnicodeEncodeError_GetEnd(PyObject *exc, Py_ssize_t *end)
 {
-if (!get_int(((PyUnicodeErrorObject *)exc)->end, end, "end")) {
-Py_ssize_t size;
-PyObject *obj = get_unicode(((PyUnicodeErrorObject *)exc)->object,
-"object");
-if (!obj) return -1;
-size = PyUnicode_GET_SIZE(obj);
-if (*end<1)
-*end = 1;
-if (*end>size)
-*end = size;
-Py_DECREF(obj);
-return 0;
-}
-return -1;
+PyObject *obj = get_unicode(((PyUnicodeErrorObject *)exc)->object,
+"object");
+Py_ssize_t size;
+if (!obj)
+

[issue1144] parsermodule validation out of sync with Grammar

2007-11-08 Thread Guido van Rossum

Guido van Rossum added the comment:

No, I didn't write the parser module (which isn't the parser, just a
wrapper to make it accessible from Python).

--
assignee: gvanrossum -> fdrake
nosy: +fdrake

__
Tracker <[EMAIL PROTECTED]>

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



[issue1393] function comparing lacks NotImplemented error

2007-11-08 Thread Guido van Rossum

Guido van Rossum added the comment:

It's still odd though.  Why does object() == Anything() pass control to
the right hand side, while (lambda: None) == Anything() doesn't? 
There's no definition of equality in PyFunction_Type, so it would seem
to fall back on the definition in PyBaseObject_Type, which I would
expect to return False from the code in object_richcompare()...

[...gdb...]

OK, here's the solution of the mystery.  do_richcompare() ends up taking
the swapped code path for object() == Anything(), but not for function
objects.  This is because Anything() is a subclass of object, but not of
.

Perhaps the solution is to change object_richcompare() to return
NotImplemented instead of returning False?  Or perhaps even remove
object_richcompare() altogether, since it doesn't do anything that
do_richcompare() doesn't know how to do...

__
Tracker <[EMAIL PROTECTED]>

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



[issue1720390] Remove backslash escapes from tokenize.c.

2007-11-08 Thread Guido van Rossum

Guido van Rossum added the comment:

FWIW, I'm +1 on the part of this patch that disables \u in raw strings.
I just had a problem with a doctest that couldn't be run in verbose mode
because \u was being interpreted in raw mode...  But I'm still solidly
-1 on allowing trailing \.

_
Tracker <[EMAIL PROTECTED]>

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



[issue1377] test_import breaks on Linux

2007-11-08 Thread Guido van Rossum

Guido van Rossum added the comment:

I wouldn't close this until it's fixed.

--
status: closed -> open

__
Tracker <[EMAIL PROTECTED]>

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



[issue1402] Interpreter cleanup: order of _PyGILState_Fini and PyInterpreterState_Clear

2007-11-08 Thread Guido van Rossum

Guido van Rossum added the comment:

Do you have a patch?  Then we could consider fixing this in 2.5.2.

--
nosy: +gvanrossum

__
Tracker <[EMAIL PROTECTED]>

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



[issue1720250] PyGILState_Ensure does not acquires GIL

2007-11-08 Thread Brad Johnson

Changes by Brad Johnson:


--
nosy: +urBan_dK

_
Tracker <[EMAIL PROTECTED]>

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



[issue1395] py3k: duplicated line endings when using read(1)

2007-11-08 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Updated patch (io6.diff): 
- simplifications in readline
- seennl is now completely handled by the NewlineDecoder

Added file: http://bugs.python.org/file8719/io6.diff

__
Tracker <[EMAIL PROTECTED]>

__

io6.diff
Description: Binary data
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1410] BaseHTTPServer cannot accept Unicode data

2007-11-08 Thread J. Peterson

Changes by J. Peterson:


--
components: Library (Lib)
nosy: isonno
severity: normal
status: open
title: BaseHTTPServer cannot accept Unicode data
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



[issue1395] py3k: duplicated line endings when using read(1)

2007-11-08 Thread Guido van Rossum

Guido van Rossum added the comment:

> Considering that test_csv is failing on windows even without any changes
> related to this issue, I looked at it and came up with this patch:
>
> -
> Index: Lib/test/test_csv.py
> ===
> --- Lib/test/test_csv.py(revision 58914)
> +++ Lib/test/test_csv.py(working copy)
> @@ -375,7 +375,7 @@
>
>  class TestCsvBase(unittest.TestCase):
>  def readerAssertEqual(self, input, expected_result):
> -with TemporaryFile("w+") as fileobj:
> +with TemporaryFile("w+", newline='') as fileobj:
>  fileobj.write(input)
>  fileobj.seek(0)
>  reader = csv.reader(fileobj, dialect = self.dialect)
> -
>
> Does this look ok? The tests pass on windows and Linux.

Yes, especially since writerAssertEqual() already uses that. :-)

I do think there is something iffy here -- the 2.x version of this
test opens the files in binary mode. I wonder what end users are
supposed to do.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1390] toxml generates output that is not well formed

2007-11-08 Thread Paul Pogonyshev

Paul Pogonyshev added the comment:

I think unexpected exception in toxml() is not worse than producing
unreadable output.  With createComment() it is different, since you can
e.g. create a temporary DOM tree only to discard it later and never
serialize.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1409] new keyword-only function parameters interact badly with nested functions

2007-11-08 Thread Paul Pogonyshev

New submission from Paul Pogonyshev:

Attached scripts fails with 'NameError: free variable 'a' referenced
before assignment in enclosing scope'.  If you remove '*' in function
parameter list, it works.  I think it is a bug.

--
components: Interpreter Core
files: test.py
messages: 57277
nosy: _doublep
severity: normal
status: open
title: new keyword-only function parameters interact badly with nested functions
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file8716/test.py

__
Tracker <[EMAIL PROTECTED]>

__# Note that '*,' here is important.
def foo(*, a=None):
def bar(dictionary):
dictionary['a'] = a
return dictionary
return bar

print(foo(a=42)({ }))
print(foo()({ }))
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1407] [performance] Too many closed() checkings

2007-11-08 Thread Christian Heimes

Christian Heimes added the comment:

The problem should be addressed after the last alpha during the
optimization and cleanup phase.

--
components: +Interpreter Core, Library (Lib) -Build
keywords: +py3k
nosy: +tiran
priority:  -> normal
resolution:  -> later

__
Tracker <[EMAIL PROTECTED]>

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



[issue1157] test_urllib2net fails on test_ftp

2007-11-08 Thread Christian Heimes

Christian Heimes added the comment:

The test is passing for me on Ubuntu and Windows.

--
keywords: +py3k
nosy: +tiran
resolution:  -> works for me
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



[issue1047] py3k: corrections for test_subprocess on windows

2007-11-08 Thread Christian Heimes

Christian Heimes added the comment:

The patch to _fileio was implemented in a different way and applied to
the py3k branch a while ago.

--
nosy: +tiran
resolution: accepted -> fixed
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



[issue1400] Py3k's print() flushing problem

2007-11-08 Thread Guido van Rossum

Guido van Rossum added the comment:

I don't think anything was accepted yet.

--
nosy: +gvanrossum
resolution: accepted -> 

__
Tracker <[EMAIL PROTECTED]>

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



[issue1399] XML codec

2007-11-08 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

Thanks, Walter !

__
Tracker <[EMAIL PROTECTED]>

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



[issue1406] Use widechar api for os.environ

2007-11-08 Thread Thomas Heller

Thomas Heller added the comment:

Committed as rev 58916.

The getpath.c, sys.path, and sys.argv issues is much more difficult to
fix IMO.
If you write a testcase for THIS issue (os.environ), I'll start thinking
on them.  No promises, though.

--
assignee:  -> theller
resolution: accepted -> fixed
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



[issue1407] [performance] Too many closed() checkings

2007-11-08 Thread Wojciech Walczak

New submission from Wojciech Walczak:

For debugging reasons I have added a simple line to PyObject_Call()
function in Objects/abstract.c:
printf("%s.%s\n", func->ob_type->tp_name, PyEval_GetFuncName(func));
Now, after compiling python and running interpreter with simple
print() call I receive this:

Python 3.0a1 (py3k, Nov  6 2007, 19:25:33)
[GCC 4.1.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print('!',end='')
builtin_function_or_method.print
method.write
function.write
function.closed
function.closed
builtin_function_or_method.ascii_encode
function.closed
function.closed
!method.write   # here it goes again for 'end' parameter
function.write
function.closed
function.closed
builtin_function_or_method.ascii_encode
function.closed
builtin_function_or_method.displayhook
>>>

Note that there can be something going on between one function.closed 
and the next one, because not every piece of code gets called by 
PyObject_Call(), but still - isn't it checking if stream is closed a 
bit too often?

Regards,
Wojtek Walczak

--
components: Build
messages: 57275
nosy: wojtekwalczak
severity: minor
status: open
title: [performance] Too many closed() checkings
type: resource usage
versions: Python 3.0

__
Tracker <[EMAIL PROTECTED]>

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



[issue1408] Inconsistence in multiply list

2007-11-08 Thread beco

Changes by beco:


--
components: Interpreter Core
nosy: beco
severity: major
status: open
title: Inconsistence in multiply list
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



[issue1408] Inconsistence in multiply list

2007-11-08 Thread beco

New submission from beco:

There is no way to create a big nested list without references using the
multiplication operator.

'*' is supposed to work like + ... + in this cases:

>>> a=[0, 0]
>>> b=[a[:]]+[a[:]]
>>> b
[[0, 0], [0, 0]]
>>> b[0][0]=1
>>> b
[[1, 0], [0, 0]]

Ok! Copy here, not reference. Mainly because we use [:] explicitly
expressing we want a copy.

>>> c=[a[:]]*2
>>> c
[[0, 0], [0, 0]]
>>> c[0][0]=2
>>> c
[[2, 0], [2, 0]]

Inconsistence here. It is supposed to be clear and copy, not reference
in between.

Consequence: there is no clear way to create a nested list of, lets say,
60x60, using multiplications.

Even when using this, we cannot deal with the problem:

>>> import copy
>>> d=[copy.deepcopy(a[:])]*2
>>> d
[[0, 0], [0, 0]]
>>> d[0][0]=3
>>> d
[[3, 0], [3, 0]]

Workaround:
>>> from numpy import *
>>> a=zeros((2,2),int)
>>> a
array([[0, 0],
   [0, 0]])
>>> b=a.tolist()
>>> b
[[0, 0], [0, 0]]
>>> b[0][0]=4
>>> b 
[[4, 0], [0, 0]]

And that is the expected behaviour.

Thanks.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1409] new keyword-only function parameters interact badly with nested functions

2007-11-08 Thread Christian Heimes

Changes by Christian Heimes:


--
keywords: +py3k
priority:  -> normal
resolution:  -> accepted

__
Tracker <[EMAIL PROTECTED]>

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



[issue1410] BaseHTTPServer cannot accept Unicode data

2007-11-08 Thread J. Peterson

New submission from J. Peterson:

Within a do_GET hander for a BaseHTTPServer.BaseHTTPRequestHandler,
trying to write unicode data causes a UnicodeEncodeError exception.  It
should be possible to send Unicode data to the browser.

The enclosed Python file demonstrates the issue.

Added file: http://bugs.python.org/file8718/TestUnicodeHTTP.py

__
Tracker <[EMAIL PROTECTED]>

__

TestUnicodeHTTP.py
Description: Binary data
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1351] Add getsize() to io instances

2007-11-08 Thread Guido van Rossum

Guido van Rossum added the comment:

Sorry, I still don't like it.  You'll have to come up with a darned good
use case to justify this.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1410] BaseHTTPServer cannot accept Unicode data

2007-11-08 Thread J. Peterson

J. Peterson added the comment:

The diagnostic printed is:
  File "C:\Apps\Python25\lib\socket.py", line 255, in write
data = str(data) # XXX Should really reject non-string non-buffers

The comment indicates the developer was aware of the bug.  See also
similar bug in writelines(), near line 267.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1411] A typo in tutorial

2007-11-08 Thread Jeong-Min Lee

New submission from Jeong-Min Lee:

In the middle of "3.1.4 Lists", it reads as follow

-
>>> a
[]

The built-in function len() also applies to lists:

>>> len(a)
8
-

but it should be ..
-
>>> a
[]

The built-in function len() also applies to lists:

>>> len(a)
0
-


http://docs.python.org/tut/node5.html#SECTION00514

--
components: Documentation
messages: 57295
nosy: falsetru
severity: urgent
status: open
title: A typo in tutorial
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



[issue1409] new keyword-only function parameters interact badly with nested functions

2007-11-08 Thread Guido van Rossum

Guido van Rossum added the comment:

I think I agree this is a bug.
Who is setting all bugs to 'accepted'?

--
nosy: +gvanrossum
resolution: accepted -> 

__
Tracker <[EMAIL PROTECTED]>

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



[issue1402] Interpreter cleanup: order of _PyGILState_Fini and PyInterpreterState_Clear

2007-11-08 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I don't have a patch. I don't even know enough of the threading 
infrastructure to know if this really a bug or if it is a bug in my 
code.

I'll work on a patch this weekend, if changing the order of calls to 
PyGILState_Fini and PyInterpreterState_Clear doesn't break unittests and 
fixes the problem I ran into I'll post about this issue on python-dev.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1411] A typo in tutorial

2007-11-08 Thread Martin v. Löwis

Changes by Martin v. Löwis:


--
severity: urgent -> normal

__
Tracker <[EMAIL PROTECTED]>

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



[issue1727780] 64/32-bit issue when unpickling random.Random

2007-11-08 Thread Peter Maxwell

Peter Maxwell added the comment:

For the record, and to prevent dilution of the count of times this bug has 
been encountered: this issue is a duplicate of issue1472695, which was 
later marked "won't fix" for no apparent reason. sligocki's patch is more 
thorough than mine was and I hope it has a better fate too.

--
nosy: +pm67nz

_
Tracker <[EMAIL PROTECTED]>

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