[issue20169] random module doc page has broken links

2016-02-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2d8e8d0e7162 by Georg Brandl in branch '2.7':
Closes #20169: fix inner links random doc.
https://hg.python.org/cpython/rev/2d8e8d0e7162

New changeset 426ac89548b3 by Georg Brandl in branch '3.5':
Closes #20169: fix inner links random doc.
https://hg.python.org/cpython/rev/426ac89548b3

--
nosy: +python-dev
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue26385] the call of tempfile.NamedTemporaryFile fails and leaves a file on the disk

2016-02-18 Thread SilentGhost

SilentGhost added the comment:

I wonder if Victor could clarify why bare except wasn't used in the python3 
version.

Anyway, here is the updated patch testing for TypeError as well.

--
nosy: +haypo
Added file: http://bugs.python.org/file41968/issue26385_2.diff

___
Python tracker 

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



[issue26374] concurrent_futures Executor.map semantics better specified in docs

2016-02-18 Thread Mark Dickinson

Changes by Mark Dickinson :


--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python

___
Python tracker 

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



[issue23430] socketserver.BaseServer.handle_error() should not catch exiting exceptions

2016-02-18 Thread Martin Panter

Martin Panter added the comment:

Thanks for the reivew Berker. I have merged the patch with recent changes and 
updated according to your comments.

--
Added file: http://bugs.python.org/file41967/socketserver-exit.v6.patch

___
Python tracker 

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



[issue16823] Python quits on running tkinter code with threads

2016-02-18 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
versions: +Python 3.5 -Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue16823] Python quits on running tkinter code with threads

2016-02-18 Thread Terry J. Reedy

Terry J. Reedy added the comment:

If I understand the test code, it creates the tk window in thread 0 (the main 
thread), generates data in thread 1, sends data via a queue to thread 2, which 
then inserts it into the Text widget.  I ran a 3.x version up to 34000 
iterations.  When I comment out 'tk.mainloop()' or stop the mainloop with ^C, 
thread 2 stops (reproducibly) with

Exception in thread Thread-2:
Traceback (most recent call last):
  File "C:\Programs\Python35\lib\threading.py", line 914, in _bootstrap_inner
self.run()
  File "C:\Programs\Python35\lib\threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
  File "F:\Python\mypy\tem.py", line 23, in QueueHandler
widinst.configure(state="normal")
  File "C:\Programs\Python35\lib\tkinter\__init__.py", line 1330, in configure
return self._configure('configure', cnf, kw)
  File "C:\Programs\Python35\lib\tkinter\__init__.py", line 1321, in _configure
self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
RuntimeError: main thread is not in main loop

I removed the spamming of Shell with 'running' and sped up the test code by 
reducing the queued and inserted text to the iteration number and reran to 
completion at 99.  I retract my statement about all widget access in 
threads being unsupported.  At least some seems to be at least in 3.x.

Running the original test code above in 2.7.11 from IDLE and console both fail 
before 2000 iterations in my tries.

Sarbjit: I do not understand 'tkinter wizard'.

Serhiy: I am coming back to this after reading #11077.  Do you have any idea 
why this code runs in 3.x but eventually fails in 2.x?  If there anything to 
do, or just close?

--
nosy: +serhiy.storchaka -gpolo, roger.serwy
Added file: http://bugs.python.org/file41966/tem.py

___
Python tracker 

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



[issue15608] Improve socketserver doc

2016-02-18 Thread Martin Panter

Changes by Martin Panter :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 2.7, Python 3.6 -Python 3.4

___
Python tracker 

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



[issue15608] Improve socketserver doc

2016-02-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9211b7e60c92 by Martin Panter in branch '2.7':
Issue #15608: Improve socketserver module documentation
https://hg.python.org/cpython/rev/9211b7e60c92

--

___
Python tracker 

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



[issue15608] Improve socketserver doc

2016-02-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8b71cd67f548 by Martin Panter in branch '3.5':
Issue #15608: Improve socketserver module documentation
https://hg.python.org/cpython/rev/8b71cd67f548

New changeset fbb8b634fe59 by Martin Panter in branch 'default':
Issue #15608: Merge socketserver doc from 3.5
https://hg.python.org/cpython/rev/fbb8b634fe59

--
nosy: +python-dev

___
Python tracker 

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



[issue5824] SocketServer.DatagramRequestHandler Broken under Linux

2016-02-18 Thread Martin Panter

Changes by Martin Panter :


Added file: http://bugs.python.org/file41965/bind-unix.patch

___
Python tracker 

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



[issue5824] SocketServer.DatagramRequestHandler Broken under Linux

2016-02-18 Thread Martin Panter

Changes by Martin Panter :


Removed file: http://bugs.python.org/file41964/bind-unix.patch

___
Python tracker 

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



[issue5824] SocketServer.DatagramRequestHandler Broken under Linux

2016-02-18 Thread Martin Panter

Martin Panter added the comment:

Here is a patch to enable the Unix domain DatagramRequestHandler tests, and 
bind the client to a socket name. Tests pass for me on Linux :)

The Python 2 version will need to have lowercase socketserver changed case to 
camel-case SocketServer.

--
components: +Tests -Documentation
keywords: +patch
stage: needs patch -> patch review
versions: +Python 3.5, Python 3.6 -Python 3.1, Python 3.2
Added file: http://bugs.python.org/file41964/bind-unix.patch

