[issue28465] python 3.5 magic number

2016-10-18 Thread Zachary Ware

Zachary Ware added the comment:

I suspect Debian 9's Python 3.5.2 has patches beyond v3.5.2, including the 
patch from #27286 (34d24c51eab6).

What problem is this causing for you?

--
nosy: +doko, serhiy.storchaka, zach.ware

___
Python tracker 

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



[issue28415] PyUnicode_FromFormat integer format handling different from printf about zeropad

2016-10-18 Thread Josh Rosenberg

Changes by Josh Rosenberg :


--
title: PyUnicode_FromFromat interger format handling different from printf 
about zeropad -> PyUnicode_FromFormat integer format handling different from 
printf about zeropad

___
Python tracker 

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



[issue28410] Add convenient C API for "raise ... from ..."

2016-10-18 Thread Nick Coghlan

Nick Coghlan added the comment:

Issue 23188 (referenced above) covers making this a public API for 3.7.

I think it's a good idea, but it's too late to add it to 3.6, and getting the 
documentation right is going to require some discussion (as using this new API 
isn't necessary if you're already in a Python exception handler and are 
directly or indirectly calling PyErr_SetObject, but *is* necessary if you're 
wanting to chain with a just set C level exception).

--

___
Python tracker 

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



[issue28465] python 3.5 magic number

2016-10-18 Thread 曹忠

曹忠 added the comment:

I try, still the same:
On debian 9 and python 3.5.2:
>>> importlib.util.MAGIC_NUMBER
b'\x17\r\r\n'

On windows and python 3.5.2
>>> importlib.util.MAGIC_NUMBER
b'\x16\r\r\n'

--

___
Python tracker 

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



[issue28472] SystemTap usage examples in docs are incorrect

2016-10-18 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +lukasz.langa
versions: +Python 3.7

___
Python tracker 

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



[issue26240] Docstring of the subprocess module should be cleaned up

2016-10-18 Thread Tim Mitchell

Tim Mitchell added the comment:

Am now working from tip of default in mercurial (Python 3.6).

* Removed all changes to subprocess.rst.

subprocess.__doc__
* Trimmed down even further - removed function signatures.
* added note to see Python docs for complete description.

Exception docs
* just list attributes rather than describing them - they are pretty 
self-explanatory.

Popen.__doc__ 
* Trimmed down to just list arguments with 1 or 2 liner descriptions. 
* Added note to see Python docs for complete description.
* added encoding and errors arguments

--
Added file: http://bugs.python.org/file45140/subprocess2.patch

___
Python tracker 

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



[issue28448] C implemented Future doesn't work on Windows

2016-10-18 Thread INADA Naoki

INADA Naoki added the comment:

I think _WaitCancelFuture can do same thing by overriding
callers of _schedule_callbacks.

Attached patch does it, and make _schedule_callbacks private
by renaming it to __schedule_callbacks.

--
Added file: 
http://bugs.python.org/file45139/dont-override-schedule-callbacks.patch

___
Python tracker 

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



[issue28473] mailbox.MH crashes on certain Claws Mail .mh_sequences files

2016-10-18 Thread R. David Murray

R. David Murray added the comment:

I just checked, and nhm 1.3 produces a warning for case 1 and either fails to 
interpret anything past a token that starts with a '-' or it hangs. You should 
report the invalid sequence problem to claws mail.

--
resolution:  -> third party
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



[issue28473] mailbox.MH crashes on certain Claws Mail .mh_sequences files

2016-10-18 Thread R. David Murray

R. David Murray added the comment:

What do you mean by "crashes"?  I'm sure you don't mean a segfault.  Can you 
paste the traceback?

Neither of those two cases are valid in mh, as far as I know, so I'm not sure 
there is anything to fix here.

--
nosy: +r.david.murray
type: crash -> behavior

___
Python tracker 

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



[issue26685] Raise errors from socket.close()

2016-10-18 Thread Yury Selivanov

Yury Selivanov added the comment:

Maybe we should fix asyncio.  Maybe if a user passes an existing socket object 
into loop.create_connection, it should duplicate the socket.

--

___
Python tracker 

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



[issue26685] Raise errors from socket.close()

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

> My proposal: ignore EBADF in socket.close().  It means that the socket is 
> closed already.  It doesn't matter why.

As Martin explained, getting EBAD means that your code smells. Your
code may close completely unrelated file descriptor... Say hello to
race conditions :-)

--

___
Python tracker 

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



[issue26685] Raise errors from socket.close()

2016-10-18 Thread Yury Selivanov

Yury Selivanov added the comment:

My proposal: ignore EBADF in socket.close().  It means that the socket is 
closed already.  It doesn't matter why.

--

___
Python tracker 

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



[issue26685] Raise errors from socket.close()

2016-10-18 Thread Yury Selivanov

Yury Selivanov added the comment:

Another example: some asyncio (run with uvloop) code:
 
conn, _ = lsock.accept()
f = loop.create_task(
loop.connect_accepted_socket(
proto_factory, conn))
# More code
loop.run_forever()
conn.close()

Suppose the above snippet of code is some real-world program.

Now, in Python 3.5 everything works as expected.  In Python 3.6, "conn.close()" 
will raise an exception.

Why: uvloop passes the FD of "conn" to libuv, which does its thing and closes 
the connection when it should be closed.

Now:

> 1. Your code should call sock0.detach() rather than fileno(), so that sock0 
> no longer “owns” the file descriptor, or

I can't modify "connect_accepted_socket" to call "detach" on "conn", as it 
would make "conn" unusable right after the call.  This option can't be 
implemented, as it would break the backwards compatibility.

> 2. libuv should not close file descriptors that it doesn’t own.

This is not just about uvloop/libuv.  It's about any Python program out there 
that will break in 3.6.  A lot of code extracts the FD out of socket objects 
and does something with it.  We can't just make socket.close() to raise in 3.6 
-- that's not how backwards compatibility promise works.

Guido, what do you think about this issue?

--

___
Python tracker 

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



[issue26685] Raise errors from socket.close()

2016-10-18 Thread Martin Panter

Martin Panter added the comment:

If libuv closes the FD (step 3), won’t you get the same sort of problem if the 
uvloop user tries to do something else with the Python socket object, e.g. call 
getpeername()?

I see the fileno=... parameter for sockets as a parallel to the os.fdopen() 
function, which does raise exceptions from FileIO.close().

Maybe one option is to only trigger a DeprecationWarning, and raise a proper 
OSError in a future version.

--

___
Python tracker 

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



[issue26685] Raise errors from socket.close()

2016-10-18 Thread Martin Panter

Martin Panter added the comment:

I think your code example is not very robust, because the “sock” object refers 
to a freed file descriptor, and could easily close an unrelated file:

$ python3.5 -q
>>> import socket
>>> sock0 = socket.socket()
>>> sock = socket.socket(fileno=sock0.fileno())
>>> sock0.close()
>>> f = open("/dev/null")  # Unrelated code/thread opens a file
>>> sock.close()  # Closes unrelated file descriptor!
>>> f.close()  # Error even in 3.5
Traceback (most recent call last):
  File "", line 1, in 
