[issue17765] weakref.ref ignores a 'callback' keyword argument

2016-05-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> georg.brandl

___
Python tracker 

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



[issue26889] Improve Doc/library/xmlrpc.client.rst

2016-05-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 04250fc723e6 by Serhiy Storchaka in branch '3.5':
Issue #26889: Tweaked xmlrpc.client documentation.
https://hg.python.org/cpython/rev/04250fc723e6

New changeset 9bdec549bad3 by Serhiy Storchaka in branch 'default':
Issue #26889: Tweaked xmlrpc.client documentation.
https://hg.python.org/cpython/rev/9bdec549bad3

New changeset fb5bd513751f by Serhiy Storchaka in branch '2.7':
Issue #26889: Tweaked xmlrpclib documentation.
https://hg.python.org/cpython/rev/fb5bd513751f

--
nosy: +python-dev

___
Python tracker 

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



[issue26889] Improve Doc/library/xmlrpc.client.rst

2016-05-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Terry.

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

___
Python tracker 

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



[issue22107] tempfile module misinterprets access denied error on Windows

2016-05-06 Thread Eryk Sun

Eryk Sun added the comment:

The Windows API loses information when mapping kernel status values to Windows 
error codes. For example, the following status values are all mapped to 
ERROR_ACCESS_DENIED:

STATUS_INVALID_LOCK_SEQUENCE   0xc01e
STATUS_INVALID_VIEW_SIZE   0xc01f
STATUS_ALREADY_COMMITTED   0xc021
STATUS_ACCESS_DENIED   0xc022
STATUS_PORT_CONNECTION_REFUSED 0xc041
STATUS_THREAD_IS_TERMINATING   0xc04b
STATUS_DELETE_PENDING  0xc056
STATUS_FILE_IS_A_DIRECTORY 0xc0ba
STATUS_FILE_RENAMED0xc0d5
STATUS_PROCESS_IS_TERMINATING  0xc10a
STATUS_CANNOT_DELETE   0xc121
STATUS_FILE_DELETED0xc123

Encrypting File System
STATUS_ENCRYPTION_FAILED   0xc28a
STATUS_DECRYPTION_FAILED   0xc28b
STATUS_NO_RECOVERY_POLICY  0xc28d
STATUS_NO_EFS  0xc28e
STATUS_WRONG_EFS   0xc28f
STATUS_NO_USER_KEYS0xc290

STATUS_ACCESS_DENIED is from a failed NtAccessCheck. STATUS_FILE_IS_A_DIRECTORY 
is from trying to open a directory as a file, because NT doesn't allow 
accessing the anonymous data stream of a directory, such as "dirname::$DATA", 
which is the same as trying to open "dirname" as a file. It only allows 
creating a named data stream for a directory, such as 
"dirname:streamname:$DATA".

The original status value may still be available, but only by calling the 
undocumented runtime library function, RtlGetLastNtStatus, which was added in 
XP (NT 5.1). After a failed system call, the Windows base API calls 
BaseSetLastNTError, which calls RtlNtStatusToDosError to get the Win32/DOS 
error code for a given NT status value. This in turn caches the last NT status 
in the LastStatusValue field of the thread environment block (TEB). 
RtlGetLastNtStatus gets this value from the TEB.

Possibly PyErr_SetExcFromWindowsErrWithFilenameObjects could capture the most 
recent kernel status value from RtlGetLastNtStatus(), to add this as a new 
"ntstatus" attribute of OSError. This wouldn't always be meaningful, since the 
thread's LastErrorValue (returned by GetLastError) isn't always related to a 
failed system call, but it can help in cases such as this, to distinguish a 
genuine denial of access from some other failure, and without suffering from 
race conditions. 

For example, I added a "testdir" subdirectory to a directory and then modified 
the DACL of the parent directory to deny write/append access for all users. The 
following experiment checks the NT status using ctypes:

STATUS_ACCESS_DENIED = ctypes.c_long(0xC022).value
STATUS_FILE_IS_A_DIRECTORY = ctypes.c_long(0xC0BA).value

ntdll = ctypes.WinDLL('ntdll')

try: open('testdir', 'w')
except: status_dir = ntdll.RtlGetLastNtStatus()

try: open('test', 'w')
except: status_access = ntdll.RtlGetLastNtStatus()

>>> status_dir == STATUS_FILE_IS_A_DIRECTORY
True
>>> status_access == STATUS_ACCESS_DENIED
True

Obviously using ctypes isn't recommended, since the status value needs to be 
captured ASAP after the call fails, so here's an example in C:

#define UNICODE
#include 
#include 
#include 

typedef NTSTATUS (NTAPI *RTLGETLASTNTSTATUS)(VOID);

int main()
{
HMODULE hNtdll = GetModuleHandle(L"ntdll");
RTLGETLASTNTSTATUS RtlGetLastNtStatus = (RTLGETLASTNTSTATUS)
GetProcAddress(hNtdll, "RtlGetLastNtStatus");

if (_open("testdir", _O_CREAT | _O_EXCL) == -1)
printf("status_dir: %#08x\n", RtlGetLastNtStatus());

if (_open("test", _O_CREAT | _O_EXCL) == -1)
printf("status_access: %#08x\n", RtlGetLastNtStatus());
 
   return 0;
}

output:

status_dir: 0xc0ba
status_access: 0xc022

--

___
Python tracker 

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



[issue26889] Improve Doc/library/xmlrpc.client.rst

2016-05-06 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The corrected link works.  I agree with deleting a bad sentence if you cannot 
fix it.  I think you can go ahead and apply as is.

--

___
Python tracker 

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



[issue26934] android: test_faulthandler fails

2016-05-06 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The 8 failures are all because exitcode is 0 when it should not be.

self.assertNotEqual(exitcode, 0)
AssertionError: 0 == 0

--
nosy: +terry.reedy

___
Python tracker 

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



[issue26969] ascynio should provide a policy to address pass-loop-everywhere problem