___
Python tracker 

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



[issue26309] socketserver.BaseServer._handle_request_noblock() doesn't shutdown request if verify_request is False

2016-02-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cba717fa8e10 by Martin Panter in branch '2.7':
Issue #26309: Rewrite test in main thread and avoid race condition
https://hg.python.org/cpython/rev/cba717fa8e10

New changeset 537608bafa5a by Martin Panter in branch '3.5':
Issue #26309: Rewrite test in main thread and avoid race condition
https://hg.python.org/cpython/rev/537608bafa5a

New changeset c791d57c8168 by Martin Panter in branch 'default':
Issue #26309: Merge socketserver fix from 3.5
https://hg.python.org/cpython/rev/c791d57c8168

--

___
Python tracker 

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



[issue26280] ceval: Optimize list

2016-02-18 Thread Zach Byrne

Zach Byrne added the comment:

Is it worth handling the exception, or just let it take the slow path and get 
caught by PyObject_GetItem()? We're still making sure the index is in bounds.

Also, where would be an appropriate place to put a macro for adjusting negative 
indices?

--

___
Python tracker 

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



[issue26309] socketserver.BaseServer._handle_request_noblock() doesn't shutdown request if verify_request is False

2016-02-18 Thread Martin Panter

Martin Panter added the comment:

Some of the buildbots failed (e.g. 
).
 I think the server is run in a separate thread, and the problem is a race 
between shutdown_request() being called and run_server returning.

--
status: closed -> open

___
Python tracker 

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



[issue26381] Add 'geo' URI scheme (RFC 5870) to urllib.parse.uses_params

2016-02-18 Thread Martin Panter

Martin Panter added the comment:

Sounds reasonable to me, and thanks for the reference.

But it would be nice to find a way for this to work sensibly with arbitrary 
schemes, in the same spirit as Issue 18828. Would it break anything if we 
removed the uses_params list altogether? I notice it already works if you omit 
the scheme:

>>> urlparse("48.198634,16.371648;crs=wgs84")
ParseResult(scheme='', netloc='', path='48.198634,16.371648', 
params='crs=wgs84', query='', fragment='')

If a programmer doesn’t want to split of the “params” they can always use 
urlsplit() instead of urlparse().

--
nosy: +martin.panter
stage:  -> needs patch
type:  -> enhancement

___
Python tracker 

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



[issue26390] hashlib's pbkdf2_hmac documentation "rounds" does not match source

2016-02-18 Thread Martin Panter

Martin Panter added the comment:

Thanks for the patch. The documentation still mentions *rounds* in one place, 
which I presume was meant to be a direct reference to the parameter.

--
nosy: +martin.panter
stage:  -> patch review
versions:  -Python 3.4

___
Python tracker 

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



[issue26385] the call of tempfile.NamedTemporaryFile fails and leaves a file on the disk

2016-02-18 Thread Martin Panter

Martin Panter added the comment:

This looks like an extension of Issue 21058. Does the unlink() work on Windows? 
It seems to me that the file is configured to remove itself on close(), 
therefore I expect unlink() will raise an exception of its own. Also made some 
suggestions in the code review.

This problem also affects Python 2, if you fudge the right wrong parameters:

>>> NamedTemporaryFile((), prefix="blaua.")
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/proj/python/cpython/Lib/tempfile.py", line 477, in 
NamedTemporaryFile
file = _os.fdopen(fd, mode, bufsize)
TypeError: argument 2 must be string, not tuple
[59140 refs]
>>> glob("/tmp/blaua.*")
['/tmp/blaua.AFtEqx']

--
nosy: +martin.panter
versions: +Python 2.7 -Python 3.4

___
Python tracker 

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



[issue26388] Disabling changing sys.argv[0] with runpy.run_module(...alter_sys=True)

2016-02-18 Thread Eric Snow

Eric Snow added the comment:

python-dev thread:

  https://mail.python.org/pipermail/python-dev/2016-February/143374.html

Notably:

  https://github.com/pantsbuild/pex/pull/211

--
nosy: +eric.snow

___
Python tracker 

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



[issue26367] importlib.__import__ does not fail for invalid relative import

2016-02-18 Thread Brett Cannon

Brett Cannon added the comment:

If a contribution is insignificant enough then technically a CLA isn't 
necessary, but I just make it a habit to ask for one regardless.

And your profile will probably get updated fairly quickly, so I wouldn't worry 
about it holding anything up (I'm hoping to commit the code tomorrow; I already 
did a review and it LGTM).

--

___
Python tracker 

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



[issue26390] hashlib's pbkdf2_hmac documentation "rounds" does not match source

2016-02-18 Thread Daan Bakker

New submission from Daan Bakker:

The documentation for pbkdf2_hmac at 
https://docs.python.org/3/library/hashlib.html uses the "rounds" keyword:

hashlib.pbkdf2_hmac(name, password, salt, rounds, dklen=None)

However, the actual source code uses "iterations". No-one has probably noticed 
it before because no error is raised if the number of iterations is given as a 
positional argument.

--
assignee: docs@python
components: Documentation
files: pbkdf2_4.patch
keywords: patch
messages: 260490
nosy: dbakker, docs@python
priority: normal
severity: normal
status: open
title: hashlib's pbkdf2_hmac documentation "rounds" does not match source
type: enhancement
versions: Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41963/pbkdf2_4.patch

