[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2011-06-29 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Marking the PEP 380 implementation as a dependency, as I expect it to be easier 
to update this patch to cope with those changes than it would be the other way 
around.

--
dependencies: +PEP 380 reference implementation for 3.3

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



[issue12417] Inappropriate copyright on profile files

2011-06-29 Thread Barry A. Warsaw

Barry A. Warsaw ba...@python.org added the comment:

Thanks Benjamin!

--

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



[issue12352] multiprocessing.Value() hangs

2011-06-29 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

 Nice work! I also think heap_gc_deadlock_lockless.diff is good, except for 
 Victor's reservation: is it deliberate that you reversed the following two 
 statements in _free_pending_blocks(), compared to the code in free()?

 +            self._free(block)
 +            self._allocated_blocks.remove(block)


No, it's not deliberate (it shouldn't have any impact since they're
protected by the mutex though).
As for calling _free_pending_blocks() a second time, I'm not sure
that's necessary, I find the code simpler and cleaner that way.
I'll provide a new patch in a couple days (no access to my development
box right now).

--

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



[issue12303] expose sigwaitinfo() and sigtimedwait() in the signal module

2011-06-29 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

 Oh, the problem is that sigwait() behaviour changes after a fork: it is 
 interrupted if an unexpected signal is received, but the signal handler is 
 not called. It behaves correctly (the signal handler is called) without the 
 fork.


Reminds me of http://bugs.python.org/issue8407#msg138066

But I think we could just remove this test: honestly, I'm not sure
that checking the behavior in case of delivery of an unblocked signal
is really useful, especially since the behavior is not clearly
defined, see POSIX man page:

The sigwaitinfo() and sigtimedwait() functions may fail if:

[EINTR]
The wait was interrupted by an unblocked, caught signal. It will be
documented in system documentation whether this error will cause these
functions to fail.


may fail [...] It will be documented in system documentation

--

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



[issue12303] expose sigwaitinfo() and sigtimedwait() in the signal module

2011-06-29 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 00ca0c2c7bc0 by Victor Stinner in branch 'default':
Issue #12303: run sig*wait*() tests in a subprocesss
http://hg.python.org/cpython/rev/00ca0c2c7bc0

--

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



[issue12303] expose sigwaitinfo() and sigtimedwait() in the signal module

2011-06-29 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 But I think we could just remove this test

The test pass on Linux and FreeBSD 6 using a subprocess. I commited my patch to 
replace fork() by subprocess, let's see how it works on buildbots.

--

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



[issue12439] BaseHTTPServer's send_reponse adds extra \r\n when using HTTPMessage in input

2011-06-29 Thread Yoav Weiss

New submission from Yoav Weiss yoav.weiss...@gmail.com:

I'm using BaseHTTPServer's send_response (from within a class that inherits 
BaseHTTPRequestHandler) with the following:

self.send_response(response.code, response.headers)
self.end_headers()
self.wfile.write(content)
self.wfile.flush()
When response is a httplib's HTTPResponse object, and its headers inherits from 
rfc822.Message.

What I see is that message is printed as is, including all the headers trailing 
\r\n, after which the send_response method (BaseHTTPServer.py:381) adds 
another \r\n.
Then send_response adds the Server and Date headers.
Since the headers before Server  Date include \r\n\r\n, Date  server are 
considered by the browser as the content.

Am I misusing BaseHTTPServer? If not, this is a bug and \r\n should be 
removed from line 381, or added only after a check that shows they are not 
already there at the headers end, or in case there are no input headers.

--
components: Library (Lib)
messages: 139401
nosy: Yoav.Weiss
priority: normal
severity: normal
status: open
title: BaseHTTPServer's send_reponse adds extra \r\n when using HTTPMessage 
in input
type: behavior
versions: Python 2.6

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



[issue7117] Backport py3k float repr to trunk

2011-06-29 Thread Michael Foord

Michael Foord mich...@voidspace.org.uk added the comment:

Wondered if you guys had heard of some recent advances in the state of the art 
in this field. I'm sure you have, but thought I'd link it here anywhere.

Quote taken from this article (which links to relevant papers):

http://www.serpentine.com/blog/2011/06/29/here-be-dragons-advances-in-problems-you-didnt-even-know-you-had/

In 2010, Florian Loitsch published a wonderful paper in PLDI, Printing 
floating-point numbers quickly and accurately with integers, which represents 
the biggest step in this field in 20 years: he mostly figured out how to use 
machine integers to perform accurate rendering! Why do I say mostly? Because 
although Loitsch's Grisu3 algorithm is very fast, it gives up on about 0.5% 
of numbers, in which case you have to fall back to Dragon4 or a derivative.

If you're a language runtime author, the Grisu algorithms are a big deal: 
Grisu3 is about 5 times faster than the algorithm used by printf in GNU libc, 
for instance. A few language implementors have already taken note: Google hired 
Loitsch, and the Grisu family acts as the default rendering algorithms in both 
the V8 and Mozilla Javascript engines (replacing David Gay's 17-year-old dtoa 
code). Loitsch has kindly released implementations of his Grisu algorithms as a 
library named double-conversion.

--
nosy: +michael.foord

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