2016-05-06 Thread Guido van Rossum

Guido van Rossum added the comment:

FWIW asyncio's own test suite makes sure that the loop is indeed passed
everywhere by setting the default loop to None. If a library chooses to
pass the loop around like this it should structure its tests the same way.

--

___
Python tracker 

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



[issue26911] lib2to3/tests/pytree_idempotency.py has broken imports

2016-05-06 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I decided that I should leave the scope of this issue as it was and close it as 
fixed.

--
assignee:  -> terry.reedy
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed
title: lib2to3/tests/pytree_idempotency.py does not run -> 
lib2to3/tests/pytree_idempotency.py has broken imports
versions:  -Python 2.7

___
Python tracker 

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



[issue26912] Broken imports in test/test_email/torture_test.py, test_asian_codecs.py) has a broken import

2016-05-06 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I also removed try to import the deleted support.TestSkipped.  I temporarily 
commented out the SkipTest replacement so the module would run, create the test 
class, run it, and fail.

I believe the import of run_unittest and the associated test_main, etc, can be 
deleted, but that is another issue.

--
assignee:  -> terry.reedy
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



[issue26912] Broken imports in test/test_email/torture_test.py, test_asian_codecs.py) has a broken import

2016-05-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e7da216ba17c by Terry Jan Reedy in branch '3.5':
Issue 26912: fix broken imports in test_email package.
https://hg.python.org/cpython/rev/e7da216ba17c

--
nosy: +python-dev

___
Python tracker 

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



[issue16113] Add SHA-3 and SHAKE (Keccak) support

2016-05-06 Thread Christian Heimes

Christian Heimes added the comment:

This patch implements SHA-3 and SHAKE for Python 3.6. The algorithm is provided 
by a slightly modified copy of the Keccak Code Package. I had to replace C++ 
comments and perform some minor cleanups.

--
stage: needs patch -> patch review
Added file: 
http://bugs.python.org/file42764/SHA3-and-SHAKE-support-for-Python.patch

___
Python tracker 

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



[issue26912] Broken imports in test/test_email/torture_test.py, test_asian_codecs.py) has a broken import

2016-05-06 Thread Terry J. Reedy

Terry J. Reedy added the comment:

As with #26911, no 'test_' prefix means 'run by hand'.  I will make the two 
simple fixes, as well as delete 'from types import ListType' (ListType is list, 
and removed in 3.x).  But I will not try to run the torture test, hence no 
guarantee that it will run after import.

--
nosy: +terry.reedy
stage:  -> needs patch
title: test/test_email/torture_test.py (and test_asian_codecs.py) has a broken 
import -> Broken imports in test/test_email/torture_test.py, 
test_asian_codecs.py) has a broken import
type: compile error -> behavior

___
Python tracker 

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



[issue16113] Add SHA-3 and SHAKE (Keccak) support

2016-05-06 Thread Christian Heimes

Changes by Christian Heimes :


--
hgrepos:  -152

___
Python tracker 

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



[issue26969] ascynio should provide a policy to address pass-loop-everywhere problem

2016-05-06 Thread Yury Selivanov

Yury Selivanov added the comment:

>> Update some places in asyncio where we currently use "get_event_loop()", 
>> such as Future constructor, Task.current_task, etc.

> Yury, do you have an idea how it could be done?

I think I do.  To keep the backwards compatibility, we'll need to update the 
"get_event_loop()" function as follows:

  def get_event_loop():
 loop = _running_loop.loop
 if loop is None:
 loop = get_event_loop_old_impl()
 return loop

No need to actually update Future or Task or any other asyncio code.

The get_running_loop() would look like this:

  def get_running_loop():
 loop = _running_loop.loop
 if loop is None:
 raise RuntimeError('no running event loop')
 return loop

--

___
Python tracker 

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