___
Python tracker 

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



[issue26380] Add an http method enum

2016-02-18 Thread Demian Brecht

Demian Brecht added the comment:

> BTW I think it is actually OPTIONS; see review comment.
Well, don't I feel silly. Fixed.

--
Added file: http://bugs.python.org/file41962/issue26380_2.patch

___
Python tracker 

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



[issue26380] Add an http method enum

2016-02-18 Thread Demian Brecht

Demian Brecht added the comment:

> I can see the advantage of using an enum over a plain string. But you only 
> get an error at run time, not compile time, if you misspell it.

Sure, but at least you're giving static analysis utilities the chance to catch 
it up front.

> And there is also the disadvantage of the extra boilerplate of importing 
> HTTPMessage.

I guess that all depends on how you're importing your modules. If you just 
import "http", then there's no additional boilerplate.

> So I don’t have a strong opinion either way. Do other libraries have a 
> similar enum?

I haven't seen enums in other libraries, only constants. I figured that it 
might as well be consistent with HTTPStatus, although granted, HTTPStatus does 
a little more than the methods.

--

___
Python tracker 

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



[issue26323] Add assert_called() and assert_called_once() methods for mock objects

2016-02-18 Thread Amit Saha

Amit Saha added the comment:

Updated patch with docs and addressed review comments.

--
Added file: http://bugs.python.org/file41961/issue26323.patch

___
Python tracker 

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



[issue26367] importlib.__import__ does not fail for invalid relative import

2016-02-18 Thread Manuel Jacob

Manuel Jacob added the comment:

Done.  I'm a bit surprised this wasn't necessary for my previous two patches, 
but they were even more trival than this one. ;)

Do we have to wait until my tracker profile is updated?

--

___
Python tracker 

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



[issue26389] Expand traceback module API to accept just an exception as an argument

2016-02-18 Thread Brett Cannon

New submission from Brett Cannon:

When reading 
https://docs.python.org/3/library/traceback.html#traceback.print_exception I 
noticed that everything takes a traceback or a set of exception type, instance, 
and traceback. But since Python 3.0 all of that information is contained in a 
single exception object. So there's no reason to expand the APIs in the 
traceback module that take an exception to just take an exception instance and 
infer the exception type and grab the exception from exception instance itself.

--
components: Library (Lib)
messages: 260485
nosy: brett.cannon
priority: low
severity: normal
stage: test needed
status: open
title: Expand traceback module API to accept just an exception as an argument
versions: Python 3.6

___
Python tracker 

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



[issue26367] importlib.__import__ does not fail for invalid relative import

2016-02-18 Thread Brett Cannon

Brett Cannon added the comment:

The corresponding code in C that actually does the check: 
https://hg.python.org/cpython/file/default/Python/import.c#l1498

Manuel, can you sign the CLA at 
https://www.python.org/psf/contrib/contrib-form/ ? Once you sign it I can 
officially review your patch, otherwise I technically can't touch your code.

--
stage:  -> patch review

___
Python tracker 

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



[issue26388] Disabling changing sys.argv[0] with runpy.run_module(...alter_sys=True)

2016-02-18 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue26388] Disabling changing sys.argv[0] with runpy.run_module(...alter_sys=True)

2016-02-18 Thread Mike Kaplinskiy

New submission from Mike Kaplinskiy:

For the purposes of pex (https://github.com/pantsbuild/pex), it would be useful 
to allow calling run_module without sys.argv[0] changing. In general, this 
behavior is useful if the script intends to re-exec itself (so it needs to know 
the original arguments that it was started with).

To make run_module more useful in general, I propose adding a `argv` parameter 
that has the following semantics:
 - (default) If set to a special value runpy.INHERIT (similar to 
subprocess.STDOUT), produces the current behavior of just changing sys.argv[0].
 - If set to None, does not touch sys.argv at all.
 - If set to an iterable, executes `sys.argv = [module.__file__] + list(argv)`, 
and properly reverts it once the module is done executing.

--
components: Library (Lib)
messages: 260483
nosy: Mike Kaplinskiy
priority: normal
severity: normal
status: open
title: Disabling changing sys.argv[0] with runpy.run_module(...alter_sys=True)
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue26380] Add an http method enum

2016-02-18 Thread Martin Panter

Martin Panter added the comment:

I can see the advantage of using an enum over a plain string. But you only get 
an error at run time, not compile time, if you misspell it. And there is also 
the disadvantage of the extra boilerplate of importing HTTPMessage. So I don’t 
have a strong opinion either way. Do other libraries have a similar enum?

BTW I think it is actually OPTIONS; see review comment.

--
nosy: +martin.panter
stage:  -> patch review
type:  -> enhancement

___
Python tracker 

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



[issue26379] zlib decompress as_bytearray flag

2016-02-18 Thread Joe Jevnik

Joe Jevnik added the comment:

The recipe you showed looks like it is very complicated for the expected use 
case of decompressing all of the data into a mutable buffer. One difference I 
see with this and struct.pack_into or socket.recv_into is that in both of those 
cases we know how large our buffer needs to be. With zlib.decompress there is 
not a simple way for users to preallocate a buffer to hold the result and need 
to resort to some looping with a lot of resizes. I think that returning either 
a mutable or immutable buffer hits 95% of use cases. If we go with the 
decompress_into method I would strongly advise putting decompress_as_bytearray 
into the standard library so that users do not need write this themselves.

