[issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline

2013-03-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c31d700dea8b by Senthil Kumaran in branch '2.7':
Fix Issue #12921: BaseHTTPServer's send_error should send the correct error
http://hg.python.org/cpython/rev/c31d700dea8b

New changeset 5126e62c60af by Senthil Kumaran in branch '3.2':
Fix Issue #12921: BaseHTTPServer's send_error should send the correct error
http://hg.python.org/cpython/rev/5126e62c60af

New changeset 5d76a4746d9d by Senthil Kumaran in branch '3.3':
Fix Issue #12921: BaseHTTPServer's send_error should send the correct error
http://hg.python.org/cpython/rev/5d76a4746d9d

New changeset b87792757ee8 by Senthil Kumaran in branch 'default':
Fix Issue #12921: BaseHTTPServer's send_error should send the correct error
http://hg.python.org/cpython/rev/b87792757ee8

--
nosy: +python-dev

___
Python tracker 

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



[issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline

2013-03-05 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Karl - thanks for your telnet debugging session output. Helped realized the 
problem better. So I had been thinking that sending message is okay. But had 
not realized that same variable name was used and was causing problem.

I have gone ahead with the fix for now. And for the tests, I think, will be 
written very similar to test_header_buffering_of_send_error of 
test_header_bufferring_of_send_error - when send_error is sent and then error 
asserted.

(Usually, I try to change test and patch together and that's our protocol too. 
In this case, I only tested it manually, thinking that there is not test 
coverage for this portion (yet). But later when I peeked into tests, I saw that 
it would be written for this scenario). Will include and then close this 
report. The other suggestion of Paul can be included in another report and so 
the change of the error status to proper 501 Not Implemented.

Thanks.

--
versions: +Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue17354] TypeError when running setup.py upload --show-response

2013-03-05 Thread Dmitry Shachnev

New submission from Dmitry Shachnev:

When running `python3 setup.py sdist upload --show-response`, one may get this 
exception:

Traceback (most recent call last):
  File "setup.py", line 47, in 
requires=['dbus']
  File "/usr/lib/python3.2/distutils/core.py", line 148, in setup
dist.run_commands()
  File "/usr/lib/python3.2/distutils/dist.py", line 917, in run_commands
self.run_command(cmd)
  File "/usr/lib/python3.2/distutils/dist.py", line 936, in run_command
cmd_obj.run()
  File "/usr/lib/python3.2/distutils/command/upload.py", line 66, in run
self.upload_file(command, pyversion, filename)
  File "/usr/lib/python3.2/distutils/command/upload.py", line 201, in 
upload_file
msg = '\n'.join(('-' * 75, r.read(), '-' * 75))
TypeError: sequence item 1: expected str instance, bytes found

This happens because r is binary stream, so r.read() returns bytes. A trivial 
patch that fixes the problem is attached.

--
components: Library (Lib)
files: distutils-decode-server-response.patch
keywords: patch
messages: 183517
nosy: mitya57
priority: normal
severity: normal
status: open
title: TypeError when running setup.py upload --show-response
versions: Python 3.3
Added file: 
http://bugs.python.org/file29312/distutils-decode-server-response.patch

___
Python tracker 

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



[issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline

2013-03-05 Thread Senthil Kumaran

Senthil Kumaran added the comment:

There is a test failure. which leads me to believe that "Error message" may 
probably be relied upon by some applications.
 

FAIL: test_header_length (test.test_httpservers.BaseHTTPRequestHandlerTestCase)
--
Traceback (most recent call last):
  File 
"/export/home/buildbot/64bits/3.2.cea-indiana-amd64/build/Lib/test/test_httpservers.py",
 line 605, in test_header_length
self.assertEqual(result[0], b'HTTP/1.1 400 Line too long\r\n')
AssertionError: b'HTTP/1.1 400 Bad Request\r\n' != b'HTTP/1.1 400 Line too 
long\r\n'



I think, I am going revert the change I made first.

Because, looking at documentation and usage, leads me to believe that we are 
bit assuming much from a misleading example.

send_error(code, message) - message here is optional, but when sent, the server 
is responsible for displaying it. 

It is *never* advertised that the traceback can be sent as a message.

However, I do think there a chance for improvement and that is the reason, I 
went ahead with the change.

The improvement can be send_error - response header could be the uniform 
shortmsg and response body can be the message that is sent by send_error(code, 
message).  Now, this will be improvement and it should be discussed in that 
aspect rather than as a fix for anything.

Going ahead with the revert. Sorry for the mistake.

--

___
Python tracker 

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



[issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline

2013-03-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4e6c46d5f77d by Senthil Kumaran in branch '2.7':
Reverting the changeset c31d700dea8b made for Issue #12921
http://hg.python.org/cpython/rev/4e6c46d5f77d

New changeset 637d7c953b10 by Senthil Kumaran in branch '3.2':
Reverting the changeset 5126e62c60af made for Issue #12921
http://hg.python.org/cpython/rev/637d7c953b10

New changeset 84e7a7f6ddb8 by Senthil Kumaran in branch '3.3':
Reverting the changeset 5d76a4746d9d made for Issue #12921
http://hg.python.org/cpython/rev/84e7a7f6ddb8

New changeset b0890674bc21 by Senthil Kumaran in branch 'default':
Reverting the changeset b87792757ee8  made for Issue #12921
http://hg.python.org/cpython/rev/b0890674bc21

--

___
Python tracker 

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



[issue6419] Broken test_kqueue.py on OpenBSD

2013-03-05 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy:  -mark.dickinson

___
Python tracker 

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



[issue15465] Improved documentation for C API version info

2013-03-05 Thread Kushal Das

Changes by Kushal Das :


Added file: http://bugs.python.org/file29313/issue15465v4.patch

___
Python tracker 

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



[issue15465] Improved documentation for C API version info

2013-03-05 Thread Kushal Das

Kushal Das added the comment:

version 4 of the patch contains a new column in table as Bytes as suggested by 
Ezio Melotti

--

___
Python tracker 

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



[issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline

2013-03-05 Thread karl

karl added the comment:

The culprit is here 
http://hg.python.org/cpython/file/3.3/Lib/http/server.py#l320

That an application or a person decides to send another message is ok. Designer 
choice. That the library is sending something optional as a test seems more 
uncomfortable.

The list of codes for 4xx is declared at 
http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-22#section-6.5

In HTTP, only the code is mandatory, the text is optional. But indeed you 
reveal a loophole, which means that someone might want to send a message for 
the body. That said, I still do not think it should lend in the header for 
reasons explained previously (serious breakage).

I will come up with something which is fixing the issue without breaking the 
existent. 

That said, do I open another bug for the test? The test should be fixed too. It 
should test 400 only. and not the full status-line.

The previous test is also an issue, testing 414. Because the prose in the spec 
is "URI Too Long" and not "HTTP/1.1 414 Request-URI Too Long"
http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-22#section-6.5.12

Hmmm… I see all tests are like this. It should be fixed. Opening bug? Thought?

--

___
Python tracker 

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



[issue17355] http tests testing more than the error code are fragile

2013-03-05 Thread karl

New submission from karl:

Some of the tests of the HTTP Test suite are checking for the full status-line, 
instead of just the error code.


Why is it an issue?

1. The only mandatory part in the status-line is the error code. The phrase is 
optional. For example the response is made of 3 parts.

   HTTP/1.1 400 Bad Request
   ('HTTP/1.1', '400', 'Bad Request')

Only 400 is the mandatory part of the error code and is testing the error.

2. It creates dependencies on how we conceive, modify the construction of the 
status-line and error messages.

3. Some tests are testing messages with different "optional texts".

http://hg.python.org/cpython/file/3.3/Lib/test/test_httpservers.py#l640
Test for "HTTP/1.1 400 Line Too Long\r\n".
Instead of just testing "400". (A specific message could be put in the body, 
but that's informational)

http://hg.python.org/cpython/file/3.3/Lib/test/test_httpservers.py#l633
Test for "HTTP/1.1 414 Request-URI Too Long\r\n"
instead of just testing "414", btw the spec says for the optional message "URI 
Too Long"
http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-22#section-6.5.12

Testing the message, IMHO, should be only, for testing the construction of the 
message. The tests here are made for testing the right error code, but they try 
to do more.

Hope it helps :)

Threading: related to http://bugs.python.org/issue12921#msg183520

--
messages: 183521
nosy: karlcow, orsenthil
priority: normal
severity: normal
status: open
title: http tests testing more than the error code are fragile
versions: Python 3.3

___
Python tracker 

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



[issue17355] http tests testing more than the error code are fragile

2013-03-05 Thread karl

Changes by karl :


--
components: +Library (Lib), Tests

___
Python tracker 

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



[issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline

2013-03-05 Thread karl

karl added the comment:

Senthil,


I created another bug reports for the tests which are fragile.
http://bugs.python.org/issue17355

--

___
Python tracker 

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



[issue17025] reduce multiprocessing.Queue contention

2013-03-05 Thread Charles-François Natali

Charles-François Natali added the comment:

> No.  I only looked at the diff and assumed both changes were for Queue.

OK, great.

> Since you marked issue 10886 as superceded, do you intend to do the
> pickling in put()?

Actually no, I'll reopen it.
I find the performance hit important, though.

--

___
Python tracker 

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



[issue10886] Unhelpful backtrace for multiprocessing.Queue

2013-03-05 Thread Charles-François Natali

Changes by Charles-François Natali :


--
status: closed -> open
superseder: reduce multiprocessing.Queue contention -> 

___
Python tracker 

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



[issue15866] encode(..., 'xmlcharrefreplace') produces entities for surrogate pairs

2013-03-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> I think it's better to be compatible with 3.3+.  This is anyway a rather 
> obscure corner case.

Well, we should not introduce new divergence between 3.2 wide build and 3.3.

> Do you want to propose a new patch?

I will do it.

--

___
Python tracker 

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



[issue17353] Plistlib outputs empty data tags when deeply nested

2013-03-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

We should limit the indentation to be less than the maximal line length.

--
assignee:  -> ronaldoussoren
components: +Macintosh
nosy: +ronaldoussoren, serhiy.storchaka
stage:  -> needs patch
type:  -> behavior
versions: +Python 3.2, Python 3.3 -Python 3.5

___
Python tracker 

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



[issue17355] http tests testing more than the error code are fragile

2013-03-05 Thread R. David Murray

R. David Murray added the comment:

We are testing our http server.  It is not obviously inappropriate to test the 
full string.  Especially in the Line to Long case, where we are testing that 
our specific error message is produced.  If you wish to argue that we should 
emit the standard message and only put the specific info in the body of the 
response, that would be a design change, and then we should probably test for 
*that*, since it would be a change from current behavior.  Personally I find 
the more-specific information being in the response code message to be helpful, 
but I haven't done enough web programming lately for my opinion to count for 
much :)

So, I do not think this issue needs to be separate from issue 12921.  The tests 
should be fixed as part of the enhancement being advocated there (and I 
certainly agree it should be *possible* to control the two messages separately, 
regardless of what we choose to do by default).

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> http.server.BaseHTTPRequestHandler.send_error and trailing 
newline

___
Python tracker 

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



[issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline

2013-03-05 Thread R. David Murray

R. David Murray added the comment:

Which I closed, sorry.

I agree it should be possible to control the text produced with the error code 
separately from the text in the body.  I prefer the specific text produced by 
our http server to the generic message, but I would only be -0 on changing this 
so that the default was the generic message and the specific message only went 
in the body.  Since changing that would change the behavior of existing code, 
this is an enhacement request and not a bug fix.  (That is, it may be a design 
bug, but those get fixed as enhancements :)

Either way, the httpserver tests will need to be modified to test the API 
enhancement, and the possible default text change, proposed here.

--
nosy: +r.david.murray
type: behavior -> enhancement
versions:  -Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue17343] Add a version of str.split which returns an iterator

2013-03-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Indeed, a bytearray version would require the talked about but not 
> implemented due to complexity (in pep3118) support for locking a buffer from 
> other mutations.

I rather think that a bytearray version can't pre-scan the data. Note that an 
array for pre-scanned result can be larger than input data (if we split into a 
large number of small items). Also note that iterative split useful when we do 
not want to process all input, but only several first items.

Actually I think that in most common cases non-iterative split will be faster 
than iterative one.

--

___
Python tracker 

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



[issue17343] Add a version of str.split which returns an iterator

2013-03-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> There is no string view that I know of. Interesting idea, though, thanks to 
> the immutability of strings. Would much have to be different other than 
> boundary checking and __hash__ (and hoping extension authors are changing 
> things in-place)?

Objects/stringlib/unicode_format.h contains internal structure SubString which 
can be taken as a basis. But it is unlikely that it will be useful. All API 
which accept strings will require converting substring views to regular 
strings. And substring object can consume more memory than full string. This 
looks like a step backwards from PEP 393.

--

___
Python tracker 

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



[issue17301] An in-place version of many bytearray methods is needed

2013-03-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Sorry, Terry, I was meaning a CPU time.

--

___
Python tracker 

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



[issue17301] An in-place version of many bytearray methods is needed

2013-03-05 Thread Christian Heimes

Christian Heimes added the comment:

+1

--
nosy: +christian.heimes

___
Python tracker 

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



[issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline

2013-03-05 Thread karl

karl added the comment:

hehe. No hard feelings. I still do not think it is a good idea to test the 
"error code" and its associated message in the same test. :)

For example, in RFC2616, 414 is defined as 

414 Request-URI Too Long

and in the HTTP1.1bis (which will not get a new version number) because the 
goal of the work was to just clarify and not make incompatible changes, 414 is 
defined as 

414 URI Too Long

which is fine because the message is optional. With the current tests, it will 
make it hard to modify :)
http://hg.python.org/cpython/file/3.3/Lib/http/server.py#l627

# More about this specific issue

Right now, send_error groks everything, which is not very good in terms of 
security and side effects. 
http://hg.python.org/cpython/file/3.3/Lib/http/server.py#l404

def send_error(self, code, message=None):

Then later on:
try:
   shortmsg, longmsg = self.responses[code]

* shortmsg is supposed to bewhat is written in the spec.
* longmsg  is specific to the python project. 

When the message is not defined it takes the shortmsg
http://hg.python.org/cpython/file/3.3/Lib/http/server.py#l421

but if defined it sends everything whatever it is
http://hg.python.org/cpython/file/3.3/Lib/http/server.py#l428

Checking the status-line 
http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-22#section-3.1.2

3.1.2. Status Line


   The first line of a response message is the status-line, consisting
   of the protocol version, a space (SP), the status code, another
   space, a possibly-empty textual phrase describing the status code,
   and ending with CRLF.

 status-line = HTTP-version SP status-code SP reason-phrase CRLF

   The status-code element is a 3-digit integer code describing the
   result of the server's attempt to understand and satisfy the client's
   corresponding request.  The rest of the response message is to be
   interpreted in light of the semantics defined for that status code.
   See Section 6 of [Part2] for information about the semantics of
   status codes, including the classes of status code (indicated by the
   first digit), the status codes defined by this specification,
   considerations for the definition of new status codes, and the IANA
   registry.

 status-code= 3DIGIT

   The reason-phrase element exists for the sole purpose of providing a
   textual description associated with the numeric status code, mostly
   out of deference to earlier Internet application protocols that were
   more frequently used with interactive text clients.  A client SHOULD
   ignore the reason-phrase content.

 reason-phrase  = *( HTAB / SP / VCHAR / obs-text )


* So client SHOULD ignore the reason-phrase
* The reason-phrase can only contains 
** HTAB (horizontal tab)
** SP (space)
** VCHAR (any visible [USASCII] character)
** obs-text
*** As a convention, ABNF rule names prefixed with "obs-" denote "obsolete" 
grammar rules that appear for historical reasons.
*** obs-text = %x80-FF (range of characters)


A hacky way to mitigate the issue would be to 

1. extract the first line (stop after the first CRLF)
2. sanitize this line. (allow only "*(HTAB / SP / VCHAR / %x80-FF)" )
3. send only this.

Thoughts?
Honestly, I do not find very satisfying. ;) but at least it should not break 
everything.

--

___
Python tracker 

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



[issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline

2013-03-05 Thread R. David Murray

R. David Murray added the comment:

Your suggestion could probably be applied as a bug fix to maintenance releases, 
but is it worth the effort?  We don't generally try to protect programmers from 
themselves in Python.

On the other hand, there should clearly be a way to provide the 'explain' text 
as well as the message text.

In 3.4 we could add an 'explain' keyword to send_error.  If only explain is 
specified, we'd use the shortmsg for message.  That way, a programmer writing 
new code can make it work the way they want it to, while existing code will 
continue to work the way it used to.

--

___
Python tracker 

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



[issue17301] An in-place version of many bytearray methods is needed

2013-03-05 Thread Gregory P. Smith

Gregory P. Smith added the comment:

The important reasons for this are memory use and cache thrashing, not just
CPU time.

--

___
Python tracker 

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



[issue12921] http.server.BaseHTTPRequestHandler.send_error and trailing newline

2013-03-05 Thread karl

karl added the comment:

R.david

Trying another patch just for understanding if it's what you meant.

What it does:

1. adding an 'explain' keyword
2. escaping the explain message for the body
3. checking for injection of newline in the reason phrase.

For the part 3, TODO:
check if there are other parts in the library if the reason phrase is injected 
in the message.

--
Added file: http://bugs.python.org/file29314/issue-12921-3.patch

___
Python tracker 

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



[issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing

2013-03-05 Thread Christian Heimes

Changes by Christian Heimes :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing

2013-03-05 Thread Christian Heimes

Christian Heimes added the comment:

My python-ideas posting about the same topic 
http://mail.python.org/pipermail/python-ideas/2013-March/019807.html

--

___
Python tracker 

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



[issue10886] Unhelpful backtrace for multiprocessing.Queue

2013-03-05 Thread Charles-François Natali

Charles-François Natali added the comment:

For the record, I'm posting thse benchmark numbers here (originally from issue 
#17025):

"""
with patch:
$ ./python /tmp/multi_queue.py
took 0.7945001125335693 seconds with 1 workers
took 0.7428359985351562 seconds with 2 workers
took 0.7897098064422607 seconds with 3 workers
took 1.1860828399658203 seconds with 4 workers

I tried Richard's suggestion of serializing the data inside put(), but this 
reduces performance quite notably:
$ ./python /tmp/multi_queue.py
took 1.412883996963501 seconds with 1 workers
took 1.3212130069732666 seconds with 2 workers
took 1.2271699905395508 seconds with 3 workers
took 1.4817359447479248 seconds with 4 workers

Although I didn't analyse it further, I guess one reason could be that if the 
serializing is done in put(), the feeder thread has nothing to do but keep 
waiting for data to be available from the buffer, send it, and block until 
there's more to do: basically, it almost doesn't use its time-slice, and spends 
its time blocking and doing context switches.
"""

So serializing the data from put() seems to have a significant performance 
impact (other benchmarks are welcome), that's something to keep in mind.

--

___
Python tracker 

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



[issue17356] Invalid link to repr() built-in function description

2013-03-05 Thread Vladimir Rutsky

New submission from Vladimir Rutsky:

References to built-in function repr() links to repr module 
(http://docs.python.org/2/library/repr.html#module-repr), but must link to 
description in http://docs.python.org/2/library/functions.html.

It can be at least in http://docs.python.org/2/library/functions.html (link in 
table at page top).

--
assignee: docs@python
components: Documentation
messages: 183538
nosy: docs@python, vrutsky
priority: normal
severity: normal
status: open
title: Invalid link to repr() built-in function description
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue17357] Add missing verbosity message to importlib

2013-03-05 Thread Brett Cannon

New submission from Brett Cannon:

Looks like I missed some verbosity messages in importlib. The most obvious one 
is the "trying" messages under verbosity 2 (-vv or PYTHONVERBOSE=2). Should 
probably go through import.c again and make sure no other messages are missing 
(http://hg.python.org/cpython/file/637d7c953b10/Python/import.c).

--
components: Interpreter Core
keywords: easy
messages: 183539
nosy: brett.cannon, twouters
priority: normal
severity: normal
stage: needs patch
status: open
title: Add missing verbosity message to importlib
type: behavior
versions: Python 3.3, Python 3.4

___
Python tracker 

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



[issue11732] Skip decorator for tests requiring manual intervention on Windows

2013-03-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 834a451f1cdb by Ezio Melotti in branch '3.3':
#11732: add a new suppress_crash_popup() context manager to test.support.
http://hg.python.org/cpython/rev/834a451f1cdb

New changeset b87123015fb0 by Ezio Melotti in branch 'default':
#11732: merge with 3.3.
http://hg.python.org/cpython/rev/b87123015fb0

--
nosy: +python-dev

___
Python tracker 

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



[issue17357] Add missing verbosity message to importlib

2013-03-05 Thread Brett Cannon

Brett Cannon added the comment:

Any change below needs to be checked for what verbosity it matters for 
(although I think there is only a single level 2 message):

PySys_WriteStderr("# %s has bad magic\n", cpathname); 
(http://hg.python.org/cpython/file/637d7c953b10/Python/import.c#l1038)

PySys_WriteStderr("import %s # directory %s\n", name, pathname);  although that 
might be confusing in the face of namespace packages 
(http://hg.python.org/cpython/file/637d7c953b10/Python/import.c#l1435)

PySys_WriteStderr("# trying %s\n", buf); 
(http://hg.python.org/cpython/file/637d7c953b10/Python/import.c#l1837)

PySys_WriteStderr("import %s # frozen%s\n", name, ispackage ? " package" : ""); 
(http://hg.python.org/cpython/file/637d7c953b10/Python/import.c#l2335)

PySys_WriteStderr("import %s # builtin\n", name); 
(http://hg.python.org/cpython/file/637d7c953b10/Python/import.c#l2224)

Everything else changed, but is covered by some new verbose message.



Should probably change "created {!r}" to "wrote {!r}" in importlib 
(http://hg.python.org/cpython/file/b0890674bc21/Lib/importlib/_bootstrap.py#l1091)

--

___
Python tracker 

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



[issue17357] Add missing verbosity message to importlib

2013-03-05 Thread Brett Cannon

Brett Cannon added the comment:

Actually, the builtin/frozen stuff is covered by a catch-all "import ..." 
message in importlib itself (I thought I wasn't _that_ sloppy when I added the 
messages). That just leaves the bad magic number, what to do about a matching 
directory, and "trying".

--

___
Python tracker 

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



[issue14489] repr() function link on the built-in function documentation is incorrect

2013-03-05 Thread R. David Murray

R. David Murray added the comment:

Confirm that this is not fixed.

--
resolution: fixed -> 
stage: committed/rejected -> needs patch
status: closed -> open

___
Python tracker 

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



[issue17356] Invalid link to repr() built-in function description

2013-03-05 Thread R. David Murray

R. David Murray added the comment:

Closing in favor of re-opening issue 14489, which tried to fix this and 
apparently failed.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> repr() function link on the built-in function documentation is 
incorrect

___
Python tracker 

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



[issue14489] repr() function link on the built-in function documentation is incorrect

2013-03-05 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +vrutsky

___
Python tracker 

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



[issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing

2013-03-05 Thread Christian Heimes

Christian Heimes added the comment:

Here is an experimental patch. The speedup is ... measurable.

$ ./python -m timeit -n1000 "l = []" "l.__preallocate__(1)" "app = 
l.append" "for i in range(1): app(i)" "l.__shrink__()"
1000 loops, best of 3: 3.68 msec per loop

$ ./python -m timeit -n1000 "l = []" "app = l.append" "for i in range(1): 
app(i)"
1000 loops, best of 3: 3.75 msec per loop

--
keywords: +patch
Added file: http://bugs.python.org/file29315/preallocate.patch

___
Python tracker 

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



[issue17223] Initializing array.array with unicode type code and buffer segfaults

2013-03-05 Thread Ezio Melotti

Ezio Melotti added the comment:

Tests are still failing on Windows:
http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/1558/steps/test/logs/stdio

--

___
Python tracker 

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



[issue14489] repr() function link on the built-in function documentation is incorrect

2013-03-05 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue11732] Skip decorator for tests requiring manual intervention on Windows

2013-03-05 Thread Ezio Melotti

Ezio Melotti added the comment:

I applied this only on 3.3/3.x because I didn't manage to test on 2.7/3.2.
If test_ctypes and/or other tests are failing there I can backport it, but the 
patch needs to be tweaked there because it doesn't apply cleanly (and there's 
no test_faulthandler there).

--
assignee: brian.curtin -> ezio.melotti
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue17323] Disable [X refs, Y blocks] ouput in debug builds

2013-03-05 Thread Brian Curtin

Brian Curtin added the comment:

I don't know exactly what the option would be called, but +1 on the idea. 
Perhaps something under the interpreter's -X option since it's 
implementation-specific?

This output gets in the way a fair bit when debugging interpreter sessions, and 
Chris brings up a good point about testability.

--
nosy: +brian.curtin

___
Python tracker 

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



[issue17358] imp.load_module() leads to the improper caching of the 'file' argument

2013-03-05 Thread Brett Cannon

New submission from Brett Cannon:

As of right now, if you use imp.load_module(), it will store any 'file' 
argument you give it in a hacked loader. That's a problem when you call 
imp.reload() on such a module, though, as subsequent calls to 
__loader__.load_module() will attempt to use the cached file object which was 
closed on the initial load. What the code should do is use the hacked loader to 
load the module, but then set an unhacked loader to __loader__ for reloads to 
work properly.

Traceback below:

==
ERROR: test_source (test.test_imp.ReloadTests)
--
Traceback (most recent call last):
  File 
"/build/work/cf49a3092a96daebb23bf3c6e0d86ac9/google3/tmp/lib/python3.3/test/test_imp.py",
 line 248, in test_source
imp.reload(os)
  File 
"/build/work/cf49a3092a96daebb23bf3c6e0d86ac9/google3/tmp/lib/python3.3/imp.py",
 line 252, in reload
return module.__loader__.load_module(name)
  File "", line 586, in _check_name_wrapper
  File "", line 1023, in load_module
  File "", line 1004, in load_module
  File "", line 562, in module_for_loader_wrapper
  File "", line 854, in _load_module
  File "", line 978, in get_code
  File 
"/build/work/cf49a3092a96daebb23bf3c6e0d86ac9/google3/tmp/lib/python3.3/imp.py",
 line 88, in get_data
with self.file:
ValueError: I/O operation on closed file.

--
components: Library (Lib)
keywords: easy
messages: 183549
nosy: brett.cannon
priority: normal
severity: normal
stage: test needed
status: open
title: imp.load_module() leads to the improper caching of the 'file' argument
versions: Python 3.3, Python 3.4

___
Python tracker 

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



[issue17359] python modules.zip is not documented

2013-03-05 Thread Marc-Andre Lemburg

New submission from Marc-Andre Lemburg:

The feature to run a ZIP file containing Python modules is not documented.

It was implemented in Python 2.6:

 * http://bugs.python.org/issue1739468

and mentioned in the "What's new":

 * 
http://docs.python.org/2/whatsnew/2.6.html?highlight=python%20run%20zip%20files#other-language-changes

but searching the documentation for "__main__.py" returns 0 hits in the docs 
(for Python 2.7 and 3.4).

I guess "python dir" should also be mentioned somewhere...

--
assignee: docs@python
components: Documentation
messages: 183550
nosy: docs@python, lemburg
priority: normal
severity: normal
status: open
title: python modules.zip is not documented
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing

2013-03-05 Thread Charles-François Natali

Charles-François Natali added the comment:

> Here is an experimental patch. The speedup is ... measurable.

It's likely to be more useful for dict and set, to avoid/limit rehashs.
Also, the allocation overhead depends on the implementation, I suspect the gain 
would be more important with PyPy.

FWIW, Java proposes this for lists and maps, but I'm not convinced exposing 
such tunables really makes sense for Python.

--
nosy: +neologix

___
Python tracker 

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



[issue17358] imp.load_module() leads to the improper caching of the 'file' argument

2013-03-05 Thread Roumen Petrov

Roumen Petrov added the comment:

How to reproduce issue with normal in source tree build ?

I'm asking because to avoid issue, on read only file system , I use patch 
posted in scope of issue3754 and issue15833 
(0016-CROSS-reload-may-fail-with-operation-on-closed-file-.patch) .

--
nosy: +rpetrov

___
Python tracker 

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



[issue17358] imp.load_module() leads to the improper caching of the 'file' argument

2013-03-05 Thread Brett Cannon

Brett Cannon added the comment:

I don't have a Python 3.3 install happy (someone at work reported the failure), 
but simply calling imp.load_module() and then __loader__.load_module() on the 
returned module immediately after should trigger it.

--

___
Python tracker 

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



[issue17360] Regular expressions on mmap'd files can overflow

2013-03-05 Thread Jeremy Archer

New submission from Jeremy Archer:

I've recently been having problems with the Python regular expressions module 
when mmap'ing large (> 2^32 bits) on Linux.

Steps to reproduce:

https://gist.github.com/fatlotus/5094575

I've been able to replicate it on Ubuntu Linux (uname -r = 3.5.0-23-generic). 
Naturally, this is on a 64-bit platform with Python 2.7.3 installed from APT.

--
components: Library (Lib), Regular Expressions
messages: 183555
nosy: ezio.melotti, fatlotus, mrabarnett
priority: normal
severity: normal
status: open
title: Regular expressions on mmap'd files can overflow
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2013-03-05 Thread Piotr Dobrogost

Changes by Piotr Dobrogost :


--
nosy: +piotr.dobrogost

___
Python tracker 

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



[issue17361] use CC to test compiler flags in setup.py

2013-03-05 Thread Roumen Petrov

New submission from Roumen Petrov:

Version of gcc compiler may differ between build and host system. As result 
could be activated unsupported options and build of _decimal module will fail.

--
components: Cross-Build
files: 0003-ORIGIN-use-CC-to-test-compiler-flags-in-setup.py.patch
keywords: patch
messages: 183556
nosy: doko, rpetrov, skrah
priority: normal
severity: normal
status: open
title: use CC to test compiler flags in setup.py
type: compile error
versions: Python 3.3, Python 3.4
Added file: 
http://bugs.python.org/file29316/0003-ORIGIN-use-CC-to-test-compiler-flags-in-setup.py.patch

___
Python tracker 

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



[issue17362] enable-new-dtags only for GNU ELF linker

2013-03-05 Thread Roumen Petrov

New submission from Roumen Petrov:

GNU binutils properly document that flag --enable-new-dtags is only available 
on ELF systems.
I would like to propose a simple hack to avoid activation if ELF is not listed 
in supported emulations.

Comments in unixccompiler.py are not precise : "# GNU ld needs an extra option 
to get a RUNPATH ..", i.e. ELF is missing. 

Also GNULD is not correct name for flag. What about to change to GNUELFLD ?

You could test on cygwin for instance.

--
components: Build
files: 0004-ORIGIN-enable-new-dtags-only-for-GNU-ELF-linker.patch
keywords: patch
messages: 183557
nosy: rpetrov
priority: normal
severity: normal
status: open
title: enable-new-dtags only for GNU ELF linker
type: compile error
versions: Python 3.4
Added file: 
http://bugs.python.org/file29317/0004-ORIGIN-enable-new-dtags-only-for-GNU-ELF-linker.patch

___
Python tracker 

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



[issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing

2013-03-05 Thread Gregory P. Smith

Gregory P. Smith added the comment:

The gain will be more noticeable the faster the Python implementation it is 
running under is. It is going to avoid logN relloc's in just about all 
implementations.  That CPython is relatively slow is not a justification to 
avoid adding the feature.

I like Christian's proposal of not having it be a constructor argument but 
having it be a __preallocate__ method on the object.  That keeps it out of the 
eyes of most users reading the docs (keeping the main interface clear) and lets 
us put it in a special section of the python docs.  Code that *needs* it could 
use it but most would not need to bother.

Python VMs would be free to have dummy do nothing implementations (ie: we 
should *never* guarantee that a python call to thing.__preallocate__(1000) 
followed immediately by a C extension module call that takes thing as input can 
assume anything about the underlying object... it needs to check the size or 
resize itself before using the unchecked _SET_ITEM macros, etc.)

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue17329] Document unittest.SkipTest

2013-03-05 Thread Zachary Ware

Zachary Ware added the comment:

Here's a pair of patches for 3.x and 2.7.  The 3.x patch is actually targeted 
at default; it has a couple extra instances of ``SkipTest`` that are converted 
to :exc:`SkipTest` in the patch.

--
keywords: +patch
versions: +Python 3.3
Added file: http://bugs.python.org/file29318/issue17329.diff

___
Python tracker 

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



[issue17329] Document unittest.SkipTest

2013-03-05 Thread Zachary Ware

Changes by Zachary Ware :


Added file: http://bugs.python.org/file29319/issue17329-2.7.diff

___
Python tracker 

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



[issue17329] Document unittest.SkipTest

2013-03-05 Thread Zachary Ware

Zachary Ware added the comment:

In the patches, the description of SkipTest is copied directly from the 
docstring in Lib/unittest/case.py with a bit of markup added.  It mentions 
TestResult.skip(), which doesn't exist.  I wonder if that was meant to be 
TestCase.skipTest()?

--
type:  -> enhancement
versions: +Python 2.7, Python 3.2

___
Python tracker 

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



[issue17223] Initializing array.array with unicode type code and buffer segfaults

2013-03-05 Thread STINNER Victor

STINNER Victor added the comment:

> ezio.melotti: Tests are still failing on Windows

Oh, I read the PyUnicode_FromUnicode() twice and there is a bug :-( With 16-bit 
wchar_t type (on Windows), find_maxchar_surrogates() doesn't fail if the 
wchar_* string contains in invalid surrogate pair.

--

___
Python tracker 

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



[issue17223] Initializing array.array with unicode type code and buffer segfaults

2013-03-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 15190138d3f3 by Victor Stinner in branch 'default':
Issue #17223: Add another test to check that _PyUnicode_Ready() rejects
http://hg.python.org/cpython/rev/15190138d3f3

New changeset b9f7b1bf36aa by Victor Stinner in branch 'default':
Issue #17223: Fix PyUnicode_FromUnicode() on Windows (16-bit wchar_t type)
http://hg.python.org/cpython/rev/b9f7b1bf36aa

--

___
Python tracker 

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



[issue17223] Initializing array.array with unicode type code and buffer segfaults

2013-03-05 Thread STINNER Victor

STINNER Victor added the comment:

Changeset b9f7b1bf36aa should fix the test on Windows. My Windows VM is dead, I 
cannot test myself. If the fix works, it must be backported in Python 3.3.

--

___
Python tracker 

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



[issue17363] Argument Mixup in PyState_AddModule

2013-03-05 Thread Tobias Becker

New submission from Tobias Becker:

http://docs.python.org/3.3/c-api/module.html?highlight=pymodule#PyState_AddModule

the arguments of PyState_AddModule are in wrong order:
currently: int PyState_AddModule(PyModuleDef *def, PyObject *module)
correct: int PyState_AddModule(PyObject *module,PyModuleDef *def)

--
assignee: docs@python
components: Documentation
messages: 183564
nosy: Tobias.Becker, docs@python
priority: normal
severity: normal
status: open
title: Argument Mixup in PyState_AddModule
versions: Python 3.3

___
Python tracker 

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



[issue17223] Initializing array.array with unicode type code and buffer segfaults

2013-03-05 Thread STINNER Victor

STINNER Victor added the comment:

> Changeset b9f7b1bf36aa should fix the test on Windows.

Oh, many tests are failing because of this change, so I reverted it.

==
ERROR: test_surrogatepass_handler (test.test_codecs.CP65001Test)
--
Traceback (most recent call last):
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_codecs.py", 
line 799, in test_surrogatepass_handler
"abc\ud800def")
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\unittest\case.py", 
line 642, in assertEqual
assertion_func(first, second, msg=msg)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\unittest\case.py", 
line 1007, in assertMultiLineEqual
if first != second:
ValueError: illegal UTF-16 surrogate


==
ERROR: test_unicode (test.test_array.ArrayReconstructorTest)
--
Traceback (most recent call last):
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_array.py", 
line 183, in test_unicode
msg="{0!r} != {1!r}; testcase={2!r}".format(a, b, testcase))
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\unittest\case.py", 
line 642, in assertEqual
assertion_func(first, second, msg=msg)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\unittest\case.py", 
line 632, in _baseAssertEqual
if not first == second:
ValueError: illegal UTF-16 surrogate

==
ERROR: test_byteswap (test.test_array.UnicodeTest)
--
Traceback (most recent call last):
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_array.py", 
line 239, in test_byteswap
self.assertNotEqual(a, b)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\unittest\case.py", 
line 648, in assertNotEqual
if not first != second:
ValueError: illegal UTF-16 surrogate

==
FAIL: test_issue17223 (test.test_array.UnicodeTest)
--
Traceback (most recent call last):
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_array.py", 
line 1082, in test_issue17223
self.assertRaises(ValueError, a.tounicode)
AssertionError: ValueError not raised by tounicode

--

___
Python tracker 

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



[issue17364] Multiprocessing documentation mentions function that doesn't exist

2013-03-05 Thread Topher Brown

New submission from Topher Brown:

multiprocessing documentation 
(http://docs.python.org/2/library/multiprocessing.html#pipes-and-queues) for 
multiprocessing.Queue mentions Queue.get_no_wait() as an alias for 
Queue.get_nowait(). This function does not seem to exist.

--
assignee: docs@python
components: Documentation
messages: 183566
nosy: Topher.Brown, docs@python
priority: normal
severity: normal
status: open
title: Multiprocessing documentation mentions function that doesn't exist
versions: Python 2.7

___
Python tracker 

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



[issue17364] Multiprocessing documentation mentions function that doesn't exist

2013-03-05 Thread Richard Oudkerk

Changes by Richard Oudkerk :


--
nosy: +sbt

___
Python tracker 

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



[issue17363] Argument Mixup in PyState_AddModule

2013-03-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 29d5bc1226f9 by Ezio Melotti in branch '3.3':
#17363: fix arguments in PyState_AddModule and PyState_RemoveModule docs.
http://hg.python.org/cpython/rev/29d5bc1226f9

New changeset 75c0cb169be5 by Ezio Melotti in branch 'default':
#17363: merge with 3.3.
http://hg.python.org/cpython/rev/75c0cb169be5

--
nosy: +python-dev

___
Python tracker 

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



[issue17363] Argument Mixup in PyState_AddModule

2013-03-05 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the report!

--
assignee: docs@python -> ezio.melotti
nosy: +ezio.melotti
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
type:  -> enhancement
versions: +Python 3.4

___
Python tracker 

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



[issue17364] Multiprocessing documentation mentions function that doesn't exist

2013-03-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 01a8fcc91d5a by Ezio Melotti in branch '2.7':
#17364: remove documentation for a function that does not exist.
http://hg.python.org/cpython/rev/01a8fcc91d5a

New changeset 4f9de1b18cab by Ezio Melotti in branch '3.2':
#17364: remove documentation for a function that does not exist.
http://hg.python.org/cpython/rev/4f9de1b18cab

New changeset 5e294202f93e by Ezio Melotti in branch '3.3':
#17364: merge with 3.2.
http://hg.python.org/cpython/rev/5e294202f93e

New changeset b87e9b8dc9ad by Ezio Melotti in branch 'default':
#17364: merge with 3.3.
http://hg.python.org/cpython/rev/b87e9b8dc9ad

--
nosy: +python-dev

___
Python tracker 

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



[issue17364] Multiprocessing documentation mentions function that doesn't exist

2013-03-05 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the report!

--
assignee: docs@python -> ezio.melotti
nosy: +ezio.melotti
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
type:  -> enhancement
versions: +Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue17329] Document unittest.SkipTest

2013-03-05 Thread Ezio Melotti

Ezio Melotti added the comment:

> I wonder if that was meant to be TestCase.skipTest()?

Most likely.

I would document this exception at the end of the "Skipping tests and expected 
failures".  You could documented it simply as "the exception raised by the skip 
decorators", and suggest to use TestCase.skipTest() to skip a test rather than 
just raising this exception directly.

I'm also not sure if the note should be kept -- it seems quite obvious to me 
that the test will be marked as skipped even if previous assertions succeeded.  
Moreover, if the exception is generally not supposed to be used directly 
there's no need to explain how to use it.

--

___
Python tracker 

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



[issue11732] Skip decorator for tests requiring manual intervention on Windows

2013-03-05 Thread Ezio Melotti

Ezio Melotti added the comment:

Attached an untested patch against 3.2.
On 2.7 and 3.2 there's no test_faulthandler, and the crashing test in 
test_ctypes seems to be in 3.x only.

Unless I'm missing something:
 1) no crash popups should appear while running the 2.7 test suite;
 2) only test_ctypes should show a crash popup on 3.2 and the attached patch 
should fix it;

Brian, if you can confirm this I'll go ahead, backport the patch on 3.2, and 
null merge it on 3.3/default.

--
Added file: http://bugs.python.org/file29320/nopopup3.2.diff

___
Python tracker 

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



[issue8732] Should urrllib2.urlopen send an Accept-Encoding header?

2013-03-05 Thread karl

karl added the comment:

What was the content of http://support.github.com/discussions/site/1510
I can't find it. Is the issue still going on?

--
nosy: +karlcow

___
Python tracker 

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



[issue15465] Improved documentation for C API version info

2013-03-05 Thread Nick Coghlan

Nick Coghlan added the comment:

Mostly looks good to me, but the second sentence in the first paragraph of the 
new section should be deleted. The relationship between PY_LIMITED_API and 
PY_VERSION_HEX is already covered in the stable ABI docs:

"""In some cases, the stable ABI needs to be extended with new functions. 
Extensions modules wishing to use these new APIs need to set Py_LIMITED_API to 
the PY_VERSION_HEX value of the minimum Python version they want to support 
(e.g. 0x0303 for Python 3.3). Such modules will work on all subsequent 
Python releases, but fail to load (because of missing symbols) on the older 
releases."""

(As a separate issue, it may be worth doing an editing pass on the stable ABI 
docs - there are a few typos in there, and the layout is a bit odd for a 
reference doc. We shouldn't hold up this patch for that, though).

--

___
Python tracker 

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



[issue8450] httplib: false BadStatusLine() raised

2013-03-05 Thread karl

karl added the comment:

Hmm no code.
I wonder if it's about this part.
http://hg.python.org/cpython/file/3.3/Lib/http/client.py#l321

--
nosy: +karlcow

___
Python tracker 

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



[issue13359] urllib2 doesn't escape spaces in http requests

2013-03-05 Thread karl

karl added the comment:

The issue with the current patch is that it is escaping more than only the 
spaces, with possibly indirect border effect.
Anne van Kesteren is in the process of creating a parsing/writing specification 
for URL. Not finished but putting it here for future reference.
http://url.spec.whatwg.org/

--
nosy: +karlcow

___
Python tracker 

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



[issue14132] Redirect is not working correctly in urllib2

2013-03-05 Thread karl

karl added the comment:

→  curl -sI  http://kniznica.uniza.sk/opac

HTTP/1.1 302 Moved Temporarily
Date: Wed, 06 Mar 2013 03:23:06 GMT
Server: Indy/9.0.50
Content-Type: text/html
Location: ?fs=C79F09C9F1304E7AA4FF7C211BEA2B9B&fn=main


→ python3.3

Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 01:25:11) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib.parse
>>> urllib.parse.urlparse("http://kniznica.uniza.sk/opac";)
ParseResult(scheme='http', netloc='kniznica.uniza.sk', path='/opac', params='', 
query='', fragment='')
>>> urllib.parse.urlparse("?fs=C79F09C9F1304E7AA4FF7C211BEA2B9B&fn=main")
ParseResult(scheme='', netloc='', path='', params='', 
query='fs=C79F09C9F1304E7AA4FF7C211BEA2B9B&fn=main', fragment='')

Redirection is defined at
http://hg.python.org/cpython/file/5e294202f93e/Lib/urllib/request.py#l643

--
nosy: +karlcow

___
Python tracker 

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



[issue15465] Improved documentation for C API version info

2013-03-05 Thread Kushal Das

Kushal Das added the comment:

Attached version 5 of the patch with changes based on suggestions of ncoghlan

--
Added file: http://bugs.python.org/file29321/issue15465v5.patch

___
Python tracker 

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



[issue15851] Lib/robotparser.py doesn't accept setting a user agent string, instead it uses the default.

2013-03-05 Thread karl

karl added the comment:

Setting a user agent string should be possible.
My guess is that the default library has been used by an abusive client (by 
mistake or intent) and wikimedia project has decided to blacklist the client 
based on the user-agent string sniffing.

The match is on anything which matches

"Python-urllib" in UserAgentString

See below:

>>> import urllib.request
>>> opener = urllib.request.build_opener()
>>> opener.addheaders = [('User-agent', 'Python-urllib')]
>>> fobj = opener.open('http://en.wikipedia.org/robots.txt')
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/urllib/request.py",
 line 479, in open
response = meth(req, response)
  File 
"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/urllib/request.py",
 line 591, in http_response
'http', request, response, code, msg, hdrs)
  File 
"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/urllib/request.py",
 line 517, in error
return self._call_chain(*args)
  File 
"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/urllib/request.py",
 line 451, in _call_chain
result = func(*args)
  File 
"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/urllib/request.py",
 line 599, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
>>> import urllib.request
>>> opener = urllib.request.build_opener()
>>> opener.addheaders = [('User-agent', 'Pythonurllib/3.3')]
>>> fobj = opener.open('http://en.wikipedia.org/robots.txt')
>>> fobj

>>> import urllib.request
>>> opener = urllib.request.build_opener()
>>> opener.addheaders = [('User-agent', 'Pyt-honurllib/3.3')]
>>> fobj = opener.open('http://en.wikipedia.org/robots.txt')
>>> import urllib.request
>>> opener = urllib.request.build_opener()
>>> opener.addheaders = [('User-agent', 'Python-urllib')]
>>> fobj = opener.open('http://en.wikipedia.org/robots.txt')
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/urllib/request.py",
 line 479, in open
response = meth(req, response)
  File 
"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/urllib/request.py",
 line 591, in http_response
'http', request, response, code, msg, hdrs)
  File 
"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/urllib/request.py",
 line 517, in error
return self._call_chain(*args)
  File 
"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/urllib/request.py",
 line 451, in _call_chain
result = func(*args)
  File 
"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/urllib/request.py",
 line 599, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
>>> import urllib.request
>>> opener = urllib.request.build_opener()
>>> opener.addheaders = [('User-agent', 'Python-urlli')]
>>> fobj = opener.open('http://en.wikipedia.org/robots.txt')
>>> 

Being able to change the header might indeed be a good thing.

--
nosy: +karlcow

___
Python tracker 

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



[issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing

2013-03-05 Thread Stefan Behnel

Stefan Behnel added the comment:

I agree with basically all counter-arguments that were brought up so far. While 
I would eventually like to use the available length hints in the special case 
of Cython's list comprehensions, I'm far from seeing a general applicability 
for this. The use cases are fairly limited, the (missing) guarantees are easy 
to misunderstand by users and alternatives exist for most use cases. Python 
code shouldn't be bothered with memory management.

--
nosy: +scoder

___
Python tracker 

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



[issue17365] Remove Python 2 code from test_print

2013-03-05 Thread Berker Peksag

New submission from Berker Peksag:

Changes:

* Removed Python 2 specific code
* Re-enabled u'' tests (see PEP 414)
* Cosmetic fixes

--
components: Tests
files: test_print.diff
keywords: patch
messages: 183581
nosy: berker.peksag
priority: normal
severity: normal
status: open
title: Remove Python 2 code from test_print
versions: Python 3.4
Added file: http://bugs.python.org/file29322/test_print.diff

___
Python tracker 

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



[issue17366] os.chdir win32

2013-03-05 Thread Dave Humphries

New submission from Dave Humphries:

os.chdir missed a back slash in rewriting a file path see example below (the 
extra backslash was missing from the trunk directory). 
Modifying the path with an extra slash enabled this to work for some reason. 
(os windows 8 64 bit Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 
32 bit (Intel)] on win32 :
spyder console output:
>>> os.chdir("C:\Projects\trunk\BusPirate\dangerous-prototypes-open-hardware-read-only\Bus_Pirate\scripts\pyBusPirateLite")
Traceback (most recent call last):
  File "", line 1, in 
WindowsError: [Error 123] The filename, directory name or volume label syntax 
is incorrect: 
'C:\\Projects\trunk\\BusPirate\\dangerous-prototypes-open-hardware-read-only\\Bus_Pirate\\scripts\\pyBusPirateLite'
>>> os.chdir("C:\Projects\\trunk\BusPirate\dangerous-prototypes-open-hardware-read-only\Bus_Pirate\scripts\pyBusPirateLite")
>>> from pyBusPirateLite.SPI import *

--
components: Windows
messages: 183582
nosy: DaveH
priority: normal
severity: normal
status: open
title: os.chdir win32
type: behavior
versions: Python 2.7

___
Python tracker 

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