[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-05-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Luiz for your testing.

> __main__:1: DeprecationWarning: Use of '' is deprecated

It is bad that a warning is emitted for default value.

> Will bytes be deprecated if used as a default_schema?

No, only using empty bytes schema with string url is deprecated (because it 
works now). Using non-empty bytes schema with string url just causes an error.

> Shouldn't it complain that the types are different?

This special case is left for compatibility with wrappers.

> __main__:1: DeprecationWarning: Use of [] is deprecated

The warning should not be emitted for the value that the user did not provide.

If go by the way of strong deprecation, the patch needs reworking. But this is 
a way of overcomplication.

Since as pointed Antti, only using str, bytes and bytearray is documented, I 
think we can ignore the breakage for other types.

--

___
Python tracker 

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



[issue26969] ascynio should provide a policy to address pass-loop-everywhere problem

2016-05-06 Thread R. David Murray

R. David Murray added the comment:

The way I avoid the errors of failing to always pass the loop through in my 
application library, currently, is to run my tests in a thread with no event 
loop set up, so that get_event_loop will raise an error.  Take that for what it 
is worth, since I don't claim to know what best practices are in asyncio 
programming.

--

___
Python tracker 

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



[issue26969] ascynio should provide a policy to address pass-loop-everywhere problem

2016-05-06 Thread Ilya Kulakov

Ilya Kulakov added the comment:

> Update some places in asyncio where we currently use "get_event_loop()", such 
> as Future constructor, Task.current_task, etc.

Yury, do you have an idea how it could be done?

--

___
Python tracker 

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



[issue26939] android: test_functools hangs on armv7

2016-05-06 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Forgot to say that the backtraces for test_threading and test_importlib were 
obtained with the patch applied while they were hanging.

--

___
Python tracker 

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



[issue26911] lib2to3/tests/pytree_idempotency.py does not run

2016-05-06 Thread Terry J. Reedy

Terry J. Reedy added the comment:

(Import errors are runtime errors, not compile errors.)

After 'import lib2to3.pgen2', 'pgen2' in the code would not be valid.  A 'from' 
import is needed instead.  I fixed the import for 3.5/6 (but not 2.7), but the 
file still does not run.

  File "F:\Python\dev\35\lib\lib2to3\tests\pytree_idempotency.py", line 27, in 
main
gr = driver.load_grammar("Grammar.txt")
 ,,,
FileNotFoundError: [Errno 2] No such file or directory: 'Grammar.txt'

After fixing this with

 def main():
-gr = driver.load_grammar("Grammar.txt")
+gfile = os.path.dirname(os.path.dirname(__file__)) + "/Grammar.txt"
+gr = driver.load_grammar(gfile)
 dr = driver.Driver(gr, convert=pytree.convert)
 
the file fails with

FileNotFoundError: [Errno 2] No such file or directory: 'example.py'

There is no 'example.py in lib2to3.  The closest is 
lib2to3/tests/data/fixers/parrot_example.py.  At this point, I leave it 
Benjamin to fix the file so it runs or delete it.

The file is not used anywhere since it is not part of the regular test suite 
(that would require the name to begin with 'test_').  It was meant to be run as 
a test by itself -- see the doc string.  Perhaps the completion of 2to3 and the 
test suite made it obsolete.

--
nosy: +terry.reedy
stage:  -> needs patch
title: lib2to3/tests/pytree_idempotency.py has a broken import -> 
lib2to3/tests/pytree_idempotency.py does not run
type: compile error -> behavior
versions: +Python 2.7, Python 3.6

___
Python tracker 

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



[issue26969] ascynio should provide a policy to address pass-loop-everywhere problem

2016-05-06 Thread Ilya Kulakov

Ilya Kulakov added the comment:

Yury, that would do it.

Guido, that's indeed might be an anti-pattern. But it looks like passing event 
loop around is just a worse version of it.

--

___
Python tracker 

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



[issue26969] ascynio should provide a policy to address pass-loop-everywhere problem

2016-05-06 Thread Yury Selivanov

Yury Selivanov added the comment:

> Honestly I think it's pretty crazy and out there to have multiple event
loops in the same thread. That feels like an anti-pattern inspired by some
other event loop APIs (in other languages) that encourage this. But asyncio
was not designed for that.

I agree.

OTOH, if you're designing a library for asyncio, you want it to be as foolproof 
as possible, so many people simply pass an event loop everywhere.  It's 
especially annoying when you have a huge chunk of code that didn't need the 
loop, and then when something needs it you have to refactor everything or use 
"get_event_loop".

In terms of performance, I don't think this is gonna affect anything, it's just 
a couple of additional thread-local sets in the Loop.run method.

And we can design "get_running_loop" to raise a clear exception if no loop is 
currently running.

--

___
Python tracker 

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



[issue26906] format(object.__reduce__) fails intermittently

2016-05-06 Thread Guido van Rossum

Guido van Rossum added the comment:

Probably.

--

___
Python tracker 

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



[issue26969] ascynio should provide a policy to address pass-loop-everywhere problem

2016-05-06 Thread Guido van Rossum

Guido van Rossum added the comment:

Honestly I think it's pretty crazy and out there to have multiple event
loops in the same thread. That feels like an anti-pattern inspired by some
other event loop APIs (in other languages) that encourage this. But asyncio
was not designed for that.

--

___
Python tracker 

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



[issue26969] ascynio should provide a policy to address pass-loop-everywhere problem

2016-05-06 Thread Yury Selivanov

Yury Selivanov added the comment:

> Thread may have multiple event loops, but only one, explicitly associated, is 
> default. And it's not necessary one which is currently running.

Ah, I got it.  You know what, this actually is starting to make sense.

Guido, what do you think about this?  Essentially, (Ilya, feel free to correct 
me if I'm wrong), we can implement the following:

1. Add a new thread-local storage, say "_running_loop"

2. Add another method "asyncio.get_running_loop()"

3. Update some places in asyncio where we currently use "get_event_loop()", 
such as Future constructor, Task.current_task, etc.

This might actually solve an awkwardness of get_event_loop(), which when 
called, instantiates an event loop if it doesn't find one, which makes it 
difficult to know if an event loop was running before the call.

--

___
Python tracker 

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



[issue26939] android: test_functools hangs on armv7

2016-05-06 Thread Xavier de Gaye

Xavier de Gaye added the comment:

> Do you know in which precise test it hangs?

They are named in the first msg of each issue, the issues are:
issue #26938: android: test_concurrent_futures hangs on armv7
issue #26939: android: test_functools hangs on armv7
issue #26940: android: test_importlib hangs on armv7
issue #26941: android: test_threading hangs on armv7

The test_threading and test_importlib issues have also now a gdb backtrace, so 
we know not only the test name but also the full python frame stack with line 
numbers thanks to python-gdb.py magic. It seems that test_functools, 
test_threading and test_importlib all hang within take_gil().

test_concurrent_futures is different and hangs in a futex().

With "thread apply all backtrace",  nothing changes and gdb still prints:
Cannot access memory at address 0x0
#0  0xb6efae6c in ?? ()
#1  0xb6efd830 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

The problem seems to be that gdb does not have enough information to unwind the 
stack for the other threads and for thread #1 it only works after an 
interrupted continue command, and not on gdb startup.

--

___
Python tracker 

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



[issue26906] format(object.__reduce__) fails intermittently

2016-05-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There is one test 
(ClassPropertiesAndMethods.test_mutable_bases_with_failing_mro in test_descr) 
that crashes with the code from issue551412 because _PyType_Lookup() is 
recursive called from PyType_Ready(). Is this the reason? My patch prevents 
recursive calls.

Here is minimal example (for Python 3):

class M(type):
def mro(self):
hasattr(self, 'foo')
return type.mro(self)

class C(metaclass=M):
pass

When class C is created, C.mro() is called while C still is not ready. 
Resolving an attribute calls _PyType_Lookup() which calls PyType_Ready() which 
calls mro() etc.

--
keywords:  -patch

___
Python tracker 

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



[issue26969] ascynio should provide a policy to address pass-loop-everywhere problem

2016-05-06 Thread Ilya Kulakov

Ilya Kulakov added the comment:

> In this case I'm not sure how this is different from the current 
> "get_event_loop"

Thread may have multiple event loops, but only one, explicitly associated, is 
default. And it's not necessary one which is currently running.

I think what I propose here can be expressed in Python terms as an implicit 
context manager that replaces Thread's default event loop once while it "runs" 
particular event loop then switches it back (possible to None) once loop is 
stopped.

--

___
Python tracker 

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



[issue26969] ascynio should provide a policy to address pass-loop-everywhere problem

2016-05-06 Thread Yury Selivanov

Yury Selivanov added the comment:

To clarify: the problem lies in "return currently running event loop when 
called from within a coroutine" -- what if there is no GIL and we have a few 
event loops running?  You'd need to use a threadlocal storage.  In this case 
I'm not sure how this is different from the current "get_event_loop".

--

___
Python tracker 

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



[issue26969] ascynio should provide a policy to address pass-loop-everywhere problem

2016-05-06 Thread Yury Selivanov

Yury Selivanov added the comment:

> Probably it would make sense to modify behavior of the default policy to make 
> get_event_loop to return Thread-local event loop when called from 
> out-of-event-loop and return currently running event loop when called from 
> within a coroutine.

The problem with this approach is that you're relying on the presence of GIL.  
If, let's say, PyPy releases tomorrow with 3.5 and STM, this won't work.

--

___
Python tracker 

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



[issue26911] lib2to3/tests/pytree_idempotency.py has a broken import

2016-05-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3279c910d0e0 by Terry Jan Reedy in branch '3.5':
Issue 26911: fix import (other problems remain).
https://hg.python.org/cpython/rev/3279c910d0e0

--
nosy: +python-dev

___
Python tracker 

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



[issue26969] ascynio should provide a policy to address pass-loop-everywhere problem

2016-05-06 Thread Ilya Kulakov

Ilya Kulakov added the comment:

> Why does it have to be a standard part of asyncio?

I've only seen few libraries that deal with asyncio so far (aiohttp, pyzmq), 
but my general impression is that this is a generic problem.

With asyncio code should be (ideally) written as a set of coroutines which 
schedule each other or are called in response to monitored events. That means 
(and asyncio very implementation shows that) loop has to be "self" for all 
coroutines it executes.

Thread-local default event loop is a good solution to get an entry point into 
the event loop from an out-of-event-loop execution location. But (ideally) 
there will be exactly one place in code where this behavior is convenient: when 
you "instantiate" and run event loop. After that the event loop becomes "self" 
for each coroutine it may run and therefore it's now convenient for 
get_event_loop to return currently running event loop.

Probably it would make sense to modify behavior of the default policy to make 
get_event_loop to return Thread-local event loop when called from 
out-of-event-loop and return currently running event loop when called from 
within a coroutine.

> Why don't you just use 'loop = asyncio.get_event_loop()' in places where you 
> need the loop?

As David pointed out, I'm not using thread-local event loop.

--

___
Python tracker 

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



[issue26889] Improve Doc/library/xmlrpc.client.rst

2016-05-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your review Terry. Updated patch addresses most of your comments. 
But I'm unable to expand ServerProxy description as you suggest. May you can do 
this? My purpose was modest. Just fix some incorrect and outdated sentences. 
Then I fixed some formatting. I was not going and is not able to do anything 
besides this. I will take all that you offer.

--
Added file: http://bugs.python.org/file42763/docs_xmlrpc_client_2.patch

___
Python tracker 

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



[issue26938] android: test_concurrent_futures hangs on armv7

2016-05-06 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The strace output, the process is blocked in a futex system call:

root@generic:/ # strace -p 1304
Process 1304 attached
futex(0xb6f24880, FUTEX_WAIT_PRIVATE, 2, NULL

--

___
Python tracker 

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



[issue26906] format(object.__reduce__) fails intermittently

2016-05-06 Thread Guido van Rossum

Guido van Rossum added the comment:

But the problem isn't limited to format()... Why would format() be special?

--

___
Python tracker 

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



[issue26906] format(object.__reduce__) fails intermittently

2016-05-06 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Is there a way to have format() try to force the initialization, by explicitly 
doing the equivalent of obj.__format__, at least for types, instead of raising 
the TypeError?

--
nosy: +terry.reedy

___
Python tracker 

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



[issue26941] android: test_threading hangs on armv7

2016-05-06 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Adding the back trace.

--
Added file: http://bugs.python.org/file42761/test_threading_gdb_bt.txt

___
Python tracker 

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



[issue26903] ProcessPoolExecutor(max_workers=64) crashes on Windows

2016-05-06 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The example runs fine, in about 1 second, on my 6 core (which I guess is 12 
logical cores) Pentium.  I am guessing that the default number of workers needs 
to be changed, at least on Windows, to min(#logical_cores, 60)

--
nosy: +bquinlan, terry.reedy

___
Python tracker 

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



[issue26889] Improve Doc/library/xmlrpc.client.rst

2016-05-06 Thread Terry J. Reedy

Terry J. Reedy added the comment:

This is my first reading of this doc.  The formatting improvements look good.  
A definite enhancement.

Review contains a few comments.  My main difficulty is separating creation of a 
proxy instance from use of a proxy instance.  Some of the creation parameters 
govern the use, and hence do not make must sense until one reads the instance 
description a few paragraphs further on.  
Perhaps the initial sentence "A :class:`ServerProxy` instance is an object that 
manages communication with aremote XML-RPC server." should be expanded into a 
paragraph with some of the description given later.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue26163] FAIL: test_hash_effectiveness (test.test_set.TestFrozenSet)

2016-05-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I can stably reproduce this. 

PYTHONHASHSEED=36 ./python -m test.regrtest -vm test_hash_effectiveness test_set

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26967] argparse: allow_abbrev=False stops -vv from working

2016-05-06 Thread Xiang Zhang

Xiang Zhang added the comment:

I agree with you. But right now, it seems parsing short options and 
allow_abbrev both rely on the same logic. If you turn off allow_abbrev, short 
options parsing also disabled. Separating them seems nontrivial.

--

___
Python tracker 

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



[issue26939] android: test_functools hangs on armv7

2016-05-06 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Still hangs at test_lru_cache_threaded with this last patch :(

What about the other tests (test_importlib, test_threading)?

Do you know in which precise test it hangs? (use "-v" to print test names)

> There are two threads, gdb does not print the backtrace of the other thread.

Even with "thread apply all backtrace" (Google tells me this is the 
incantation)?

--

___
Python tracker 

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



[issue26969] ascynio should provide a policy to address pass-loop-everywhere problem

2016-05-06 Thread R. David Murray

R. David Murray added the comment:

Because, as indicated by the OP, I'm not using the default event loop of the 
thread.

Thinking about my code, I now remember that the reason I went down this path 
was because I wanted to make sure that my functions, like asyncio functions, 
accepted the optional loop parameter, and that it worked. For it to work my 
code pretty much has to pass loop everywhere, because that was a design 
decision I made early on.  So maybe there's nothing interesting for me here 
after all.

--

___
Python tracker 

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



[issue26632] __all__ decorator

2016-05-06 Thread R. David Murray

R. David Murray added the comment:

"This will cause more problems than it solves" and "this looks unpythonic" are, 
IMO, not strong arguments against it without butressing discussion.  If we can 
have some examples of problems it will cause, or a concrete explanation of wy 
something that makes code easier to understand and update (by putting the 
__all__ declaration next to the object being made public) is unpythonic, that 
would also help.

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



[issue26969] ascynio should provide a policy to address pass-loop-everywhere problem

2016-05-06 Thread Yury Selivanov

Yury Selivanov added the comment:

> Currently if one needs lazily resolve event loop depending on where awaitable 
> is being awaited have to pass loop everywhere explicitly. That quickly 
> becomes an unnecessary noise in interfaces of callables. 

Why don't you just use 'loop = asyncio.get_event_loop()' in places where you 
need the loop?

--

___
Python tracker 

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



[issue26969] ascynio should provide a policy to address pass-loop-everywhere problem

2016-05-06 Thread R. David Murray

R. David Murray added the comment:

Can we at least make it part of the documentation?  It's not obvious to me, at 
least, how to do it.  (Maybe I just haven't thought about it carefully enough.) 
 For that matter, it wasn't obvious to me it could even be done, so I've been 
passing loop everywhere in my code rather than thinking about how to avoid it; 
which is another argument for documenting it at least.

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



[issue11063] uuid.py module import has heavy side effects

2016-05-06 Thread Michael Felt

Michael Felt added the comment:

I cannot comment on uuid directly, but for me, this is yet another example of 
how assumptions can break things.

imho - if you know the exact version of s shared library that you want, calling 
cdll directly should be find. Maybe find_library is historic.

However, an advantage to calling find_library is that it should lead to an 
OSError if it cannot be loaded. But trapping OSError on a call to ctypes.cdll 
or testing for None (NULL) from find_library() is the option of a developer 
using the ctypes interface.

As far as libFOO.so.N - do you always want to assume it is going to be version 
N, or are you expecting to be able to work work version N+X?
Again, find_library() can give you the library name it would load - but a 
programmer must be aware of the platform differences (e.g., AIX returns not a 
filename, but a libFOO.a(libFOO.so.N) - as just one example.
p.s. as far as ldconfig being part of the problem on AIX (as it does not exist 
and can lead to OSError or just long delays, I have worked out a (pending) 
patch for ctypes/util (and ctypes/cdll) that may address the issues with uuid 
import on AIX. (see issue26439 for the patch)

--
nosy: +Michael.Felt

___
Python tracker 

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



[issue26632] __all__ decorator

2016-05-06 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Updated.

--
Added file: http://bugs.python.org/file42760/26632-in-c-3.diff

___
Python tracker 

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



[issue18726] json functions have too many positional parameters

2016-05-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

My remark was just about that I proposed to start a deprecation period at the 
time of developing Python 3.4. If this did accepted, the deprecation period 
would already finished and we would come up to the same code in 3.6.

It doesn't matter now.

--

___
Python tracker 

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



[issue26939] android: test_functools hangs on armv7

2016-05-06 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The strace of test_lru_cache_threaded:

...
gettimeofday({1462553238, 580860}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1462553238, 581276772}) = 0
gettimeofday({1462553238, 581672}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1462553238, 582078767}) = 0
gettimeofday({1462553238, 583956}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1462553238, 585865959}) = 0
gettimeofday({1462553238, 587597}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1462553238, 589381724}) = 0
gettimeofday({1462553238, 589973}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1462553238, 591858839}) = 0
gettimeofday({1462553238, 593003}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1462553238, 593452750}) = 0
gettimeofday({1462553238, 593886}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1462553238, 594364345}) = 0
gettimeofday({1462553238, 594764}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1462553238, 595227771}) = 0
gettimeofday({1462553238, 595626}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1462553238, 596027590}) = 0
gettimeofday({1462553238, 596448}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1462553238, 596848736}) = 0
gettimeofday({1462553238, 597259}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1462553238, 597665484}) = 0
gettimeofday({1462553238, 598060}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1462553238, 598869963}) = 0
gettimeofday({1462553238, 599547}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1462553238, 601053152}) = 0
gettimeofday({1462553238, 601593}, NULL) = 0
clock_gettime(CLOCK_REALTIME, ^CProcess 908 detached
 

--

___
Python tracker 

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



[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-06 Thread Eric V. Smith

Eric V. Smith added the comment:

Okay. Adding back 3.5 and 2.7, in case someone wants to document the behavior 
there. I'm not sure if we fix docs in 3.4 still.

--
versions: +Python 2.7, Python 3.5

___
Python tracker 

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



[issue18726] json functions have too many positional parameters

2016-05-06 Thread Guido van Rossum

Guido van Rossum added the comment:

> Guido's decision on similar issue25628 is that changing keyword-or-positional 
> parameters to keyword-only is safe and can be made without deprecation.

> If we started the deprecation period in 3.4, we could finish it in 3.6.

That makes little sense. You can't start deprecation in 3.4 or in 3.5 since 
these have been released already.

But what I said implies that you can make these things mandatory in 3.6 without 
having to worry about deprecating them, so the start of the deprecation period 
is meaningless.

However I do encourage you to be conservative, and add a warning about this and 
similar cases when the alphas and betas go out; and if you get much pushback 
during beta consider changing your mind.

--

___
Python tracker 

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



[issue26156] Bad name into power operator syntax

2016-05-06 Thread Guido Treutwein

Guido Treutwein added the comment:

I'm with David here, in that a change would improve ease of comprehension:
I still find it strange, that the grammar symbol has the same name as the
keyword (or in the proposed version keyword+'expr'), which is never done on
more widely used levels. I would have expected something like
'coroutine_suspension', which reflects what it is and not which keyword is
required to state it.

2016-05-06 15:04 GMT+02:00 R. David Murray :

>
> R. David Murray added the comment:
>
> Sounds like it is a bit more than just confusion: given that power can be
> used outside a coroutine but await can't, Serhiy's formulation would seem
> to me to be more semantically correct, even if syntactically it is the same
> as the current.
>
> I think it would regardless be better to replace 'await' with
> 'await_expr', so +1 on that from me as well.
>
> --
> nosy: +r.david.murray
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue18726] json functions have too many positional parameters

2016-05-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Guido's decision on similar issue25628 is that changing keyword-or-positional 
parameters to keyword-only is safe and can be made without deprecation.

If we started the deprecation period in 3.4, we could finish it in 3.6.

Proposed simple patch changes all optional parameters in functions and 
constructors that takes too much parameters in the json module to keyword-only 
without deprecation.

--
keywords: +patch
nosy: +gvanrossum
stage:  -> patch review
versions: +Python 3.6 -Python 3.4
Added file: http://bugs.python.org/file42759/json_keyword_only.patch

___
Python tracker 

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



[issue26906] format(object.__reduce__) fails intermittently

2016-05-06 Thread Guido van Rossum

Guido van Rossum added the comment:

Sadly it's been a very long time since I wrote that code and I don't recall
much about it. I presume there was a good reason for not to do it in
_PyType_Lookup(), but who knows -- maybe the oroginal approach was just too
naive and nobody cared? I'm not excited by a patch that does this for 38
types -- invariably there will be another type that still surfaces the same
bug.

--

___
Python tracker 

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



[issue25628] Make namedtuple "verbose" and "rename" parameters into keyword only arguments

2016-05-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Then namedtuple_keywords.diff LGTM. But please document changes.

--
assignee:  -> rhettinger
stage: patch review -> commit review

___
Python tracker 

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



[issue26939] android: test_functools hangs on armv7

2016-05-06 Thread Xavier de Gaye

Xavier de Gaye added the comment:

> Can you post the backtraces of all threads (at least the innermost frames)?

There are two threads, gdb does not print the backtrace of the other thread. My 
current gdb setup with a connection to a gdb-server misses some stuff (access 
to the loader or some libraries I guess) and needs to be completed with the 
same setup as the one used by the ndk-gdb script (released by google for 
android applications).

> Also, can you reproduce on an actual armv7 machine? Just wondering if there 
> may be something peculiar in the emulator.

I don't have an armv7 device that can be used for testing.

--

___
Python tracker 

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



[issue26632] __all__ decorator

2016-05-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Added a couple of comments on Rietveld.

But sorry, the overall idea looks unpythonic to me. I'm strong -1.

--

___
Python tracker 

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



[issue25628] Make namedtuple "verbose" and "rename" parameters into keyword only arguments

2016-05-06 Thread Guido van Rossum

Guido van Rossum added the comment:

I think such a change can be safely made in a feature release (say 3.6) without 
further deprecation. But not in a bugfix release (say 3.5.2).

--

___
Python tracker 

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



[issue25628] Make namedtuple "verbose" and "rename" parameters into keyword only arguments

2016-05-06 Thread Guido van Rossum

Guido van Rossum added the comment:

And by "safely" I mean that I don't mind if some code breaks when they upgrade 
to a new feature release.

FWIW the code most likely to break is code that wraps these functions with an 
identical interface.

--

___
Python tracker 

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



[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-06 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On May 06, 2016, at 03:41 PM, Eric V. Smith wrote:

>I agree it would be a 3.6 only change (and I've change the versions to
>reflect that).

The reason the other versions were included was because this was originally
reported as a documentation bug.  It should probably still be documented in
those older releases.

--

___
Python tracker 

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



[issue26969] ascynio should provide a policy to address pass-loop-everywhere problem

2016-05-06 Thread Guido van Rossum

Guido van Rossum added the comment:

Can't you easily write such a policy yourself? Why does it have to be a
standard part of asyncio?

--

___
Python tracker 

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



[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-06 Thread Eric V. Smith

Eric V. Smith added the comment:

I think it's okay to change this as far as str.format() goes.

Interestingly enough, the motivating case to add str.format_map() in issue 6081 
was exactly this kind of code. Although I notice that the example in that 
issue, which it shows as failing, works in both 2.7 and 3.4 (the only versions 
I have handy). So I'm not sure what changed after 2009 to cause that code to 
start working, but I'd be okay with it breaking again. But maybe we should 
track it down, in case it was deliberately changed and is important to someone.

In any event, since str.format_map() is well-known (to me, at least!), and is 
the approved way of getting the behavior of passing a specific map in to the 
format machinery, I'm okay with changing **dict to create an exact new dict, at 
least as far as str.format() goes. I can't speak to the overall implications 
(such as other APIs and performance).

I agree it would be a 3.6 only change (and I've change the versions to reflect 
that).

--
versions:  -Python 2.7, Python 3.5

___
Python tracker 

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



[issue26939] android: test_functools hangs on armv7

2016-05-06 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Still hangs at test_lru_cache_threaded with this last patch :(

--

___
Python tracker 

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



[issue26632] __all__ decorator

2016-05-06 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

I think I missed a decref.  New diff.

--
Added file: http://bugs.python.org/file42758/26632-in-c-2.diff

___
Python tracker 

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



[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-06 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Eric should chime in on the str.format() implications.

--

___
Python tracker 

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



[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-06 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +eric.smith

___
Python tracker 

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



[issue1528167] Tweak to make string.Templates more customizable

2016-05-06 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Agreed with Serhiy.  Raymond's approach is nicer, but I'm still not convinced 
about the use case.  Closing.

If someone wants to run with this again, an updated patch would be needed, and 
the issue could be reopened, but I also suggest following through with 
Raymond's idea.

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue26632] __all__ decorator

2016-05-06 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Here's a C implementation.  I'm a bit under the weather so please do double 
check my refcounting logic. ;)

No tests or docs yet, but those would be easy to add.  Here's an example:

@public
class Foo:
pass

public(qux=3)

print(qux)

@public
def zzz():
pass

public(jix=1, jox=2, jrx=3)

print(__all__)
print(jix, jox, jrx)

You could also try to add an explicit __all__ in the module and those names 
will get appended to it.

--
keywords: +patch
Added file: http://bugs.python.org/file42757/26632-in-c.diff

___
Python tracker 

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



[issue26939] android: test_functools hangs on armv7

2016-05-06 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Oops, sorry, hadn't seen the patch didn't compile. Can you tried with this new 
patch? (atomic_explicit2.patch)

--
Added file: http://bugs.python.org/file42756/atomic_explicit2.patch

___
Python tracker 

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



[issue26967] argparse: allow_abbrev=False stops -vv from working

2016-05-06 Thread Michael Kruse

Michael Kruse added the comment:

I think the allow_abbrev option should be orthogonal on how short options are 
parsed. I am using parse_known_args() to forward the unrecognized args to 
another program, therefore allow_abbrev=False is essential.

There is a special handling for short options in the consume_optional and 
_get_option_tuples to allow them being concatenated with one dash, as commonly 
done with short options (eg. "tar -czf file"). I interpret allow_abbrev as an 
option to avoid matching non-exiting options that should be forwarded to the 
other program; '-vv' is an existing option with the same meaning as '-v -v'.

This would also mean that parse_known_args(['-vz']) (where '-v' is a registered 
argument, but '-z' is not) matches '-v' and returns '-z' as unknown argument; 
but I don't know whether you want to go that far. It is difficult to interpret 
whether '-verify' should mean '-v -e -r -i -f -y' or '--verify' (but this is 
why there are double-dash options), especially when the first letter is not a 
registered short option.

--

___
Python tracker 

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



[issue26939] android: test_functools hangs on armv7

2016-05-06 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Android has stdatomic.h and HAVE_STD_ATOMIC is defined.

The build fails with the patch, see the errors in the attached file. This is 
the native compilation of python, the patches in my build system are also 
applied to the native build so that they can be checked. I can prevent that if 
needed.

--
Added file: http://bugs.python.org/file42755/build-failure.txt

___
Python tracker 

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



[issue26156] Bad name into power operator syntax

2016-05-06 Thread R. David Murray

R. David Murray added the comment:

Sounds like it is a bit more than just confusion: given that power can be used 
outside a coroutine but await can't, Serhiy's formulation would seem to me to 
be more semantically correct, even if syntactically it is the same as the 
current.

I think it would regardless be better to replace 'await' with 'await_expr', so 
+1 on that from me as well.

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



[issue26282] Add support for partial keyword arguments in extension functions

2016-05-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If there are no objections I'm inclined to commit 
pyarg_parse_positional_only_and_keywords_2.patch in short time.

--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue22107] tempfile module misinterprets access denied error on Windows

2016-05-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Billy, no, the parent directory is tested intentionally. If it isn't a 
directory, we should fail.

May be there is a way to distinguish a failure because the name is already used 
for a subdirectory from a failure because we don't have permission to create a 
file, but I haven't access to Windows and can't experiment. Someone motivated 
and experienced should to do this work.

--

___
Python tracker 

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



[issue17888] docs: more information on documentation team

2016-05-06 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue18841] math.isfinite fails with Decimal sNAN

2016-05-06 Thread Berker Peksag

Changes by Berker Peksag :


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



[issue12135] The spawn function should return stderr.

2016-05-06 Thread Berker Peksag

Changes by Berker Peksag :


--
status: open -> closed

___
Python tracker 

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



[issue20554] Use specific asserts in optparse test

2016-05-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue25745] Reference leaks in test_curses

2016-05-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is simple patch that fixes a leak.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file42754/curses_panel_dealloc_userptr.patch

___
Python tracker 

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



[issue20554] Use specific asserts in optparse test

2016-05-06 Thread Berker Peksag

Berker Peksag added the comment:

The patch looks simple, but I don't see much gain to apply it since optparse is 
a deprecated module. I'm in favor of closing this as 'wont fix'.

--
priority: normal -> low

___
Python tracker 

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



[issue26002] make statistics.median_grouped more efficient

2016-05-06 Thread Berker Peksag

Changes by Berker Peksag :


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



[issue25974] Fix statistics.py after the Decimal.as_integer_ratio() change

2016-05-06 Thread Berker Peksag

Berker Peksag added the comment:

statistics_as_integer_ratio.diff has been committed in 7b2fafd78c1d.

--
nosy: +berker.peksag
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



[issue25745] Reference leaks in test_curses

2016-05-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for the tip Berker. Now I see how to fix the leak.

--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue20971] HTML output of difflib