Thank you for pointing me at the bz2 and LZMA modules. When we come to an 
agreement on the API I will update bz2 and LZMA so that they match. Should I 
also update the gzip module?

--

___
Python tracker 

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



[issue26380] Add an http method enum

2016-02-18 Thread Demian Brecht

Demian Brecht added the comment:

> I don't have a firm opinion at this point -- can you give a few examples of 
> how this will help in code?

It'll help solely with consistency across projects. Generally, using constants 
are generally favored over using hardcoded values. Mainly, it helps reduce 
typos. Some projects use literals, others use project-specific constants. It's 
something that I've found myself redefining over various projects, and I just 
though "why couldn't this be added to the standard library, given it's an 
attribute of the HTTP/1.1 RFC"?

/Very/ minor, personal annoyance.

The updated patch fixes the OPTION typo.

--
Added file: http://bugs.python.org/file41960/issue26380_1.diff

___
Python tracker 

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



[issue26374] concurrent_futures Executor.map semantics better specified in docs

2016-02-18 Thread Mark Dickinson

Mark Dickinson added the comment:

Note also this code snippet from PEP 3148:

for number, prime in zip(PRIMES, executor.map(is_prime,
  PRIMES)):

The use of zip here suggests strongly that the intention is that the order of 
the `map` result is well-defined.

It's possible that the docs should be updated to make the ordering requirement 
clearer.

--

___
Python tracker 

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



[issue26374] concurrent_futures Executor.map semantics better specified in docs

2016-02-18 Thread Mark Dickinson

Mark Dickinson added the comment:

The documentation says: "Equivalent to map(func, *iterables)". I believe that 
that equivalency implies that the ordering *is* defined, so it would be 
incorrect to add "order of results is undefined" to the documentation.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue26370] shelve filename inconsistent between platforms

2016-02-18 Thread SilentGhost

SilentGhost added the comment:

Would you like to try to submit a patch for a solution you think most 
appropriate?

--
nosy: +SilentGhost, georg.brandl
type: behavior -> enhancement
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue26374] concurrent_futures Executor.map semantics better specified in docs

2016-02-18 Thread SilentGhost

Changes by SilentGhost :


--
components: +Library (Lib)
nosy: +bquinlan

___
Python tracker 

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



[issue26381] Add 'geo' URI scheme (RFC 5870) to urllib.parse.uses_params

2016-02-18 Thread SilentGhost

New submission from SilentGhost:

Here is the spec: https://tools.ietf.org/html/rfc5870#section-3.3

--
nosy: +SilentGhost, orsenthil

___
Python tracker 

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



[issue26385] the call of tempfile.NamedTemporaryFile fails and leaves a file on the disk

2016-02-18 Thread SilentGhost

SilentGhost added the comment:

Here is a naïve fix including a test.

--
keywords: +patch
nosy: +SilentGhost, georg.brandl
stage:  -> patch review
versions: +Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41959/issue26385.diff

___
Python tracker 

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



[issue26386] tkinter - Treeview - .selection_add and selection_toggle

2016-02-18 Thread Anish Shah

Changes by Anish Shah :


--
nosy: +anish.shah

___
Python tracker 

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



[issue26149] Suggest PyCharm Community as an editor for Unix platforms

2016-02-18 Thread Anish Shah

Changes by Anish Shah :


--
nosy: +anish.shah

___
Python tracker 

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



[issue18454] distutils crashes when uploading to PyPI having only the username (no pw) defined

2016-02-18 Thread Jason R. Coombs

Jason R. Coombs added the comment:

I've recently taken a different tack to this issue with setuptools 20.1, which 
will resolve the password from a keyring if available.

--

___
Python tracker 

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



[issue26387] Race condition in sqlite module

2016-02-18 Thread SilentGhost

Changes by SilentGhost :


--
components: +Extension Modules
nosy: +ghaering
versions:  -Python 3.2, Python 3.3

___
Python tracker 

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



[issue26387] Race condition in sqlite module

2016-02-18 Thread Filipp Andjelo

New submission from Filipp Andjelo:

Race condition in sqlite close/dealloc crashes the application with double 
free(). The pointer is set to NULL outside of mutexed zone, so if close and 
dealloc follow each other very shortly application crashes. Please see the 
attached patch.

--
components: Library (Lib)
files: sqlite_connection.c.patch
keywords: patch
messages: 260472
nosy: scorp
priority: normal
severity: normal
status: open
title: Race condition in sqlite module
type: crash
versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41958/sqlite_connection.c.patch

___
Python tracker 

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



[issue26360] Deadlock in thread.join on Python 2.7/Mac OS X 10.9

2016-02-18 Thread Mark Dickinson

Mark Dickinson added the comment:

A minor update: I did manage to verify that the GIL is indeed not held by any 
threads at the moment of the hang, so it does look very much as though a 
`pthread_cond_signal` signal has gone astray somehow.

--

___
Python tracker 

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



[issue19251] bitwise ops for bytes of equal length

2016-02-18 Thread Марк Коренберг

Марк Коренберг added the comment:

in order to increase perofrmance even more, use block operation on bytes. I.e. 
Xor by 8 bytes first (on 64-bit system) while size remainig is bigger or equal 
to 8, then by 4 bytes using same loop, and then xor remaining bytes by one 
byte. This will increase performance roughly to 8 times on 64bit systems and by 
4 times on 32bit systems.

See my PR https://github.com/KeepSafe/aiohttp/pull/687/files for details

--

___
Python tracker 

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



[issue26386] tkinter - Treeview - .selection_add and selection_toggle

2016-02-18 Thread George

New submission from George:

Id's with spaces in them causes a crash when using the .selection* methods 
Treeview.  Version of ttk.py "0.3.1" dated 12/6/2015.  Traceback line numbers 
are 1415 then 1395  

Either of these lines of code, where the item id is "2009 Report.pdf" crash
   allParents = oTree.get_children()
   for id in allParents:
 oTree.selection_add(id)
 #  oTree.selection_toggle(id)

These two lines of workaround code do work however.
   oTree.selection_add('"' + id + '"')
   #  oTree.selection_toggle('"' + id + '"')

Note that so far all other places in dealing with the item id's have no issue 
when there are spaces in them.

--
components: Tkinter
messages: 260469
nosy: gbarnabic
priority: normal
severity: normal
status: open
title: tkinter - Treeview - .selection_add and selection_toggle
type: crash
versions: Python 3.5

___
Python tracker 

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



[issue26366] Use “.. versionadded” over “.. versionchanged” where appropriate

2016-02-18 Thread Tony R.

Tony R. added the comment:

> My weak opinion is that a new parameter is a new API item, not just a change 
> in behaviour, so should probably have “versionadded”. 

This was my reasoning as well.  

Also, when I noticed so many instances of ``.. versionchanged`` that all say 
“Added the *x* parameter” (or whatever), it strikes me that these are a *large 
class of changes*, which all have some kind of addition in common.  If you 
think about it, deprecations and removals are also changes, but they are a 
large-enough class of changes to merit a distinct markup directive.  

So, just as this is true for “deprecated” or “deprecated-removed”, I believe it 
is just as true for “added”.  Once all additions, deprecations, and removals 
have been marked up as such, I think find that there’s still PLENTY of 
annotations that remain under ``.. versionchanged``.  

Put another way: 

Since these are all different types of changes, it is most useful to the reader 
if the most specific *type* of change is reflected in the markup.

--

___
Python tracker 

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



[issue26382] List object memory allocator

2016-02-18 Thread STINNER Victor

STINNER Victor added the comment:

Instead of modifying individual files, I proposed to modify PyMem_Malloc to use 
PyObject_Malloc allocator: issue #26249.

But the patch for Python 2 still makes sense.

--
nosy: +haypo

___
Python tracker 

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



[issue26385] the call of tempfile.NamedTemporaryFile fails and leaves a file on the disk

2016-02-18 Thread Eugene Viktorov

New submission from Eugene Viktorov:

When calling the tempfile.NamedTemporaryFile with mode='wr' or with any other 
wrong value for "mode", it raises the ValueError and silently leaves an 
unknown, just created file on the file system.

--
components: Library (Lib)
files: temp_file.py
messages: 260466
nosy: Eugene Viktorov
priority: normal
severity: normal
status: open
title: the call of tempfile.NamedTemporaryFile fails and leaves a file on the 
disk
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file41957/temp_file.py

___
Python tracker 

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



[issue26380] Add an http method enum

2016-02-18 Thread Ethan Furman

Ethan Furman added the comment:

I don't have a firm opinion at this point -- can you give a few examples of how 
this will help in code?

--
nosy: +ethan.furman

___
Python tracker 

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



[issue25532] infinite loop when running inspect.unwrap over unittest.mock.call

2016-02-18 Thread Berker Peksag

Changes by Berker Peksag :


--
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

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



[issue26384] UnboundLocalError in socket._sendfile_use_sendfile

2016-02-18 Thread Berker Peksag

New submission from Berker Peksag:

I noticed this while working on issue 16915:

Traceback (most recent call last):
  ...
  File "/home/berker/projects/cpython/default/Lib/socket.py", line 262, in 
_sendfile_use_sendfile
raise _GiveupOnSendfile(err)  # not a regular file
UnboundLocalError: local variable 'err' referenced before assignment

Here's a patch.

--
components: Library (Lib)
files: socket_unboundlocalerror.diff
keywords: patch
messages: 260464
nosy: berker.peksag
priority: normal
severity: normal
stage: patch review
status: open
title: UnboundLocalError in socket._sendfile_use_sendfile
type: behavior
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41956/socket_unboundlocalerror.diff

___
Python tracker 

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



[issue16915] mode of socket.makefile is more limited than documentation suggests

2016-02-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a7391c31ec4e by Berker Peksag in branch '3.5':
Issue #16915: Clarify that mode parameter of socket.makefile() does not accept
https://hg.python.org/cpython/rev/a7391c31ec4e

New changeset bbfbde6ee9d0 by Berker Peksag in branch 'default':
Issue #16915: Clarify that mode parameter of socket.makefile() does not accept
https://hg.python.org/cpython/rev/bbfbde6ee9d0

--
nosy: +python-dev

___
Python tracker 

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



[issue16915] mode of socket.makefile is more limited than documentation suggests

2016-02-18 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the report and for the patch. I would prefer to keep the code simple 
so I just applied documentation changes with a minor tweak.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +berker.peksag, docs@python
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 3.5, Python 3.6 -Python 3.4

