[issue26789] Please do not log during shutdown

2017-02-21 Thread Vinay Sajip

Vinay Sajip added the comment:

> sys.is_finalizing()

Good to know. Is the "sys" binding guaranteed to be around even when other 
builtins like "open" aren't available? In order to handle things "nicely" 
during shutdown, what guarantees can logging code rely on in terms of what's 
available? I'm assuming handling things nicely doesn't mean just swallowing any 
exceptions raised.

--

___
Python tracker 

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



[issue22273] abort when passing certain structs by value using ctypes

2017-02-21 Thread Vinay Sajip

Changes by Vinay Sajip :


--
stage: needs patch -> patch review

___
Python tracker 

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



[issue28624] Make the `cwd` argument to `subprocess.Popen` accept a `PathLike`

2017-02-21 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +xiang.zhang

___
Python tracker 

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



[issue22273] abort when passing certain structs by value using ctypes

2017-02-21 Thread Vinay Sajip

Vinay Sajip added the comment:

Patch attached, including tests. If it looks halfway sensible, I can work up a 
PR.

--
Added file: http://bugs.python.org/file46660/fix-22273-02.diff

___
Python tracker 

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



[issue29110] [patch] Fix file object leak in `aifc.open` when given invalid AIFF file.

2017-02-21 Thread INADA Naoki

INADA Naoki added the comment:


New changeset 03f68b60e17b57f6f13729ff73245dbb37b30a4c by INADA Naoki in branch 
'master':
bpo-29110: Fix file object leak in `aifc.open` when given invalid AIFF file. 
(GH-162)
https://github.com/python/cpython/commit/03f68b60e17b57f6f13729ff73245dbb37b30a4c


--
nosy: +inada.naoki

___
Python tracker 

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



[issue29589] test_asyncio & test_multiprocessing_forkserver failed

2017-02-21 Thread Xiang Zhang

Xiang Zhang added the comment:

Hmm, it seems not Python's fault. I can't reproduce the failure either. So I am 
going to close this issue.

--
resolution:  -> works for me
stage: test needed -> 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



[issue29589] test_asyncio & test_multiprocessing_forkserver failed

2017-02-21 Thread Louie Lu

Louie Lu added the comment:

Both test_asyncio & test_multiprocessing_forkserver passed on latest 3.6 and 
4.8.3-1-ARCH.

--
nosy: +louielu

___
Python tracker 

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



[issue29565] Still broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2017-02-21 Thread Vinay Sajip

Vinay Sajip added the comment:


New changeset 3cc5817cfaf5663645f4ee447eaed603d2ad290a by GitHub in branch 
'3.6':
Fixed bpo-29565: Corrected ctypes passing of large structs by value on Windows 
AMD64. (#168) (#220)
https://github.com/python/cpython/commit/3cc5817cfaf5663645f4ee447eaed603d2ad290a


--

___
Python tracker 

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



[issue29565] Still broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2017-02-21 Thread Vinay Sajip

Vinay Sajip added the comment:


New changeset 8fa7e22134ac9626b2188ff877f6aeecd3c9e618 by GitHub in branch 
'3.5':
Fixed bpo-29565: Corrected ctypes passing of large structs by value on Windows 
AMD64. (#168) (#221)
https://github.com/python/cpython/commit/8fa7e22134ac9626b2188ff877f6aeecd3c9e618


--

___
Python tracker 

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



[issue29589] test_asyncio & test_multiprocessing_forkserver failed

2017-02-21 Thread Marcel Widjaja

Marcel Widjaja added the comment:

Both test_asyncio & test_multiprocessing_forkserver work for me. I'm on the 
latest 3.6 and Mac OS 10.11.6

--
nosy: +mawidjaj

___
Python tracker 

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



[issue29617] Drop Python 3.4 support from asyncio

2017-02-21 Thread INADA Naoki

Changes by INADA Naoki :


--
pull_requests: +195

___
Python tracker 

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



[issue28814] Deprecation notice on inspect.getargvalues() is incorrect

2017-02-21 Thread Berker Peksag

Berker Peksag added the comment:


New changeset 0899b9809547ec2894dcf88cf4bba732c5d47d0d by Berker Peksag in 
branch 'master':
bpo-28814: Undeprecate inadvertently deprecated inspect functions. (#122)
https://github.com/python/cpython/commit/0899b9809547ec2894dcf88cf4bba732c5d47d0d


--

___
Python tracker 

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



[issue20438] inspect: Deprecate getfullargspec?

2017-02-21 Thread Berker Peksag

Berker Peksag added the comment:


New changeset 0899b9809547ec2894dcf88cf4bba732c5d47d0d by Berker Peksag in 
branch 'master':
bpo-28814: Undeprecate inadvertently deprecated inspect functions. (#122)
https://github.com/python/cpython/commit/0899b9809547ec2894dcf88cf4bba732c5d47d0d


--

___
Python tracker 

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



[issue29617] Drop Python 3.4 support from asyncio

2017-02-21 Thread INADA Naoki

New submission from INADA Naoki:

asyncio for Python 3.3 has not been released for two years.
https://pypi.python.org/pypi/asyncio

We have many code in asyncio for support Python 3.3.
How about removing them?

--
components: asyncio
messages: 288332
nosy: gvanrossum, inada.naoki, yselivanov
priority: normal
severity: normal
status: open
title: Drop Python 3.4 support from asyncio
versions: Python 3.7

___
Python tracker 

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



[issue7769] SimpleXMLRPCServer.SimpleXMLRPCServer.register_function as decorator

2017-02-21 Thread Xiang Zhang

Changes by Xiang Zhang :


--
pull_requests: +194

___
Python tracker 

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



[issue10701] Error pickling objects with mutating __getstate__

2017-02-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> not a bug
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



[issue29616] input() after restarting causes bug

2017-02-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
status: open -> pending

___
Python tracker 

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



[issue29614] Additional implementation alternative to DictReader

2017-02-21 Thread INADA Naoki

INADA Naoki added the comment:

I don't feel TableReader is really useful.

Would you show some realistic example when TableReader is better than
normal csv.Reader?

--
nosy: +inada.naoki

___
Python tracker 

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



[issue29616] input() after restarting causes bug

2017-02-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I am not sure what you mean by 'this bug'.  I presume by 'take input' you mean 
'display keystrokes on the input line'.  If so, the behavior you describe for 
3.6 is the correct behavior and not a bug: accept kestrokes until 'Enter' is 
pressed or until the process awaiting input is killed.  F5 kills the current 
user code execution process, as opposed to the IDLE GUI interaction process, 
and starts a new one.  That is what 'Restart' means.

Experimenting with IDLE on 3.5 and 3.6 on Windows 10, I experienced the 
(correct) behavior described above.  It does not make any difference whether 
there was any unsent input before hitting F5 or not.  I did not notice any 
difference between the two versions.  In both, hitting 'Enter' terminates input.

Unless you can provide more details that convince me otherwise, I will close 
this as 'not a bug'.

--

___
Python tracker 

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



[issue29403] mock's autospec's behavior on method-bound builtin functions is broken

2017-02-21 Thread Aaron Gallagher

Changes by Aaron Gallagher :


--
pull_requests: +193

___
Python tracker 

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



[issue26789] Please do not log during shutdown

2017-02-21 Thread INADA Naoki

INADA Naoki added the comment:

I'm -1 on suppress log silently.
While error message is bit surprising,

Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 93, in __del__
  File "/usr/lib/python3.5/asyncio/base_events.py", line 1160, in 
call_exception_handler
...
  File "/usr/lib/python3.5/logging/__init__.py", line 1037, in _open
NameError: name 'open' is not defined

This traceback is very meaningful.
You can read tasks.py:93, and find there are pending task remains.

Implementing fallback mechanism make potential risk to miss such very
important traceback.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue27660] Replace size_t with Py_ssize_t as the type of local variable in list_resize

2017-02-21 Thread Xiang Zhang

Xiang Zhang added the comment:


New changeset 4cee049f5b6864066b8315e9b54de955e5487dfc by GitHub in branch 
'master':
bpo-27660: remove unnecessary overflow checks in list_resize (GH-189)
https://github.com/python/cpython/commit/4cee049f5b6864066b8315e9b54de955e5487dfc


--

___
Python tracker 

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



[issue27660] Replace size_t with Py_ssize_t as the type of local variable in list_resize

2017-02-21 Thread Xiang Zhang

Changes by Xiang Zhang :


--
resolution:  -> fixed
stage: commit 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



[issue22087] asyncio: support multiprocessing (support fork)

2017-02-21 Thread Alexander Mohr

Alexander Mohr added the comment:

I believe this is now worse due to https://github.com/python/asyncio/pull/452

before I was able to simply create a new run loop from sub-processes however 
you will now get the error "Cannot run the event loop while another loop is 
running".  The state of the run loop should not be preserved in sub-processes 
either.

--
nosy: +thehesiod
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



[issue16011] "in" should be consistent with return value of __contains__

2017-02-21 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag
stage: needs patch -> patch review
versions: +Python 3.5, Python 3.6, Python 3.7 -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



[issue29554] profile/pstat doc clariification

2017-02-21 Thread Berker Peksag

Berker Peksag added the comment:


New changeset b067a5eef7fdf69264d3578654996fc3755df4ea by GitHub in branch 
'3.6':
bpo-29554: Improve docs for pstat module and profile. (#88) (#227)
https://github.com/python/cpython/commit/b067a5eef7fdf69264d3578654996fc3755df4ea


--

___
Python tracker 

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



[issue29554] profile/pstat doc clariification

2017-02-21 Thread Berker Peksag

Changes by Berker Peksag :


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



[issue29554] profile/pstat doc clariification

2017-02-21 Thread Berker Peksag

Berker Peksag added the comment:


New changeset 6336f0d156feec0f109a8d01da108cf96e3d9c60 by GitHub in branch 
'3.5':
bpo-29554: Improve docs for pstat module and profile. (#88) (#228)
https://github.com/python/cpython/commit/6336f0d156feec0f109a8d01da108cf96e3d9c60


--

___
Python tracker 

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



[issue2771] Test issue

2017-02-21 Thread Ezio Melotti

Changes by Ezio Melotti :


--
pull_requests: +192

___
Python tracker 

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



[issue29554] profile/pstat doc clariification

2017-02-21 Thread Berker Peksag

Changes by Berker Peksag :


--
pull_requests: +191

___
Python tracker 

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



[issue29616] input() after restarting causes bug

2017-02-21 Thread Juan

New submission from Juan:

This bug can be recreated by opening a file whose content is "input()" with 
IDLE, press F5 and the shell opens as expected. Without making the input in the 
shell stop, press F5 in the script again. In Python 3.5 IDLE only take input 
until another F5 (or Ctrl+F6) in the script. In Python 3.6 IDLE only take input 
until an Enter is pressed or another F5 (or Ctrl+F6) in the script.

--
assignee: terry.reedy
components: IDLE
messages: 288324
nosy: Juan, terry.reedy
priority: normal
severity: normal
status: open
title: input() after restarting causes bug
type: behavior
versions: 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



[issue29554] profile/pstat doc clariification

2017-02-21 Thread Berker Peksag

Changes by Berker Peksag :


--
pull_requests: +190

___
Python tracker 

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



[issue26789] Please do not log during shutdown

2017-02-21 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue27850] Remove 3DES from cipher list (sweet32 CVE-2016-2183)

2017-02-21 Thread STINNER Victor

STINNER Victor added the comment:

Larry: "I agree completely Jim.  The problem is that OpenSSL regularly 
discovers face-meltingly bad security bugs, so it frequently pulls the 
"security exception" lever."

We chose to maintain our own cipher list, and so we have to maintain it.

I created a pull request to backport the fix to Python 3.4.

--
nosy: +haypo
pull_requests: +189

___
Python tracker 

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



[issue29565] Still broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2017-02-21 Thread Steve Dower

Steve Dower added the comment:

I approved the two backports. Thanks Vinay!

--

___
Python tracker 

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



[issue26789] Please do not log during shutdown

2017-02-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> How does a particular piece of logging package code know it's being called 
> during Python finalization?

sys.is_finalizing()

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26789] Please do not log during shutdown

2017-02-21 Thread R. David Murray

R. David Murray added the comment:

If I understand correctly, the logging during shutdown coming out of asyncio 
helps debug errors in asyncio programs, and this logging can't happen before 
shutdown starts (so the application calling logging.shutdown would just hide 
the errors, I think).

Yes, the general problem affects more than just logging, and when it is 
reasonable to do so we try to fix (or at least cleanly report) these shutdown 
issues in stdlib code.  Whether it is reasonable to do so in this case I don't 
know.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue29614] Additional implementation alternative to DictReader

2017-02-21 Thread foxfluff

Changes by foxfluff :


--
pull_requests: +187

___
Python tracker 

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



[issue29532] functools.partial is not compatible between 2.7 and 3.5

2017-02-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +186

___
Python tracker 

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



[issue29615] SimpleXMLRPCDispatcher._dispatch mangles tracebacks when invoking RPC calls through _dispatch

2017-02-21 Thread Petr MOTEJLEK

New submission from Petr MOTEJLEK:

Hello,

We discovered that SimpleXMLRPCDispatcher mangles tracebacks printed from 
within the invoked RPC methods when an object that has _dispatch(method, 
params) defined has been registered with it

Steps to reproduce
- use 
https://docs.python.org/3.4/library/xmlrpc.server.html#xmlrpc.server.SimpleXMLRPCServer.register_instance
 and register within SimpleXMLRPCDispatcher an object with the 
_dispatch(method, params) method defined
- invoke any RPC method that prints a traceback (perhaps raise an exception in 
it, catch it and use logging.exception to log it) --> the traceback will 
display a very strange looking KeyError (its value being the name of the 
invoked method) and then the actual exception that was fed into 
logging.exception

The reason for this is that SimpleXMLRPCDispatcher._dispatch first attempts to 
acquire the function to invoke by reading from the functions registered with 
the dispatcher. When this attempt fails, KeyError is raised. During its 
handling different approaches are taken to acquire the function and for all but 
one when the function is acquired, handling of the KeyError ends and the 
function is called properly, outside of the except block

However, in the case of objects that define the _dispatch(method, params) 
function, the _dispatch(method, params) function is called straight away, still 
within the except block handling the KeyError, and this leads to the mangled 
traceback

This behavior is neither documented, nor expected (we believe) and thus the 
code should be changed

Will submit a PR (incl. tests) for this later on

--
components: Library (Lib)
messages: 288319
nosy: p...@motejlek.net
priority: normal
severity: normal
status: open
title: SimpleXMLRPCDispatcher._dispatch mangles tracebacks when invoking RPC 
calls through _dispatch
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue29614] Additional implementation alternative to DictReader

2017-02-21 Thread Kirk Cieszkiewicz Jr.

New submission from Kirk Cieszkiewicz Jr.:

As discussed in the following:
https://bugs.python.org/issue17537
https://mail.python.org/pipermail/python-ideas/2013-January/018844.html

DictReader has a feature that will destroy data without warning if fieldnames 
had duplicate values (manual or automatic entries)

Proposing renaming and re-implementation of DictReader class to instead return 
enumerate style output with a child class of DictReader to specifically return 
a dict object.

--
components: Library (Lib)
messages: 288318
nosy: Kirk Cieszkiewicz Jr.
priority: normal
severity: normal
status: open
title: Additional implementation alternative to DictReader
type: enhancement
versions: Python 2.7, Python 3.6, Python 3.7

___
Python tracker 

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



[issue29565] Still broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2017-02-21 Thread Vinay Sajip

Changes by Vinay Sajip :


--
pull_requests: +185

___
Python tracker 

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



[issue29565] Still broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2017-02-21 Thread Vinay Sajip

Changes by Vinay Sajip :


--
pull_requests: +184

___
Python tracker 

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



[issue26789] Please do not log during shutdown

2017-02-21 Thread Vinay Sajip

Vinay Sajip added the comment:

Calling logging.shutdown() when you know you're about to exit should eliminate 
some of the issues.

--

___
Python tracker 

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



[issue26789] Please do not log during shutdown

2017-02-21 Thread Vinay Sajip

Vinay Sajip added the comment:

> The logging module should be be enhanced to handle more nicely such error 
> during Python finalization.

How does a particular piece of logging package code know it's being called 
during Python finalization? This sort of problem (exceptions caused by 
disappearing builtins, for example) isn't confined to logging, surely?

--

___
Python tracker 

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



[issue29613] Support for SameSite Cookies

2017-02-21 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
stage:  -> patch review

___
Python tracker 

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



[issue28909] Adding LTTng-UST tracing support

2017-02-21 Thread Łukasz Langa

Łukasz Langa added the comment:

Thanks for working on this! A few thoughts.

1. Keep the existing names.

"PyTrace" is already a name in use for a different purpose. I understand the 
itch to make the name more "right" but I am in general not a fan of renaming 
"PyDTrace" to anything else now. It was a placeholder from day one (SystemTap 
uses it, too, after all). So, looking closer at the patch now I'd prefer us to 
keep all existing names and add LTTng as another alternative engine here. That 
will make the patch much shorter.

A nit: the name LTTng-UST is rather unfriendly, especially when used without 
the dash and in all lowercase characters. Given that we're using "dtrace" and 
"systemtap", it would be simpler to just use "lttng" (drop the "-ust").


2. DTrace vs SystemTap vs LTTng.

It's impossible to have DTrace and SystemTap at the same time, so it was 
natural to choose to auto-detect the engine. With LTTng it becomes less obvious 
what the configure options should be.

Should it be possible at all to have *both* LTTng and SystemTap compiled in at 
the same time? Does this make sense?

If yes, then keeping --with-dtrace and --with-lttng as separate options makes 
sense to me. If it doesn't, we should change the option to look like this: 
`--with(out)-dtrace=[=detect]`. This way people could pass the following:

--without-dtrace (the default)
--with-dtrace  (detects DTrace or SystemTap or LTTng, in that order)
--with-dtrace=detect  (like the one above)
--with-dtrace=dtrace  (assumes DTrace, fails if cannot proceed)
--with-dtrace=systemtap  (assumes SystemTap, fails if cannot proceed)
--with-dtrace=lttng  (assumes LTTng, fails if cannot proceed)  


3. Other questions.

> Clang on macOS gives `warning: code will never be executed` warnings on the 
> various arms of the `if (PyTraceEnabled(...))` statements, and GCC on Linux 
> warn about unused variables `lineno`, `funcname` and `filename` in 
> `pytrace_function_{entry,return}`, since the actual use of those variables as 
> arguments is preprocessed out of existance.

Do you get unused code warnings without your patch applied? I don't.


> I would be happy to re-post this to GitHub issues if so desired.

CPython is not using GitHub issues.

--

___
Python tracker 

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



[issue29453] Remove reference to undefined dictionary ordering in Tutorial

2017-02-21 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks everyone. PR has been merged and backported to 3.6 :)
Closing this issue.