2016-05-06 Thread Berker Peksag

Changes by Berker Peksag :


--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Modernize HTML output of difflib.HtmlDiff.make_file()

___
Python tracker 

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



[issue17888] docs: more information on documentation team

2016-05-06 Thread Berker Peksag

Berker Peksag added the comment:

issue17888.patch looks good to me. I'd probably remove the "necessary skills" 
part.

--
nosy: +berker.peksag
stage: needs patch -> patch review
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



[issue21890] wsgiref.simple_server sends headers on empty bytes

2016-05-06 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag
stage:  -> 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



[issue26939] android: test_functools hangs on armv7

2016-05-06 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Xavier, as a strating point, can you try the following patch? 
(atomic_explicit.patch)
If it solves the issue, can you also measure the performance drop compared to 
unpatched (on a non-debug build)? `python -m test.pystone` should be sufficient.

--
keywords: +patch
Added file: http://bugs.python.org/file42753/atomic_explicit.patch

___
Python tracker 

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



[issue25745] Reference leaks in test_curses

2016-05-06 Thread Berker Peksag

Berker Peksag added the comment:

In case someone wants to work on this, the suspicious tests are 
test_userptr_memory_leak and test_userptr_segfault. See also issue 18113.

--
nosy: +berker.peksag
stage:  -> needs patch
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