___
Python tracker 

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



[issue26367] importlib.__import__ does not fail for invalid relative import

2016-02-18 Thread Manuel Jacob

Manuel Jacob added the comment:

(For some reason, I forgot to submit the previous comment).

The attached patches fix the issue (one for the 3.5 branch, one for the default 
branch) by bringing importlib.__import__ closer to the builtin __import__.

The extra code in the default / 3.6 branch is because of the changes from 
issue18018.

--

___
Python tracker 

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



[issue26383] benchmarks (perf.py): number of decimal places in csv output

2016-02-18 Thread STINNER Victor

Changes by STINNER Victor :


--
title: number of decimal places in csv output -> benchmarks (perf.py): number 
of decimal places in csv output

___
Python tracker 

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



[issue26383] number of decimal places in csv output

2016-02-18 Thread Florin Papa

New submission from Florin Papa:

Hi,

This is Florin Papa from the Dynamic Scripting Languages Optimizations Team at 
Intel Corporation.

This patch checks whether the benchmark measurement that will be included in 
the csv output has more than 3 of the first decimal places equal to 0 and 
outputs more decimal places.

The problem is that each measurement in the csv output has only 6 decimal 
places (default for "%f" format), while some benchmarks, like unpack_sequence, 
will output values of the magnitude 0.xx (first four decimal places 0). 
This truncation of the original value can lead to incorrect results.

--
components: Benchmarks
files: decimal_csv_output.csv
messages: 260460
nosy: brett.cannon, florin.papa, pitrou
priority: normal
severity: normal
status: open
title: number of decimal places in csv output
type: behavior
versions: Python 2.7, Python 3.6
Added file: http://bugs.python.org/file41955/decimal_csv_output.csv

___
Python tracker 

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



[issue25532] infinite loop when running inspect.unwrap over unittest.mock.call

2016-02-18 Thread Florian Bruhin

Florian Bruhin added the comment:

FWIW, this also affects pytest users: 
https://github.com/pytest-dev/pytest/issues/1217

--
nosy: +The Compiler

___
Python tracker 

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



[issue26382] List object memory allocator

2016-02-18 Thread Catalin Gabriel Manciu

Changes by Catalin Gabriel Manciu :


Added file: http://bugs.python.org/file41954/listobject_CPython2.patch

___
Python tracker 

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



[issue26382] List object memory allocator

2016-02-18 Thread Catalin Gabriel Manciu

New submission from Catalin Gabriel Manciu:

Hi All,

This is Catalin from the Server Scripting Languages Optimization Team at Intel 
Corporation. I would like to submit a patch that replaces the 'malloc' 
allocator used by the list object (Objects/listobject.c) with the small object 
allocator (obmalloc.c) and simplifies the 'list_resize' function by removing a 
redundant check and properly handling resizing to zero.

Replacing PyMem_* calls with PyObject_* inside the list implementation is 
beneficial because many PyMem_* calls are made for requesting sizes that are 
better handled by the small object allocator. For example, when running 
Tools/pybench.py -w 1 a total of 48.295.840 allocation requests are made by the 
list implementation (either by using 'PyMem_MALLOC' directly or by calling 
'PyMem_RESIZE') out of which 42.581.993 (88%) are requesting sizes that can be 
handled by the small object allocator (they're equal or less than 512 bytes in 
size).

The changes to 'list_resize' were made in order to further improve performance 
by removing a redundant check and handling the 'resize to zero' case 
separately. The 'empty' state of a list is suggested by the 'PyList_New' 
function as having the 'ob_item' pointer NULL and the 'ob_size' and 'allocated' 
members equal with 0. Previously, when being called with zero as a size 
parameter, 'list_resize' would set 'ob_size' and 'allocated' to zero, but it 
would also call 'PyMem_RESIZE' which, by its design, would call 'realloc' with 
a size of 1, thus going through the process of allocating an unnecessary 1 byte 
and setting the 'ob_item' pointer with the newly obtained address. The proposed 
implementation just deletes the buffer pointed by 'ob_item' and sets 'ob_size', 
'allocated' and 'ob_item' to zero when receiving a 'resize to zero' request.


Hardware and OS Configuration
=
Hardware:   Intel XEON (Haswell-EP) 36 Cores / Intel XEON 
(Broadwell-EP) 36 Cores

BIOS settings:  Intel Turbo Boost Technology: false
Hyper-Threading: false  

OS: Ubuntu 14.04.2 LTS

OS configuration:   Address Space Layout Randomization (ASLR) disabled to 
reduce run
to run variation by echo 0 > 
/proc/sys/kernel/randomize_va_space
CPU frequency set fixed at 2.3GHz

GCC version:GCC version 5.1.0

Benchmark:  Grand Unified Python Benchmark from 
https://hg.python.org/benchmarks/

Measurements and Results

A. Repository:
GUPB Benchmark:
hg id :  9923b81a1d34 tip
hg --debug id -i : 9923b81a1d346891f179f57f8780f86dcf5cf3b9

CPython3:
hg id : 733a902ac816 tip
hg id -r 'ancestors(.) and tag()': 737efcadf5a6 (3.4) v3.4.4
hg --debug id -i : 733a902ac816bd5b7b4867ae1939844ba2c5