--
resolution:  -> fixed
stage: commit 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



[issue29453] Remove reference to undefined dictionary ordering in Tutorial

2017-02-21 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 9b49133082ec23b67e84d2589e66d7810018e424 by GitHub in branch 
'3.6':
bpo-29453: Remove reference to undefined dictionary ordering in Tutorial 
(GH-140) (#208)
https://github.com/python/cpython/commit/9b49133082ec23b67e84d2589e66d7810018e424


--

___
Python tracker 

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



[issue29613] Support for SameSite Cookies

2017-02-21 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
versions:  -Python 2.7, Python 3.3, Python 3.4, 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



[issue29607] Broken stack_effect for CALL_FUNCTION_EX

2017-02-21 Thread INADA Naoki

INADA Naoki added the comment:

Thanks, Matthieu.

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



[issue29607] Broken stack_effect for CALL_FUNCTION_EX

2017-02-21 Thread INADA Naoki

INADA Naoki added the comment:


New changeset 3ab24bdd47fdd9d45719ad49f93d3878d4442d7e by GitHub in branch 
'3.6':
bpo-29607: Fix stack_effect computation for CALL_FUNCTION_EX (GH-219)
https://github.com/python/cpython/commit/3ab24bdd47fdd9d45719ad49f93d3878d4442d7e


--
nosy: +inada.naoki

___
Python tracker 

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



[issue26890] inspect.getsource gets source copy on disk even when module has not been reloaded

2017-02-21 Thread Emily Morehouse

Changes by Emily Morehouse :


--
nosy: +emilyemorehouse

___
Python tracker 

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



[issue28121] If module starts with comment or empty line then frame.f_code.co_firstlineno is inconsistent with inspect.findsource

2017-02-21 Thread Emily Morehouse

Changes by Emily Morehouse :


--
nosy: +emilyemorehouse

___
Python tracker 

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



[issue29157] random.c: Prefer getrandom() over getentropy() to support glibc 2.24 on Linux

2017-02-21 Thread Vladimír Čunát

Vladimír Čunát added the comment:

Thanks, I see now.  From my point of view it is related to security, but I/we 
will deal with it somehow.

--

___
Python tracker 

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



[issue29532] functools.partial is not compatible between 2.7 and 3.5

2017-02-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset e48fd93bbb36c6d80aa4eb6af09f58c69d8cf965 by GitHub in branch 
'3.6':
bpo-29532: Altering a kwarg dictionary passed to functools.partial() no longer 
affects a partial object after creation. (#209)
https://github.com/python/cpython/commit/e48fd93bbb36c6d80aa4eb6af09f58c69d8cf965


--

___
Python tracker 

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



[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-21 Thread STINNER Victor

STINNER Victor added the comment:

Is tmpfile() available on Android?

--

___
Python tracker 

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



[issue29603] More informative Queue class: new method that returns number of unfinished tasks

2017-02-21 Thread slytomcat

slytomcat added the comment:

num_threads - unfinished() = the estimation for number of idle threads.

--

___
Python tracker 

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



[issue29603] More informative Queue class: new method that returns number of unfinished tasks

2017-02-21 Thread slytomcat

slytomcat added the comment:

One more problem that adjusting of number of threads is performed exactly after 
placing the new task in the queue. In in some cases we can find that qsuze <> 0 
but it doesn't mean that there is no idle threads. It can be equal to 1 (just 
queued task) as no threads manage to get it yet (don't forgot about GIL).

So even qsuze <> 0 dosn't mean that we need to create a new thread.

But (unfinished() <= num_threads) works perfect in this case also.

--

___
Python tracker 

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



[issue29612] TarFile.extract() suffers from hard links inside tarball

2017-02-21 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +lars.gustaebel

___
Python tracker 

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



[issue29603] More informative Queue class: new method that returns number of unfinished tasks

2017-02-21 Thread slytomcat

slytomcat added the comment:

Not exactly there are 3 cases:

If qsize <> 0 it means there is no idle consumers threads, all of them must be 
busy: we need to create one more. No doubt.

If qsize = 0 it means one of two cases: 
- all consumers threads are busy: we need to create one more
- some or all consumers threads are idle: no need create new one.

But there is no way to distinguish two last cases.

That's why I consider that (unfinished() <= num_threads) gives clear key for 
decision.

--

___
Python tracker 

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



[issue29607] Broken stack_effect for CALL_FUNCTION_EX

2017-02-21 Thread INADA Naoki

Changes by INADA Naoki :


--
pull_requests: +183

___
Python tracker 

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



[issue29598] Write unit tests for pdb module

2017-02-21 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +182

___
Python tracker 

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



[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-21 Thread Christian Heimes

Christian Heimes added the comment:

How about https://linux.die.net/man/3/tmpfile instead?

The tmpfile() function opens a unique temporary file in binary read/write (w+b) 
mode. The file will be automatically deleted when it is closed or the program 
terminates.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue29509] redundant interning in PyObject_GetAttrString

2017-02-21 Thread INADA Naoki

Changes by INADA Naoki :


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



[issue29509] redundant interning in PyObject_GetAttrString

2017-02-21 Thread INADA Naoki

INADA Naoki added the comment:


New changeset 3e8d6cb1892377394e4b11819c33fbac728ea9e0 by GitHub in branch 
'master':
bpo-29509: skip redundant intern (GH-197)
https://github.com/python/cpython/commit/3e8d6cb1892377394e4b11819c33fbac728ea9e0


--

___
Python tracker 

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



[issue26789] Please do not log during shutdown

2017-02-21 Thread STINNER Victor

STINNER Victor added the comment:

> Please do not log during shutdown

These logs are supposed to help you to find bugs in your application. Sadly, 
it's hard to log errors during Python shutdown because Pyhon is destroying its 
world: many basic functions are broken during shutdown.

We already fixed many errors, but not that one.

IMHO it's worth it to repair the logging module to be able to log during 
shutdown.

The logging module should be be enhanced to handle more nicely such error 
during Python finalization.

--

___
Python tracker 

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



[issue26970] Replace OpenSSL's CPRNG with system entropy source

2017-02-21 Thread Christian Heimes

Christian Heimes added the comment:

Let's not overcomplicate Python's ssl module any more.

I was part of an effort to provide an osrandom engine for PyCA cryptography. 
I'm going to port the engine to OpenSSL.

--
resolution:  -> wont fix
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



[issue28810] Document bytecode changes in 3.6

2017-02-21 Thread Matthieu Dartiailh

Matthieu Dartiailh added the comment:

Anyone to review this. Working on bytecode manipulation for different projects 
I wish I had known this existed before.

--
nosy: +mdartiailh

___
Python tracker 

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



[issue26789] Please do not log during shutdown

2017-02-21 Thread Jan Vorwerk

Jan Vorwerk added the comment:

Indeed, the error message is quite... surprising and misleading.
To reproduce, please run the attached (admittedly wrong) program that I could 
simplify a lot.

It seems to occur when a exception is raised at the wrong time...
I hope this helps nail down (at least) one use case.

'pip install aiohttp' is required

Best regards

--
nosy: +JanVok
Added file: http://bugs.python.org/file46659/error.py

___
Python tracker 

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



[issue22273] abort when passing certain structs by value using ctypes

2017-02-21 Thread Eryk Sun

Eryk Sun added the comment:

The 24-byte struct gets passed on the stack, as it should be. In this case 
ffi_call doesn't abort() because examine_argument returns 0, which is due to 
the following code in classify_argument:

if (words > 2)
{
/* When size > 16 bytes, if the first one isn't
   X86_64_SSE_CLASS or any other ones aren't
   X86_64_SSEUP_CLASS, everything should be passed in
   memory.  */
if (classes[0] != X86_64_SSE_CLASS)
return 0;

for (i = 1; i < words; i++)
if (classes[i] != X86_64_SSEUP_CLASS)
return 0;
}

It looks like X86_64_SSEUP_CLASS is never actually assigned by 
classify_argument(), in which case libffi never uses registers to pass structs 
that are larger than 16 bytes. 

Regarding floating-point values, we get a similar abort for passing a struct 
containing an array of two doubles because ctypes passes one ffi_type_pointer 
element instead of two ffi_type_double elements. 

Also, a struct with an array of one double (weird but should be supported) 
doesn't abort, but instead gets passed incorrectly like a pointer, i.e. as an 
integer in register rdi, instead of in the expected xmm0 register. The call 
thus uses whatever garbage value is currently in xmm0. You have to use a test 
lib to reproduce this. It's not apparent with a ctypes callback because 
ffi_closure_unix64 (unix64.S) and ffi_closure_unix64_inner (ffi64.c) use the 
same incorrect classification before calling ctypes closure_fcn and 
_CallPythonObject.

--

___
Python tracker 

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



[issue29607] Broken stack_effect for CALL_FUNCTION_EX

2017-02-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 3a9ac827c7c87dffc60c4200323948551bcb6662 by Serhiy Storchaka in 
branch 'master':
bpo-29607: Fix stack_effect computation for CALL_FUNCTION_EX (#202)
https://github.com/python/cpython/commit/3a9ac827c7c87dffc60c4200323948551bcb6662


--

___
Python tracker 

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



[issue23670] Modifications to support iOS as a cross-compilation target

2017-02-21 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
nosy: +Mariatta

___
Python tracker 

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



[issue29591] Various security vulnerabilities in bundled expat (CVE-2016-0718 and CVE-2016-4472)

2017-02-21 Thread STINNER Victor

STINNER Victor added the comment:

I'm working on a new documentation of Python vulnerabilities to help to handle 
such issue:
http://python-security.readthedocs.io/en/latest/vulnerabilities.html

--

___
Python tracker 

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



[issue29157] random.c: Prefer getrandom() over getentropy() to support glibc 2.24 on Linux

2017-02-21 Thread Christian Heimes

Christian Heimes added the comment:

Python 3.3 and 3.4 are in security-fix-only mode. Technically this fix does not 
count as security fix. It's a compatibility fix.

https://docs.python.org/devguide/#status-of-python-branches

--

___
Python tracker 

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



[issue29603] More informative Queue class: new method that returns number of unfinished tasks

2017-02-21 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> Should avoid creating new threads if there are more
# idle threads than items in the work queue.

Shouldn't this just check to see if qsize() is greater than zero?  That would 
mean that there are no idle threads.  I'm not seeing why there would be any 
idle threads if there is work in the queue (the queue unblocks idle threads).

I don't think "unfinished() - num_threads" makes sense.  The meaning of 
"unfinished() - qsize()" is the number of non-idle worker threads (work is 
taken out of the queue but has not yet reported that the task is done).

--

___
Python tracker 

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



[issue27850] Remove 3DES from cipher list (sweet32 CVE-2016-2183)

2017-02-21 Thread Christian Heimes

Christian Heimes added the comment:

Victor found out that Python is considered as affect by CVE-2016-2183, 
https://www.cvedetails.com/cve/CVE-2016-2183/

--

___
Python tracker 

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



[issue29607] Broken stack_effect for CALL_FUNCTION_EX

2017-02-21 Thread Matthieu Dartiailh

Matthieu Dartiailh added the comment:

I added the Misc/NEWS entry under Python 3.7. I guess it will be backported to 
3.6 when cherry-pinking.

--

___
Python tracker 

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



[issue29157] random.c: Prefer getrandom() over getentropy() to support glibc 2.24 on Linux

2017-02-21 Thread Vladimír Čunát

Vladimír Čunát added the comment:

Why was there no backporting e.g. to 3.4 branch?  I thought you implied that 
3.3 and 3.4 are unaffected, but our build farm says otherwise, getting a 
segfault in bin/python3.4m (3.4.6) and printing "Fatal Python error: 
getentropy() failed"

--

___
Python tracker 

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



[issue29165] Use forward compatible macro in example code for creating new type

2017-02-21 Thread INADA Naoki

INADA Naoki added the comment:

> And it seems to me that Doc/includes/shoddy.c in Python 3 is not correct.

I created another pull request PR 215.

--

___
Python tracker 

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



[issue29165] Use forward compatible macro in example code for creating new type

2017-02-21 Thread INADA Naoki

Changes by INADA Naoki :


--
resolution:  -> fixed
stage:  -> 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



[issue29165] Use forward compatible macro in example code for creating new type

2017-02-21 Thread INADA Naoki

INADA Naoki added the comment:


New changeset 9436bbd87b7eed18dec4c32f25b88452fe282e1c by GitHub in branch 
'2.7':
bpo-29165: doc: make extending/newtypes more Python 3 friendly (GH-211)
https://github.com/python/cpython/commit/9436bbd87b7eed18dec4c32f25b88452fe282e1c


--

___
Python tracker 

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



[issue29589] test_asyncio & test_multiprocessing_forkserver failed

2017-02-21 Thread Dima Zhukov

Dima Zhukov added the comment:

Just tried with 3.4.6 version. Same test failed

--

___
Python tracker 

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



[issue29613] Support for SameSite Cookies

2017-02-21 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +180

___
Python tracker 

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



[issue29613] Support for SameSite Cookies

2017-02-21 Thread Akash Shende

New submission from Akash Shende:

Right now Morsel dont accept cookie setting outside of reserved words defined 
in http/cookies.py

--
components: Library (Lib)
messages: 288287
nosy: akash0x53
priority: normal
severity: normal
status: open
title: Support for SameSite Cookies
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue29611] TextIOWrapper's write_through option behave differently between C and pure Python implementation.

2017-02-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +benjamin.peterson, serhiy.storchaka, stutzbach

___
Python tracker 

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



[issue29165] Use forward compatible macro in example code for creating new type

2017-02-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ah, now I see.

I think sample C files in Doc/includes/ should be updated too. And it seems to 
me that Doc/includes/shoddy.c in Python 3 is not correct.

--

___
Python tracker 

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



[issue29237] Create enum for pstats sorting options

2017-02-21 Thread Ratnadeep Debnath

Ratnadeep Debnath added the comment:

It's good to hear that you're working on it. You can go ahead with this. 
Anyways, I will be around to see and learn how you fix this issue :)

--

___
Python tracker 

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



[issue29612] TarFile.extract() suffers from hard links inside tarball

2017-02-21 Thread Jussi Judin

New submission from Jussi Judin:

I managed to create a tarball that brought out quite nasty behavior with 
tarfile.TarFile.extract() and tarfile.TarFile.extractall() functions when there 
are hard links inside a tarball that point to themselves with a file that is 
included in the tarball. In Python 2.7 it leads to an exception and with Python 
3.4-3.6 it extracts the same file from the tarball multiple times.

First we create a tarball that causes this behavior:

$ mkdir -p tardata/1/2/3/4/5/6/7/8/9
$ dd if=/dev/zero of=tardata/1/2/3/4/5/6/7/8/9/zeros.data bs=100 count=500
# tar by default adds all directories recursively multiple times to the 
archive, but duplicates are created as hard links:
$ find tardata | xargs tar cvfz tardata.tar.gz

Then let's extract the tarball with tarfile module
Let following commands demonstrate what happens with the attached tartest.py 
file

$ python2.7.13 tartest.py noskip tardata.tar.gz /tmp/tardata-python-2.7.13
...
tardata/1/2/3/4/5/6/7/8/9/zeros.data
...
tardata/1/2/3/4/5/6/7/8/9/zeros.data
Traceback (most recent call last):
  File "tartest.py", line 17, in 
unarchive(skip, archive, dest)
  File "tartest.py", line 12, in unarchive
tar_fd.extract(info, dest)
  File "python/2.7.13/lib/python2.7/tarfile.py", line 2118, in extract
self._extract_member(tarinfo, os.path.join(path, tarinfo.name))
  File "python/2.7.13/lib/python2.7/tarfile.py", line 2202, in _extract_member
self.makelink(tarinfo, targetpath)
  File "python/2.7.13/lib/python2.7/tarfile.py", line 2286, in makelink
os.link(tarinfo._link_target, targetpath)
OSError: [Errno 2] No such file or directory

And with Python 3.6.0 (and earlier Python 3 series based Pythons that I have 
tested):

$ time python3.6.0 tartest.py noskip tardata.tar.gz /tmp/tardata-python-3.6.0
...
tardata/1/2/3/4/5/6/7/8/9/zeros.data <-- this is extracted 11 times
...
real0m42.747s
user0m17.564s
sys 0m6.144s

If we then make the tarfile skip extraction of hard links that point to 
themselves:

$ time python3.6.0 tartest.py skip tardata.tar.gz /tmp/tardata-python-3.6.0
...
tardata/1/2/3/4/5/6/7/8/9/zeros.data <-- this is extracted once
...
Skipping tardata/1/2/3/4/5/6/7/8/9/zeros.data <-- skipped hard links 10 times
...
real0m2.688s
user0m1.816s
sys 0m0.532s

>From the used user CPU time it's obvious that there is happening a lot of 
>unneeded decompression when we compare Python 3.6 results. If I use 
>TarFile.extractall(), it behaves similarly as using TarFile.extract() 
>individually on TarInfo objects. GNU tar seems to behave in such fashion that 
>it skips over the extraction of the actual file data when it encounters this 
>situation.

--
components: Library (Lib)
files: tartest.py
messages: 288284
nosy: Jussi Judin
priority: normal
severity: normal
status: open
title: TarFile.extract() suffers from hard links inside tarball
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file46658/tartest.py

___
Python tracker 

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



[issue29165] Use forward compatible macro in example code for creating new type

2017-02-21 Thread INADA Naoki

INADA Naoki added the comment:

> but the code with PyObject_HEAD_INIT() doesn't look incompatible with Python 
> 3.

It's incompatible actually.

https://github.com/python/cpython/blob/2.7/Include/object.h

/* PyObject_HEAD defines the initial segment of every PyObject. */

#define PyObject_HEAD_INIT(type)\
_PyObject_EXTRA_INIT\
1, type,


https://github.com/python/cpython/blob/3.5/Include/object.h

#define PyObject_HEAD_INIT(type)\
{ _PyObject_EXTRA_INIT  \
1, type },


I noticed PyVarObject_HEAD_INIT is compatible, and simplified an extension I 
maintain.
https://github.com/PyMySQL/mysqlclient-python/commit/2feb5ed6850a3905edf0333e0cd11ea6218f0f4f


This small doc change helps people who writing Python 2's extension module now, 
and port it to Python 3 later.

--

___
Python tracker 

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



[issue29611] TextIOWrapper's write_through option behave differently between C and pure Python implementation.

2017-02-21 Thread INADA Naoki

New submission from INADA Naoki:

In C implementation, write() calls underlaying flush() method when 
write_through=True.

https://github.com/python/cpython/blob/3.6/Modules/_io/textio.c

if (self->write_through)
text_needflush = 1;
if (self->line_buffering &&
(haslf ||
 PyUnicode_FindChar(text, '\r', 0, PyUnicode_GET_LENGTH(text), 1) != 
-1))
needflush = 1;


But pure Python implementation doesn't care write_through option at all.

https://github.com/python/cpython/blob/3.6/Lib/_pyio.py

self.buffer.write(b)
if self._line_buffering and (haslf or "\r" in s):
self.flush()

When PyPy 3.5 is released, this difference may affects PyPy users.
(I hadn't checked how PyPy provide io module.)

--
components: IO
messages: 288282
nosy: inada.naoki
priority: normal
severity: normal
status: open
title: TextIOWrapper's write_through option behave differently between C and 
pure Python implementation.
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue24340] co_stacksize estimate can be highly off

2017-02-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29165] Use forward compatible macro in example code for creating new type

2017-02-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

PyVarObject_HEAD_INIT() is more used in Python 3 code, but the code with 
PyObject_HEAD_INIT() doesn't look incompatible with Python 3. I don't see a 
need of this change.

PyObject_HEAD_INIT() also is used in .c files in Doc/includes/.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue11572] bring Lib/copy.py to 100% coverage