[issue26939] android: test_functools hangs on armv7

2016-05-06 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +neologix

___
Python tracker 

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



[issue26939] android: test_functools hangs on armv7

2016-05-06 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I suspect this bug is caused by memory ordering differences between x86 and ARM 
(see https://en.wikipedia.org/wiki/Memory_ordering#Runtime_memory_ordering ), 
which is why it may not reproduce easily (may depend on the particular CPU 
implementation and/or various timing subtleties in the tests themselves).

Xavier / Chi, can you tell if Android has stdatomic.h? See Include/pyatomic.h 
for the difference it makes.

--

___
Python tracker 

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



[issue15786] IDLE code completion window can hang or misbehave with mouse

2016-05-06 Thread suddha sourav

suddha sourav added the comment:

I reported the issue in 2012, and it's not nice to see that in four years
the flagship editor of Python in all platforms I know is still something I
have to avoid. I am not writing this mail to vent; I'm asking: what can we
do, and through which channels we can go, for a quick solution? I am
unfamiliar with the structure of issue resolving in Python, maybe Ned can
help?

Thank you all

On Fri, May 6, 2016 at 8:36 AM, paul czyzewski 
wrote:

>
> paul czyzewski added the comment:
>
> Thanks, Terry and Ned.
>
> Ned, I checked (nice clear instructions, btw) and I had Tk 8.5.10.  So I
> followed the link and installed 8.5.18.  -- The freeze on mac still occurs
> but I understand that this will avoid some other bugs.
>
> BTW, I don't know how testing works for IDLE and Python, but that's what I
> do for a living, so maybe I'll try to get involved.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue26537] ConfigParser has optionxform, but not sectionxform

2016-05-06 Thread Xiang Zhang

Xiang Zhang added the comment:

I write a patch to add sectionxform. It wraps necessary section name operation 
I think. Hope to have some feedback.

--
keywords: +patch
Added file: http://bugs.python.org/file42752/add_sectionxform.patch

___
Python tracker 

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



[issue26156] Bad name into power operator syntax

2016-05-06 Thread Robert Jordens

Robert Jordens added the comment:

Ack to the new patch. It is semantically confusing that the await expression 
also served as the power base without any await.

--

___
Python tracker 

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



[issue20291] Argument Clinic should understand *args and **kwargs parameters

2016-05-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think at first step we can support var-positional parameter only when there 
are no other positional parameters, and var-keyword parameter only when there 
are no other keyword parameters. So print, max and dict.update will be 
supported, but __build_class__, map and functools.partial are not.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26959] pickle: respect dispatch for functions again