CPython2:
hg id : 5715a6d9ff12 (2.7)
hg id -r 'ancestors(.) and tag()': 6d1b6a68f775 (2.7) v2.7.11
hg --debug id -i : 5715a6d9ff12053e81f7ad75268ac059b079b351

B. Results:
CPython2 and CPython3 sample results, measured on a Haswell and a Broadwell 
platform can be viewed in Tables 1, 2, 3 and 4. The first column (Benchmark) is 
the benchmark name and the second (%D) is the speedup in percents compared with 
the unpatched version.

Table 1. CPython 3 results on Intel XEON (Haswell-EP) @ 2.3 GHz

Benchmark   %D
--
unpickle_list   20.27
regex_effbot6.07
fannkuch5.87
mako_v2 5.19
meteor_contest  4.31
simple_logging  3.98
nqueens 3.40
json_dump_v23.14
fastpickle  2.16
django_v3   2.03
tornado_http1.90
pathlib 1.84
fastunpickle1.81
call_simple 1.75
nbody   1.60
etree_process   1.58
go  1.54
call_method_unknown 1.53
2to31.26
telco   1.04
etree_generate  1.02
json_load   0.85
etree_parse 0.81
call_method_slots   0.73
etree_iterparse 0.68
call_method 0.65
normal_startup  0.63
silent_logging  0.56
chameleon_v20.56
pickle_list 0.52
regex_compile   0.50
hexiom2 0.47
pidigits0.39
startup_nosite  0.17
pickle_dict 0.00
unpack_sequence 0.00
formatted_logging  -0.06
raytrace   -0.06
float  -0.18
richards   -0.37
spectral_norm  -0.51
chaos  -0.65
regex_v8   -0.72


Table 2. CPython 3 results on Intel XEON (Broadwell-EP) @ 2.3 GHz

Benchmark 

[issue1731717] race condition in subprocess module

2016-02-18 Thread Krishna Oza

Krishna Oza added the comment:

Hi, Could anyone help here to identify in which Python release the bug is 
fixed. I am unable to deduce from the bug tracker interface in which release 
this issue is fixed.

Regards.

--
nosy: +Krishna Oza

___
Python tracker 

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



[issue26323] Add assert_called() and assert_called_once() methods for mock objects

2016-02-18 Thread Amit Saha

Changes by Amit Saha :


--
title: Add a assert_called() method for mock objects -> Add assert_called() and 
assert_called_once() methods for mock objects

___
Python tracker 

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



[issue26323] Add a assert_called() method for mock objects

2016-02-18 Thread Amit Saha

Amit Saha added the comment:

Updated patch

--
Added file: http://bugs.python.org/file41952/issue26323.patch

___
Python tracker 

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



[issue26323] Add a assert_called() method for mock objects

2016-02-18 Thread Amit Saha

Amit Saha added the comment:

Thanks for the review. Updated patch addressing the comments.

--

___
Python tracker 

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



[issue26381] Add 'geo' URI scheme (RFC 5870) to urllib.parse.uses_params

2016-02-18 Thread Serhiy Int

Changes by Serhiy Int :


--
components: Library (Lib)
nosy: Serhiy Int
priority: normal
severity: normal
status: open
title: Add 'geo' URI scheme (RFC 5870) to urllib.parse.uses_params
versions: Python 3.6

___
Python tracker 

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



[issue26309] socketserver.BaseServer._handle_request_noblock() doesn't shutdown request if verify_request is False

2016-02-18 Thread Martin Panter

Martin Panter added the comment:

For the Python 2 version I had to make some small changes to the test. I used 
indirection instead of “nonlocal”, and replaced the super() call because the 
classes are apparently the wrong kind for super().

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue26323] Add a assert_called() method for mock objects

2016-02-18 Thread STINNER Victor

STINNER Victor added the comment:

I reviewed your patch.

--

___
Python tracker 

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



[issue26309] socketserver.BaseServer._handle_request_noblock() doesn't shutdown request if verify_request is False

2016-02-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 651a6d47bc78 by Martin Panter in branch '3.5':
Issue #26309: Shut down socketserver request if verify_request() is false
https://hg.python.org/cpython/rev/651a6d47bc78

New changeset 0768edf5878d by Martin Panter in branch 'default':
Issue #26309: Merge socketserver fix from 3.5
https://hg.python.org/cpython/rev/0768edf5878d

New changeset e0fbd25f0b36 by Martin Panter in branch '2.7':
Issue #26309: Shut down SocketServer request if verify_request() is false
https://hg.python.org/cpython/rev/e0fbd25f0b36

--
nosy: +python-dev

___
Python tracker 

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-18 Thread Martin Panter

Martin Panter added the comment:

Did you see my class attributes suggestion a couple messages back? That might 
solve your dispatch problem:

def _parse_isodatetime(cls, string):
match = cls._iso_regex.match(...)

class time:
_iso_regex = re.compile(...)

# or

time._iso_regex = re.compile(...)
date._iso_regex = ...

For the C module, start looking at /Modules/datetimemodule.c. Maybe if you can 
think of a similar function implemented in C to copy off. It looks like 
strptime() defers to a Python-only implementation; maybe that is another option.

--
stage:  -> patch review

___
Python tracker 

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



[issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth)

2016-02-18 Thread Martin Panter

Martin Panter added the comment:

I do wonder if NotImplementedError is the right exception. According to the 
documentation it is derived from RuntimeError and is meant for abstract 
methods, i.e. it is a programmer error. Other cases in urllib.request raise 
ValueError (e.g. AbstractBasicAuthHandler), which is fairly normal for protocol 
errors like this.

Also it would be nice to add a test case for the bug fix.

--
nosy: +martin.panter
stage: needs patch -> patch review
versions: +Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

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



[issue26379] zlib decompress as_bytearray flag

2016-02-18 Thread Martin Panter

Martin Panter added the comment:

This is an unusual technique. I can’t think of any other standard library 
routine that returns a new bytearray instead of a bytes object.

Normally there are sister functions with an -into() suffix that accept a 
pre-allocated buffer. Examples are BufferedIOBase.readinto(), 
struct.pack_into(), socket.recv_into(). What do you think about adding a 
decompressobj.decompress_into(input, output) method instead? If necessary you 
could use it in a wrapper, something like:

def decompress_as_bytearray(data, wbits=15, bufsize=16384):
decompressor = zlib.decompressobj(wbits=wbits)
buffer = bytearray(bufsize + 1)  # Overallocate to help detect EOF
offset = 0
while True:
with memoryview(buffer) as view:
offset += decompressor.decompress_into(data, view[offset:])
if offset < len(buffer):
break
data = decompressor.unconsumed_tail
buffer *= 2  # Expand the buffer
del buffer[offset:]
if not decompressor.eof:
raise zlib.error("Incomplete data")
return buffer

If anything is added for zlib decompression, it would be good to add equivalent 
functionality in the bz2 and LZMA modules.

--
nosy: +martin.panter

___
Python tracker 

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



[issue26360] Deadlock in thread.join on Python 2.7/Mac OS X 10.9

2016-02-18 Thread Mark Dickinson

Mark Dickinson added the comment:

Thanks, Ned. I tried with:

   ./configure --with-pydebug MACOSX_DEPLOYMENT_TARGET=10.9 && make

I'm still able to reproduce. I plan to find some time this weekend to dig into 
the source and see if I can narrow down the cause (or at least make the hang 
easier / quicker to reproduce).

--

___
Python tracker 

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-18 Thread SilentGhost

SilentGhost added the comment:

Probably only other solution that I see is to add the third argument, an actual 
class, e.g.:

_parse_isodatetime(cls, string, datetime)

--

___
Python tracker 

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



[issue26049] Poor performance when reading large xmlrpc data

2016-02-18 Thread Cédric Krier

Cédric Krier added the comment:

ping

--

___
Python tracker 

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



[issue26302] cookies module allows commas in keys

2016-02-18 Thread Jason R. Coombs

Jason R. Coombs added the comment:

Looks good to me.

--

___
Python tracker 

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-18 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

crap, here is the attachment.
Yeah, but I really would like to use regex in the C version (unless you 
strongly disadvise), so we will have the same logic and the same problem. And I 
never made a patch for the C interpreter itself, so the C equivalent is not 
close to be here soon. (btw if you have a starting point to recommend)

I definitely do not like this fix, it destroys the elegance and the simplicity 
of the "single-dispatch" solution. And it introduce a lot of noisy code for a 
very rare case, people subclassing datetime.* classes.

Maybe making the regex dictionary having string keys instead of class and 
passing the correct string from the calling function, like:

def fromisoformat(string):
_parse_isodatetime('time', string)

or maybe functools.singledispatch handle this case ?

--
Added file: http://bugs.python.org/file41951/fromisoformat_singledispatch.patch

___
Python tracker 

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-18 Thread SilentGhost

SilentGhost added the comment:

Mathieu, nothing was attached. The penalty's worth only a few if statements, I 
wouldn't worry too much about it. Besides, a C version is going to be provided 
as well, right?

Perhaps the following approach might solve the subclasses problem:

regex = dispatch.get(cls)
if not regex:
classes = datetime, date, time
cls = next((c for c in classes if issubclass(cls, c)), None)
if cls is None:   
raise TypeError
regex = dispatch[cls]

Perhaps, TypeError is unnecessary there and just propagating StopIteration 
would do. In that case the if clause would look like:

classes = datetime, date, time
cls = next(c for c in classes if issubclass(cls, c))
regex = dispatch[cls]

--

___
Python tracker 

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-18 Thread Aymeric Augustin

Aymeric Augustin added the comment:

martin.panter: of course, I'm fine with integrating that code into Python.

deronnax: could you create a ticket on https://code.djangoproject.com/ 
highlighting the differences between Django's original implementation and the 
improved version that you worked on?

I'd like to use the stdlib implementation when it's available and align 
Django's current implementation to whatever's getting into the stdlib (to 
prepare the transition, even though we aren't going to drop support for Python 
3.5 soon).

--

___
Python tracker 

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



[issue26378] Typo in regex documentation

2016-02-18 Thread Georg Brandl

Georg Brandl added the comment:

Thanks for the report!

--
nosy: +georg.brandl

___
Python tracker 

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



[issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth)

2016-02-18 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

python 2.7

--
Added file: http://bugs.python.org/file41949/md5-sess_not_implem_27_v2.diff

___
Python tracker 

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



[issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth)

2016-02-18 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

python current

--
Added file: http://bugs.python.org/file41950/md5-sess_not_implem_cur_v2.diff

___
Python tracker 

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