[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-12 Thread Alexander Mohr

Alexander Mohr added the comment:

btw want to thank you guys for actively looking into this, I'm very grateful!

--

___
Python tracker 

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



[issue8426] multiprocessing.Queue fails to get() very large objects

2015-11-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I agree with Charles-François and think this issue should be closed. There is 
no a bug, and the behavior is documented.

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



[issue25611] test_deque failure on Gentu and OpenIndiana buildbots on 2.7

2015-11-12 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

http://buildbot.python.org/all/builders/x86%20OpenIndiana%202.7/builds/3104/steps/test/logs/stdio
http://buildbot.python.org/all/builders/x86%20Gentoo%20Non-Debug%20with%20X%202.7/builds/107/steps/test/logs/stdio
==
FAIL: test_basics (test.test_deque.TestBasic)
--
Traceback (most recent call last):
  File "/buildbot/buildarea/2.7.ware-gentoo-x86/build/Lib/test/test_deque.py", 
line 38, in test_basics
self.assertEqual(list(d), range(-200, 400))
AssertionError: Lists differ: [-200, -199, -198, -197, -196,... != [-200, -199, 
-198, -197, -196,...

First differing element 200:
-5125
0

First list contains 125 additional elements.
First extra element 600:
275

Diff is 6032 characters long. Set self.maxDiff to None to see it.

--

On other buildbots the test is passed, and I can't reproduce the failure 
locally.

--
components: Extension Modules
messages: 254548
nosy: rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: test_deque failure on Gentu and OpenIndiana buildbots on 2.7
type: behavior
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



[issue25611] test_deque failure on Gentoo and OpenIndiana buildbots on 2.7

2015-11-12 Thread Zachary Ware

Changes by Zachary Ware :


--
nosy: +zach.ware
title: test_deque failure on Gentu and OpenIndiana buildbots on 2.7 -> 
test_deque failure on Gentoo and OpenIndiana buildbots on 2.7

___
Python tracker 

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



[issue25608] ascynio readexactly() should raise ValueError if passed length <= 0 in argument

2015-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

I'm okay with raising ValueError for length<0; but for length==0 the
behavior is very much intentional -- reading zero bytes is sometimes a
useful end case that otherwise you would have to work around in the
caller.

--

___
Python tracker 

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



[issue25612] nested try..excepts don't work correctly for generators

2015-11-12 Thread Yury Selivanov

New submission from Yury Selivanov:

Nested try..except statements with yields can loose reference to the current 
exception.

The following code:

class MainError(Exception):
pass

class SubError(Exception):
pass

def main():
try:
raise MainError()
except MainError:
try:
yield
except SubError:
print('got SubError')
raise

coro = main()
coro.send(None)
coro.throw(SubError())

prints:

got SubError
Traceback (most recent call last):
  File "t.py", line 19, in 
coro.throw(SubError())
  File "t.py", line 15, in main
raise
RuntimeError: No active exception to reraise

--
components: Interpreter Core
messages: 254557
nosy: benjamin.peterson, gvanrossum, haypo, larry, ncoghlan, yselivanov
priority: release blocker
severity: normal
status: open
title: nested try..excepts don't work correctly for generators
versions: 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



[issue21748] glob.glob does not sort its results

2015-11-12 Thread Dave Jones

Dave Jones added the comment:

>From the bash man-page: "... If one of these characters appears, then the word 
>is regarded as a pattern, and replaced with an *alphabetically sorted* list of 
>filenames matching the pattern".

I would agree that glob.glob shouldn't sort its results (the overhead may be 
substantial, and there are plenty of use-cases that don't require sorting), but 
given that the documented behaviour is at odds (implicitly via the shell's 
documentation) with the implemented behaviour I would argue that it is 
premature to close this without at least adding a note to the Python docs.

(P.S. in case my comment is received poorly, I'm not the original author of 
this ticket, and no aspersions should be cast upon drj for my possibly foolish 
views!)

--
nosy: +Dave Jones

___
Python tracker 

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



[issue25612] nested try..excepts don't work correctly for generators

2015-11-12 Thread Yury Selivanov

Changes by Yury Selivanov :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue25612] nested try..excepts don't work correctly for generators

2015-11-12 Thread STINNER Victor

STINNER Victor added the comment:

Is this issue related to the issue #23353?

--

___
Python tracker 

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



[issue25313] IDLE: gracefully handle themes (or keysets, or ...) not present

2015-11-12 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The patch applied leaves 'name = IDLE New' alone so older IDLEs can use that 
instead of IDLE Classic as an alternative to IDLE Dark.  I will open an issue 
to revise IDLE New slightly.  I also added type='bool' when getting 'default' 
(the lack thereof lead to IDLE Dark being returned as a custom theme.

After working with this, I like the idea of present users with a single list of 
themes to select, instead of two buttons and two drop-down lists.

I tested fairly thoroughly, starting with no user [Theme] section.  When I 
added a print to debug idleConf.CurrentTheme, it was called 13 times on 
startup, with only Shell opened.

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



[issue25612] nested try..excepts don't work correctly for generators

2015-11-12 Thread Yury Selivanov

Changes by Yury Selivanov :


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



[issue25580] async and await missing from token list

2015-11-12 Thread Martin Panter

Martin Panter added the comment:

Do you have a new version of the patch?

--

___
Python tracker 

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



[issue24421] Race condition compiling Modules/_math.c

2015-11-12 Thread Martin Panter

Martin Panter added the comment:

Ideally, I think the solution would be to compile _math.c once, as a dependency 
shared between both extension modules (perhaps like a static library if 
necessary). Does anyone know if the build system supports this, or how to do it?

Another semi-favourable solution might be to compile _math.c twice, but send 
the output to separate directories, e.g. . . ./math-build/_math.o and . . 
./cmath-build/_math.o. Again, I don’t know if this is practical.

--

___
Python tracker 

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



[issue16394] Reducing tee() memory footprint

2015-11-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Raymond, do you want to add a clarification to the documentation, or prefer 
just to close this 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



[issue25606] asyncio doc: 'socket' transport extra info is not mandatory

2015-11-12 Thread STINNER Victor

STINNER Victor added the comment:

Guido van Rossum added the comment:
> The word 'optional' is literally the second word of the description of 
> get_extra_info(). WHat more do you want?

Hum, it can be surprising for users that an application works on
"asyncio" but doesn't work on "libuv asyncio".

We should explicitly explain that the availability of some information
depend on the event loop.

--

___
Python tracker 

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



[issue25606] asyncio doc: 'socket' transport extra info is not mandatory

2015-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

Well I don't know how adding a note to the doc is going to change that
much (those users probably don't read the docs but copy some example),
but go ahead and add something.

--

___
Python tracker 

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



[issue25612] nested try..excepts don't work correctly for generators

2015-11-12 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +pitrou

___
Python tracker 

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



[issue22995] Restrict default pickleability

2015-11-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Was committed the restriction for tp_new == NULL.

New patch uses more complex condition for types that doesn't define any 
reduce-related methods. This case covers _csv.Dialect and memoryview (and 
buffer in 2.7, issue8323).

--
Added file: http://bugs.python.org/file41024/pickle_restrictions_4.patch

___
Python tracker 

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



[issue25604] [Minor] bug in integer true division algorithm

2015-11-12 Thread Mark Dickinson

New submission from Mark Dickinson:

There's a harmless but annoying (for code readers) bug in the code for true 
division of (long) integers.  In `long_true_divide` in `Objects/longobject.c`, 
we have the following code for manipulating the bits of a 55- or 56-bit long to 
get something that will be exactly representable as a float:

/* The number of extra bits that have to be rounded away. */
extra_bits = MAX(x_bits, DBL_MIN_EXP - shift) - DBL_MANT_DIG;
assert(extra_bits == 2 || extra_bits == 3);

/* Round by directly modifying the low digit of x. */
mask = (digit)1 << (extra_bits - 1);
low = x->ob_digit[0] | inexact;
if (low & mask && low & (3*mask-1))
low += mask;
x->ob_digit[0] = low & ~(mask-1U);

/* Convert x to a double dx; the conversion is exact. */
[...]

The last code line above is supposed to be masking out all the bits that we 
don't want to keep. Instead, it's masking out all but one of those bits.  The 
line

x->ob_digit[0] = low & ~(mask-1U);

should be replaced with

x->ob_digit[0] = low & ~(2*mask-1U);

As it stands, the comment about the conversion to double being exact is false. 
(I've verified this by converting x both to a 64-bit unsigned integer and to a 
double and checking that the integer and double don't always match in value; 
with the fix above, they do.)

I don't *think* this bug actually affects the output on any platform whose 
arithmetic and ldexp functions do correct rounding with round-ties-to-even: the 
extra bit will always get rounded away (in the correct direction) by either the 
conversion to float (for the non-subnormal case) or by the ldexp operation (for 
the subnormal case). Still, the bug makes the code a bit more susceptible to 
platform arithmetic quirks.

--
assignee: mark.dickinson
components: Interpreter Core
messages: 254523
nosy: mark.dickinson
priority: low
severity: normal
status: open
title: [Minor] bug in integer true division algorithm
type: behavior
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



[issue25604] [Minor] bug in integer true division algorithm

2015-11-12 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue25606] asyncio doc: 'socket' transport extra info is not mandatory

2015-11-12 Thread STINNER Victor

New submission from STINNER Victor:

Not all implementations of asyncio event loops can provide the "socket" 
transport extra info. See for example this discussion on libuv:
https://github.com/python/asyncio/issues/286

The information should be marked as "optional", or at least we should document 
that it can miss depending on the event loop.

I guess that other info should be marked as optional.

--
components: asyncio
messages: 254527
nosy: gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: asyncio doc: 'socket' transport extra info is not mandatory
versions: 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



[issue22995] Restrict default pickleability

2015-11-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c8841db9433d by Serhiy Storchaka in branch '3.4':
Issue #22995: Default implementation of __reduce__ and __reduce_ex__ now
https://hg.python.org/cpython/rev/c8841db9433d

New changeset 4c05e7c195ac by Serhiy Storchaka in branch '3.5':
Issue #22995: Default implementation of __reduce__ and __reduce_ex__ now
https://hg.python.org/cpython/rev/4c05e7c195ac

New changeset a2f574896f49 by Serhiy Storchaka in branch 'default':
Issue #22995: Default implementation of __reduce__ and __reduce_ex__ now
https://hg.python.org/cpython/rev/a2f574896f49

--
nosy: +python-dev

___
Python tracker 

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



[issue22995] Restrict default pickleability

2015-11-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 94664fb4354e by Serhiy Storchaka in branch '2.7':
Issue #22995: Backported additional tests for non-pickleable types.
https://hg.python.org/cpython/rev/94664fb4354e

--

___
Python tracker 

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



[issue14350] Strange Exception from copying an iterator

2015-11-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies:  -Restrict default pickleability
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Restrict default pickleability

___
Python tracker 

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



[issue25586] socket.sendall broken when a socket has a timeout

2015-11-12 Thread STINNER Victor

STINNER Victor added the comment:

I'm not a big fan of "may" in documentation. I would prefer to rephrase it as 
an advice. Example:

"Considering the loss of information, it's better to not retry sending data to 
the socket anymore."

--

___
Python tracker 

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



[issue25586] socket.sendall broken when a socket has a timeout

2015-11-12 Thread STINNER Victor

STINNER Victor added the comment:

Note: socket-docs.patch file is strange, it looks like you removed the first 
line starting with "diff", and so we don't get the [Review] button.

--

___
Python tracker 

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



[issue25605] fcntl doc: document exceptions raised on error for ioctl() and flock()

2015-11-12 Thread STINNER Victor

New submission from STINNER Victor:

Attached patch documents the exception raised when ioctl() or flock() functions 
fail.

Note: flock() can also raises a ValueError if the second parameter (op) is 
unknown.

If the patch is approved, I will write a similar patch for Python 3 (just 
replace IOError with OSError in Python 3 doc).

Python 2 online doc:
https://docs.python.org/2/library/fcntl.html

Python 3 online doc:
https://docs.python.org/dev/library/fcntl.html

--
assignee: docs@python
components: Documentation
files: fcntl_doc.patch
keywords: patch
messages: 254524
nosy: docs@python, haypo
priority: normal
severity: normal
status: open
title: fcntl doc: document exceptions raised on error for ioctl() and flock()
versions: Python 2.7
Added file: http://bugs.python.org/file41020/fcntl_doc.patch

___
Python tracker 

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



[issue22995] Restrict default pickleability

2015-11-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2b950eba9792 by Serhiy Storchaka in branch '2.7':
Issue #22995: Default implementation of __reduce__ and __reduce_ex__ now
https://hg.python.org/cpython/rev/2b950eba9792

--

___
Python tracker 

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



[issue21748] glob.glob does not sort its results

2015-11-12 Thread Eric V. Smith

Eric V. Smith added the comment:

Assuming David means "it wouldn't be unreasonable to insert a disclaimer", I 
agree.

--

___
Python tracker 

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



[issue25605] fcntl doc: document exceptions raised on error for ioctl() and flock()

2015-11-12 Thread Martin Panter

Martin Panter added the comment:

This looks good for Python 2 and the equivalent for Python 3.

FWIW the ValueError case is platform-dependent. On Linux, I see EINVAL (the 
IOError version of ValueError):

>>> flock(0, LOCK_UN)
>>> flock(0, 0)
Traceback (most recent call last):
  File "", line 1, in 
IOError: [Errno 22] Invalid argument

--
nosy: +martin.panter

___
Python tracker 

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



[issue21748] glob.glob does not sort its results

2015-11-12 Thread R. David Murray

R. David Murray added the comment:

You mean my old English teachers were wrong when they said a positive statement 
was to be preferred to a double negative? :) :)

--

___
Python tracker 

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



[issue25614] Lib/code.py: InteractiveConsole.raw_input writes prompt to stdout

2015-11-12 Thread Yclept Nemo

New submission from Yclept Nemo:

Just like InteractiveInterpreter.write and the actual python interpreter, the 
console's prompt should be written to stderr. Something like:

self.write(prompt)
return input()

--
components: Library (Lib)
messages: 254575
nosy: Yclept.Nemo
priority: normal
severity: normal
status: open
title: Lib/code.py: InteractiveConsole.raw_input writes prompt to stdout
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



[issue25498] Python 3.4.3 core dump with simple sample code

2015-11-12 Thread Martin Panter

Martin Panter added the comment:

New patch with Fortran array test, and read-only and reversed memoryview() 
tests.

--
Added file: http://bugs.python.org/file41025/ctypes_from_buffer_4.patch

___
Python tracker 

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



[issue25612] nested try..excepts don't work correctly for generators

2015-11-12 Thread Yury Selivanov

Yury Selivanov added the comment:

Here's a patch the fixes the first problem (but __context__ bug is still open).

I'm not sure that the patch is correct :(  But at least I've added new 
unittests (one still failing)

--
keywords: +patch
Added file: http://bugs.python.org/file41026/gen_exc_1.patch

___
Python tracker 

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



[issue25313] IDLE: gracefully handle themes (or keysets, or ...) not present

2015-11-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b95c10cb457d by Terry Jan Reedy in branch '2.7':
Issue #25313: Change the handling of new built-in text color themes to better
https://hg.python.org/cpython/rev/b95c10cb457d

New changeset 6185c5603eed by Terry Jan Reedy in branch '3.4':
Issue #25313: Change the handling of new built-in text color themes to better
https://hg.python.org/cpython/rev/6185c5603eed

--
nosy: +python-dev

___
Python tracker 

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



[issue25612] nested try..excepts don't work correctly for generators

2015-11-12 Thread Yury Selivanov

Yury Selivanov added the comment:

This was originally discovered here: 
https://github.com/python/asyncio/issues/287

--
nosy: +brett.cannon

___
Python tracker 

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



[issue25612] nested try..excepts don't work correctly for generators

2015-11-12 Thread STINNER Victor

STINNER Victor added the comment:

I reverted the change of the issue #23353 but it doesn't fix this example, so 
it looks like these issues are not related. Cool.

--

___
Python tracker 

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



[issue8323] buffer objects are picklable but result is not unpicklable

2015-11-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

While buffer is only used in Python 2.x, there is a similar issue in 3.x with 
memoryview.

The patch for issue22995 fixes this 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



[issue25586] socket.sendall broken when a socket has a timeout

2015-11-12 Thread Martin Panter

Martin Panter added the comment:

For what it’s worth, there could be obsure cases where sending more data might 
be okay. I prefer the original version (but can settle for either). Here’s a 
third alternative:

Considering this loss of information, it is generally best not to send any more 
data to the socket.

--

___
Python tracker 

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



[issue14061] Misc fixes and cleanups in archiving code in shutil and test_shutil

2015-11-12 Thread Martin Panter

Martin Panter added the comment:

Remember that you probably should not mention “xztar” in the 3.4 or 2.7 docs 
(even though “lzma” exists in 3.4).

I am not too familiar with using shutil or zipfile, but it seems like 
extraction of some zip files is always possible, even if zlib (for Deflate) 
isn’t available (e.g. for zip files that are not compressed, or use bzip2 or 
LZMA). Maybe you should only make zip file _creation_ conditional.

--
nosy: +martin.panter

___
Python tracker 

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



[issue25613] fix ssl tests with sslv3 disabled

2015-11-12 Thread Matthias Klose

New submission from Matthias Klose:

Linux distributions (now starting with the Ubuntu development version for 16.04 
LTS) are starting to disable SSLv3, letting at least two test_ssl tests fail.

a partial fix is mentioned in https://launchpad.net/bugs/1515793

--
messages: 254573
nosy: doko
priority: normal
severity: normal
status: open
title: fix ssl tests with sslv3 disabled
versions: Python 2.7, 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



[issue25613] fix ssl tests with sslv3 disabled

2015-11-12 Thread Alex Gaynor

Alex Gaynor added the comment:

Does this issue still occur on default? 
https://hg.python.org/cpython/rev/d80954d941c7

--
nosy: +alex

___
Python tracker 

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



[issue25579] def is not a keyword with tokenize.py

2015-11-12 Thread Yury Selivanov

Yury Selivanov added the comment:

Stéphane, sorry for not replying earlier, emails from bugs.python.org sometimes 
go to spam.

[TokenInfo(type=55 (ASYNC), string='async', start=(1, 0), end=(1, 5), 
line='async def foo(): pass'),
 TokenInfo(type=1 (NAME), string='def', start=(1, 6), end=(1, 9), line='async 
def foo(): pass'),

^-- this is indeed correct.  Right now async/await are treated specially in 
tokenizer.c & parser, and tokenize.py simply mimics their behaviour.

--

___
Python tracker 

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



[issue21748] glob.glob does not sort its results

2015-11-12 Thread R. David Murray

R. David Murray added the comment:

Technically the docs are not wrong: "matches files according to the rules of 
the shell" does not say anything about sorting (matching is separate from what 
is done with the matched filenames; the shell sorts them and inserts them in 
place, python returns an unsorted list).  It also mentions using listdir, which 
is documented as unsorted.

That said, it would be reasonable to insert a disclaimer that the returned 
results are unsorted, unlike the shell.  If you want to open an new issue with 
a proposed doc patch, that would be fine.

--

___
Python tracker 

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



[issue21748] glob.glob does not sort its results

2015-11-12 Thread Eric V. Smith

Eric V. Smith added the comment:

D'oh! I read your original comment as "it would be unreasonable to insert a 
disclaimer", and then I wondered why you'd used such a convoluted sentence and 
reversed your meaning. It's all my fault. Fortunately, I don't think Mrs. 
McKinley from 11th grade English will come after me after all these years.

Sorry about that. We're in violent agreement.

--

___
Python tracker 

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



[issue25612] nested try..excepts don't work correctly for generators

2015-11-12 Thread Yury Selivanov

Yury Selivanov added the comment:

Another bug:

class MainError(Exception):
pass

class SubError(Exception):
pass

def main():
try:
raise MainError()
except MainError:
yield

coro = main()
coro.send(None)
coro.throw(SubError())


SubError will propagate, but won't have MainError in its __context__

--

___
Python tracker 

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



[issue25607] test_distutils provokes unexpected output in test_shutil

2015-11-12 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

test_distutils changes global logging level for distutils. This affects 
test_shutil.

In Python 2.7:

$ ./python -m test.regrtest test_distutils test_shutil
[1/2] test_distutils
[2/2] test_shutil
test test_shutil produced unexpected output:
**
zip -q -r archive2.zip dist

**
1 test OK.
1 test failed:
test_shutil

Python 3 testing is more lenient, but produces unexpected output too.

The global logging level is changed in Distribution.parse_command_line() by 
calling log.set_verbosity().

Proposed patch restores the value of the global logging level in tests that 
change it.

--
components: Distutils, Tests
files: test_distutils_restore_log_level.patch
keywords: patch
messages: 254529
nosy: dstufft, eric.araujo, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: test_distutils provokes unexpected output in test_shutil
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: 
http://bugs.python.org/file41021/test_distutils_restore_log_level.patch

___
Python tracker 

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



[issue25607] test_distutils provokes unexpected output in test_shutil

2015-11-12 Thread STINNER Victor

STINNER Victor added the comment:

Instead of a context manager, why not adding a addCleanup() in setUp() method 
of test cases?

You might also add a "resource" test in regrtest, but this one might be 
overkill, since tests using distutils are known (test_distutils), no?

Lib/distutils/tests/support.py:

+threshold = log.set_threshold(log.WARN)
+log.set_threshold(threshold)
+yield threshold

I would prefer to have a log.get_threshold() function (or log._get_threshold() 
if you don't want to modify the public API), or even read 
log._global_log.threshold.

test_shutil.py:

-with support.change_cwd(root_dir), captured_stdout():
+with support.change_cwd(root_dir):

Why do you remove captured_stdout() here?

--
nosy: +haypo

___
Python tracker 

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



[issue19023] ctypes docs: Unimplemented and undocumented features

2015-11-12 Thread Martin Panter

Martin Panter added the comment:

Sye van der Veen: can you sign a contributor agreement 
? I think it might be needed 
for this patch.

--

___
Python tracker 

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



[issue25017] htmllib deprecated: Which library to use? Missing sane default in docs

2015-11-12 Thread Berker Peksag

Berker Peksag added the comment:

htmllib_deprecation_warning_3.patch looks good to me.

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



[issue23883] __all__ lists are incomplete

2015-11-12 Thread Berker Peksag

Berker Peksag added the comment:

> The reason why I prefer the current API over my support.expected_module_api() 
> idea is it requires the extra assertCountEqual() boilerplate at each call 
> site.

I personally find explicit assert* calls in a test case more readable(e.g. I 
don't need to check what the helper does every N month), but I guess that's 
another version of tabs vs. space debate :)

> Jacek’s three patches look ready to me. I propose:

Your plan sounds good to me. Thanks!

> Should we add anything into What’s New, maybe warning of new symbols from 
> “import *”?

I guess it wouldn't hurt to add a sentence :)

--

___
Python tracker 

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



[issue25580] async and await missing from token list

2015-11-12 Thread SilentGhost

SilentGhost added the comment:

Hm, not sure why the file didn't get uploaded, I clearly remember attaching it.

Yury, what is the implication for this issue? Are you suggesting that the note 
should state that these two are temporary? Or is this information available 
somewhere else, in What's new, for example?

--
Added file: http://bugs.python.org/file41028/issue25580.diff

___
Python tracker 

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



[issue25604] [Minor] bug in integer true division algorithm

2015-11-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Correct.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue25608] ascynio readexactly() should raise ValueError if passed length <= 0 in argument

2015-11-12 Thread Марк Коренберг

New submission from Марк Коренберг:

ascynio readexactly() should raise ValueError if passed length <= 0 in argument.

Now, it return empty string, which is just error hiding. Why not to raise 
ValueError ? 

Returning empty string is error prone. This behaviour was not changed since 
initial commit of asyncio, so probably was not done intentionally.

--
components: asyncio
messages: 254545
nosy: gvanrossum, haypo, mmarkk, yselivanov
priority: normal
severity: normal
status: open
title: ascynio readexactly() should raise ValueError if passed length <= 0 in 
argument
type: behavior
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



[issue25609] Add a ContextManager ABC and type

2015-11-12 Thread Brett Cannon

New submission from Brett Cannon:

There should probably be a context manager ABC in collections.abc that requires 
__enter__/__exit__ and a matching entry in `typing` that also takes a type 
argument of what the __enter__ method returns.

--
components: Library (Lib)
keywords: easy
messages: 254546
nosy: brett.cannon, gvanrossum
priority: normal
severity: normal
stage: needs patch
status: open
title: Add a ContextManager ABC and type
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



[issue25610] Add typing.Awaitable

2015-11-12 Thread Brett Cannon

New submission from Brett Cannon:

Probably should have a subclass of Callable in `typing` for Awaitable functions 
(there is already a corollary object in collections.abc).

--
components: asyncio
messages: 254547
nosy: brett.cannon, giampaolo.rodola, gvanrossum, haypo, pitrou, yselivanov
priority: normal
severity: normal
stage: needs patch
status: open
title: Add typing.Awaitable
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



[issue25017] htmllib deprecated: Which library to use? Missing sane default in docs

2015-11-12 Thread Martin Panter

Martin Panter added the comment:

Here is a cleaned-up version of Nan’s first patch.

--
Added file: http://bugs.python.org/file41027/htmllib_deprecation_warning_3.patch

___
Python tracker 

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



[issue7759] mhlib fails on Btrfs filesystem (test_mhlib failure)

2015-11-12 Thread Neil Schemenauer

Neil Schemenauer added the comment:

I don't see how that patch can be correct.  The logic is now if the directory 
has two links inside it then skip it.  The filesystems that don't count '.' and 
'..' will have zero links when empty and will have two links when two real 
files exist in them.

I think my original patch is safer.

--
assignee:  -> serhiy.storchaka
resolution: fixed -> 
stage: resolved -> commit review
status: closed -> open

___
Python tracker 

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



[issue25609] Add a ContextManager ABC and type

2015-11-12 Thread Nan Wu

Nan Wu added the comment:

Hi Brett, I'd like work on this feature. Your description here is clear. 
Besides that, could you give a use case of this context manager?

--
nosy: +Nan Wu

___
Python tracker 

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



[issue25590] tab-completition on instances repeatedly accesses attribute/descriptors values

2015-11-12 Thread Martin Panter

Martin Panter added the comment:

Yeah I plan to merge the first patch (fixing conflicts) into 3.6 without any of 
the uncreated-property additions, and then apply that extra stuff in a separate 
commit.

Using __slots__ would be simpler; I’ll switch it over.

--

___
Python tracker 

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



[issue23883] __all__ lists are incomplete

2015-11-12 Thread Martin Panter

Martin Panter added the comment:

The reason why I prefer the current API over my support.expected_module_api() 
idea is it requires the extra assertCountEqual() boilerplate at each call site.

Jacek’s three patches look ready to me. I propose:

1. Commit Issue23883_support_check__all__.v6.patch to 3.6, which everything 
else depends on.

2. Commit Issue23883_test_gettext.v3.patch to 3.6. (Andrew Kuchling’s original 
gettext.__all__ fix was made in 3.4 and 2.7 as well, but we would have to 
backport the support function, or rewrite the test, to apply this to earlier 
branches.)

3. Commit Issue23883_all.v6.patch to 3.6 only to limit the chance of breaking 
existing code.

4. Rewrite Mauro SM Rodrigues’s issue23883_fileinput.patch to use 
support.check__all__().

5. Update Joel Taddei’s Issue23883_tarfile_all.patch and 
Issue23883_calendar_all.patch for support.check__all__() and addressing review 
comments.

6. Work on the remaining modules, probably in a separate issue to keep things 
under control. According to my calculations these modules are: cgi, 
configparser, doctest, http.cookies, mailbox, mimetypes, plistlib, pydoc, 
smtpd, tkinter.ttk, tokenize, xml.etree.ElementTree.

Another question that comes to mind: Should we add anything into What’s New, 
maybe warning of new symbols from “import *”?

--

___
Python tracker 

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



[issue25607] test_distutils provokes unexpected output in test_shutil

2015-11-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch that just uses addCleanup() as Victor suggested.

> Why do you remove captured_stdout() here?

It is no longer needed.

--
Added file: 
http://bugs.python.org/file41022/test_distutils_restore_log_level_2.patch

___
Python tracker 

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



[issue25493] warnings.warn: wrong stacklevel causes import of local file "sys"

2015-11-12 Thread Christoph Reiter

Christoph Reiter added the comment:

To add some info why we hit that bug:

https://bugs.python.org/issue24305 changed the warning stacklevel needed for 
import warnings from 8 to 2. As a result any code doing import warnings will 
likely hit that edge case when run with 3.5 and openafs installed. But I'm not 
sure if there is much code out there doing import warnings.. so ymmv.


For anyone with the same problem looking for a workaround:

I went through all Python versions and searched for the needed stacklevel.

def get_import_stacklevel(import_hook):
"""Returns the stacklevel value for warnings.warn() for when the warning
gets emitted by an imported module, but the warning should point at the
code doing the import.

Pass import_hook=True if the warning gets generated by an import hook
(warn() gets called in load_module(), see PEP302)
"""

py_version = sys.version_info[:2]
if py_version <= (3, 2):
# 2.7 included
return 4 if import_hook else 2
elif py_version == (3, 3):
return 8 if import_hook else 10
elif py_version == (3, 4):
return 10 if import_hook else 8
else:
# fixed again in 3.5+, see https://bugs.python.org/issue24305
return 4 if import_hook else 2

--
nosy: +lazka

___
Python tracker 

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



[issue25607] test_distutils provokes unexpected output in test_shutil

2015-11-12 Thread STINNER Victor

STINNER Victor added the comment:

test_distutils_restore_log_level_2.patch looks good to me, it's simpler than 
the first version. I hope that it will fix the sporadic failures, thanks for 
working on fixing Python 2.7 buildbots!

--

___
Python tracker 

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



[issue25580] async and await missing from token list

2015-11-12 Thread SilentGhost

SilentGhost added the comment:

I've added versionchanged, since this is what's done in os, for similar lists.

--

___
Python tracker 

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



[issue25599] asyncio.iscoroutinefunction returns unexpected results when presented with unittest.mock.Mock

2015-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

OK, I concede your point. It shouldn't be too hard to make
asyncio.iscoroutinefunction() behave the same way as
inspect.iscoroutinefunction(). Can you submit a patch?

--

___
Python tracker 

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



[issue25607] test_distutils provokes unexpected output in test_shutil

2015-11-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4461613ffe78 by Serhiy Storchaka in branch '3.4':
Issue #25607: Restore old distutils logging threshold after running tests that
https://hg.python.org/cpython/rev/4461613ffe78

New changeset d7741afd8347 by Serhiy Storchaka in branch '2.7':
Issue #25607: Restore old distutils logging threshold after running tests that
https://hg.python.org/cpython/rev/d7741afd8347

New changeset 7411830c7b24 by Serhiy Storchaka in branch '3.5':
Issue #25607: Restore old distutils logging threshold after running tests that
https://hg.python.org/cpython/rev/7411830c7b24

New changeset 9f6e43a6b3e0 by Serhiy Storchaka in branch 'default':
Issue #25607: Restore old distutils logging threshold after running tests that
https://hg.python.org/cpython/rev/9f6e43a6b3e0

--
nosy: +python-dev

___
Python tracker 

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



[issue25607] test_distutils provokes unexpected output in test_shutil

2015-11-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Victor for your review.

It's my fault, I missed this failure when added test_zipfile_vs_zip in 
issue24982. Perhaps because ran only singular test test_shutil on 2.7, and on 
3.x an unexpected output doesn't break tests.

In any case it is more right to fix the original cause in test_distutils that 
just silence an unexpected output.

--
assignee:  -> serhiy.storchaka
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



[issue25606] asyncio doc: 'socket' transport extra info is not mandatory

2015-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

The word 'optional' is literally the second word of the description of 
get_extra_info(). WHat more do you want?

--

___
Python tracker 

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



[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-12 Thread Justin Mayfield

Justin Mayfield added the comment:

Interesting.

I was going to do an analysis what using _ready.appendleft() for adding 
selector events would do for that scenario.  The idea being to consistently 
juxtapose exiting callbacks, selector events and new callbacks.  However I 
think this just moves the pawn in this ioloop halting problem.

Is it worth investigating a change to the stop mechanism instead?  Instead of 
raising an exception in the middle of run_once, it could set a flag to be seen 
by run_forever().  This may avoid this class of problem altogether and ensure 
run_once is a fairly simple and predictable.

--

___
Python tracker 

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



[issue14061] Misc fixes and cleanups in archiving code in shutil and test_shutil

2015-11-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Most of issues are already fixed. Proposed patch fixes remnants:

* You see a skip message when bz2 or lzma are not available, instead of silent 
non-testing.

* Removed a code that handles zipfile import failure. Importing zipfile now is 
always successful.

* The gztar and zip formats now are registered and supported only when zlib is 
available. This is documented now.

* Broken circular dependency between shutil and tarfile.

* Removed outdated sentences about the InfoZIP "zip" utility.

--
keywords: +patch
stage:  -> patch review
versions: +Python 3.6
Added file: http://bugs.python.org/file41023/shutil_make_archive_misc.patch

___
Python tracker 

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



[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

Yeah, I've thought about changing the stop() mechanism too. It might
mean that some callbacks will be executed that are currently skipped
though, if your proposal is to run all callbacks in self._ready
(excluding new ones) and then just exit if the stop flag is set. I
worry about how this would violate expectations. We should be able to
get away with this, because PEP 3156 is carefully vague about exactly
how soon the loop will stop: it promises that callbacks scheduled
*before* stop() was called will run before the loop exist -- but it
makes no promises either way about callbacks schedule after stop() is
called.

A less intrusive change to stop() would be to somehow mark the point
in self._ready where stop is called, so stopping at the same point as
with the old algorithm, except for one difference: if you call stop()
multiple times, it currently leaves extra "markers" in self._ready,
which must be consumed by calling run_forever() multiple times. This
proposal would change the semantics of that case. Again, I don't think
PEP 3156 prevents us from doing that.

But I still think those callbacks should be fixed (Alexander's
original fix, extended to a few other callbacks that use
fut.cancelled()).

--

___
Python tracker 

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



[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-12 Thread Guido van Rossum

Guido van Rossum added the comment:

I thought some more about this. The problem is due to stopping and
restarting the loop, and that's also something that occurs in
Alexander's example code, so I retract my accusation of aiohttp (and I
don't think I need more investigation of his code).

I recall that I thought a LOT about whether to run callbacks and then
poll the selector or the other way around. The issue is that in the
"steady state" it doesn't matter because the two would alternate
either way; but in edge cases it does matter, as we've seen here.

I worry about a scenario where a callback does something like this:

def evil():
loop.call_soon(evil)
loop.stop()

Then the following code would never poll the selector with your fix
(let's assume there are active FDs):

evil()
while True:
loop.run_forever()

Using the existing strategy it would still poll the selector.

Also, several tests fail with your patch -- I have to investigate those.

All in all I think replacing fut.cancelled() with fut.done() may be
the way to go.

--

___
Python tracker 

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



[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-12 Thread Justin Mayfield

Justin Mayfield added the comment:

Yes, that's what I was suggesting.

Looking at tornado they do the stop between callbacks/matured-scheduled and 
events.  That approach seems somewhat arbitrary to me at first glance but 
tornado is very mature and they usually have good reasons for what they do.   

The notion of always completing a cycle seems more apt to me;  Ie. your first 
design.

A compelling thought experiment for allowing stop() to be lazy is if a user 
could somehow know when stop() was going to run or when it had been run.  The 
nature of ioloop programming prevents you from knowing when it will run and 
because stop() has no return handle/future/task a user can't actually know when 
it did run.  Ie. there is no way to await/add_done_callback on it, so baring 
hacks that bookend a stop() with marker callbacks it should be, as you said, 
sufficiently vague to justify a (more) lazy effect.

--

I more or less agree on the s/cancelled/done/ changes.  I'm using a similar 
monkey patch in my libraries to dance around this issue right now.  I still 
don't exactly like the idea that code is written with an explicit expectation 
that it could be pending or cancelled, but then must also be inherently 
prepared for spurious done callbacks.  This seems like a borderline contract 
violation by add_writer() and co.  I suppose that add_writer() is primarily 
targeted at streams and the case of an EINTR in a socket connect() is a more a 
one-shot.  Tough call.

--

___
Python tracker 

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



[issue25580] async and await missing from token list

2015-11-12 Thread Yury Selivanov

Yury Selivanov added the comment:

ASYNC/AWAIT tokens are temporary and will be removed in 3.7

--

___
Python tracker 

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