[issue12440] test_ssl.test_options() failure on Snow Leopard: can't clear options before OpenSSL 0.9.8m

2011-06-29 Thread STINNER Victor

New submission from STINNER Victor victor.stin...@haypocalc.com:

Seen on AMD64 Snow Leopard 2 3.x buildbot:

=
ERROR: test_options (test.test_ssl.ContextTests)
--
Traceback (most recent call last):
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/test/test_ssl.py, 
line 81, in f
return func(*args, **kwargs)
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/test/test_ssl.py, 
line 362, in test_options
ctx.options = (ctx.options  ~ssl.OP_NO_SSLv2) | ssl.OP_NO_TLSv1
ValueError: can't clear options before OpenSSL 0.9.8m

http://www.python.org/dev/buildbot/all/builders/AMD64%20Snow%20Leopard%202%203.x/builds/581/steps/test/logs/stdio

I think that the regression was introduced by one of the following build (build 
571 didn't run the test suite):

http://www.python.org/dev/buildbot/all/builders/AMD64%20Snow%20Leopard%202%203.x/builds/571
http://www.python.org/dev/buildbot/all/builders/AMD64%20Snow%20Leopard%202%203.x/builds/572

--
components: Library (Lib)
messages: 139403
nosy: haypo, pitrou
priority: normal
severity: normal
status: open
title: test_ssl.test_options() failure on Snow Leopard: can't clear options 
before OpenSSL 0.9.8m
versions: Python 3.3

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



[issue12440] test_ssl.test_options() failure on Snow Leopard: can't clear options before OpenSSL 0.9.8m

2011-06-29 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

The OpenSSL version linked against is OpenSSL 0.9.8r 8 Feb 2011, but 
apparently the source headers are still those for an earlier version, hence the 
apparent failure (the headers don't have the necessary API).
Bill, could you please upgrade the OpenSSL headers on that buildbot to match 
the runtime version (if that's possible)?

--
assignee:  - janssen
keywords: +buildbot
nosy: +janssen
type:  - behavior
versions: +Python 3.2

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



[issue12139] Add CCC command support to ftplib

2011-06-29 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
resolution:  - fixed
status: pending - open

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



[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-29 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 949e0c0f5a38 by Victor Stinner in branch '3.2':
Issue #12400: regrtest -W doesn't rerun the tests twice anymore, but captures
http://hg.python.org/cpython/rev/949e0c0f5a38

New changeset 0172d40fdcd4 by Victor Stinner in branch 'default':
(merge 3.2) Issue #12400: regrtest -W doesn't rerun the tests twice anymore,
http://hg.python.org/cpython/rev/0172d40fdcd4

--
nosy: +python-dev

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



[issue12441] _GLOBAL_DEFAULT_TIMEOUT remains as an object() in HTTPConnection and the connection hangs

2011-06-29 Thread Juanjo Alvarez

New submission from Juanjo Alvarez juan...@gmail.com:

I was testing a jsonrpc server using a small Python client. I noticed that 
sometimes when the RPC returned some long test, the response object returned by 
URLOpener.open(), in my case an HTTPResponse, would hang about 70% of the time 
when calling read() on a RPC method returning more text than usual (a string of 
about 4000 bytes).

Investigating it I noticed that on HTTPConnection.connect, the self.timeout 
value was object. I tried to hardcode some value on the method first line, 
changing the self.timeout for 5:

self.sock = socket.create_connection((self.host,self.port),self.timeout, 
self.source_address)

Then suddenly the call to the RPC works 100% of the time, and I don't mean that 
it timeouts, it just works and doesn't hangs. So the workaround that I'm using 
is to call socket.setdefaulttimeout in my client code.

I saw that the default value in HTTPConnection for self.timeout is 
socket._GLOBAL_DEFAULT_TIMEOUT which is initialized as an object() and 
remains that way on my HTTPConnection.connect call. My guess is that when the 
RPC call is not very fast, the system checks the socket timeout and then it 
hangs if the value is an object, so the longer the text returned by the RPC, 
the higher the chance that the read() hangs.

--
components: IO
messages: 139406
nosy: juanjux
priority: normal
severity: normal
status: open
title: _GLOBAL_DEFAULT_TIMEOUT remains as an object() in HTTPConnection and the 
connection hangs
type: behavior
versions: Python 2.7

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



[issue12441] _GLOBAL_DEFAULT_TIMEOUT remains as an object() in HTTPConnection and the connection hangs

2011-06-29 Thread Juanjo Alvarez

Juanjo Alvarez juan...@gmail.com added the comment:

PS: This only happens to my on Windows XP, works perfectly under Linux.

--

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



[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-29 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset af799df478c6 by Victor Stinner in branch 'default':
Issue #12400: oops, remove debug code...
http://hg.python.org/cpython/rev/af799df478c6

--

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



[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-29 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 69e102bfed2b by Victor Stinner in branch '3.2':
Issue #12400: remove unused variable
http://hg.python.org/cpython/rev/69e102bfed2b

New changeset 9d53612333c7 by Victor Stinner in branch 'default':
(merge 3.2) Issue #12400: remove unused import
http://hg.python.org/cpython/rev/9d53612333c7

--

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



[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-29 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

I will not backport the change in Python 2.7, because regrtest already captures 
stdout (but not in verbose mode), and it checks that the output is empty.

--

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



[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-29 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 80c7d63325f6 by Victor Stinner in branch 'default':
Issue #12400: fix test_faulthandler if regrtest captures sys.stderr
http://hg.python.org/cpython/rev/80c7d63325f6

--

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



[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-29 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 74c6afbb524a by Victor Stinner in branch '3.2':
Issue #12400: don't use sys.stderr in test_kqueue because it may be replaced by
http://hg.python.org/cpython/rev/74c6afbb524a

New changeset c0afc8d00c0a by Victor Stinner in branch 'default':
(merge 3.2) Issue #12400: don't use sys.stderr in test_kqueue because it may be
http://hg.python.org/cpython/rev/c0afc8d00c0a

--

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



[issue12438] IDLE problem displaying warning message

2011-06-29 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

The problem isn't with getpass, the problem is that getpass is generating a 
warning message on first call and idle isn't handling that correctly.  Your 
suggested fix is probably correct.

--
nosy: +r.david.murray, terry.reedy
stage:  - needs patch
title: getpass error on idle - IDLE problem displaying warning message
versions: +Python 3.3 -Python 3.1

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



[issue12439] BaseHTTPServer's send_reponse adds extra \r\n when using HTTPMessage in input

2011-06-29 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +orsenthil

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



[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-29 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 6c54c334ea7a by Victor Stinner in branch '3.2':
Issue #12400: runtest() reuses the same io.StringIO instance for all calls
http://hg.python.org/cpython/rev/6c54c334ea7a

New changeset 8897c755633b by Victor Stinner in branch 'default':
(merge 3.2) Issue #12400: runtest() reuses the same io.StringIO instance for
http://hg.python.org/cpython/rev/8897c755633b

--

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



[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-29 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 2d07b1b4466a by Victor Stinner in branch '3.2':
Issue #12400: regrtest, force verbose mode to True with option -W
http://hg.python.org/cpython/rev/2d07b1b4466a

New changeset 561974b760eb by Victor Stinner in branch 'default':
(merge 3.2) Issue #12400: regrtest, force verbose mode to True with option -W
http://hg.python.org/cpython/rev/561974b760eb

--

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



[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-29 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset d8ba59de860a by Victor Stinner in branch '3.2':
Issue #12400: test.support.run_doctest() doesn't change sys.stdout anymore
http://hg.python.org/cpython/rev/d8ba59de860a

New changeset bb7c9308c846 by Victor Stinner in branch 'default':
Issue #12400: test.support.run_doctest() doesn't change sys.stdout anymore
http://hg.python.org/cpython/rev/bb7c9308c846

--

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



[issue2193] Cookie Colon Name Bug

2011-06-29 Thread Luke Plant

Luke Plant l.plant...@cantab.net added the comment:

First, I agree with others who say that RFCs are basically irrelevant for 
cookies. For Django we've discovered this in various ways e.g. issue 9824 - 
http://bugs.python.org/issue9824 - which has now been applied. We have also had 
to work around the stdlib behaviour here.

Second, I have implemented a patch for this, with tests, against trunk - please 
review.

After looking at the implementation, this seems like the best way to make 
Python conservative in what is produces and liberal in what it accepts, which 
seems to be what the thread converged on. BaseCookie will now silently discard 
cookie 'morsels' with a colon in their name (and all other irregularities) when 
loading from a string, rather than raise an exception.

This allows cookie parsing to continue, so that other cookies in the HTTP 
header will be found.

However, if in Python code you attempt to directly set a morsel with an illegal 
name, you will still get the error.

There is a more lax strategy: Simply add ':' to the _LegalChars variable.

This would allow morsels to be *read* that have a colon in their name. However, 
from the current implementation, it would be very hard to add that ability 
without also allowing the BaseCookie class to produce such cookies. This would 
also raise other issues about at what point an error should be raised for 
setting invalid cookies etc.

Also, allowing these illegal cookies to be read is a corner case that is much 
less important - it isn't needed either for Trac or for our needs in Django.

For these reasons, I decided against the more lax strategy.

--
keywords: +patch
nosy: +spookylukey
Added file: http://bugs.python.org/file22513/issue2193_patch_trunk.diff

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



[issue2193] Cookie Colon Name Bug

2011-06-29 Thread Luke Plant

Luke Plant l.plant...@cantab.net added the comment:

Same patch backported to python 2.7 branch

--
Added file: http://bugs.python.org/file22514/issue2193_patch_python27.diff

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



[issue12406] msi.py needs updating for Python 3.3

2011-06-29 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Packaging has two wininst*.exe files that distutils has not.  If the code 
already uses a glob, it should be fine; if it uses a fixed list, then we have 
to add an if block.

--

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



[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-29 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Hmm.  I thought Antoine got rid of the output checking when he added -j 
support.  Well, he was the one who did it, anyway, so there may be a change set 
you could backport to get rid of the output checking if you want to backport 
this to 2.7.

--

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



[issue2193] Cookie Colon Name Bug

2011-06-29 Thread Luke Plant

Luke Plant l.plant...@cantab.net added the comment:

Found a bug with patch - this supersedes old one.

--
Added file: http://bugs.python.org/file22515/issue2193_patch_2_trunk.diff

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



[issue2193] Cookie Colon Name Bug

2011-06-29 Thread Luke Plant

Luke Plant l.plant...@cantab.net added the comment:

Same against Python 2.7

--
Added file: http://bugs.python.org/file22516/issue2193_patch_2_python27.diff

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



[issue2193] Cookie Colon Name Bug

2011-06-29 Thread Luke Plant

Changes by Luke Plant l.plant...@cantab.net:


Removed file: http://bugs.python.org/file22513/issue2193_patch_trunk.diff

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



[issue2193] Cookie Colon Name Bug

2011-06-29 Thread Luke Plant

Changes by Luke Plant l.plant...@cantab.net:


Removed file: http://bugs.python.org/file22514/issue2193_patch_python27.diff

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



[issue12431] urllib2.Request.get_full_url() broken in newer versions of Python

2011-06-29 Thread Senthil Kumaran

Senthil Kumaran sent...@uthcode.com added the comment:

As Santosa said, this was discovered and fixed in 2.7 itself, surprised that 
you discovered it in any release Jon. If it was from a checkout, please update.

--
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

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



[issue2193] Cookie Colon Name Bug

2011-06-29 Thread karl

karl karl+pythonb...@la-grange.net added the comment:

@Luke

did you have the opportunity to look at 
http://greenbytes.de/tech/webdav/rfc6265.html 

If there is something which doesn't match reality in that document that would 
be cool to have feedback about it.

--

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



[issue10403] Use member consistently

2011-06-29 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

I’m not -1 on using “attributes” to denote methods, since they *are* and it’s 
not difficult to understand, and I’m not opposed either to using “attributes” 
to replace “members” (i.e. attributes that are not methods.)

For those wanting to see the raging debate: 
http://mail.python.org/pipermail/python-dev/2011-June/112020.html

:)

--

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



[issue11363] Curses - add missing functions to doc

2011-06-29 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

A typo slipped into the 3.2 commit: x``'\033[6;4H'``

In addition, I tried the example in my shell and got a bytes/str error; that’s 
probably another report.

--
nosy: +eric.araujo
status: closed - open

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



[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-29 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset fdb98a7ef9be by Victor Stinner in branch '3.2':
Issue #12400: Add missing import (os) to test_kqueue
http://hg.python.org/cpython/rev/fdb98a7ef9be

New changeset 37877d19c2c9 by Victor Stinner in branch 'default':
(merge 3.2) Issue #12400: Add missing import (os) to test_kqueue
http://hg.python.org/cpython/rev/37877d19c2c9

--

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



[issue7117] Backport py3k float repr to trunk

2011-06-29 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Hadn't seen that.  Interesting!

--

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



[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-29 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 7bd23115b6c4 by Victor Stinner in branch '3.2':
Issue #12400: runtest() truncates the StringIO stream before a new test
http://hg.python.org/cpython/rev/7bd23115b6c4

New changeset fc831c49216d by Victor Stinner in branch 'default':
(merge 3.2) Issue #12400: runtest() truncates the StringIO stream before a new
http://hg.python.org/cpython/rev/fc831c49216d

--

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



[issue2193] Cookie Colon Name Bug

2011-06-29 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Thanks for taking a crack at this.  IMO the thing that needs to be fixed here 
is that receiving an invalid cookie makes it difficult to receive the valid 
cookies.  I'd love to accept your patch, but silently ignore sounds like a 
bad idea and is something we try to avoid in Python where practical.  In the 
email package we have a mechanism for reporting RFC violations (the defects 
attribute).  And we make as much sense of the input as we can, even if it is 
invalid, and preserve it.  We even allow generation of some RFC-invalid stuff, 
though we have plans to make applications work harder to do that in the future.

So I think your harder fix (accept the RFC-invalid cookies as long as there is 
some sensible way to parse them, but reject creating them) is the right 
approach.  I could also see the possibility of accepting a feature request for 
adding the ability to explicitly create RFC-invalid cookies, if someone can 
demonstrate a use case for doing so.  Other possible follow-on feature requests 
would be a 'defects' facility and/or a way to explicitly request that 
non-compliant cookies be ignored.

Note that in suggesting we reject creating RFC-invalid cookies by default I am 
not expressing an opinion on the relevance of the RFCs to cookie processing in 
the wild.  Given that there is a standard and we are talking about what to do 
on generation, the obvious answer (by Postel's law) is that we ought to 
generate standards-compliant cookies.

Also note that I have not looked at the referenced rfc (here is what I believe 
is the official link: http://tools.ietf.org/html/rfc6265).

--

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



[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-29 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

One more time, commit messages using the present tense are ambiguous: when you 
write “runtest() truncates the StringIO stream before a new test“, it’s not 
clear at all whether you describe the previous, incorrect behavior or the new, 
fixed one.  These phrasings are better:

“X used to do Y” (old behavior)
“X now does Z” (new)
“make X do Z” (new)

--
nosy: +eric.araujo

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



[issue2193] Cookie Colon Name Bug

2011-06-29 Thread Luke Plant

Luke Plant l.plant...@cantab.net added the comment:

I had a quick look, and there are these relevant bits:

 There are two audiences for this specification: developers of 
cookie-generating servers and developers of cookie-consuming user agents. 

And:

 To maximize interoperability with user agents, servers should limit 
themselves to the well-behaved profile defined in Section 4 when generating 
cookies. 

So, the document doesn't tell servers how to parse cookies, only how to 
generate them.

With regards to generation, there is basically no change - we still disallow 
programmers to set cookie names that are not a 'token', as defined by section 4 
of that document, which is the same as RFC 2109 in terms of valid cookie names 
if you look at it. It is not obvious to me that Python's BaseCookie 
implementation obeys RFC 2109 (due to the way character lists are defined in 
the opposite way), but if you believe the comments in the module then it does.

I haven't read the rest of RFC 6265 and checked BaseCookie against it - that 
would be a much bigger job. But with respect to the change in my patch, it 
looks like we are all OK.

--

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



[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-29 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 One more time, commit messages using the present tense are ambiguous:
 when you write “runtest() truncates the StringIO stream before a new
 test“, it’s not clear at all whether you describe the previous,
 incorrect behavior or the new, fixed one.

You can guess by reading the patch.

--

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



[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-29 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

It’s irrelevant, please provide unambiguous commit message.  This was discussed 
two or three times already.

--

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



[issue12425] gettext breaks on empty plural-forms value

2011-06-29 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

IIUC, this comes up with invalid po files, so this report is about graceful 
error handling, not strictly a bug.

If https://bugzilla.redhat.com/attachment.cgi?id=489427 was applied, gettext 
would not fail anymore, but the invalid line would not be reported IIUC.  I 
think we should print an error message, to let libs/apps find the mistake.

--
keywords: +needs review, patch
nosy: +eric.araujo, lemburg, loewis
stage:  - patch review
type:  - behavior
versions: +Python 3.3 -Python 3.1

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



[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-29 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset bc2f3fbda7e3 by Victor Stinner in branch '3.2':
Issue #12400: test_zipimport_support doesn't restore original sys.stdout
http://hg.python.org/cpython/rev/bc2f3fbda7e3

New changeset ff5abf93db80 by Victor Stinner in branch 'default':
(merge 3.2) Issue #12400: test_zipimport_support doesn't restore original
http://hg.python.org/cpython/rev/ff5abf93db80

--

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



[issue12406] msi.py needs updating for Python 3.3

2011-06-29 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

 Packaging has two wininst*.exe files that distutils has  not.  If the code 
already uses a glob, it should be fine; if it uses a  fixed list, then we have 
to add an if  block.

Yes, it's using glob :-)

--

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



[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-29 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Eric is right. I don't see the patch when reading hg log output, or looking 
up revisions given by hg annotate.

--

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



[issue12442] shutil.disk_usage()

2011-06-29 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola' g.rod...@gmail.com:

Patch in attachment adds a new disk_usage() function to shutil module which 
retrieves total, used and free disk space given a certain path plus the 
percentage usage.

See original discussion on python-ideas ml:
http://mail.python.org/pipermail/python-ideas/2011-June/010480.htm

--
assignee: giampaolo.rodola
components: Library (Lib)
files: diskusage.patch
keywords: needs review, patch
messages: 139439
nosy: giampaolo.rodola, pitrou, rhettinger
priority: normal
severity: normal
stage: patch review
status: open
title: shutil.disk_usage()
type: feature request
versions: Python 3.3
Added file: http://bugs.python.org/file22517/diskusage.patch

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



[issue12442] shutil.disk_usage()

2011-06-29 Thread Brian Curtin

Changes by Brian Curtin br...@python.org:


--
nosy: +brian.curtin

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



[issue12442] shutil.disk_usage()

2011-06-29 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Typo. It's:
http://mail.python.org/pipermail/python-ideas/2011-June/010480.html

--

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



[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-29 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 Eric is right. I don't see the patch when reading hg log output

I'm using hg log -p.

 or looking up revisions given by hg annotate.

hg annotate doesn't display the changelog, only the commit number or
hash, which option do you use?

--

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



[issue12442] shutil.disk_usage()

2011-06-29 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

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



[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-29 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 450209efe272 by Victor Stinner in branch '3.2':
Issue #12400: regrtest.runtest() uses stream.seek(0) before .truncate()
http://hg.python.org/cpython/rev/450209efe272

New changeset 3ce22f1b9540 by Victor Stinner in branch 'default':
(merge 3.2) Issue #12400: regrtest.runtest() uses stream.seek(0) before 
.truncate()
http://hg.python.org/cpython/rev/3ce22f1b9540

--

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



[issue11363] Curses - add missing functions to doc

2011-06-29 Thread Sandro Tosi

Sandro Tosi sandro.t...@gmail.com added the comment:

I think the same typo is also on default (since merged from 3.2): Ezio, do you 
want me to upload a patch or you'll fix it?

Éric: I can see the tparm() example is failing, since tgetstr() is returning 
bytes while it expects a string: did you already file about about it? want me 
to?

--

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



[issue7117] Backport py3k float repr to trunk

2011-06-29 Thread Raymond Hettinger

Raymond Hettinger raymond.hettin...@gmail.com added the comment:

Thanks for the link :-)

--

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



[issue12443] locale.setlocale(locale.LC_ALL, locale.getlocale()) fails for some locales

2011-06-29 Thread Jean-Paul Calderone

New submission from Jean-Paul Calderone invalid@example.invalid:

Consider this transcript from OS X 10.6:

 import locale
 locale.getlocale()
(None, None)
 locale.setlocale(locale.LC_ALL, _)
'C'
 locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
'en_US.UTF-8'
 locale.getlocale()
('en_US', 'UTF8')
 locale.setlocale(locale.LC_ALL, _)
Traceback (most recent call last):
  File stdin, line 1, in module
  File 
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/locale.py,
 line 494, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
 

OS X does not recognize 'en_US.UTF8', only 'en_US.UTF-8'.  However, when passed 
a tuple, the locale module tries to normalize the values.  It ends up turning 
the result of getlocale from ('en_US', 'UTF-8') into 'en_US.UTF8'.

--
assignee: ronaldoussoren
components: Extension Modules, Library (Lib), Macintosh
messages: 139445
nosy: exarkun, ronaldoussoren
priority: normal
severity: normal
status: open
title: locale.setlocale(locale.LC_ALL, locale.getlocale()) fails for some 
locales
type: behavior
versions: Python 2.6, Python 2.7

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



[issue12443] locale.setlocale(locale.LC_ALL, locale.getlocale()) fails for some locales

2011-06-29 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Good news: it's a duplicate and it's already fixed! See issues #10090 and 
#10154. The fix is part of Python 3.1.4 (released the 12th june 2011) and 
Python 2.7.2 (released the 12 june 2011), and will be part of Python 3.2.1.

--
nosy: +haypo
resolution:  - duplicate
status: open - closed

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



[issue12443] locale.setlocale(locale.LC_ALL, locale.getlocale()) fails for some locales

2011-06-29 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

(Python 2.6 only accepts security fixes, no more bug fixes. It's time to 
upgrade to 2.7!)

--

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



[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-29 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

 Eric is right. I don't see the patch when reading hg log output

... or when looking at the issue tracker.  Yes, one can probably figure out the 
intent by looking at the whole patch but it's kind of rude to force people to 
do that.  That's what the commit message is there for: to give a brief, 
unambiguous summary of what the change is about.

--
nosy: +ned.deily

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



[issue12444] accept sets or collections for str.strip/lstrip/rstrip

2011-06-29 Thread Peter Eisentraut

New submission from Peter Eisentraut pete...@gmx.net:

It appears to be a pretty common mistake to think that the argument of 
str.strip/lstrip/rstrip is a substring rather than a set of characters.  To 
allow a more clearer notation, it would be nice if these functions also 
accepted an argument other than a string, for example a set or any collection.  
Then you could write, for example:

a.strip({'a', 'b', 'c'})

I suggest to either add support for sets specifically, or more generally 
anything that supports the in operator.

I can try to code it up if it sounds acceptable.

--
components: Library (Lib)
messages: 139449
nosy: petere
priority: normal
severity: normal
status: open
title: accept sets or collections for str.strip/lstrip/rstrip
type: feature request

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



[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2011-06-29 Thread John O'Connor

Changes by John O'Connor tehj...@gmail.com:


--
nosy: +jcon

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



[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-29 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset c7bed90e4f31 by Victor Stinner in branch 'default':
Issue #12400: test_faulthandler now uses sys.__stderr__
http://hg.python.org/cpython/rev/c7bed90e4f31

--

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



[issue12444] accept sets or collections for str.strip/lstrip/rstrip

2011-06-29 Thread Raymond Hettinger

Raymond Hettinger raymond.hettin...@gmail.com added the comment:

-1 on complicating the API.  The purported problem isn't pervasive enough to 
warrant a change (I frequently teach python classes and do code reviews and 
rarely encounter this issue).  Also, the proposed change isn't going to help 
the people who are setting out to remove a .html suffix and are presuming 
that rstrip is the way to do it.  Those folks have already made an unfounded 
assumption this proposal does nothing to invalidate their experiment.  AFAICT, 
this proposal would only benefit someone who already knows that strip 
characters are accepted in all combinations (as clearly documented).

--
nosy: +rhettinger

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



[issue2193] Cookie Colon Name Bug

2011-06-29 Thread Luke Plant

Luke Plant l.plant...@cantab.net added the comment:

@ David Murray:

Thanks for taking the time to look at this - can I trouble you to keep going 
and read my response?

Thanks. 

You wrote:

 IMO the thing that needs to be fixed here is that receiving an invalid cookie 
 makes it difficult to receive the valid cookies.

I agree absolutely, and my patch implements exactly that aim. So I don't 
understand why the rest of your reply goes on to assume a very different goal - 
handling RFC-invalid cookies such that we can read their values. 

 I'd love to accept your patch, but silently ignore sounds like a bad 
 idea and is something we try to avoid in Python where practical.

silently ignore is what the current BaseCookie implementation does for 
**every other** type of invalid input, with the only exception (I can find) 
being the case where everything is correct apart from the name:

 from Cookie import SimpleCookie
 c = SimpleCookie()
 c.load('rubbish')
 c
SimpleCookie: 
 c.output()
''
 c.load('more:rubbish')
 c
SimpleCookie: 
 c.load('name=value')
 c
SimpleCookie: name='value'
 c.load('name=value; invalidattribute;')
 c.output()
'Set-Cookie: name=value'
 c.load('xyz123sfs;;=-abc')
 c
SimpleCookie: name='value'
 c.load('namewith:colon=value')
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/lib/python2.7/Cookie.py, line 632, in load
self.__ParseString(rawdata)
  File /usr/lib/python2.7/Cookie.py, line 665, in __ParseString
self.__set(K, rval, cval)
  File /usr/lib/python2.7/Cookie.py, line 585, in __set
M.set(key, real_value, coded_value)
  File /usr/lib/python2.7/Cookie.py, line 460, in set
raise CookieError(Illegal key value: %s % key)
Cookie.CookieError: Illegal key value: namewith:colon

As you said, I think this ticket is about fixing that last one, which is the 
gross exception to the rule, and the only thing that is causing major problems 
for people.

I agree that handling cookies with invalid names so that we can read them would 
be nice, but I think it is **very** difficult to find a rationale for saying 
that this bug fix should have to wait for that change.

In addition, I do not think there is any sensible way to implement that 
suggestion given the API of BaseCookie at the moment - it's not just the 
implementation I baulked at, it is the API of BaseCookie that works against you 
every step of the way.

The API of BaseCookie works like this in the typical case:

Consuming:

input - load()- store in BaseCookie - __getitem__()

Generating:

input - __setitem__() - store in BaseCookie - output()

(Of course you don't have to do it that way, but looking at the docs and 
examples, http://docs.python.org/library/cookie.html, it's very clear that it's 
meant to be used that way).

The fact that both modes involves storing in BaseCookie really messes up any 
attempt to make these two work differently, and means you would have a really 
surprising and strange API whichever way you do it.

So, option (1): you could allow BaseCookie to store invalid cookie names if 
they come via load, but not via __setitem__(). This means that you've got an 
easy work-around for BaseCookie refusing to store your value - just use 
'load()' instead. It also means that simple code like this fails:

 c['name:val'] = c['name:val']

which can be a problem if you are trying to do some generalised processing of 
the contents of a BaseCookie.

This leads us to option (2): allow RFC-invalid cookies to be stored, but then 
quietly sanitise (i.e. discard) in output().

But this becomes a much worse example of silently ignoring - the former is 
tolerant handling of data that is outside the programmers control - Postel's 
law. But this would be accepting incorrect data from a programmer, and then 
silently discarding it, is what we should do our utmost to avoid.

Neither of these options is any good, and it is because the API of BaseCookie 
was just not designed for it. The only sensible things to do, given our API, is 
sanitise on input. We could have an 'RFC-invalid' mode, but it would have to be 
turned on for the whole Cookie instance, and it would be a feature addition. An 
alternative implementation would be a 'badmorsels' attribute which preserves 
the rubbish where possible, in case you want it - but again, it's a feature 
addition.

Finally, I think the behaviour you are aiming at is unreasonable to ask for, 
especially in this ticket. You are essentially asking for a tolerant kind of 
cookie parsing which does its best to do 'do-what-I-mean'. But:

1) You haven't specified further than that (and there are no RFCs of use)
2) in general that kind of thing is notoriously hard to get right
3) the job is never finished - there are always more cases of invalid cookies 
that you *could* handle
4) and in fact it is impossible to provide an implementation that pleases 
everyone - there will always be invalid cookies that were 'meant' to be one 
thing, but the implementation 

[issue12400] regrtest: always run tests in verbose mode, but hide the output on success

2011-06-29 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 6edb7c153105 by Victor Stinner in branch 'default':
Issue #12400: test_cprofile now restores correctly the previous sys.stderr
http://hg.python.org/cpython/rev/6edb7c153105

--

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



[issue12444] accept sets or collections for str.strip/lstrip/rstrip

2011-06-29 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

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



[issue7846] Fnmatch cache is never cleared during usage

2011-06-29 Thread Tom Rini

Tom Rini tom.r...@gmail.com added the comment:

Did a change later make this user-configurable?  I've got some code here that 
now runs so slow as to be unusable because nothing is ever cached anymore.  
Thanks!

--
nosy: +Tom.Rini

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



[issue9516] sysconfig: $MACOSX_DEPLOYMENT_TARGET mismatch: now 10.3 but 10.5 during configure

2011-06-29 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
status: pending - closed

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



[issue12445] dict view values objects are missing tp_richcmp and tp_as_number

2011-06-29 Thread Julian

New submission from Julian julian+python@grayvines.com:

dict view values() objects are missing tp_richcmp and tp_as_sequence, and the 
tests for those were incomplete, which means that on 2.7 and 3.2 (and on 
current head) viewvalues / values objects don't compare correctly. Without 
indication, I assume this is not the desired behavior.

Looks like the cause is that the dictview_richcompare function was written to 
expect a set-like object, and nothing was written for values. I've modified it 
to accept any view object and do the appropriate check.

One thing I'm unsure of, which I'm sure one of you will help with, is what the 
desired behavior is on what values() view objects actually *should* be equal 
to. Being that there isn't a multiset object, and that I couldn't find any 
resource, I assumed that they only should be equal to other values() objects, 
not any of the other (ordered) containers. If that's incorrect, or if I need to 
discuss that on the mailing list, please let me know.

A patch to fix both is attached with the correction to the unit test, hope I 
did this correctly. I assume this needs to be backported to 2.7, but I figured 
I'd ask about that first. (Test suite runs without errors on current 3.3 head 
with this patch for me).

dictview_richcompare also needs unit tests for the NotImplemented error that it 
should return, but I didn't want to convolute this patch, please let me know if 
I should put that in here, or file another ticket, or neither.

Thanks!

--
components: Interpreter Core
files: viewvalues_compare.patch
keywords: patch
messages: 139455
nosy: Julian
priority: normal
severity: normal
status: open
title: dict view values objects are missing tp_richcmp and tp_as_number
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file22518/viewvalues_compare.patch

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



[issue12445] dict view values objects are missing tp_richcmp and tp_as_number

2011-06-29 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti, rhettinger
stage:  - patch review

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



[issue12172] IDLE crashes when I use F5 to run

2011-06-29 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

I forgot that there was another issue with F5 using IDLE on OS X when linked to 
Cocoa Tcl/Tk 8.5, including ActiveState 8.5; see Issue11088.  The fix for it 
was released in Python 2.7.2 and will be in the forthcoming Python 3.2.1 (as of 
rc2).

--

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



[issue12446] StreamReader Readlines

2011-06-29 Thread Thomas Barnet-Lamb

New submission from Thomas Barnet-Lamb tbarnetl...@gmail.com:

It appears that StreamReader's readlines method behaves in a strange manner if 
the StreamReader has, in a previous read operation, decoded more characters 
than the user asked for; this happens when both the chars and size parameters 
are used, but only in some circumstances.

See the following:

Python 2.7.2 (default, Jun 26 2011, 02:56:25) 
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type help, copyright, credits or license for more information.
 import codecs
 
 ## First make a file
... with codecs.open('temp.tmp','wb', encoding='utf8') as f:
... f.write(u'This\u00ab is a test line\nThis is another test line\n')
... 
 
 ## Now open it for reading 
... UTF8Reader = codecs.getreader('utf-8')
 with UTF8Reader(codecs.open('temp.tmp','rb')) as f:
... print(repr(f.read(size=5, chars=5)))
... print(f.readlines())
... 
u'This\xab'
[u' is ']
# The expected output is 
# u'This\xab'
# [u' is a test line\n', u'This is another test line\n']


I believe the culprit is codecs.py, line 466-467 (the two starred lines below). 
I think they ought to be replaced with 'pass'.


if chars  0:
if size  0:
*   if self.charbuffer:
*   break  
elif len(self.charbuffer) = size:
break

Best wishes,
Thomas

PS - I will apologize in advance for any oversights or mistakes in the 
formatting etc. of this bug report---this is my first time!

--
components: Unicode
messages: 139457
nosy: Thomas.Barnet-Lamb
priority: normal
severity: normal
status: open
title: StreamReader Readlines
versions: Python 2.7

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



[issue12446] StreamReader Readlines

2011-06-29 Thread Thomas Barnet-Lamb

Changes by Thomas Barnet-Lamb tbarnetl...@gmail.com:


--
type:  - behavior

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



[issue12446] StreamReader Readlines behavior odd

2011-06-29 Thread Thomas Barnet-Lamb

Changes by Thomas Barnet-Lamb tbarnetl...@gmail.com:


--
title: StreamReader Readlines - StreamReader Readlines behavior odd

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



[issue12446] StreamReader Readlines behavior odd

2011-06-29 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc amaur...@gmail.com:


--
nosy: +haypo, lemburg

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



[issue12447] ~True is not False

2011-06-29 Thread Matt Joiner

New submission from Matt Joiner anacro...@gmail.com:

Given there is no ! operator in Python, I next tried ~ (despite that I'm after 
a logical not). This came as a surprise:

 bool(~True)
True
 bool(~False)
True
 bool(~~False)
False
 ~True, ~~True, ~False, ~~False
(-2, 1, -1, 0)

Is there any consideration to fixing this? Is int(True) 1 due to C? Why is it 
preferred over -1?

It seems more appropriate to me that True have:

def __invert__(self): return False
def __int__(self): return 1 # or even -1

This also fixes this case too:

 -True
-1

--
components: Interpreter Core
messages: 139458
nosy: anacrolix
priority: normal
severity: normal
status: open
title: ~True is not False
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

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



[issue12447] ~True is not False

2011-06-29 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

Did you try the not operator?
http://docs.python.org/reference/expressions.html#boolean-operations

 not True
False
 not False
True

--
nosy: +amaury.forgeotdarc
resolution:  - invalid
status: open - pending

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