[issue31803] time.clock() should emit a DeprecationWarning

2017-10-17 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

time.cock() is used in a lot of code. Why can't we simply replace the 
functionality with one of the other functions ?

The documentation certainly allows for such a change, since it pretty much just 
says that only the delta between two values has a meaning.

--

___
Python tracker 

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



[issue31807] unitest.mock: Using autospec=True conflicts with 'wraps'

2017-10-17 Thread John Villalovos

Change by John Villalovos :


--
title: Using autospec=True conflicts with 'wraps' -> unitest.mock: Using 
autospec=True conflicts with 'wraps'

___
Python tracker 

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



[issue31753] Unnecessary closure in ast.literal_eval

2017-10-17 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I question those timings.  Here's the results from a script I've been using for 
many years:

$ python3.6 variable_access.py
0.065   read_local
0.068   read_nonlocal
0.179   read_global
0.236   read_builtin
0.267   read_classvar
0.392   read_instancevar
0.291   read_unboundmethod
0.383   read_boundmethod
0.077   write_local
0.069   write_nonlocal
0.240   write_global
1.154   write_classvar
0.540   write_instance

See the attached timing script:  variable_access.py

Also, take a look at the underlying code:

#define GETLOCAL(i) (fastlocals[i])

TARGET(LOAD_FAST) {
PyObject *value = GETLOCAL(oparg);
if (value == NULL) {
...
}
Py_INCREF(value);
PUSH(value);
FAST_DISPATCH();
}

#define PyCell_GET(op) (((PyCellObject *)(op))->ob_ref)

TARGET(LOAD_DEREF) {
PyObject *cell = freevars[oparg];
PyObject *value = PyCell_GET(cell);
if (value == NULL) {
...
}
Py_INCREF(value);
PUSH(value);
DISPATCH();
}

You can see that the only difference is that LOAD_DEREF has one extra 
indirection.  That should be very cheap.   In contrast, a LOAD_GLOBAL does a 
lot more work.  If this isn't evident in your timings, I suspect there is 
something wrong with the timings.

--
Added file: https://bugs.python.org/file47225/variable_access.py

___
Python tracker 

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



[issue31739] socket.close recommended but not demonstrated in same-page example code

2017-10-17 Thread R. David Murray

R. David Murray  added the comment:

Heh, of course the socket server also only ends with ctl-C.  And I misread the 
CAN example, it won't spin because the read isn't wrapped in a try/except.  So 
yes, that should use a with on the socket as well, since the with will close 
the socket on a ctl-C, unlike a close statement after the loop which will never 
be reached.

--

___
Python tracker 

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



[issue31739] socket.close recommended but not demonstrated in same-page example code

2017-10-17 Thread R. David Murray

R. David Murray  added the comment:

I think in the echo examples the 'with conn' block should be indented and a
'with s:' added around it.

The network sniffer should probably use a with statement with the
created socket.

The CAN example ends only on ctrl-C, and could go into a fast spin
loop on error, so it probably needs a more extensive rewrite.

--

___
Python tracker 

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



[issue31676] test.test_imp.ImportTests.test_load_source has side effects

2017-10-17 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset 178148025494c4058571831fb11fc8eeff8b7365 by Mariatta (Miss 
Islington (bot)) in branch '3.6':
bpo-31676: Fix test_imp.test_load_source() side effect (GH-3871) (GH-3988)
https://github.com/python/cpython/commit/178148025494c4058571831fb11fc8eeff8b7365


--
nosy: +Mariatta

___
Python tracker 

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



[issue31798] `site.abs__file__` fails for modules where `__file__` cannot be modified

2017-10-17 Thread Eric V. Smith

Eric V. Smith  added the comment:

I don't have clr installed in order to test this. It would be good if you could 
produce it without us having to install additional software.

Could you please copy the entire stack traceback you get when this error occurs?

Does this error happen on 3.6, too?

--
nosy: +eric.smith

___
Python tracker 

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



[issue31807] Using autospec=True conflicts with 'wraps'

2017-10-17 Thread John Villalovos

New submission from John Villalovos :

If have autospec=True, then no ValueError is raised. If autospec=False or not 
defined, then the ValueError is raised.


import sys
from unittest import mock

def wrapped_func(value):
raise ValueError(value)

@mock.patch('__main__.wrapped_func', autospec=True, wraps=wrapped_func)
def main(mock_wrap):

wrapped_func("testing")

if '__main__' == __name__:
sys.exit(main())

--
components: Library (Lib)
messages: 304549
nosy: John Villalovos
priority: normal
severity: normal
status: open
title: Using autospec=True conflicts with 'wraps'
type: behavior
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



[issue29696] Use namedtuple in string.Formatter.parse iterator response

2017-10-17 Thread Eric V. Smith

Eric V. Smith  added the comment:

It does seem like overkill for something that's rarely used. I'm -0 on the 
structseq version.

--

___
Python tracker 

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



[issue31780] Using format spec ',x' displays incorrect error message

2017-10-17 Thread Chris Angelico

Chris Angelico  added the comment:

Thanks for handling that Terry. I take it the PR isn't needed now?

I would have done it, but I'm on the way to the US (literally posting this from 
the airport), and hadn't gotten to looking at this in the interval.

--

___
Python tracker 

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



[issue30928] Copy modified blurbs to idlelib/NEWS.txt

2017-10-17 Thread Terry J. Reedy

Terry J. Reedy  added the comment:


New changeset 98e0f26f2e4cbf5c2ca27b39f43c1cb0114c6e3c by Terry Jan Reedy (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-30928: Update idlelib/NEWS.txt to 2017 Oct 17. (GH-4025) (#4028)
https://github.com/python/cpython/commit/98e0f26f2e4cbf5c2ca27b39f43c1cb0114c6e3c


--

___
Python tracker 

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



[issue13802] IDLE font settings: use multiple character sets in examples

2017-10-17 Thread Terry J. Reedy

Change by Terry J. Reedy :


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



[issue13802] IDLE font settings: use multiple character sets in examples

2017-10-17 Thread Terry J. Reedy

Terry J. Reedy  added the comment:


New changeset ecacbb4f22ae86d29a73a5f715bce07d091da10d by Terry Jan Reedy (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-13802: Use non-Latin characters in IDLE's Font settings sample. 
(GH-3960) (#4027)
https://github.com/python/cpython/commit/ecacbb4f22ae86d29a73a5f715bce07d091da10d


--

___
Python tracker 

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



[issue30928] Copy modified blurbs to idlelib/NEWS.txt

2017-10-17 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4003

___
Python tracker 

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



[issue30928] Copy modified blurbs to idlelib/NEWS.txt

2017-10-17 Thread Terry J. Reedy

Terry J. Reedy  added the comment:


New changeset 27288de0856c6fbe56354adb312ae706ce8bc7de by Terry Jan Reedy in 
branch 'master':
bpo-30928: Update idlelib/NEWS.txt to 2017 Oct 17. (#4025)
https://github.com/python/cpython/commit/27288de0856c6fbe56354adb312ae706ce8bc7de


--

___
Python tracker 

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



[issue13802] IDLE font settings: use multiple character sets in examples

2017-10-17 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4002

___
Python tracker 

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



[issue13802] IDLE font settings: use multiple character sets in examples

2017-10-17 Thread Terry J. Reedy

Terry J. Reedy  added the comment:


New changeset e2e42274ee5db1acedf57b63943e1f536d7a25bc by Terry Jan Reedy in 
branch 'master':
bpo-13802: Use non-Latin characters in IDLE's Font settings sample. (#3960)
https://github.com/python/cpython/commit/e2e42274ee5db1acedf57b63943e1f536d7a25bc


--

___
Python tracker 

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



[issue31805] support._is_gui_available() hangs on x86-64 Sierra 3.6/3.x buildbot

2017-10-17 Thread Matt Billenstein

Matt Billenstein  added the comment:

Note, that's running ./python.exe Lib/tests/test_tk.py from a Terminal when 
logged into the gui...

--

___
Python tracker 

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



[issue31805] support._is_gui_available() hangs on x86-64 Sierra 3.6/3.x buildbot

2017-10-17 Thread Matt Billenstein

Matt Billenstein  added the comment:

Did some debugging by sticking a couple prints in support.is_gui_available() 
and it appears everything is fine up until the call to 
app_services.SetFrontProcess() -- this is returning error code -606 which is 
defined in:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers/MacErrors.h:
appIsDaemon   = -606, /*app is BG-only, and launch flags 
disallow this*/

What this means exactly or how to fix it, I don't know...

--

___
Python tracker 

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



[issue31806] Use _PyTime_ROUND_TIMEOUT in _threadmodule.c, timemodule.c and socketmodule.c

2017-10-17 Thread Pablo Galindo Salgado

Change by Pablo Galindo Salgado :


--
keywords: +patch
pull_requests: +4001
stage:  -> patch review

___
Python tracker 

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



[issue31806] Use _PyTime_ROUND_TIMEOUT in _threadmodule.c, timemodule.c and socketmodule.c

2017-10-17 Thread Pablo Galindo Salgado

New submission from Pablo Galindo Salgado :

Following PR for https://bugs.python.org/issue31786 time_sleep, 
lock_acquire_parse_args and socket_parse_timeout should use 
_PyTime_ROUND_TIMEOUT instead of _PyTime_ROUND_CEILING.

--
components: Library (Lib)
messages: 304540
nosy: pablogsal
priority: normal
severity: normal
status: open
title: Use _PyTime_ROUND_TIMEOUT in _threadmodule.c, timemodule.c and 
socketmodule.c
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



[issue28603] traceback module can't format/print unhashable exceptions

2017-10-17 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Thank you for your contribution Zane.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue28603] traceback module can't format/print unhashable exceptions

2017-10-17 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 2712247ec94dcc12cf9abeec78f18f54fcc3357a by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.6':
[3.6] bpo-28603: Fix formatting tracebacks for unhashable exceptions (GH-4014) 
(#4024)
https://github.com/python/cpython/commit/2712247ec94dcc12cf9abeec78f18f54fcc3357a


--

___
Python tracker 

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



[issue30928] Copy modified blurbs to idlelib/NEWS.txt

2017-10-17 Thread Terry J. Reedy

Change by Terry J. Reedy :


--
pull_requests: +4000

___
Python tracker 

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



[issue31343] Include major(), minor(), makedev() from sysmacros

2017-10-17 Thread Florian Weimer

Change by Florian Weimer :


--
nosy: +fweimer

___
Python tracker 

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



[issue31803] time.clock() should emit a DeprecationWarning

2017-10-17 Thread STINNER Victor

STINNER Victor  added the comment:

Ok, I modified time.clock() and time.get_clock_info('clock') to emit a 
DeprecationWarning.

Let's wait for Python 3.8 to remove time.clock() ;-)

Thanks for the reviews Serhiy Storchaka and Diana Clarke!

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



[issue31803] Remove not portable time.clock(), replaced by time.perf_counter() and time.process_time()

2017-10-17 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 884d13a55fc328e2e1e3948a82b361b30804b818 by Victor Stinner in 
branch 'master':
time.clock() now emits a DeprecationWarning (GH-4020)
https://github.com/python/cpython/commit/884d13a55fc328e2e1e3948a82b361b30804b818


--

___
Python tracker 

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



[issue28603] traceback module can't format/print unhashable exceptions

2017-10-17 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +3999

___
Python tracker 

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



[issue28603] traceback module can't format/print unhashable exceptions

2017-10-17 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset de86073a761cd3539aaca6f886a1f55effc0d9da by Serhiy Storchaka 
(Zane Bitter) in branch 'master':
bpo-28603: Fix formatting tracebacks for unhashable exceptions (#4014)
https://github.com/python/cpython/commit/de86073a761cd3539aaca6f886a1f55effc0d9da


--

___
Python tracker 

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



[issue31630] math.tan has poor accuracy near pi/2 on OpenBSD

2017-10-17 Thread Jeff Allen

Change by Jeff Allen :


--
nosy: +jeff.allen

___
Python tracker 

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



[issue28603] traceback module can't format/print unhashable exceptions

2017-10-17 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

As I understand it, the patch amounts to ignoring any custom __eq__ and 
__hash__ on an Exception class when printing tracebacks and, in effect, using 
the default id-based versions inherited from object, as is being assumed.  This 
seems right to me in this context.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue29696] Use namedtuple in string.Formatter.parse iterator response

2017-10-17 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I'm not convinced that a named tuple is needed here.

--

___
Python tracker 

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



[issue31753] Unnecessary closure in ast.literal_eval

2017-10-17 Thread Aaron Hall

Aaron Hall  added the comment:

New information: I think I have pinpointed at least a contributor to the 
difference - closure lookups seem to be currently slightly slower (by a few 
percent) than global lookups (see https://stackoverflow.com/a/46798876/541136). 

And as we can see, an inner function that references itself is a closure on 
itself (see LOAD_DEREF):

>>> def foo():
... def bar():
... return bar
... return bar
...
>>> bar = foo()
>>> import dis
>>> dis.dis(bar)
  3   0 LOAD_DEREF   0 (bar)
  2 RETURN_VALUE

This, at least to me, explains why the performance difference doesn't 
completely amortize away.

--

___
Python tracker 

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



[issue31786] In select.poll.poll() ms can be 0 if timeout < 0

2017-10-17 Thread Pablo Galindo Salgado

Change by Pablo Galindo Salgado :


--
pull_requests: +3997
stage: backport needed -> patch review

___
Python tracker 

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



[issue25711] Rewrite zipimport from scratch

2017-10-17 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

I've ported the patch to a branch on GH.  See PR 4023.  I started from 
zipimport-2.patch.  It doesn't work, but it will be easier to work on as a PR 
rather than a patch.

Contributions welcome!  Let's see if we can make this work.

--

___
Python tracker 

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



[issue25711] Rewrite zipimport from scratch

2017-10-17 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


--
pull_requests: +3998

___
Python tracker 

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



[issue31234] Make support.threading_cleanup() stricter

2017-10-17 Thread STINNER Victor

STINNER Victor  added the comment:

It seems like all attached PR are now merged. I didn't see any random "dangling 
thread" warning recently in the master branch, so I close this issue.

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



[issue26145] [WIP] PEP 511: Add sys.set_code_transformers()

2017-10-17 Thread STINNER Victor

STINNER Victor  added the comment:

I rejected my own PEP 511, so I now reject this issue as well.
https://mail.python.org/pipermail/python-dev/2017-October/149903.html

--
resolution:  -> rejected
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



[issue26098] [WIP] PEP 510: Specialize functions with guards

2017-10-17 Thread STINNER Victor

STINNER Victor  added the comment:

I rejected my own PEP 510, so I reject this issue as well.
https://mail.python.org/pipermail/python-dev/2017-October/149901.html

--
resolution:  -> rejected
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



[issue31692] [2.7] Test `test_huntrleaks()` of test_regrtest fails in debug build with COUNT_ALLOCS

2017-10-17 Thread STINNER Victor

STINNER Victor  added the comment:

I documented the two new environment variables in What's New in Python 2.7, so 
this issue can now be closed again.

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



[issue31733] [2.7] Add PYTHONSHOWREFCOUNT environment variable to Python 2.7

2017-10-17 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 355393e7438deeab4aeec3fcffea65e8cada083b by Victor Stinner in 
branch '2.7':
[2.7] bpo-31733, bpo-31692: Document 2 new env vars in What's New in Python 2.7 
(GH-4019)
https://github.com/python/cpython/commit/355393e7438deeab4aeec3fcffea65e8cada083b


--

___
Python tracker 

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



[issue31692] [2.7] Test `test_huntrleaks()` of test_regrtest fails in debug build with COUNT_ALLOCS

2017-10-17 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 355393e7438deeab4aeec3fcffea65e8cada083b by Victor Stinner in 
branch '2.7':
[2.7] bpo-31733, bpo-31692: Document 2 new env vars in What's New in Python 2.7 
(GH-4019)
https://github.com/python/cpython/commit/355393e7438deeab4aeec3fcffea65e8cada083b


--

___
Python tracker 

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



[issue31799] Improve __spec__ discoverability

2017-10-17 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


--
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.4, Python 3.5

___
Python tracker 

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



[issue31799] Improve __spec__ discoverability

2017-10-17 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:


New changeset 858ea4354fafa36e57859d2dfd70f8a057984075 by Barry Warsaw (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-31799: Make module.__spec__ more discoverable (GH-4010) (#4021)
https://github.com/python/cpython/commit/858ea4354fafa36e57859d2dfd70f8a057984075


--

___
Python tracker 

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



[issue31799] Improve __spec__ discoverability

2017-10-17 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +3996

___
Python tracker 

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



[issue31805] support._is_gui_available() hangs on x86-64 Sierra 3.6/3.x buildbot

2017-10-17 Thread STINNER Victor

STINNER Victor  added the comment:

Matt: Would you like to look at your buildbot to check if something is wrong 
with Tkinter?

The code hangs on the CGMainDisplayID() call in support._is_gui_available():

from ctypes import cdll, c_int, pointer, Structure
from ctypes.util import find_library
app_services = cdll.LoadLibrary(find_library("ApplicationServices"))
app_services.CGMainDisplayID()

--
nosy: +mattbillenstein

___
Python tracker 

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



[issue31799] Improve __spec__ discoverability

2017-10-17 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:


New changeset 191e3138200906e43cba9347177914325b54843f by Barry Warsaw in 
branch 'master':
bpo-31799: Make module.__spec__ more discoverable (#4010)
https://github.com/python/cpython/commit/191e3138200906e43cba9347177914325b54843f


--

___
Python tracker 

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



[issue21114] wsgiref.simple_server doesn't handle multi-line headers correctly

2017-10-17 Thread abraithwaite

abraithwaite  added the comment:

This might have been fixed by https://bugs.python.org/issue22928

Have not tested.

--
nosy: +abraithwaite

___
Python tracker 

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



[issue31753] Unnecessary closure in ast.literal_eval

2017-10-17 Thread Aaron Hall

Aaron Hall  added the comment:

Static analysis:

My mental model currently says the rebuilt function every outer call is an 
expense with no offsetting benefit. It seems that a function shouldn't build a 
closure on every call if the closure doesn't close over anything immediately 
used by the functionality. But I can't explain why the cost doesn't amortize 
toward zero in my testing.

Usage analysis:

On the other hand, this doesn't seem used very much at all in the std lib.
I'm not sure what the entire global benefit is to moving the closure to be a 
global instead - but there are about 88000 potential uses of the code on 
github: https://github.com/search?p=3=literal_eval=Code=%E2%9C%93 
One use seems to be scanning Python code - so potentially it gets a lot of use?

Alternatively: - to echo Serhiy ("Maybe it is worth to spend some time for 
optimizing closure creation."), perhaps the matter could be made irrelevant by 
looking at how we handle closures. I'm not sure why the difference didn't 
amortize to nearly nothing in my testing - I used Anaconda's Python 3.6.1 
distribution on Linux - if that matters.

Potential improvement:

So to be clear, the suggested change would probably be to move _convert to a 
global, maybe named _literal_eval_convert (this is less half-baked than my 
first code post, which I somewhat regret. Note that the recursive calls would 
need to be edited as well as the move and dedent.):


def literal_eval(node_or_string):
"""
Safely evaluate an expression node or a string containing a Python
expression.  The string or node provided may only consist of the following
Python literal structures: strings, bytes, numbers, tuples, lists, dicts,
sets, booleans, and None.
"""
if isinstance(node_or_string, str):
node_or_string = parse(node_or_string, mode='eval')
if isinstance(node_or_string, Expression):
node_or_string = node_or_string.body
return _literal_eval_convert(node_or_string)


def _literal_eval_convert(node):
if isinstance(node, Constant):
return node.value
elif isinstance(node, (Str, Bytes)):
return node.s
elif isinstance(node, Num):
return node.n
elif isinstance(node, Tuple):
return tuple(map(_literal_eval_convert, node.elts))
elif isinstance(node, List):
return list(map(_literal_eval_convert, node.elts))
elif isinstance(node, Set):
return set(map(_literal_eval_convert, node.elts))
elif isinstance(node, Dict):
return dict((_literal_eval_convert(k), _literal_eval_convert(v)) for k, 
v
in zip(node.keys, node.values))
elif isinstance(node, NameConstant):
return node.value
elif isinstance(node, UnaryOp) and isinstance(node.op, (UAdd, USub)):
operand = _literal_eval_convert(node.operand)
if isinstance(operand, _NUM_TYPES):
if isinstance(node.op, UAdd):
return + operand
else:
return - operand
elif isinstance(node, BinOp) and isinstance(node.op, (Add, Sub)):
left = _literal_eval_convert(node.left)
right = _literal_eval_convert(node.right)
if isinstance(left, _NUM_TYPES) and isinstance(right, _NUM_TYPES):
if isinstance(node.op, Add):
return left + right
else:
return left - right
raise ValueError('malformed node or string: ' + repr(node))

Note that I am not strongly committed to this issue, and won't feel badly if it 
is closed. It just seemed to be some low-hanging fruit in the standard library 
that I happened across.

--

___
Python tracker 

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



[issue31805] support._is_gui_available() hangs on x86-64 Sierra 3.6/3.x buildbot

2017-10-17 Thread STINNER Victor

STINNER Victor  added the comment:

Same issue on x86-64 Sierra 3.x:

http://buildbot.python.org/all/#/builders/14/builds/21

--
components: +Tkinter
title: support._is_gui_available() hangs on x86-64 Sierra 3.6 buildbot -> 
support._is_gui_available() hangs on x86-64 Sierra 3.6/3.x buildbot
versions: +Python 3.6, Python 3.7

___
Python tracker 

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



[issue31805] support._is_gui_available() hangs on x86-64 Sierra 3.6 buildbot

2017-10-17 Thread STINNER Victor

New submission from STINNER Victor :

http://buildbot.python.org/all/#/builders/20/builds/11

Re-running test 'test_ttk_guionly' in verbose mode
Timeout (0:15:00)!
Thread 0x7fffc0cd73c0 (most recent call first):
  File 
"/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/support/__init__.py",
 line 485 in _is_gui_available
  File 
"/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/support/__init__.py",
 line 531 in requires
  File 
"/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/test_ttk_guionly.py",
 line 8 in 
  File "", line 219 in _call_with_frames_removed
  File "", line 678 in exec_module
  File "", line 665 in _load_unlocked
  File "", line 955 in _find_and_load_unlocked
  File "", line 971 in _find_and_load
  File "", line 994 in _gcd_import
  File 
"/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/importlib/__init__.py",
 line 126 in import_module
  File 
"/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/libregrtest/runtest.py",
 line 160 in runtest_inner
  File 
"/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/libregrtest/runtest.py",
 line 137 in runtest
  File 
"/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/libregrtest/main.py",
 line 290 in rerun_failed_tests
  File 
"/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/libregrtest/main.py",
 line 539 in _main
  File 
"/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/libregrtest/main.py",
 line 509 in main
  File 
"/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/libregrtest/main.py",
 line 584 in main
  File 
"/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/__main__.py", 
line 2 in 
  File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/runpy.py", 
line 85 in _run_code
  File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/runpy.py", 
line 193 in _run_module_as_main
make: *** [buildbottest] Error 1

--
components: Tests, macOS
keywords: buildbot
messages: 304518
nosy: haypo, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: support._is_gui_available() hangs on x86-64 Sierra 3.6 buildbot

___
Python tracker 

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



[issue31334] select.poll.poll fails on BSDs with arbitrary negative timeouts

2017-10-17 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 6cfa927ceb931ad968b5b03e4a2bffb64a8a0604 by Victor Stinner 
(Riccardo Coccioli) in branch 'master':
bpo-31334: Fix timeout in select.poll.poll() (GH-3277)
https://github.com/python/cpython/commit/6cfa927ceb931ad968b5b03e4a2bffb64a8a0604


--

___
Python tracker 

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



[issue31803] Remove not portable time.clock(), replaced by time.perf_counter() and time.process_time()

2017-10-17 Thread STINNER Victor

STINNER Victor  added the comment:

I proposed PR 4020 to emit a DeprecationWarning in time.clock() and 
time.get_clock_info('clock').

--

___
Python tracker 

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



[issue31803] Remove not portable time.clock(), replaced by time.perf_counter() and time.process_time()

2017-10-17 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +3995

___
Python tracker 

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



[issue31782] Add a timeout to multiprocessing's Pool.join

2017-10-17 Thread Will Starms

Will Starms  added the comment:

I've realized that my patch may not be ideal for general-purpose use, but it's 
a good start for a discussion on the proper way to implement a timeout.

My patch (which is based on a more involved modification to Pool) assumes that 
the joins after the first will complete within a timely fashion, which is not 
necessarily true. While this prevents leaving the pool in a half-joined state, 
it can still get stuck joining other components or at least take significantly 
longer than the requested timeout.

Assuming that joining an already-joined object is safe, or it can be wrapped in 
an if statement to check before rejoining, I feel the best solution would be to 
reduce the timeout as joins complete, either raising (much easier) or returning 
(like threading.thread, but makes an is_alive function more difficult) when the 
remaining timeout time hits zero.

--

___
Python tracker 

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



[issue31739] socket.close recommended but not demonstrated in same-page example code

2017-10-17 Thread Nathaniel Manista

Nathaniel Manista  added the comment:

As I am learning from the examples, I don't have the confidence to propose a 
fix to them. :-P

For the IPv4-and-IPv6 "Echo server program": should s be closed at some point 
after "conn, addr = s.accept()"? Should s be closed on the line immediately 
after "conn, addr = s.accept()", should it be closed on the last line (after 
the "with conn:" context is exited), or is either acceptable?

Should the "very simple network sniffer with raw sockets on Windows" have a 
with statement or "s.close()"? Should the "communicate to a CAN network using 
the raw socket protocol" example have a with statement or "s.close()"?

Of course it's possible that I'm misunderstanding one or more things.

--

___
Python tracker 

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



[issue31803] Remove not portable time.clock(), replaced by time.perf_counter() and time.process_time()

2017-10-17 Thread Matthew Barnett

Matthew Barnett  added the comment:

@Victor: True, people often ignore DeprecationWarning anyway, but that's their 
problem, at least you can say "well, you were warned". They might not have read 
the documentation on it recently because they have not felt the need to read 
again about a function with which they are already familiar.

--
nosy: +mrabarnett

___
Python tracker 

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



[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2017-10-17 Thread Mario Corchero

Change by Mario Corchero :


--
nosy: +mariocj89

___
Python tracker 

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



[issue31804] multiprocessing calls flush on sys.stdout at exit even if it is None (pythonw)

2017-10-17 Thread Pox TheGreat

New submission from Pox TheGreat :

If you start Python by pythonw then sys.stdout and sys.stderr are set to None. 
If you also use multiprocessing then when the child process finishes 
BaseProcess._bootstrap calls sys.stdout.flush() and sys.stderr.flush() finally. 
This causes the process return code to be not zero (it is 1).

--
components: Library (Lib)
files: process.py.patch
keywords: patch
messages: 304512
nosy: Pox TheGreat
priority: normal
severity: normal
status: open
title: multiprocessing calls flush on sys.stdout at exit even if it is None 
(pythonw)
type: crash
versions: Python 3.5
Added file: https://bugs.python.org/file47224/process.py.patch

___
Python tracker 

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



[issue31786] In select.poll.poll() ms can be 0 if timeout < 0

2017-10-17 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
stage: patch review -> backport needed

___
Python tracker 

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



[issue31786] In select.poll.poll() ms can be 0 if timeout < 0

2017-10-17 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 2c15b29aea5d6b9c61aa42d2c24a07ff1edb4b46 by Serhiy Storchaka 
(Pablo Galindo) in branch 'master':
bpo-31786: Make functions in the select module blocking when timeout is a small 
negative value. (#4003)
https://github.com/python/cpython/commit/2c15b29aea5d6b9c61aa42d2c24a07ff1edb4b46


--

___
Python tracker 

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



[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-17 Thread Mario Corchero

Mario Corchero  added the comment:

Yep, http://man7.org/linux/man-pages/man3/strptime.3.html does support it even 
if it might look asymetrical.

Example:

   struct tm tm;
   char buf[255];

   memset(, 0, sizeof(struct tm));
   strptime("+00:00", "%z", );
   strftime(buf, sizeof(buf), "%z", );
   puts(buf); // Will print +
   exit(EXIT_SUCCESS);

Martin do you want me to "cleanup" the PR, add docs, news entry, etc?

--

___
Python tracker 

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



[issue31692] [2.7] Test `test_huntrleaks()` of test_regrtest fails in debug build with COUNT_ALLOCS

2017-10-17 Thread STINNER Victor

STINNER Victor  added the comment:

Serhiy: "Isn't worth to document these changes in What's New?"

Ok, I created the PR 4019.

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

___
Python tracker 

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



[issue31692] [2.7] Test `test_huntrleaks()` of test_regrtest fails in debug build with COUNT_ALLOCS

2017-10-17 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +3994

___
Python tracker 

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



[issue31733] [2.7] Add PYTHONSHOWREFCOUNT environment variable to Python 2.7

2017-10-17 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +3993

___
Python tracker 

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



[issue31803] Remove not portable time.clock(), replaced by time.perf_counter() and time.process_time()

2017-10-17 Thread STINNER Victor

STINNER Victor  added the comment:

Serhiy: "I think it is better to not remove time.clock() until EOL of 2.7. And 
in any case it first should start emitting a deprecation warning for a one or 
two releases."

I really hate using 2.7 EOL as the final countdown to start changing things. 
Are we building a new "Python 3" chaos where everything explode at once?

IMHO it's not that hard to write code compatible with Python 2 and Python 3:

try:
   from time import perf_counter # Python 3
except ImportError:
   from time import clock as perf_counter # Python 2

time.clock() is probably not the only code which requires two code paths in any 
non trivial application which wants to stay compatible with Python 2.

time.clock() is usually used for benchmarking. I hope that all benchmarking 
code was already patched to use time.perf_counter() when available, to make the 
code portable and get better resolution on Unix.

--

___
Python tracker 

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



[issue31803] Remove not portable time.clock(), replaced by time.perf_counter() and time.process_time()

2017-10-17 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

A runtime deprecation warning was not emitted in 3.3 because two alternatives, 
time.process_time() and time.perf_counter(), were not available before 3.3. It 
would be hard to write a warning-free code that supports 3.3 and earlier 
versions at the same time. But now 3.2 is virtually out of use and I think we 
can start emitting a deprecation warning at runtime.

And maybe make 2to3 replacing time.clock() with time.process_time() or 
time.perf_counter()?

--

___
Python tracker 

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



[issue31803] Remove not portable time.clock(), replaced by time.perf_counter() and time.process_time()

2017-10-17 Thread STINNER Victor

STINNER Victor  added the comment:

Ben Hoyt: "... from the PR it's clear that the standard library and tests do 
too."

I disagree here. The standard library doesn't use time.clock() since Python 
3.3. Better clocks like time.perf_counter() or time.monotonic() are now used in 
the standard library.

My PR onl changes two old tests and the very old turtledemo. I never used 
turtledemo, I didn't now that it exists neither :-)


"I wouldn't be at all surprised to find others do as well."

Oh, me neither. I'm quite sure that time.clock() is used in the wild. The 
problem is that you should not use it :-)


"I realize it's been deprecated since 3.3, but without a DeprecatingWarning, 
that's easy to miss. What about adding a DeprecatingWarning for 3.7 and 
deprecate it later, maybe in 3.9? (I know that's a long time, but time.clock() 
is an old function so we should be cautious!)"

I never understood the willingness of DeprecationWarning since almost nobody 
configures Python to run them. In my experience, even when they are displayed, 
they are usually ignored until the feature is really removed and then people 
only really start to look at the issue :-)

But I'm fine with keeping the function and emit a warning in Python 3.7, and 
remove it from Python 3.8.

--

___
Python tracker 

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



[issue31803] Remove not portable time.clock(), replaced by time.perf_counter() and time.process_time()

2017-10-17 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I think it is better to not remove time.clock() until EOL of 2.7. And in any 
case it first should start emitting a deprecation warning for a one or two 
releases.

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

___
Python tracker 

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



[issue31803] Remove not portable time.clock(), replaced by time.perf_counter() and time.process_time()

2017-10-17 Thread Ben Hoyt

Ben Hoyt  added the comment:

I don't think this is a good idea. I still use time.clock() out of habit (on 
Windows), and from the PR it's clear that the standard library and tests do 
too. I wouldn't be at all surprised to find others do as well.

I realize it's been deprecated since 3.3, but without a DeprecatingWarning, 
that's easy to miss. What about adding a DeprecatingWarning for 3.7 and 
deprecate it later, maybe in 3.9? (I know that's a long time, but time.clock() 
is an old function so we should be cautious!)

--
nosy: +benhoyt

___
Python tracker 

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



[issue31803] Remove not portable time.clock(), replaced by time.perf_counter() and time.process_time()

2017-10-17 Thread Ned Deily

Change by Ned Deily :


--
nosy: +belopolsky, lemburg

___
Python tracker 

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



[issue31803] Remove not portable time.clock(), replaced by time.perf_counter() and time.process_time()

2017-10-17 Thread Fred L. Drake, Jr.

Change by Fred L. Drake, Jr. :


--
nosy: +fdrake

___
Python tracker 

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



[issue31803] Remove not portable time.clock(), replaced by time.perf_counter() and time.process_time()

2017-10-17 Thread STINNER Victor

STINNER Victor  added the comment:

With the PR, Python 3.7 will still requires the C clock() function to build on 
Unix, since time.process_time() uses it as the last fallback if all other 
functions failed.

Maybe we can require to have other functions used by time.process_time() 
(clock_gettime(CLOCK_PROF), getrusage(), times(), ...), but I consider that it 
can be done later. This change may impact the Python portability: compilation 
error when building Python, see bpo-22624.

--

___
Python tracker 

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



[issue31803] Remove not portable time.clock(), replaced by time.perf_counter() and time.process_time()

2017-10-17 Thread STINNER Victor

Change by STINNER Victor :


--
keywords: +patch
pull_requests: +3992
stage:  -> patch review

___
Python tracker 

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



[issue31803] Remove not portable time.clock(), replaced by time.perf_counter() and time.process_time()

2017-10-17 Thread STINNER Victor

New submission from STINNER Victor :

The behaviour of the time.clock() function is not portable: on Windows it 
mesures wall-clock, whereas it measures CPU time on Unix. Python has 
time.process_time() and time.perf_counter(), since Python 3.3, which are 
portable, well defined and have a better resolution.

time.clock() was deprecated in Python 3.3 documentation, but calling 
time.clock() didn't raise a DeprecationWarning. I proposed to remove it from 
Python 3.7.

Sometimes, a deprecated function raises a DeprecationWarning in Python version 
N, before removing it from Python version N. time.clock() doesn't emit such 
warning, but I consider that it is possible to remove it anyway.

While it can be annoying to have to patch code to no more use time.clock(), I 
consider that it's worth it for portability and better clock resolution.

Attached PR removes time.clock() and time.get_clock_info() doens't accept 
'clock' anymore.

Current time.clock() documentation:

.. function:: clock()

   .. index::
  single: CPU time
  single: processor time
  single: benchmarking

   On Unix, return the current processor time as a floating point number 
expressed
   in seconds.  The precision, and in fact the very definition of the meaning of
   "processor time", depends on that of the C function of the same name.

   On Windows, this function returns wall-clock seconds elapsed since the first
   call to this function, as a floating point number, based on the Win32 
function
   :c:func:`QueryPerformanceCounter`. The resolution is typically better than 
one
   microsecond.

   .. deprecated:: 3.3
  The behaviour of this function depends on the platform: use
  :func:`perf_counter` or :func:`process_time` instead, depending on your
  requirements, to have a well defined behaviour.


--
components: Library (Lib)
messages: 304502
nosy: haypo
priority: normal
severity: normal
status: open
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



[issue31343] Include major(), minor(), makedev() from sysmacros

2017-10-17 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Louie Lu proposed the fix for this issue in issue30013.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue30013] Compiler warning in Modules/posixmodule.c

2017-10-17 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Sorry, Louie Lu, this already has been fixed in issue31343.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Include major(), minor(), makedev() from sysmacros

___
Python tracker 

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



[issue31589] Links for French documentation PDF is broken: LaTeX issue with non-ASCII characters?

2017-10-17 Thread Julien Palard

Julien Palard  added the comment:

Finally have a combination of latex engines that work for every cases, did a PR 
on docsbuild-scripts:

https://github.com/python/docsbuild-scripts/pull/34/

I already pulled xelatex on docs.iad1.psf.io via 
https://github.com/python/psf-salt/commit/989a7715c4a452b5af13baf9a33535bab0af822b#diff-6fb01fe8bbc22a54d234a57ad58e291e

Also opened a few related issue sphinx-doc side to track my thoughts:

- https://github.com/sphinx-doc/sphinx/issues/4150 (Ask if there is a better 
way to set the latex engine than giving it from docsbuild-scripts)
- https://github.com/sphinx-doc/sphinx/issues/4159 (Choose unicode-enabled 
default latex engines)
- https://github.com/sphinx-doc/sphinx/issues/4149 (Be more explicit on 
documentation about how to choose a latex engine)

--

___
Python tracker 

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



[issue31802] 'import posixpath' fails if 'os.path' has not be imported already.

2017-10-17 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +3991
stage: needs patch -> patch review

___
Python tracker 

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



[issue30013] Compiler warning in Modules/posixmodule.c

2017-10-17 Thread Florian Weimer

Change by Florian Weimer :


--
nosy: +fweimer

___
Python tracker 

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



[issue30541] Add restricted mocks to the python unittest mocking framework

2017-10-17 Thread STINNER Victor

Change by STINNER Victor :


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



[issue30541] Add restricted mocks to the python unittest mocking framework

2017-10-17 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 552be9d7e64f91b8e4ba5b29cd5dcc442d56f92c by Victor Stinner (Mario 
Corchero) in branch 'master':
bpo-30541: Add new method to seal mocks (GH61923)
https://github.com/python/cpython/commit/552be9d7e64f91b8e4ba5b29cd5dcc442d56f92c


--

___
Python tracker 

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



[issue31802] 'import posixpath' fails if 'os.path' has not be imported already.

2017-10-17 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
components: +Library (Lib)
nosy: +serhiy.storchaka
type: crash -> behavior
versions: +Python 2.7, Python 3.6, Python 3.7

___
Python tracker 

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



[issue31692] [2.7] Test `test_huntrleaks()` of test_regrtest fails in debug build with COUNT_ALLOCS

2017-10-17 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Isn't worth to document these changes in What's New?

--

___
Python tracker 

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



[issue31733] [2.7] Add PYTHONSHOWREFCOUNT environment variable to Python 2.7

2017-10-17 Thread STINNER Victor

STINNER Victor  added the comment:

Python 2.7.15 now requires to set PYTHONSHOWREFCOUNT env var to dump "[xxx 
refs]".

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



[issue31692] [2.7] Test `test_huntrleaks()` of test_regrtest fails in debug build with COUNT_ALLOCS

2017-10-17 Thread STINNER Victor

STINNER Victor  added the comment:

Python 2.7.15 will require to compile Python with COUNT_ALLOCS defined *and* to 
set the PYTHONSHOWALLOCCOUNT environment variable (ex: PYTHONSHOWALLOCCOUNT=1) 
to dump allocation counts. Moreover, counts are now dumped into stderr, instead 
of stdout.

Python 2.7 test suite now pass when Python is compiled with COUNT_ALLOCS.

Python 2.7 test suite doens't pass with PYTHONSHOWALLOCCOUNT set. I don't think 
that it's worth it to fix this case.

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



[issue31802] 'import posixpath' fails if 'os.path' has not be imported already.

2017-10-17 Thread Mark Shannon

New submission from Mark Shannon :

$ python3.7 -S
>>> import posixpath
Traceback (most recent call last):
  File "", line 1, in 
  File "--/Lib/posixpath.py", line 13, in 
import os
  File "--/Lib/os.py", line 92, in 
from os.path import (curdir, pardir, sep, pathsep, defpath, extsep, altsep,
ImportError: cannot import name 'curdir' from 'posixpath' (--/Lib/posixpath.py)

Whether this counts as a bug or not is debatable. It could be argued that you 
shouldn't be importing 'posixpath' directly, in which case it ought to be 
called '_posixpath', but I guess it is too late to be changing the name.

--
messages: 304494
nosy: Mark.Shannon
priority: normal
severity: normal
stage: needs patch
status: open
title: 'import posixpath' fails if 'os.path' has not be imported already.
type: crash

___
Python tracker 

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



[issue19527] Test failures with COUNT_ALLOCS

2017-10-17 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 7b4ba62e388474e811268322b47f80d464933541 by Victor Stinner in 
branch '2.7':
[2.7] bpo-31692: Add PYTHONSHOWALLOCCOUNT env var (GH-3927)
https://github.com/python/cpython/commit/7b4ba62e388474e811268322b47f80d464933541


--

___
Python tracker 

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



[issue31692] [2.7] Test `test_huntrleaks()` of test_regrtest fails in debug build with COUNT_ALLOCS

2017-10-17 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 7b4ba62e388474e811268322b47f80d464933541 by Victor Stinner in 
branch '2.7':
[2.7] bpo-31692: Add PYTHONSHOWALLOCCOUNT env var (GH-3927)
https://github.com/python/cpython/commit/7b4ba62e388474e811268322b47f80d464933541


--

___
Python tracker 

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



[issue31733] [2.7] Add PYTHONSHOWREFCOUNT environment variable to Python 2.7

2017-10-17 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 3c082a7fdb472f02bcac7a7f8fe1e3a34a11b70b by Victor Stinner in 
branch '2.7':
bpo-31733: Add PYTHONSHOWREFCOUNT env var (GH-3932)
https://github.com/python/cpython/commit/3c082a7fdb472f02bcac7a7f8fe1e3a34a11b70b


--

___
Python tracker 

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



[issue14465] xml.etree.ElementTree: add feature to prettify XML output

2017-10-17 Thread Alex Dzyoba

Change by Alex Dzyoba :


--
pull_requests: +3990
stage:  -> patch review

___
Python tracker 

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