2017-02-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

copy and pickle use the same protocol. The copy module shouldn't be changed 
independently, the changes should be synchronised with both implementations of 
the pickle module.

--

___
Python tracker 

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



[issue29575] doc 17.2.1: basic Pool example is too basic

2017-02-21 Thread Joachim

Joachim added the comment:

I never proposed to add a second example, but to make the one example more 
meaningful.

As a minimal solution, could we replace the numbers 3 (input data) and 5 
(threads)
by a slightly more plausible choice? Davin explained why numbers should be
incommensurate. So what about 10 data, 3 threads?

--
Added file: http://bugs.python.org/file46657/smime.p7s

___
Python tracker 

___

smime.p7s
Description: S/MIME cryptographic signature
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29575] doc 17.2.1: basic Pool example is too basic

2017-02-21 Thread Berker Peksag

Berker Peksag added the comment:

I agree with and Davin and Inada. Note that multiprocessing documentation is 
already too long and we'd like to be careful before adding another example.

If you could create a "multiprocessing cookbook" on wiki.python.org I'm pretty 
sure we'd be happy to consider adding a link to it in the documentation.

--
nosy: +berker.peksag
title: your closing of issue29575 -> doc 17.2.1: basic Pool example is too basic

___
Python tracker 

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



[issue24340] co_stacksize estimate can be highly off