2016-05-06 Thread Vsevolod Velichko

Vsevolod Velichko added the comment:

I was trying to avoid additional imports in the test.
But your point of view seems more reasonable, so I reupload the fixed patch.

--
Added file: http://bugs.python.org/file42751/function_pickle.patch

___
Python tracker 

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



[issue26939] android: test_functools hangs on armv7

2016-05-06 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

FWIW, test_functools passes on ASUS Zenfone 2 Laser ZE500KL with stock ROM 
(rooted) and my patchset. [1] The CPU is ARM64 and the Python is built as 
32-bit ARM binaries. test_threading (#26941) and test_importlib (#26940) pass, 
too. test_concurrent_futures (#26938) fails with 27 errors, all with "OSError: 
[Errno 38] Function not implemented", which seems the same as #26924.

The attached file contains logs of the four tests mentioned here.

[1] https://github.com/yan12125/python3-android

--
nosy: +Chi Hsuan Yen
Added file: http://bugs.python.org/file42750/python_tests_on_arm.txt

___
Python tracker 

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



[issue13173] Default values for string.Template

2016-05-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue1528167] Tweak to make string.Templates more customizable

2016-05-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I seconded Raymond. Now the approach is argued against twice. And the patch 
itself is outdated. I suggest to close this issue. If somebody want to 
implement Raymond's idea, his can reopen this issue or open new issue.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26870] Unexpected call to readline's add_history in call_readline

2016-05-06 Thread Tyler Crompton

Tyler Crompton added the comment:

I couldn't think of a way to test input() with the unittest module without 
bypassing readline or requesting the input from the user. With that said, this 
informal script verifies proper behavior.

--
status: open -> pending
Added file: http://bugs.python.org/file42749/test_set_auto_history.py

___
Python tracker 

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



[issue26870] Unexpected call to readline's add_history in call_readline

2016-05-06 Thread Tyler Crompton

Changes by Tyler Crompton :


--
status: pending -> open

___
Python tracker 

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



  1   2   >