OSError: [Errno 9] Bad file descriptor

I am not familiar with your use case or library, but I would suggest that 
either:

1. Your code should call sock0.detach() rather than fileno(), so that sock0 no 
longer “owns” the file descriptor, or

2. libuv should not close file descriptors that it doesn’t own.

Calling socket.close() should be safe if the Python socket object is registered 
as closed, but IMO calling close(), or any other method, when the OS socket 
(file descriptor) has been released behind Python’s back is a programming error.

--

___
Python tracker 

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



[issue26685] Raise errors from socket.close()

2016-10-18 Thread Yury Selivanov

Yury Selivanov added the comment:

IOW, what is happening in uvloop:

1. A user has a Python socket object and passes it asyncio (run with uvloop) 
API.

2. uvloop extracts the FD of the socket, and passes it to low-level libuv.

3. At some point of time, libuv closes the FD.

4. When user tries to close the socket, it silently fails in 3.5, and raises an 
exception in 3.6.

One way to solve this would be to use os.dup() in uvloop (i.e. pass a 
duplicated FD to libuv).  But that would mean that programs that use uvloop 
will consume file descriptors (limited resource) faster than programs that use 
vanilla asyncio.

Currently, there's a documented way of creating a socket out of an existing FD 
(fourth argument to the socket's constructor).  This means that the FD might be 
controlled by someone.  At least in this case, sock.close() must not raise if 
it fails.  It's OK if the FD is already close, because the Python socket was 
only wrapping it in the first place.

--

___
Python tracker 

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



[issue26685] Raise errors from socket.close()

2016-10-18 Thread Yury Selivanov

Yury Selivanov added the comment:

I think this patch should be reverted.  It breaks backwards compatibility:

import socket

sock0 = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
sock = socket.socket(
socket.AF_INET, socket.SOCK_STREAM, 0, sock0.fileno())
sock0.close()

sock.close()


This code behaves differently on 3.5 vs 3.6.

In uvloop (https://github.com/magicstack/uvloop) I create Python sockets for 
libuv socket handles. Sometimes, those handles are closed by libuv, and I have 
no control over that. So right now, a lot of uvloop tests fail because 
socket.close() now can raise an error.

It also doesn't make any sense to raise it anyways.  socket.close() *must* be 
safe to call even when the socket is already closed.

--
nosy: +yselivanov
status: closed -> open

___
Python tracker 

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



[issue28473] mailbox.MH crashes on certain Claws Mail .mh_sequences files

2016-10-18 Thread Garrett Nievin

New submission from Garrett Nievin:

Using Claws Mail, and mailbox.MH crashes on two different conditions:

1) sequence spans lines, suchly:
unseen: 1-222 225-300
990-1024 1048-2048

Not Pythonic, but I fixed it with this update:

def get_sequences(self):
"""Return a name-to-key-list dictionary to define each sequence."""
results = {}
with open(os.path.join(self._path, '.mh_sequences'), 'r', 
encoding='ASCII') as f:
all_keys = set(self.keys())
for line in f:
try:
if line.count(':') == 0:
contents = line
else:
name, contents = line.split(':')
keys = set()
for spec in contents.split():
if spec.isdigit():
keys.add(int(spec))



2) Sequence spec appears to be open-ended on the front:
 28119-28123 28127 28129 28131 28133-28142 28144-28154 28156-28172 28174-28189 
28191-28204 28206-28218 28220-28224 28226 28228-28234 28237-28239
 28119-28123 28127 28129 28131 28133-28142 28144-28154 28156-28163
 28119-28123 28127 28129 28131 28133-28157
-27920 27923-27945 27947

I'm not sure how to interpret this, so just put in a kludgy fix to get my 
script running as a workaround (not using sequences).

Would also be interested in an option to open a mailbox and process while 
ignoring sequences.

--
components: Library (Lib)
messages: 278945
nosy: garrettzilla
priority: normal
severity: normal
status: open
title: mailbox.MH crashes on certain Claws Mail .mh_sequences files
type: crash
versions: Python 3.5

___
Python tracker 

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



[issue28472] SystemTap usage examples in docs are incorrect

2016-10-18 Thread Roman Podoliaka

New submission from Roman Podoliaka:

There are a couple of errors in SystemTap examples from "Instrumenting CPython 
with DTrace and SystemTap" page 
(https://docs.python.org/dev/howto/instrumentation.html):

1) in SystemTap double quotes are used to denote string literals. As is 
examples fail with:

parse error: expected literal string or number
saw: operator ''' at show_call.stp:1:15
 source: probe process('python').mark("function__entry") {

2) stap -c option expects a command as a single string argument, not as a list 
of strings. As is the following example:

$ stap \
  show-call-hierarchy.stp \
  -c ./python test.py

will not run a test.py script, but instead ./python without any args, thus it 
will print a
prompt (i.e. >>>) and wait for user input.

--
assignee: docs@python
components: Documentation
files: patch.diff
keywords: patch
messages: 278944
nosy: docs@python, rpodolyaka
priority: normal
severity: normal
status: open
title: SystemTap usage examples in docs are incorrect
versions: Python 3.6
Added file: http://bugs.python.org/file45138/patch.diff

___
Python tracker 

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



[issue28441] Change sys.executable to include executable suffix

2016-10-18 Thread Masayuki Yamamoto

Masayuki Yamamoto added the comment:

I agree to add the suffix to solve ambiguous path on Cygwin. And I think the 
patch should apply to all platforms having executable suffix.

Therefore, I modified your patch to remove #if directive for Cygwin, and I 
changed title to spread covered platforms.
This patch uses EXE_SUFFIX that is the EXE defined on Makefile. If platform 
doesn't have executable suffix, doesn't add anything process.

--
components: +Interpreter Core
title: sys.executable is ambiguous on Cygwin without .exe suffix -> Change 
sys.executable to include executable suffix
Added file: http://bugs.python.org/file45137/sys-executable-suffix.patch

___
Python tracker 

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



[issue26240] Docstring of the subprocess module should be cleaned up

2016-10-18 Thread Martin Panter

Martin Panter added the comment:

Thanks for tackling this one Tim. I agree with Berker that the :const:`True` 
changes are out of scope (some introduce errors and inaccuracies).

 class CalledProcessError(SubprocessError):
-"""Raised when a check_call() or check_output() process returns non-zero.
+"""Raised when a process run by check_call() or check_output() process
+returns a non-zero exit status.

New text has stray “process” noun. The old text was good enough IMO.

+  output:  Output of the child process if it was captured by run() or
+   check_output(). Otherwise, None.
 check_output() will also store the output in the output attribute.

I think that last paragraph is redundant and strange now that you already 
described the “output” attribute.

 class TimeoutExpired(SubprocessError):
+Attributes:

The “cmd” attribute is missing from the list.

 class Popen(object):

Your patch seems to be based on 3.6 or 3.7, but you have omitted the new 
“encoding” etc parameters from the signature (and list of constructor 
parameters). What about just relying on the automatic signature for __init__()?

+""" [. . .]
+  universal_newlines:
+If universal_newlines is True, the file objects stdout and stderr are
+opened as a text file, but lines may be terminated by any of '\n',

“opened as text files” would read better I think.

The escape codes will be translated to literal newlines etc in the doc string. 
The best solution is probably to make it a raw string: r""". . .""".

This universal_newlines entry has lots of details about newline translation of 
stdout and stderr, but fails to mention the translation of stdin. And I think 
the details about the child decoding its input should be added to the RST 
documentation before we consider adding it to the doc string.

--

___
Python tracker 

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



[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread Yury Selivanov

Yury Selivanov added the comment:

> I'm curious. I tested in release mode, the example does crash:

Well, since the GIL wasn't properly acquired, it's only a matter of time until 
something else crashes.

--

___
Python tracker 

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



[issue24381] Got warning when compiling ffi.c on Mac

2016-10-18 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

of course, I will do it. Thank for your review

--

___
Python tracker 

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



[issue28334] netrc does not work if $HOME is not set

2016-10-18 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



[issue24381] Got warning when compiling ffi.c on Mac

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

Modules/_ctypes/libffi_osx/ffi.c comes from libffi, can you please propose a 
bugfix upstream?

* https://sourceware.org/libffi/
* https://github.com/libffi/libffi

I'm not sure where is the upstream.

--
nosy: +haypo

___
Python tracker 

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



[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

I'm curious. I tested in release mode, the example does crash:

$ ./python x.py 
Segmentation fault (core dumped)


I'm able to get a Python traceback using PYTHONMALLOC=debug:

$ PYTHONMALLOC=debug ./python x.py 
Fatal Python error: Python memory allocator called without holding the GIL

Current thread 0x7f65bd74b700 (most recent call first):
  File "/home/haypo/prog/python/default/Lib/asyncio/base_events.py", line 790 
in _create_connection_transport
  File "/home/haypo/prog/python/default/Lib/asyncio/base_events.py", line 777 
in create_connection
  File "/home/haypo/prog/python/default/Lib/asyncio/streams.py", line 75 in 
open_connection
  File "x.py", line 13 in client
  File "x.py", line 16 in runner
  File "/home/haypo/prog/python/default/Lib/asyncio/tasks.py", line 239 in _step
  File "/home/haypo/prog/python/default/Lib/asyncio/events.py", line 126 in _run
  File "/home/haypo/prog/python/default/Lib/asyncio/base_events.py", line 1390 
in _run_once
  File "/home/haypo/prog/python/default/Lib/asyncio/base_events.py", line 405 
in run_forever
  File "/home/haypo/prog/python/default/Lib/asyncio/base_events.py", line 437 
in run_until_complete
  File "x.py", line 18 in 
Aborted (core dumped)

--

___
Python tracker 

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



[issue28293] Don't completely dump the regex cache when full

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

re_cache_ordered_dict_popitem.patch: LGTM, it can be pushed to the default 
branch.

--

"This is unlikely possible with current API of lru_cache. Testing flags before 
looking up in a cache adds an overhead."

Oh wait, I looked at the code and this case is complex because the function 
depends on the current locale if the LOCALE flag is set... A lookup in the the 
cache requires to get the current locale, but not if the LOCALE flag is not 
set... It seems too complex for @lru_cache().

--

___
Python tracker 

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



[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread Ned Deily

Changes by Ned Deily :


--
priority: release blocker -> 

___
Python tracker 

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



[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread Yury Selivanov

Yury Selivanov added the comment:

> In release mode, the check is disabled by default (can be enabled at
runtime), and I don't think that the code can crash.

It actually crashed in release mode for me.  Maybe the exact location of SF was 
different, but whatever...

Anyways, closing the issue. Thanks for the review Christian!

--
components: +Library (Lib) -Interpreter Core
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



[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4b5b233d4c98 by Yury Selivanov in branch '3.6':
Issue #28471: Fix crash (GIL state related) in socket.setblocking
https://hg.python.org/cpython/rev/4b5b233d4c98

New changeset 554fb699af8c by Yury Selivanov in branch 'default':
Merge 3.6 (issue #28471)
https://hg.python.org/cpython/rev/554fb699af8c

--
nosy: +python-dev

___
Python tracker 

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



[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

> Fatal Python error: Python memory allocator called without holding the GIL

Oh, I didn't expect that my new check would catch such bug. Nice.

In release mode, the check is disabled by default (can be enabled at
runtime), and I don't think that the code can crash.

But the bug should be fixed anyway :-)

--

___
Python tracker 

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



[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread Christian Heimes

Christian Heimes added the comment:

3.5 is not affected by the crasher. I only added the error check to default 
(3.6).

--

___
Python tracker 

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



[issue28334] netrc does not work if $HOME is not set

2016-10-18 Thread Dimitri Merejkowsky

Dimitri Merejkowsky added the comment:

During review SilentGhost suggested that maybe a test was not essential.

In any case, I think patching documentation about the new behavior won't hurt. 

Do you want me to do that?

--

___
Python tracker 

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



[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread Yury Selivanov

Yury Selivanov added the comment:

> LGTM, thanks Yury!

NP :)  Should this be committed to 3.6/default, or in 3.5 too?

--

___
Python tracker 

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



[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread Christian Heimes

Christian Heimes added the comment:

LGTM, thanks Yury!

--
stage:  -> patch review
type:  -> crash
versions: +Python 3.7

___
Python tracker 

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



[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread Yury Selivanov

Yury Selivanov added the comment:

Attaching a patch to fix this. Please review.

--
keywords: +patch
Added file: http://bugs.python.org/file45136/issue28471.patch

___
Python tracker 

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



[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread Christian Heimes

Christian Heimes added the comment:

It's my fault. I added the "goto error" w/o realizing that I forgot to 
re-acquire the GIL.

--

___
Python tracker 

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



[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread Yury Selivanov

Yury Selivanov added the comment:

I have a patch already, writing a unittest.

--

___
Python tracker 

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



[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread Christian Heimes

Christian Heimes added the comment:

internal_setblocking() sets an exception w/o holding the GIL.

#0  0x7711f6f5 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/unix/sysv/linux/raise.c:54
#1  0x771212fa in __GI_abort () at abort.c:89
#2  0x0042935f in Py_FatalError (msg=0x83d8f8 "Python memory allocator 
called without holding the GIL")
at Python/pylifecycle.c:1457
#3  0x0042138f in _PyMem_DebugCheckGIL () at Objects/obmalloc.c:1972
#4  0x004214ae in _PyMem_DebugFree (ctx=0xad8bf0 <_PyMem_Debug+48>, 
ptr=0xcf8b40) at Objects/obmalloc.c:1994
#5  0x0041e9cb in PyMem_Free (ptr=0xcf8b40) at Objects/obmalloc.c:442
#6  0x0046f7ed in _PyFaulthandler_Fini () at 
./Modules/faulthandler.c:1369
#7  0x00429303 in Py_FatalError (msg=0x83d8f8 "Python memory allocator 
called without holding the GIL")
at Python/pylifecycle.c:1431
#8  0x0042138f in _PyMem_DebugCheckGIL () at Objects/obmalloc.c:1972
#9  0x004213d0 in _PyMem_DebugMalloc (ctx=0xad8c20 <_PyMem_Debug+96>, 
nbytes=84) at Objects/obmalloc.c:1980
#10 0x0041eb6b in PyObject_Malloc (size=84) at Objects/obmalloc.c:479
#11 0x005c0a19 in PyUnicode_New (size=19, maxchar=116) at 
Objects/unicodeobject.c:1280
#12 0x005c8e0e in PyUnicode_FromUnicode (u=0xd26450 L"Bad file 
descriptor", size=19) at Objects/unicodeobject.c:2016
#13 0x005ce90f in PyUnicode_FromWideChar (w=0xd26450 L"Bad file 
descriptor", size=19) at Objects/unicodeobject.c:2497
#14 0x005d48f0 in PyUnicode_DecodeLocaleAndSize (str=0x77273e98 
"Bad file descriptor", len=19, 
errors=0x8747bb "surrogateescape") at Objects/unicodeobject.c:3729
#15 0x005d4f86 in PyUnicode_DecodeLocale (str=0x77273e98 "Bad file 
descriptor", errors=0x8747bb "surrogateescape")
at Objects/unicodeobject.c:3802
#16 0x00717924 in PyErr_SetFromErrnoWithFilenameObjects (exc=, filenameObject=0x0, filenameObject2=0x0)
at Python/errors.c:448
#17 0x00717f00 in PyErr_SetFromErrno (exc=) at 
Python/errors.c:553
#18 0x703000b0 in internal_setblocking (s=0x7fffeb3e1d48, block=1) at 
/home/heimes/dev/python/cpython/Modules/socketmodule.c:667
#19 0x7030597a in sock_setblocking (s=0x7fffeb3e1d48, arg=False) at 
/home/heimes/dev/python/cpython/Modules/socketmodule.c:2445
#20 0x0054a2ce in _PyCFunction_FastCallDict (func_obj=, 
args=0xef4058, nargs=1, kwargs=0x0) at Objects/methodobject.c:209
#21 0x0054a963 in _PyCFunction_FastCallKeywords (func=, 
stack=0xef4058, nargs=1, kwnames=0x0) at Objects/methodobject.c:295
#22 0x006e306c in call_function (pp_stack=0x7ffe9088, oparg=1, 
kwnames=0x0) at Python/ceval.c:4787

--
nosy: +christian.heimes

___
Python tracker 

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



[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread Ned Deily

Ned Deily added the comment:

And here's an OS X debug-build stack trace using the system malloc (current 3.6 
tip, a218260334c4):

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   pytest_10.120x00010256b794 PyObject_Call + 404 
(abstract.c:2245)
1   pytest_10.120x0001027797cf 
PyErr_SetFromErrnoWithFilenameObjects + 479 (errors.c:515)
2   pytest_10.120x0001027799ff PyErr_SetFromErrno + 
31 (errors.c:553)
3   _socket.cpython-36dm-darwin.so  0x000102c3a496 internal_setblocking 
+ 118 (socketmodule.c:671)
4   _socket.cpython-36dm-darwin.so  0x000102c36473 sock_setblocking + 
115 (socketmodule.c:2445)
5   pytest_10.120x00010260be60 
_PyCFunction_FastCallDict + 1104 (methodobject.c:209)
6   pytest_10.120x00010260c305 
_PyCFunction_FastCallKeywords + 501 (methodobject.c:295)
7   pytest_10.120x00010274f76d call_function + 637 
(ceval.c:4784)
8   pytest_10.120x0001027487de 
_PyEval_EvalFrameDefault + 78878 (ceval.c:3271)
9   pytest_10.120x0001027353b0 PyEval_EvalFrameEx + 
80 (ceval.c:718)
10  pytest_10.120x0001025b68bb gen_send_ex + 843 
(genobject.c:216)
11  pytest_10.120x0001025b6563 _PyGen_Send + 35 
(genobject.c:343)
12  pytest_10.120x00010273d915 
_PyEval_EvalFrameDefault + 34133 (ceval.c:2021)
13  pytest_10.120x0001027353b0 PyEval_EvalFrameEx + 
80 (ceval.c:718)
14  pytest_10.120x0001025b68bb gen_send_ex + 843 
(genobject.c:216)
15  pytest_10.120x0001025b6563 _PyGen_Send + 35 
(genobject.c:343)
16  pytest_10.120x00010273d915 
_PyEval_EvalFrameDefault + 34133 (ceval.c:2021)
17  pytest_10.120x0001027353b0 PyEval_EvalFrameEx + 
80 (ceval.c:718)
18  pytest_10.120x0001025b68bb gen_send_ex + 843 
(genobject.c:216)
19  pytest_10.120x0001025b6563 _PyGen_Send + 35 
(genobject.c:343)
20  pytest_10.120x00010273d915 
_PyEval_EvalFrameDefault + 34133 (ceval.c:2021)
21  pytest_10.120x0001027353b0 PyEval_EvalFrameEx + 
80 (ceval.c:718)
22  pytest_10.120x0001025b68bb gen_send_ex + 843 
(genobject.c:216)
23  pytest_10.120x0001025b6563 _PyGen_Send + 35 
(genobject.c:343)
24  pytest_10.120x00010273d915 
_PyEval_EvalFrameDefault + 34133 (ceval.c:2021)
25  pytest_10.120x0001027353b0 PyEval_EvalFrameEx + 
80 (ceval.c:718)
26  pytest_10.120x0001025b68bb gen_send_ex + 843 
(genobject.c:216)
27  pytest_10.120x0001025b6563 _PyGen_Send + 35 
(genobject.c:343)
28  pytest_10.120x00010260be60 
_PyCFunction_FastCallDict + 1104 (methodobject.c:209)
29  pytest_10.120x00010260c305 
_PyCFunction_FastCallKeywords + 501 (methodobject.c:295)
30  pytest_10.120x00010274f76d call_function + 637 
(ceval.c:4784)
31  pytest_10.120x0001027487de 
_PyEval_EvalFrameDefault + 78878 (ceval.c:3271)
32  pytest_10.120x0001027353b0 PyEval_EvalFrameEx + 
80 (ceval.c:718)
33  pytest_10.120x0001027515f0 
_PyEval_EvalCodeWithName + 5472 (ceval.c:4115)
34  pytest_10.120x000102752ca0 
_PyFunction_FastCallDict + 1296 (ceval.c:5017)
35  pytest_10.120x00010256bb82 
_PyObject_FastCallDict + 562 (abstract.c:2297)
36  pytest_10.120x00010256bf02 
_PyObject_Call_Prepend + 370 (abstract.c:2360)
37  pytest_10.120x00010259be9a method_call + 106 
(classobject.c:317)
38  pytest_10.120x00010256b7dd PyObject_Call + 477 
(abstract.c:2248)
39  pytest_10.120x00010274fd0c do_call_core + 508 
(ceval.c:5053)
40  pytest_10.120x0001027492ac 
_PyEval_EvalFrameDefault + 81644 (ceval.c:3353)
41  pytest_10.120x0001027353b0 PyEval_EvalFrameEx + 
80 (ceval.c:718)
42  pytest_10.120x000102752ee2 _PyFunction_FastCall 
+ 370 (ceval.c:4866)
43  pytest_10.120x00010275253e fast_function + 574 
(ceval.c:4901)
44  pytest_10.120x00010274f8f6 call_function + 1030 
(ceval.c:4805)
45  pytest_10.120x0001027487de 
_PyEval_EvalFrameDefault + 78878 (ceval.c:3271)
46  pytest_10.120x0001027353b0 PyEval_EvalFrameEx + 
80 (ceval.c:718)
47  

[issue26240] Docstring of the subprocess module should be cleaned up

2016-10-18 Thread Tim Mitchell

Tim Mitchell added the comment:

hg patch with changes forthcoming

--

___
Python tracker 

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



[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread Ned Deily

Ned Deily added the comment:

Fatal Python error: Python memory allocator called without holding the GIL

Current thread 0x7fffb043b3c0 (most recent call first):
  File 
"/py/dev/36/root/fwd_macports/Library/Frameworks/pytest_10.12.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py",
 line 790 in _create_connection_transport
  File 
"/py/dev/36/root/fwd_macports/Library/Frameworks/pytest_10.12.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py",
 line 777 in create_connection
  File 
"/py/dev/36/root/fwd_macports/Library/Frameworks/pytest_10.12.framework/Versions/3.6/lib/python3.6/asyncio/streams.py",
 line 75 in open_connection
  File "/Users/nad/Desktop/test_28471.py", line 13 in client
  File "/Users/nad/Desktop/test_28471.py", line 16 in runner
  File 
"/py/dev/36/root/fwd_macports/Library/Frameworks/pytest_10.12.framework/Versions/3.6/lib/python3.6/asyncio/tasks.py",
 line 239 in _step
  File 
"/py/dev/36/root/fwd_macports/Library/Frameworks/pytest_10.12.framework/Versions/3.6/lib/python3.6/asyncio/events.py",
 line 126 in _run
  File 
"/py/dev/36/root/fwd_macports/Library/Frameworks/pytest_10.12.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py",
 line 1390 in _run_once
  File 
"/py/dev/36/root/fwd_macports/Library/Frameworks/pytest_10.12.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py",
 line 405 in run_forever
  File 
"/py/dev/36/root/fwd_macports/Library/Frameworks/pytest_10.12.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py",
 line 437 in run_until_complete
  File "/Users/nad/Desktop/test_28471.py", line 18 in 
Abort trap: 6

--

___
Python tracker 

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



[issue27779] Sync-up docstrings in C version of the the decimal module

2016-10-18 Thread Stefan Krah

Stefan Krah added the comment:

Raymond: "code area" meant literally that -- all code under Modules/_decimal/* 
is by myself.

It is well understood that you and many people (e.g. Mark Dickinson)
have a stake in Decimal.  This however does not warrant reassigning
an issue in which I had already indicated to be cooperative.

I want to know what is going into that code area.


Lisa: I think I can take a look in the weekend.

--

___
Python tracker 

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



[issue28471] Python 3.6b2 crashes with "Python memory allocator called without holding the GIL"

2016-10-18 Thread Yury Selivanov

New submission from Yury Selivanov:

The following Python program causes a segfault in Python 3.6b2:

import socket
import asyncio

loop = asyncio.get_event_loop()


sock = socket.socket()
sock.close()

async def client():
reader, writer = await asyncio.open_connection(
sock=sock,
loop=loop)

async def runner():
await client()

loop.run_until_complete(runner())

--
components: Interpreter Core
messages: 278921
nosy: haypo, inada.naoki, ned.deily, serhiy.storchaka, yselivanov
priority: release blocker
severity: normal
status: open
title: Python 3.6b2 crashes with "Python memory allocator called without 
holding the GIL"
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



[issue28293] Don't completely dump the regex cache when full

2016-10-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is unlikely possible with current API of lru_cache. Testing flags before 
looking up in a cache adds an overhead.

--

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy Storchaka added the comment:
>> Sorry, I don't understand how running 1 iteration instead of 10 makes the 
>> benchmark less reliable. IMO the reliability is more impacted by the number

> Caches. Not high-level caching that can make the measurement senseless, but 
> low-level caching, for example memory caching, that can cause small 
> difference (but this difference can be larger than the effect that you 
> measure). On every repetition you first run a setup code, and then run 
> testing code in loops. After the first loop the memory cache is filled with 
> used data and next loops can be faster. On next repetition running a setup 
> code can unload this data from the memory cache, and the next loop will need 
> to load it back from slow memory. Thus on every repetition the first loop is 
> slower that the followings. If you run 10 or 100 loops the difference can be 
> negligible, but if run the only one loop, the result can differs on 10% or 
> more.

It seems like you give a time budget of less than 20 seconds to timeit
according to one of your previous message. IMO reliability is
incompatible with quick timeit command. If you want a reliable
benchmark, you need much more repetition than just 5. perf uses
20x(1+3) by default: it always run the benchmark once to "warmup" the
benchmark, but ignore this timing. All parameters can be tuned on the
command line (number of processes, warmups, samples, etc.).

Well, I'm not really interested by timeit in the stdlib anymore since
it seems to make significant enhancements without bikeshedding. So I
let you revert my change if you consider that it makes timeit less
reliable.

--

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy: "It may be worth to emit a warning in case of using timeit for too 
short code."

I suggest to simply warn users that timeit is not reliable at all :-)

By the way, I close this issue, so I suggest you to open new issues if you want 
further enhancements.

--

___
Python tracker 

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



[issue28469] timeit: use powers of 2 in autorange(), instead of powers of 10

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

> The perf module doesn't report the number of loops by default.

Right, it's hidden by default. I consider that it's not an useful information 
for end users.

If you want more details (see the number of inner and outer loops), use 
--verbose ("python3 -m perf timeit -v ...") or the stats commands ("python3 -m 
perf stats file.json").

--

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-10-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It may be worth to emit a warning in case of using timeit for too short code.

--

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy Storchaka:
> This is a senseless example. 0.0339 usec is not a time of executing "pass", 
> it is an overhead of the iteration. You can't use timeit for measuring the 
> performance of the code that takes such small time. You just can't get the 
> reliable result for it. Even for code that takes an order larger time the 
> result is not very reliable. Thus no need to worry about timing much less 
> than 1 usec.

I will not argue about the reliability of the timeit module.

It's common to see code snippets using timeit for short
microbenchmarks taking less than 1 us, especially on
micro-optimization on CPython.

--

___
Python tracker 

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



[issue28469] timeit: use powers of 2 in autorange(), instead of powers of 10

2016-10-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The perf module doesn't report the number of loops by default.

--

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-10-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Sorry, I don't understand how running 1 iteration instead of 10 makes the 
> benchmark less reliable. IMO the reliability is more impacted by the number 
> of repeatitions (-r). I changed the default from 3 to 5 repetitions, so 
> timeit should be *more* reliable in Python 3.7 than 3.6.

Caches. Not high-level caching that can make the measurement senseless, but 
low-level caching, for example memory caching, that can cause small difference 
(but this difference can be larger than the effect that you measure). On every 
repetition you first run a setup code, and then run testing code in loops. 
After the first loop the memory cache is filled with used data and next loops 
can be faster. On next repetition running a setup code can unload this data 
from the memory cache, and the next loop will need to load it back from slow 
memory. Thus on every repetition the first loop is slower that the followings. 
If you run 10 or 100 loops the difference can be negligible, but if run the 
only one loop, the result can differs on 10% or more.

> $ python3.6 -m timeit 'pass'
> 1 loops, best of 3: 0.0339 usec per loop

This is a senseless example. 0.0339 usec is not a time of executing "pass", it 
is an overhead of the iteration. You can't use timeit for measuring the 
performance of the code that takes such small time. You just can't get the 
reliable result for it. Even for code that takes an order larger time the 
result is not very reliable. Thus no need to worry about timing much less than 
1 usec.

--

___
Python tracker 

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



[issue28383] __hash__ documentation recommends naive XOR to combine but this is suboptimal

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

Christian Heimes:
>  ACK!

Does it mean that my patch LGTY?

--

___
Python tracker 

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



[issue28130] Document that time.tzset updates time module globals

2016-10-18 Thread Lisa Roach

Lisa Roach added the comment:

Will this simple update be enough? Or should more documentation be added for 
clarification?

--
keywords: +patch
nosy: +lisroach
Added file: http://bugs.python.org/file45135/tzset_doc.patch

___
Python tracker 

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



[issue28470] configure.ac -g debug compiler option when not Py_DEBUG

2016-10-18 Thread Chris Byers

New submission from Chris Byers:

The configure.ac file adds the "-g" debug compiler option to both debug and 
non-debug builds, so debug information is built for production builds.  This 
seems likely a bug, unless there was a specific reason to do this.

Around line 1480 of configure.ac:
if test "$Py_DEBUG" = 'true' ; then
# Optimization messes up debuggers, so turn it off for
# debug builds.
if "$CC" -v --help 2>/dev/null |grep -- -Og > /dev/null; then
OPT="-g -Og -Wall $STRICT_PROTO"
else
OPT="-g -O0 -Wall $STRICT_PROTO"
fi
else
OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
fi
The else case to the first statement (if test "$Py_DEBUG"...) should not 
contain -g should it?

--
components: Build
messages: 278910
nosy: Chris Byers
priority: normal
severity: normal
status: open
title: configure.ac -g debug compiler option when not Py_DEBUG
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



[issue28463] Email long headers parsing/serialization

2016-10-18 Thread R. David Murray

R. David Murray added the comment:

It is a bug, but it is not a bug that the message-id body gets put on a second 
line.  The old (compat32) folder introduces an extra space while folding, which 
then gets preserved when the re-parsing is done.  The new folder 
(policy=default) folds correctly (putting the id on a separate line), but the 
parser fails to remove the leading blank from the value when it is parsed.  It 
should remove the leading blank because that blank "belongs" to the header 
label (the "Message-Id:" part).  The RFC caution about whitespace only lines 
applies to whole lines; the first line in the present example is not blank 
because it has the header label on it.

I also need to add a test with a Message-Id that is in itself longer than 77 
characters.  Such a header can't be folded, so it will have to be emitted with 
a length longer than the default.  (And yes, the default can be changed to any 
value you like, see Policy.max_line_len).

--

___
Python tracker 

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



[issue26436] Add the regex-dna benchmark

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

The performance project is now hosted on GitHub. I created a pull request from 
Serhiy's patch:
https://github.com/python/performance/pull/17

So I now close this issue. Let's continue the discussion there.

--
resolution:  -> third party
status: open -> closed

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

I'm disappointed by the discussion on minumum vs average. Using the perf module 
(python3 -m perf timeit), it's very easy to show that the average is more 
reliable than the minimum. The perf module runs 20 worker processes by default: 
with so many processes, it's easy to see that each process has a different 
timing because of random address space layout and the randomized Python hash 
function.

Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer)Date: 
2016-09-21 15:17

Serhiy: "This makes hard to compare results with older Python versions."

Serhiy is right. I see two options: display average _and_ minimum (which can be 
confusing for users!) or display the same warning than PyPy:

"WARNING: timeit is a very unreliable tool. use perf or something else for real 
measurements"

But since I'm grumpy now, I will now just close the issue :-) I pushed enough 
changes to timeit for today ;-)

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue28469] timeit: use powers of 2 in autorange(), instead of powers of 10

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

> "131072 loops" in a report looks not human friendly.

In my perf module, I use 2^n syntax for numbers larger than 1024. Syntax 
accepted in command line arguments.

--

___
Python tracker 

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



[issue28469] timeit: use powers of 2 in autorange(), instead of powers of 10

2016-10-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

"131072 loops" in a report looks not human friendly. I would prefer using a 
sequence of round numbers: 1, 2, 5, 10, 20, 50, 100, ...

--

___
Python tracker 

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



[issue28463] Email long headers parsing/serialization

2016-10-18 Thread Константин Волков

Константин Волков added the comment:

But message ID have its own syntax https://www.ietf.org/rfc/rfc2822.txt:

3.6.4. Identification fields

message-id  =   "Message-ID:" msg-id CRLF
msg-id  =   [CFWS] "<" id-left "@" id-right ">" [CFWS]

3.2.3. Folding white space and comments

However, where CFWS occurs in this standard, it MUST NOT be inserted
   in such a way that any line of a folded header field is made up
   entirely of WSP characters and nothing else.

Its not obvious, but it seems that there must be no CRLF symbol before 
MessageID.

--

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy Storchaka:
>> * autorange: start with 1 loop instead of 10 for slow benchmarks like 
>> time.sleep(1)
> This is good if you run relatively slow benchmark, but it makes the result 
> less reliable. You always can specify -n1, but on your own risk.

Sorry, I don't understand how running 1 iteration instead of 10 makes the 
benchmark less reliable. IMO the reliability is more impacted by the number of 
repeatitions (-r). I changed the default from 3 to 5 repetitions, so timeit 
should be *more* reliable in Python 3.7 than 3.6.

> Even "pass" takes at least 0.02 usec on my computer. What you want to measure 
> that takes < 1 ns? I think timeit is just wrong tool for this.

It's just a matter of formatting. IMO clocks have a precision good enough to 
display nanoseconds when the benchmark uses many iterations (which is the case 
by default since autorange uses a minimum of 200 ms per benchmark).

Before:

$ python3.6 -m timeit 'pass'
1 loops, best of 3: 0.0339 usec per loop

After:

$ python3.7 -m timeit 'pass'
1000 loops, best of 5: 33.9 nsec per loop

IMO "33.9" is more readable than "0.0339".

--

___
Python tracker 

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



[issue28467] Installer should be a 64-bit executable

2016-10-18 Thread Steve Dower

Steve Dower added the comment:

You can also modify the "python36._pth" file in the embedded distro to include 
"import site" if you want all the stuff that comes with that.

The intent of the embeddable distribution is to be a private dependency of a 
larger application, where you typically won't want the site module. 

It is also intended to be a developer resource that is extracted by the dev, 
modified, and then put into another installer - it's not meant to be 
automatically extracted and used on a target machine. Modifying the ._pth file 
is therefore "acceptable" given the purpose.

I've closed this as an issue. Hopefully I can convince the Nano Server guys to 
blog again (they did once before at 
https://blogs.msdn.microsoft.com/pythonengineering/2016/06/20/python-and-django-on-nano-server/)

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-10-18 Thread Maciej Fijalkowski

Changes by Maciej Fijalkowski :


--
nosy:  -fijall

___
Python tracker 

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



[issue26010] document CO_* constants

2016-10-18 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


--
stage: patch review -> needs patch

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

> For now default timeit run takes from 0.8 to 8 sec. Adding yet 5 sec makes a 
> user more angry.

See the issue #28469 "timeit: use powers of 2 in autorange(), instead of powers 
of 10" for a simple fix to reduce the total duration of the worst case (reduce 
it to 2.4 seconds).

--

___
Python tracker 

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



[issue28410] Add convenient C API for "raise ... from ..."

2016-10-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm not sure about the function name. Does anybody want to suggest better name?

--

___
Python tracker 

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



[issue28469] timeit: use powers of 2 in autorange(), instead of powers of 10

2016-10-18 Thread STINNER Victor

New submission from STINNER Victor:

In the issue #28240, I changed the default repeat from 3 to 5 in timeit. Serhiy 
wrote (msg277157): "For now default timeit run takes from 0.8 to 8 sec. Adding 
yet 5 sec makes a user more angry."

I propose to use powers to 2, instead of powers of 10, in timeit autorange to 
reduce the total duration of the microbenchmark.

* Without the patch, the worst case: 4.0 * 6 = 24 seconds.
* With the patch, the worst case is: 0.4 * 6 = 2.4 seconds

* 6: autorange (1 iteration) + 5 repeatition
* autorange uses a minimum of 200 ms, so the worst case is 200 ms * 10 before, 
or 200 ms * 2 after

--
files: timeit_autorange_pow2.patch
keywords: patch
messages: 278899
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: timeit: use powers of 2 in autorange(), instead of powers of 10
type: performance
versions: Python 3.7
Added file: http://bugs.python.org/file45134/timeit_autorange_pow2.patch

___
Python tracker 

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



[issue26010] document CO_* constants

2016-10-18 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

I have reviewed your patch, but could you add the doc for CO_ASYNC_GENERATOR ? 
Thank you

--
nosy: +matrixise

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

Steven D'Aprano:
>> * Display large number of loops as power of 10 for readability, ex: 
>> "10^6" instead of "100". Also accept "10^6" syntax for the --num 
>> parameter.
>
> Shouldn't we use 10**6 or 1e6 rather than bitwise XOR? :-)

Hum, with "10**6" syntax, I see a risk of typo: "10*6" instead of "10**6".

I don't know if the x^y syntax is common or not, but I like it. LaTeX uses it 
for example.

--

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

Steven D'Aprano:
>> * Don't disable the garbage collector anymore! Disabling the GC is not 
>> fair: real applications use it.

> But that's just adding noise: you're not timing code snippet, you're 
timing code snippet plus garbage collector.
>
> I disagree with this change, although I would accept it if there was an 
optional flag to control the gc.

IMO it's a lie to display the minimum timing with the garbage collector 
disabled. The garbage collector is enabled in all applications.

--

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-10-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4d611957732b by Victor Stinner in branch 'default':
timeit: enhance format of raw timings (in verbose mode)
https://hg.python.org/cpython/rev/4d611957732b

New changeset c3a93069111d by Victor Stinner in branch 'default':
timeit: add nsec (nanosecond) unit for format timings
https://hg.python.org/cpython/rev/c3a93069111d

New changeset 40e97c9dae7a by Victor Stinner in branch 'default':
timeit: add newlines to output for readability
https://hg.python.org/cpython/rev/40e97c9dae7a

--

___
Python tracker 

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



[issue28463] Email long headers parsing/serialization

2016-10-18 Thread Mariusz Masztalerczuk

Mariusz Masztalerczuk added the comment:

I think that it is not bug. It is just rfc ;) Due to 
https://www.ietf.org/rfc/rfc2822.txt, 

A message consists of header fields, optionally followed by a message
   body.  Lines in a message MUST be a maximum of 998 characters
   excluding the CRLF, but it is RECOMMENDED that lines be limited to 78
   characters excluding the CRLF

Because you have the line with the size more then 78 chars (the header + 
value), the python is trying to break this line into two. 

Maybe there should be option to increase this value to something more then 78? 
(because max is 998 due to rfc)

--
nosy: +mmasztalerczuk

___
Python tracker 

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



[issue28410] Add convenient C API for "raise ... from ..."

2016-10-18 Thread Emanuel Barry

Emanuel Barry added the comment:

I see the function is private; is there any concern with extending the PyErr_* 
API? I think it'd make sense to expose it, since it's a convenient way to do in 
C what can already be done easily in Python, but I don't actually have a good 
reason :)

Other than this small nitpick, this LGTM.

(Alternatively, we can keep it private for 3.6 and revise that decision for 3.7)

--

___
Python tracker 

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



[issue28410] Add convenient C API for "raise ... from ..."

2016-10-18 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


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



[issue28214] Improve exception reporting for problematic __set_name__ attributes

2016-10-18 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


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



[issue11632] difflib.unified_diff loses context

2016-10-18 Thread Steve Newcomb

Steve Newcomb added the comment:

Context reporting is still buggy in Python 3.5.2:

>>> [ x for x in difflib.unified_diff( "'on'\n", "'on'\n\n\n")]
['--- \n', '+++ \n', '@@ -3,3 +3,5 @@\n', ' n', " '", ' \n', '+\n', '+\n']
>>> import sys
>>> sys.version
'3.5.2 (default, Sep 10 2016, 08:21:44) \n[GCC 5.4.0 20160609]'
>>> 
(compiled under Ubuntu 16.04.1 LTS)

--
nosy: +steve.newcomb

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-10-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 975df4c13db6 by Victor Stinner in branch 'default':
timeit: remove --clock and --time options
https://hg.python.org/cpython/rev/975df4c13db6

--

___
Python tracker 

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



[issue28123] _PyDict_GetItem_KnownHash ignores DKIX_ERROR return

2016-10-18 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


--
assignee:  -> haypo

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-10-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3aba5552b976 by Victor Stinner in branch 'default':
timeit: start autorange with 1 iteration, not 10
https://hg.python.org/cpython/rev/3aba5552b976

New changeset 2dafb2f3e7ff by Victor Stinner in branch 'default':
timeit: change default repeat to 5, instead of 3
https://hg.python.org/cpython/rev/2dafb2f3e7ff

--
nosy: +python-dev

___
Python tracker 

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



[issue26436] Add the regex-dna benchmark

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

I created https://github.com/python/performance/issues/15

--

___
Python tracker 

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



[issue15369] pybench and test.pystone poorly documented

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

I'm closing the issue again.

Again, pybench moved to http://github.com/python/performance : please continue 
the discussion there if you consider that we still need to do something on 
pybench.

FYI I reworked deeply pybench recently using the new perf 0.8 API. perf 0.8 now 
supports running multiple benchmarks per script, so pybench was written as only 
a benchmark runner. Comparison between benchmarks can be done using 
performance, or directly using perf (python3 -m perf compare a.json b.json).

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue28383] __hash__ documentation recommends naive XOR to combine but this is suboptimal

2016-10-18 Thread Christian Heimes

Christian Heimes added the comment:

ACK!

--
nosy: +christian.heimes

___
Python tracker 

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



[issue28383] __hash__ documentation recommends naive XOR to combine but this is suboptimal

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

hash(tuple of attributes) is what I'm using in all my projects.

Here is a patch for the doc.

--
keywords: +patch
nosy: +haypo
Added file: http://bugs.python.org/file45133/hash_doc.patch

___
Python tracker 

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



[issue28340] [py2] TextIOWrapper.tell extremely slow

2016-10-18 Thread STINNER Victor

Changes by STINNER Victor :


--
title: TextIOWrapper.tell extremely slow -> [py2] TextIOWrapper.tell extremely 
slow

___
Python tracker 

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



[issue28293] Don't completely dump the regex cache when full

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

Can't we redesign the function to reuse @functools.lru_cache(_MAXCACHE) but 
take care of the debug flag? For example, split the function in smaller parts.

--
nosy: +haypo

___
Python tracker 

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



[issue28256] Cleanup Modules/_math.c

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

Thanks for the review Serhiy and Christian, it seems like a review was needed 
:-D

I pushed my fix to Python 3.7.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue28256] Cleanup Modules/_math.c

2016-10-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8999d702ac29 by Victor Stinner in branch 'default':
Issue #28256: Cleanup _math.c
https://hg.python.org/cpython/rev/8999d702ac29

--
nosy: +python-dev

___
Python tracker 

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



[issue28448] C implemented Future doesn't work on Windows

2016-10-18 Thread STINNER Victor

STINNER Victor added the comment:

INADA Naoki added the comment:
> @haypo, do you know why _WaitCancelFuture overrides _schedule_callbacks() 
> instead
> of self.add_done_callback(self._unregister_wait_cb)?
> _unregister_wait_cb must be called after all callbacks are called?

Oh no. I tried to forget this mess :-( It took me 2 or 3 months to
understand and fix this complex issue of cancelling a wait on
Windows...

Hum, let me check.

I found this in IocpProactor:
---
def _wait_cancel(self, event, done_callback):
fut = self._wait_for_handle(event, None, True)
# add_done_callback() cannot be used because the wait may only complete
# in IocpProactor.close(), while the event loop is not running.
fut._done_callback = done_callback
return fut
---

I don't understand my comment anymore /o\

I just recall that it was complex to get this crap working in all
cases, especially in corner cases.

--

___
Python tracker 

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



[issue28410] Add convenient C API for "raise ... from ..."

2016-10-18 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

I have read and executed the tests and for me the patch is good.

--
nosy: +matrixise

___
Python tracker 

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



[issue23188] Provide a C helper function to chain raised (but not yet caught) exceptions

2016-10-18 Thread Nick Coghlan

Nick Coghlan added the comment:

Via issue 28410, Serhiy is adding a private "_PyErr_FormatFromCause" helper API 
to make explicit C level exception chaining easier within the implementation of 
CPython (this helps resolve issue 28214, an exception reporting problem in the 
new PEP 487 __set_name__ feature).

It may be sufficient to make that API public, and use that as the home of 
documentation for some of the subtleties discussed here.

--
versions: +Python 3.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



[issue28410] Add convenient C API for "raise ... from ..."

2016-10-18 Thread Nick Coghlan

Nick Coghlan added the comment:

The patch looks good to me Serhiy, but I don't think it makes sense to apply 
this to 3.5 - it touches quite a few places in the code, and there's no reason 
to risk introducing a regression into a 3.5 maintenance release for a pure 
maintainer convenience function.

Adding it to 3.6+ will be sufficient to help resolve issue 28214.

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



[issue27896] Allow passing sphinx options to Doc/Makefile

2016-10-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3b22c99535d0 by Victor Stinner in branch '2.7':
Issue #27896: Allow passing sphinx options to Doc/Makefile
https://hg.python.org/cpython/rev/3b22c99535d0

--

___
Python tracker 

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



[issue27896] Allow passing sphinx options to Doc/Makefile

2016-10-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 87aced4a9cf5 by Victor Stinner in branch '3.5':
Issue #27896: Allow passing sphinx options to Doc/Makefile
https://hg.python.org/cpython/rev/87aced4a9cf5

--

___
Python tracker 

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



[issue28467] Installer should be a 64-bit executable

2016-10-18 Thread John Taylor

John Taylor added the comment:

python-3.6.0b2-embed-amd64.zip will load the interpreter as is easy to install. 
 The Python Embedded Distribution documentation mentions needing ucrtbase.dll, 
which is already installed on Nano Server.

One small pain point is that ctrl-z seems to exit/suspend the docker container 
and drop you back to the host.  Under the normal, non-embedded python, you can 
just run exit() to quit the interpreter.  Since this option is not available 
under the embedded version, you have to import sys; sys.exit() to quit the 
interpreter under Nano Server.  Also, there is no pip.exe.

Thank you for the information regarding MSI which I was not aware of.  Upon 
further consideration, I believe this issue can be closed because the embedded 
distribution works on Nano Server.

--

___
Python tracker 

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



[issue28410] Add convenient C API for "raise ... from ..."

2016-10-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Fixed error message in tests.

--
Added file: http://bugs.python.org/file45132/_PyErr_FormatFromCause-2.patch

___
Python tracker 

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



[issue28467] Installer should be a 64-bit executable

2016-10-18 Thread Steve Dower

Steve Dower added the comment:

Last time I spoke with the Nano Server team (admittedly this was 6-12 months 
ago) they had no plans to support MSI at all. Even though our installer is an 
exe, under the covers it is installing MSIs.

We discussed this and decided the best approach would be to install locally and 
then copy the install directory, as Nano Server already includes all the 
required dependencies. There are also packages on nuget that can install Python 
that should work fine.

However, as I'm a little out of date, please let me know if Nano Server has 
actually added support for MSIs and I can look into it.

--

___
Python tracker 

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



[issue28214] Improve exception reporting for problematic __set_name__ attributes

2016-10-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for testing Stéphane. Ignore this failure, the test should be fixed 
by updated patch in issue28410.

--

___
Python tracker 

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



[issue28468] Add platform.linux_os_release()

2016-10-18 Thread R. David Murray

R. David Murray added the comment:

Sorry, it wasn't my intent to (re)start a flame war, just to point out that 
there are linux platforms in wide use that do not support systemd.  But I don't 
have an opinion on whether or not adding this function is a good idea or not.

--

___
Python tracker 

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



[issue28468] Add platform.linux_os_release()

2016-10-18 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

We need a fallback in the case where /etc/os-release does not exists, or just 
use hasattr on `platform`

if hasattr(platform, 'linux_os_release'):
   print(platform.linux_os_release())
else:
   ...

or just raise an exception if platform.linux_os_release is not available.

--

___
Python tracker 

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



  1   2   >