2017-02-21 Thread INADA Naoki

Changes by INADA Naoki :


--
nosy: +inada.naoki

___
Python tracker 

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



[issue29603] More informative Queue class: new method that returns number of unfinished tasks

2017-02-21 Thread slytomcat

slytomcat added the comment:

Raymond, Serhiy, thanks for your opinions.

I agree that this method like empty, full, and qsize returns information that 
may be out-of-date in time of its usage.

But like those empty, full, and qsize it provides information that helps to 
make some decisions.

What I disagree that this information can be correctly estimated based on qsize 
and number of parallel consumers as there is no information what exactly 
consumers do at the moment. Such estimation will be absolutely useless for a 
decision making.

In the example (see 
https://github.com/slytomcat/cpython/commit/ea313986d86c083e81624fbc8a7ab6a75784e15d)
 we need to estimate the number of unfinished tasks and comparing it to the 
number of active threads we can decide: should we create a new thread or not. 
There is no reason to wait until all tasks done (via join) we need to make 
decision in working conditions.

Actually I've implemented this solution (Queue.unfinished + modified 
concurrent.futures.ThreadPoolExecutor) in my project (see 
https://github.com/slytomcat/yandex-disk-client) and it works perfectly: the 
number of working threads is increasing only on massive flow of tasks, while 
weak flow of tasks keeps low number of working threads.
And even when Queue.unfinished gives wrong (outdated) information, it can lead 
to creation one new thread that is not really required at the moment. That is 
not a big mistake, I suppose (comparing to creation all N threads during 
placing first N tasks in queue without considering the volume of concurrent 
tasks).

--

___
Python tracker 

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



[issue29575] your closing of issue29575

2017-02-21 Thread INADA Naoki

INADA Naoki added the comment:

I like current, minimum example to describe API.

No need to make it complex only for checking it's really executed in parallel.

Adding more and more "may be useful for someone" code in the doc make the 
document long, hard and tedious to read for everyone.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue14551] imp.load_source docs removed from python3 docs...is this correct?

2017-02-21 Thread irdb

Changes by irdb :


--
nosy: +irdb

___
Python tracker 

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



  1   2   >