[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding

2017-09-25 Thread Denis Osipov

Changes by Denis Osipov :


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

___
Python tracker 

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



[issue27426] Encoding mismatch causes some tests to fail on Windows

2017-09-25 Thread Denis Osipov

Changes by Denis Osipov :


--
keywords: +patch
pull_requests: +3727
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



[issue31311] a SystemError and a crash in PyCData_setstate() when __dict__ is bad

2017-09-25 Thread Oren Milman

Oren Milman added the comment:

> But this is a separate issue, 3.7 only.
I don't think i understand what this issue would include.

Anyway, i updated the PR according to your comments.

--

___
Python tracker 

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



[issue30995] Support logging.getLogger(style='{')

2017-09-25 Thread Vinay Sajip

Changes by Vinay Sajip :


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



[issue18558] Iterable glossary entry needs clarification

2017-09-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:


New changeset 0bf287b6e0a42877b06cbea5d0fe6474d8061caa by Raymond Hettinger in 
branch 'master':
bpo-18558: Clarify glossary entry for "Iterable" (#3732)
https://github.com/python/cpython/commit/0bf287b6e0a42877b06cbea5d0fe6474d8061caa


--

___
Python tracker 

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



[issue18558] Iterable glossary entry needs clarification

2017-09-25 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3728

___
Python tracker 

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



[issue18558] Iterable glossary entry needs clarification

2017-09-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:


New changeset 01438ed4c22ca150da1cc5c38d83a59b0b6a62a7 by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.6':
[3.6] bpo-18558: Clarify glossary entry for "Iterable" (GH-3732) (#3741)
https://github.com/python/cpython/commit/01438ed4c22ca150da1cc5c38d83a59b0b6a62a7


--

___
Python tracker 

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



[issue18558] Iterable glossary entry needs clarification

2017-09-25 Thread Raymond Hettinger

Changes by Raymond Hettinger :


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



[issue31549] test_strptime and test_time fail on non-English Windows

2017-09-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This looks a duplicate of issue16322.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> time.tzname on Python 3.3.0 for Windows is decoded by wrong 
encoding

___
Python tracker 

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



[issue23702] docs.python.org/3/howto/descriptor.html still refers to "unbound methods"

2017-09-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:


New changeset 0d4497b9cae7942b7f731a6f99a73985c3fb4630 by Raymond Hettinger in 
branch 'master':
bpo-23702: Update Descriptor-HOWTO to reflect the removal of unbound methods 
(#3739)
https://github.com/python/cpython/commit/0d4497b9cae7942b7f731a6f99a73985c3fb4630


--

___
Python tracker 

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



[issue23702] docs.python.org/3/howto/descriptor.html still refers to "unbound methods"

2017-09-25 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3729

___
Python tracker 

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



[issue31311] a SystemError and a crash in PyCData_setstate() when __dict__ is bad

2017-09-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 57c2561c8c5663aef55b00e3f29cba575ff36ccd by Serhiy Storchaka 
(Oren Milman) in branch 'master':
bpo-31311: Fix a SystemError and a crash in ctypes._CData.__setstate__(), in 
case of a bad __dict__. (#3254)
https://github.com/python/cpython/commit/57c2561c8c5663aef55b00e3f29cba575ff36ccd


--

___
Python tracker 

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



[issue31311] a SystemError and a crash in PyCData_setstate() when __dict__ is bad

2017-09-25 Thread Roundup Robot

Changes by Roundup Robot :


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

___
Python tracker 

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



[issue23702] docs.python.org/3/howto/descriptor.html still refers to "unbound methods"

2017-09-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:


New changeset 73c915a5cd1cdd8775cf47b77fef7ca8fd42ad96 by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.6':
[3.6] bpo-23702: Update Descriptor-HOWTO to reflect the removal of unbound 
methods (GH-3739) (#3742)
https://github.com/python/cpython/commit/73c915a5cd1cdd8775cf47b77fef7ca8fd42ad96


--

___
Python tracker 

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



[issue23702] docs.python.org/3/howto/descriptor.html still refers to "unbound methods"

2017-09-25 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
dependencies:  -Wrong function calls and referring to not removed concepts in 
descriptor HowTo (documentation)

___
Python tracker 

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



[issue23702] docs.python.org/3/howto/descriptor.html still refers to "unbound methods"

2017-09-25 Thread Raymond Hettinger

Changes by Raymond Hettinger :


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



[issue25435] Wrong function calls and referring to not removed concepts in descriptor HowTo (documentation)

2017-09-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I've just updated the section on unbound methods.  I'll be working on a number 
of other improvements over the next few weeks and will incorporate the 
suggested changes where appropriate.

--

___
Python tracker 

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



[issue27385] itertools.groupby has misleading doc string

2017-09-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:


New changeset 49392c63a243052c8013bef80d35202bb6d7c404 by Raymond Hettinger in 
branch 'master':
bpo-27385: Clarify docstring for groupby() (#3738)
https://github.com/python/cpython/commit/49392c63a243052c8013bef80d35202bb6d7c404


--

___
Python tracker 

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



[issue27385] itertools.groupby has misleading doc string

2017-09-25 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3731

___
Python tracker 

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



[issue31568] Configure thinks it finds python3.5 but doesn't

2017-09-25 Thread STINNER Victor

STINNER Victor added the comment:

It seems like the bug was fixed. Nice.

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



[issue30947] Update embeded copy of libexpat from 2.2.1 to 2.2.3

2017-09-25 Thread STINNER Victor

STINNER Victor added the comment:

libexpat has been upgraded from 2.2.1 to 2.2.4 in 2.7, 3.4, 3.5, 3.6 and master 
branches.

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



[issue31170] Update to expat 2.2.4 (expat: utf8_toUtf8 cannot properly handle exhausting buffer)

2017-09-25 Thread STINNER Victor

STINNER Victor added the comment:


New changeset e6d9fcbb8d0c325e57df08ae8781aafedb71eca2 by Victor Stinner in 
branch 'master':
bpo-31170: Write unit test for Expat 2.2.4 UTF-8 bug (#3570)
https://github.com/python/cpython/commit/e6d9fcbb8d0c325e57df08ae8781aafedb71eca2


--

___
Python tracker 

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



[issue31170] Update to expat 2.2.4 (expat: utf8_toUtf8 cannot properly handle exhausting buffer)

2017-09-25 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3732
stage: commit review -> patch review

___
Python tracker 

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



[issue31170] Update to expat 2.2.4 (expat: utf8_toUtf8 cannot properly handle exhausting buffer)

2017-09-25 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3733

___
Python tracker 

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



[issue27385] itertools.groupby has misleading doc string

2017-09-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:


New changeset e2a30cd35b95dad55aea10347655f246348d1951 by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.6':
[3.6] bpo-27385: Clarify docstring for groupby() (GH-3738) (#3744)
https://github.com/python/cpython/commit/e2a30cd35b95dad55aea10347655f246348d1951


--

___
Python tracker 

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



[issue27385] itertools.groupby has misleading doc string

2017-09-25 Thread Raymond Hettinger

Changes by Raymond Hettinger :


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

___
Python tracker 

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



[issue31170] Update to expat 2.2.4 (expat: utf8_toUtf8 cannot properly handle exhausting buffer)

2017-09-25 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 5f5da728aec9c4f74cc771fbf30037b64a447514 by Victor Stinner in 
branch '2.7':
bpo-31170: Write unit test for Expat 2.2.4 UTF-8 bug (#3570) (#3745)
https://github.com/python/cpython/commit/5f5da728aec9c4f74cc771fbf30037b64a447514


--

___
Python tracker 

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



[issue31311] a SystemError and a crash in PyCData_setstate() when __dict__ is bad

2017-09-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset a6bddb8e4397df30926eb1ade6420a2277174227 by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.6':
[3.6] bpo-31311: Fix a SystemError and a crash in ctypes._CData.__setstate__(), 
in case of a bad __dict__. (GH-3254) (#3743)
https://github.com/python/cpython/commit/a6bddb8e4397df30926eb1ade6420a2277174227


--

___
Python tracker 

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



[issue30947] Update embeded copy of libexpat from 2.2.1 to 2.2.3

2017-09-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

And in 3.3.

--

___
Python tracker 

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



[issue26491] Defer DECREFs until enum object is in a consistent state for re-entrancy

2017-09-25 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
pull_requests: +3734

___
Python tracker 

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



[issue31170] Update to expat 2.2.4 (expat: utf8_toUtf8 cannot properly handle exhausting buffer)

2017-09-25 Thread STINNER Victor

STINNER Victor added the comment:


New changeset ad051cbce1360ad3055a048506c09bc2a5442474 by Victor Stinner in 
branch '3.6':
bpo-31170: Write unit test for Expat 2.2.4 UTF-8 bug (#3570) (#3746)
https://github.com/python/cpython/commit/ad051cbce1360ad3055a048506c09bc2a5442474


--

___
Python tracker 

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



[issue31170] Update to expat 2.2.4 (expat: utf8_toUtf8 cannot properly handle exhausting buffer)

2017-09-25 Thread STINNER Victor

STINNER Victor added the comment:

libexpat has been upgraded to version 2.2.4 in Python 2.7, 3.3, 3.4, 3.5, 3.6 
and master.

I added an unit test to Python 2.7, 3.6 and master. I'm not sure about 
backporting the new unit test to Python 3.3, 3.4 and 3.5.

I close the issue.

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



[issue31530] Python 2.7 readahead feature of file objects is not thread safe

2017-09-25 Thread STINNER Victor

STINNER Victor added the comment:

It's difficult to make a choice between Benjamin's PR 3670 and Serhiy's PR 3672.

Benjamin wrote that about his PR:

> No attempt is made to define or provide "reasonable" semantics for iterating
> over a file on multiple threads. (Non-crashing) races are still
> present. Duplicated, corrupt, and missing data will happen.

I'm not confortable with the idea of data corruption. I'm not confortable with 
breaking backward compatibility neither. IMHO the key question is if anyone 
actually use a file object at the same time in multiple threads. Since, it's 
likely that iterating on the same object crash, I'm not sure that anyone do it.

If someone rely on the feature, we should maybe explain how to handle properly 
the issue: use a lock.

I have a preference for Serhiy's PR 3672. It's simple, the error is easy to 
understand. Maybe his PR just lacks a mention in "Porting to Python 2.7" 
section of What's New in Python 2.7 and/or the NEWS entry. Suggest to use a 
lock for example.

--

___
Python tracker 

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



[issue26491] Defer DECREFs until enum object is in a consistent state for re-entrancy

2017-09-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:


New changeset 8110dbd470f3daa4de58dda66d360e3c26d3b94f by Raymond Hettinger in 
branch 'master':
bpo-26491 Defer DECREFs until enumobject is in a consistent state (#3747)
https://github.com/python/cpython/commit/8110dbd470f3daa4de58dda66d360e3c26d3b94f


--

___
Python tracker 

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



[issue26491] Defer DECREFs until enum object is in a consistent state for re-entrancy

2017-09-25 Thread Raymond Hettinger

Changes by Raymond Hettinger :


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

___
Python tracker 

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



[issue30347] itertools.groupby() can fail a C assert()

2017-09-25 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: rhettinger -> serhiy.storchaka

___
Python tracker 

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



[issue25732] functools.total_ordering does not correctly implement not equal behaviour

2017-09-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Serhiy, do you want to bring this to fruition?

--
assignee: rhettinger -> serhiy.storchaka

___
Python tracker 

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



[issue31520] ResourceWarning: unclosed warning

2017-09-25 Thread STINNER Victor

STINNER Victor added the comment:

socket.SocketIO inherits from io.RawIOBase which inherits from io.IOBase.

io.IOBase has a finalizer which calls the close() method. I tried to add a 
__del__ method to socket.SocketIO, but the object was already closed by the 
finalizer.

io.FileIO uses a trick at the C level: it sets an internal "finalizing" 
attribute to check if close() was called by IOBase finalizer. If it's the case, 
a ResourceWarning is emitted.

I don't see a simpler way to emit a ResourceWarning in SocketIO. Maybe it's not 
the right approach.

--

___
Python tracker 

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



[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding

2017-09-25 Thread STINNER Victor

STINNER Victor added the comment:

Formatting timezone on Windows in the right encoding is an old Python 
(especially Python 3) issue:

https://bugs.python.org/issue1040
https://bugs.python.org/issue8304
https://bugs.python.org/issue10653
https://bugs.python.org/issue16322#msg174164

--

___
Python tracker 

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



[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding

2017-09-25 Thread STINNER Victor

STINNER Victor added the comment:

bpo-31549 has been marked as a duplicate of this issue.

--

___
Python tracker 

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



[issue31530] Python 2.7 readahead feature of file objects is not thread safe

2017-09-25 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I'm wary of raising an exception.  Assuming Benjamin's patch is correct, I vote 
for it.

--

___
Python tracker 

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



[issue31530] Python 2.7 readahead feature of file objects is not thread safe

2017-09-25 Thread STINNER Victor

STINNER Victor added the comment:

Antoine: "I'm wary of raising an exception.  Assuming Benjamin's patch is 
correct, I vote for it."

Can you please elaborate? You are fine with the fact that iter(file) in two 
thread can return the same line?

--

___
Python tracker 

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



[issue31530] Python 2.7 readahead feature of file objects is not thread safe

2017-09-25 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 25/09/2017 à 11:39, STINNER Victor a écrit :
> 
> Antoine: "I'm wary of raising an exception.  Assuming Benjamin's patch is 
> correct, I vote for it."
> 
> Can you please elaborate? You are fine with the fact that iter(file) in two 
> thread can return the same line?

AFAIU it already could.  Iteration on Python 2 files is fragile, now is
not the time to fix fundamental bugs in Python 2.

--

___
Python tracker 

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



[issue25732] functools.total_ordering does not correctly implement not equal behaviour

2017-09-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +3735
stage: commit review -> patch review

___
Python tracker 

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



[issue30152] Reduce the number of imports for argparse

2017-09-25 Thread INADA Naoki

INADA Naoki added the comment:

Oh, the pull request is far larger than I thought!

I doubt that avoiding functools and collections is worth enough, because it is 
very common.

For example:

* functools is very commonly imported, especially for wraps().

* collections is imported by functools, so it's more commonly imported than 
functools.

* Old style namespace package (.pth file) imports types module, and types 
module and types imports functools, collections.  So even `python -c 42` 
imports them if at least one old-style namespace package is installed.  (e.g. 
Sphinx)


Instead of avoiding them, I want to make them faster.

* C implementation of ABC will makes collection, weakref and some other modules 
much faster.
* Recent PEP will allows split functools module into submodules without 
breaking backward compatibility.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue31573] struct_rusage

2017-09-25 Thread Oren Milman

Changes by Oren Milman :


--
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: struct_rusage

___
Python tracker 

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



[issue31574] Add dtrace hook for importlib

2017-09-25 Thread Christian Heimes

New submission from Christian Heimes:

#31415 proposed an option to show import timings. The output is primarily 
designed for humans. I propose to instrument importlib with two dtrace hooks:

  probe import__find__load__start(const char *)
  probe import__find__load__done(const char *, int);

arg0 is the absolute module name as UTF-8 string. arg1 of import_find_load_done 
probe indicates if the module was found (1) or import failed (0).

--
components: Interpreter Core
messages: 302942
nosy: brett.cannon, christian.heimes, eric.snow, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Add dtrace hook for importlib
type: performance
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



[issue31574] Add dtrace hook for importlib

2017-09-25 Thread Christian Heimes

Changes by Christian Heimes :


--
keywords: +patch
pull_requests: +3736
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



[issue31415] Add -X option to show import time

2017-09-25 Thread Christian Heimes

Christian Heimes added the comment:

+1 for an option to profile import time.

I have a minor complain: The output format is not machine-friendly, which makes 
it harder to perform automatic analysis. I created #31574 / PR3749 to add 
dtrace probes.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue30152] Reduce the number of imports for argparse

2017-09-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

functools.wraps() is used in more complex programs. The purpose of this PR is 
speeding up small scripts that just start, parse arguments, do its fast work 
(so fast as outputting a help or a version) and exit. Even collections is not 
used in a half of my scripts.

types needs functools only for coroutine(). Unlikely it is used in old style 
namespace packages.

--

___
Python tracker 

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



[issue31573] crashes in os.wait3() and os.wait4() in case of a bad resource.struct_rusage

2017-09-25 Thread Oren Milman

New submission from Oren Milman:

The following code causes the interpreter to crash:
import os
import time
import resource
new_pid = os.fork()
if new_pid == 0:
time.sleep(0.5)
else:
resource.struct_rusage = None
os.wait3(0)

We would get a crash also if we replaced 'os.wait3(0)' with 'os.wait4(new_pid, 
0)'.

This is because wait_helper() (in in Modules/posixmodule.c) assumes that
resource.struct_rusage is a type object, and passes it to 
PyStructSequence_New(),
which tries to access the n_fields attribute, and crashes.


In addition, the following code causes a SystemError:
class BadStructRusage:
n_fields = None

import os
import time
import resource
new_pid = os.fork()
if new_pid == 0:
time.sleep(0.5)
else:
resource.struct_rusage = BadStructRusage
os.wait3(0)

This is because PyStructSequence_New() (in Objects/structseq.c) assumes that it
received a type with a valid n_fields attribute.


Similarly, the following code causes the interpreter to crash:
class BadStructRusage:
n_fields = 16
n_sequence_fields = None

import os
import time
import resource
new_pid = os.fork()
if new_pid == 0:
time.sleep(0.5)
else:
resource.struct_rusage = BadStructRusage
os.wait3(0)


ISTM that we can fix these problems by adding checks to wait_helper() and to
PyStructSequence_New().
However, maybe a more simple solution would be to either:
- Make wait_helper() always use StructRUsageType (defined in 
Modules/resource.c).
- Disable assigning to resource.struct_rusage.

Moreover, I don't understand the comment before calling PyStructSequence_New():
/* XXX(nnorwitz): Copied (w/mods) from resource.c, there should be only one. */
Is it relevant to this issue?


Lastly, I am not sure about tests (as I found almost no tests of wait3() and
wait4()).
Should I add to Lib/test/test_wait3.py and Lib/test/test_wait4.py each a class
to test this issue? Or is it too much of a corner case, and a test is not 
needed?

--
components: +Extension Modules
title: struct_rusage -> crashes in os.wait3() and os.wait4() in case of a bad 
resource.struct_rusage
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



[issue25732] functools.total_ordering does not correctly implement not equal behaviour

2017-09-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset d94a65a0694a188713f91ba7c9fffded090247dc by Serhiy Storchaka in 
branch '2.7':
bpo-25732: Make functools.total_ordering implementing __ne__. (#3748)
https://github.com/python/cpython/commit/d94a65a0694a188713f91ba7c9fffded090247dc


--

___
Python tracker 

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



[issue25732] functools.total_ordering does not correctly implement not equal behaviour

2017-09-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I committed the patch from Raymond's name, but GitHub set me as the author of 
the commit. :(

--

___
Python tracker 

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



[issue25732] functools.total_ordering does not correctly implement not equal behaviour

2017-09-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue30347] itertools.groupby() can fail a C assert()

2017-09-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue30347] itertools.groupby() can fail a C assert()

2017-09-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Hmm, the sole issue30346 is not enough for fixing this crash. I don't know if 
there is a simpler fix based on issue30346, but since PR 1557 removes the code 
duplication I'm going to merge it in any case.

--

___
Python tracker 

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



[issue31520] ResourceWarning: unclosed warning

2017-09-25 Thread Martin Panter

Martin Panter added the comment:

I’m curious how you manage to trigger the warning in the “closed” state. The 
Python I have handy is half a year out of date, but all my attempts to trigger 
the warning either produce the less confusing version,

ResourceWarning: unclosed 

or there is no warning at all due IOBase.__del__ (see Issue 19829).

If your SocketIO was wrapped in a BufferedReader/Writer/RWPair, then that could 
easily close the SocketIO object before SocketIO.__del__ is called. You would 
also have to override the wrapper’s __del__ method, rather than (or as well as) 
SocketIO.__del__.

--

___
Python tracker 

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



[issue31575] Functional Programming HOWTO sub-optimal example for reduce

2017-09-25 Thread Anran Yang

New submission from Anran Yang:

At the end of the Functional Programming HOWTO document 
(https://docs.python.org/3.7/howto/functional.html) the usage of 
reduce/lambda/for loops are compared and discussed. However, the example for 
reduce seems sub-optimal and thus the discussion is not that efficient. The 
example:

total = functools.reduce(lambda a, b: (0, a[1] + b[1]), items)[1]

could be changed to:

total = functools.reduce(lambda total, item: total + item[1], items, 0)

which is much more readable and is actually not much inferior to the loop one 
(though the sum approach is still more concise).

--
assignee: docs@python
components: Documentation
messages: 302950
nosy: Anran Yang, docs@python
priority: normal
severity: normal
status: open
title: Functional Programming HOWTO sub-optimal example for reduce
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue31574] Add dtrace hook for importlib

2017-09-25 Thread Christian Heimes

Christian Heimes added the comment:

Example output:

$ sudo stap import.stp -c "./python -c pass"
[1506342342142233574] * Importing '_frozen_importlib_external' ...
[1506342342142719538] + Imported  '_frozen_importlib_external'
[1506342342143260191] * Importing 'zipimport' ...
[1506342342143329476] + Imported  'zipimport'
[1506342342143474571] * Importing 'encodings' ...
[1506342342143858228]   * Importing 'codecs' ...
[1506342342144149624] * Importing '_codecs' ...
[1506342342144205933] + Imported  '_codecs'
[1506342342144363609]   + Imported  'codecs'
[1506342342144377843]   * Importing 'encodings.aliases' ...
[1506342342144676180]   + Imported  'encodings.aliases'
[1506342342144712610] + Imported  'encodings'
[1506342342144725110] * Importing 'encodings.utf_8' ...
[1506342342144906782] + Imported  'encodings.utf_8'
[1506342342144925714] * Importing '_signal' ...
[1506342342145015138] + Imported  '_signal'
[1506342342145025346] * Importing 'encodings.latin_1' ...
[1506342342145229859] + Imported  'encodings.latin_1'
[1506342342145236273] * Importing 'io' ...
[1506342342145333476]   * Importing 'abc' ...
[1506342342145443604] * Importing '_weakrefset' ...
[1506342342145658942] + Imported  '_weakrefset'
[1506342342145746442]   + Imported  'abc'
[1506342342145929972] + Imported  'io'
[1506342342145985754] * Importing 'site' ...
[1506342342146168933]   * Importing 'os' ...
[1506342342146387697] * Importing 'errno' ...
[1506342342146455581] + Imported  'errno'
[1506342342146457808] * Importing 'stat' ...
[1506342342146620691]   * Importing '_stat' ...
[1506342342146676954]   + Imported  '_stat'
[1506342342146700059] + Imported  'stat'
[1506342342146738715] * Importing 'posixpath' ...
[1506342342146882603]   * Importing 'genericpath' ...
[1506342342146999370]   + Imported  'genericpath'
[1506342342147014839] + Imported  'posixpath'
[1506342342147133401] * Importing '_collections_abc' ...
[1506342342148404142] + Imported  '_collections_abc'
[1506342342148517849]   + Imported  'os'
[1506342342148521360]   * Importing '_sitebuiltins' ...
[1506342342148680131]   + Imported  '_sitebuiltins'
[1506342342148952120]   * Importing 'sitecustomize' ...
[1506342342149107151]   - Failed'sitecustomize'
[1506342342149111461]   * Importing 'usercustomize' ...
[1506342342149171745]   - Failed'usercustomize'
[1506342342149182576] + Imported  'site'

--
Added file: https://bugs.python.org/file47168/import.stp

___
Python tracker 

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



[issue31520] ResourceWarning: unclosed warning

2017-09-25 Thread STINNER Victor

STINNER Victor added the comment:

> I’m curious how you manage to trigger the warning in the “closed” state.

It comes from Refleak buildbots. Example:

0:13:47 load avg: 3.24 [ 52/407] test_urllib2net passed (239 sec)
beginning 6 repetitions
123456
Resource 'http://www.imdb.com' is not available
/buildbot/buildarea/3.x.ware-gentoo-x86.refleak/build/Lib/test/libregrtest/refleak.py:253:
 ResourceWarning: unclosed 
  gc.collect()
..

I failed to reproduce this exact warning. I don't know if it's related to the 
"Resource 'http://www.imdb.com' is not available" message.

--

___
Python tracker 

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



[issue31553] Extend json.tool to handle jsonlines (with a flag)

2017-09-25 Thread Eric Moyer

Eric Moyer added the comment:

I planned to write the PR myself, on the principle of "it's my itch, I
should scratch it." But if you think it is better for someone else to write
it, you know the codebase better than I, and you know how long a PR takes
to review/fix. My intention is to help. I'll do whatever is easier for you.

On Sep 24, 2017 10:01 PM, "Raymond Hettinger" 
wrote:

>
> Raymond Hettinger added the comment:
>
> Eric, did you want to write the PR yourself or would you like for Lisa to
> bring it to fruition?   If you're going to do it yourself, Lisa will serve
> as the primary reviewer (with either Ezio or me doing the final sign-off).
>
> --
> assignee:  -> lisroach
> nosy: +lisroach
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue31574] Add dtrace hook for importlib

2017-09-25 Thread Christian Heimes

Christian Heimes added the comment:

Improved script and output for "import asyncio":

$ sudo stap import.stp -c "./python -c 'import asyncio'"
[1506343527655342994] * Importing '_frozen_importlib_external' ...
[1506343527655797118] + Imported  '_frozen_importlib_external' in 454us
[1506343527656351387] * Importing 'zipimport' ...
[1506343527656420328] + Imported  'zipimport' in 68us
[1506343527656577490] * Importing 'encodings' ...
[1506343527656969001]   * Importing 'codecs' ...
[1506343527657242647] * Importing '_codecs' ...
[1506343527657302163] + Imported  '_codecs' in 59us
[1506343527657461354]   + Imported  'codecs' in 492us
[1506343527657475610]   * Importing 'encodings.aliases' ...
[1506343527657778342]   + Imported  'encodings.aliases' in 302us
[1506343527657815834] + Imported  'encodings' in 1238us
[1506343527657829245] * Importing 'encodings.utf_8' ...
[1506343527658013466] + Imported  'encodings.utf_8' in 184us
[1506343527658037373] * Importing '_signal' ...
[1506343527658133293] + Imported  '_signal' in 95us
[1506343527658144146] * Importing 'encodings.latin_1' ...
[1506343527658350574] + Imported  'encodings.latin_1' in 206us
[1506343527658357616] * Importing 'io' ...
[1506343527658456592]   * Importing 'abc' ...
[1506343527658570293] * Importing '_weakrefset' ...
[1506343527658790316] + Imported  '_weakrefset' in 219us
[1506343527658881770]   + Imported  'abc' in 425us
[1506343527659074176] + Imported  'io' in 716us
[1506343527659130999] * Importing 'site' ...
[1506343527659303251]   * Importing 'os' ...
[1506343527659525410] * Importing 'errno' ...
[1506343527659597020] + Imported  'errno' in 71us
[1506343527659599466] * Importing 'stat' ...
[1506343527659766912]   * Importing '_stat' ...
[1506343527659826033]   + Imported  '_stat' in 59us
[1506343527659850009] + Imported  'stat' in 250us
[1506343527659890059] * Importing 'posixpath' ...
[1506343527660042891]   * Importing 'genericpath' ...
[1506343527660162920]   + Imported  'genericpath' in 119us
[1506343527660178776] + Imported  'posixpath' in 288us
[1506343527660291984] * Importing '_collections_abc' ...
[1506343527661557288] + Imported  '_collections_abc' in 1265us
[1506343527661673583]   + Imported  'os' in 2370us
[1506343527661677360]   * Importing '_sitebuiltins' ...
[1506343527661838265]   + Imported  '_sitebuiltins' in 160us
[1506343527662126078]   * Importing 'sitecustomize' ...
[1506343527662277259]   - Failed'sitecustomize' in 151us
[1506343527662281831]   * Importing 'usercustomize' ...
[1506343527662342158]   - Failed'usercustomize' in 60us
[1506343527662352810] + Imported  'site' in 3221us
[1506343527662533328] * Importing 'asyncio' ...
[1506343527662726586]   * Importing 'asyncio.selectors' ...
[1506343527662819261]   - Failed'asyncio.selectors' in 92us
[1506343527662828182]   * Importing 'selectors' ...
[1506343527662998225] * Importing 'collections' ...
[1506343527663394147]   * Importing 'operator' ...
[1506343527663966898] * Importing '_operator' ...
[1506343527664053199] + Imported  '_operator' in 86us
[1506343527664080513]   + Imported  'operator' in 686us
[1506343527664084065]   * Importing 'keyword' ...
[1506343527664212162]   + Imported  'keyword' in 128us
[1506343527664217270]   * Importing 'heapq' ...
[1506343527664344952] * Importing '_heapq' ...
[1506343527664482616] + Imported  '_heapq' in 137us
[1506343527664500526]   + Imported  'heapq' in 283us
[1506343527664504388]   * Importing 'itertools' ...
[1506343527664598920]   + Imported  'itertools' in 94us
[1506343527664603801]   * Importing 'reprlib' ...
[1506343527664775143]   + Imported  'reprlib' in 171us
[1506343527664779385]   * Importing '_collections' ...
[1506343527664845585]   + Imported  '_collections' in 66us
[1506343527665283918] + Imported  'collections' in 2285us
[1506343527665287954] * Importing 'collections.abc' ...
[1506343527665431913] + Imported  'collections.abc' in 143us
[1506343527665435709] * Importing 'math' ...
[1506343527665598221] + Imported  'math' in 162us
[1506343527665600676] * Importing 'select' ...
[1506343527665748069] + Imported  'select' in 147us
[1506343527666097689]   + Imported  'selectors' in 3269us
[1506343527666102503]   * Importing 'asyncio.base_events' ...
[1506343527666436554] * Importing 'concurrent.futures' ...
[1506343527666449899]   * Importing 'concurrent' ...
[1506343527666575660]   + Imported  'concurrent' in 125us
[150634352796868]   * Importing 'concurrent.futures._base' ...
[1506343527666880942] * Importing 'logging' ...
[1506343527667272107]   * Importing 'time' ...
[1506343527667364105]   + Imported  'time' in 91us
[1506343527667366876]   * Importing 'traceback' ...
[1506343527667538062] * Importing 'linecache' ...
[1506343527667655837]   * Impo

[issue31576] problem in math

2017-09-25 Thread ANEESH JOSE

New submission from ANEESH JOSE:

We know that the answer of sin 90 is 1.
But In Python's library math,the value of it is around 0.83...
My program is as follows:
import math
a=math.sin(90)
print(a)
#Output obtained is 0.83.
Hope you guys solve this on the next update or nearby
I hope it is a small issue.But the credibility of program depends upon every 
minute particles

--
messages: 302955
nosy: aneesh317
priority: normal
severity: normal
status: open
title: problem in math
type: performance
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



[issue31576] problem in math

2017-09-25 Thread STINNER Victor

STINNER Victor added the comment:

It seems like you are confused between radians and degrees. math.sin() expects 
radians.
https://docs.python.org/dev/library/math.html#math.sin

Sorry but the Python bug tracker is not the right to ask questions. I close 
your bug report.

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



[issue31576] problem in math

2017-09-25 Thread ANEESH JOSE

ANEESH JOSE added the comment:

Thankyou for the information .

--

___
Python tracker 

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



[issue31558] gc.freeze() - an API to mark objects as uncollectable

2017-09-25 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +pitrou

___
Python tracker 

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



[issue31573] crashes in os.wait3() and os.wait4() in case of a bad resource.struct_rusage

2017-09-25 Thread STINNER Victor

Changes by STINNER Victor :


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

___
Python tracker 

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



[issue31573] crashes in os.wait3() and os.wait4() in case of a bad resource.struct_rusage

2017-09-25 Thread STINNER Victor

STINNER Victor added the comment:

Attached PR 3750 tries to validate the input type. The problem is that 
structseq is not exactly a type. It's hard to really validate everything. See 
the comment test in my PR.

--
nosy: +haypo

___
Python tracker 

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



[issue31573] crashes in os.wait3() and os.wait4() in case of a bad resource.struct_rusage

2017-09-25 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31573] PyStructSequence_New() doesn't validate its input type (crashes in os.wait3() and os.wait4() in case of a bad resource.struct_rusage

2017-09-25 Thread STINNER Victor

Changes by STINNER Victor :


--
title: crashes in os.wait3() and os.wait4() in case of a bad 
resource.struct_rusage -> PyStructSequence_New() doesn't validate its input 
type (crashes in os.wait3() and os.wait4() in case of a bad 
resource.struct_rusage

___
Python tracker 

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



[issue31573] PyStructSequence_New() doesn't validate its input type (crashes in os.wait3() and os.wait4() in case of a bad resource.struct_rusage)

2017-09-25 Thread STINNER Victor

Changes by STINNER Victor :


--
title: PyStructSequence_New() doesn't validate its input type (crashes in 
os.wait3() and os.wait4() in case of a bad resource.struct_rusage -> 
PyStructSequence_New() doesn't validate its input type (crashes in os.wait3() 
and os.wait4() in case of a bad resource.struct_rusage)

___
Python tracker 

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



[issue31145] PriorityQueue.put() fails with TypeError if priority_number in tuples of (priority_number, data) are the same.

2017-09-25 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +r.david.murray

___
Python tracker 

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



[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding

2017-09-25 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue31569] inconsistent case of PCbuild/ directory

2017-09-25 Thread Steve Dower

Steve Dower added the comment:

I'm okay with the PR as it stands, especially the parts that affect GitHub and 
appveyor, as those are almost certainly using case sensitive comparisons.

It's definitely not easier to update the case of a file that is in git, and 
doing so will very likely break users (we had to do a case-folding pass over 
the Mercurial repository because while it could handle case changes, git could 
not import the ones we had in history).

Personally I'd prefer it to have always been PCBuild rather than PCbuild, and 
it's very likely that I've introduced most of the 'incorrect' ones. But what's 
done is done and we should avoid the potential distraction of mismatched case 
throughout the rest of our codebase.

--

___
Python tracker 

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



[issue31569] inconsistent case of PCbuild/ directory

2017-09-25 Thread Zachary Ware

Zachary Ware added the comment:

Personally, *I'd* prefer PC -> Windows and PCbuild -> Windows\build :)

I'm also good with the PR as is.

--

___
Python tracker 

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



[issue31170] Update to expat 2.2.4 (expat: utf8_toUtf8 cannot properly handle exhausting buffer)

2017-09-25 Thread Steve Dower

Changes by Steve Dower :


--
pull_requests: +3738

___
Python tracker 

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



[issue31577] crash in os.utime() in case of a bad ns argument

2017-09-25 Thread Oren Milman

New submission from Oren Milman:

The following code causes the interpreter to crash:
class BadInt:
def __divmod__(*args):
return 42

import os
os.utime('foo.txt', ns=(BadInt(), 1))


This is because split_py_long_to_s_and_ns() (in Modules/posixmodule.c) assumes
that PyNumber_Divmod() returns a 2-tuple, and passes it to PyTuple_GET_ITEM(),
which assumes it is a tuple. Thus, PyTuple_GET_ITEM() might return a non-NULL
value which is not an address of a Python object.

--
components: Extension Modules
messages: 302962
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: crash in os.utime() in case of a bad ns argument
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



[issue31569] inconsistent case of PCbuild/ directory

2017-09-25 Thread Paul Moore

Paul Moore added the comment:

OK, having re-read the PR, I'm fine with applying it as is, too.

--

___
Python tracker 

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



[issue31569] inconsistent case of PCbuild/ directory

2017-09-25 Thread Paul Moore

Paul Moore added the comment:


New changeset f1502d097c29b266a5748312ee2451a2d6ac0af6 by Paul Moore (Stefan 
Grönke) in branch 'master':
bpo-31569: correct PCBuild/ case to PCbuild/ in build scripts and docs (GH-3711)
https://github.com/python/cpython/commit/f1502d097c29b266a5748312ee2451a2d6ac0af6


--

___
Python tracker 

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



[issue31475] Bug in argparse - not supporting utf8

2017-09-25 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Based on the OP's patch, it looks like they have a problem where they have 
non-ASCII text in their output strings (either due to using non-ASCII switches, 
or using non-ASCII help documentation), but sys.stdout/sys.stderr are 
configured for some encoding that doesn't support said characters, so they're 
getting exceptions when the help message is sent to the screen automatically 
(e.g. by running with --help).

It's only sort of a bug in Python: Fundamentally, the problem is a script that 
assumes arbitrary Unicode support being run under a locale that doesn't provide 
it. The solution provided is bad though: It shouldn't be trying to force UTF8 
output regardless of locale.

A simple repro, at least on Linux-like systems, would be to run Python with 
LANG=C (and no other LC variables set), then do:

import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-f', help=chr(233)) # help is 'é'
parser.print_help()

While the patch as given is wrong (with the exception of Windows weirdness, 
blithely ignoring/second-guessing the locale is a terrible idea), it's not a 
terrible idea to fix this in some way; if nothing else, it might make sense to 
have some fallback approach when the exception is raised (e.g. encoding the 
output with errors='ignore' or the like) so running scriptname.py --help at 
least provides *some* output even with incompatible locales, rather than dying 
with an error in the help message handling code itself.

--
nosy: +josh.r
status: pending -> open

___
Python tracker 

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



[issue31574] Add dtrace hook for importlib

2017-09-25 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue31423] Error while building PDF documentation

2017-09-25 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Sorry!! Yesterday morning I received 50+ emails all about document download 
page is 404. Reading those again, turns out these are older emails from a week 
before, somehow just showing up in my mailbox.
I think everything is good here. :)

Thanks!

--

___
Python tracker 

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



[issue22140] "python-config --includes" returns a wrong path (double prefix)

2017-09-25 Thread Michał Górny

Changes by Michał Górny :


--
nosy: +mgorny

___
Python tracker 

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



[issue31574] Add dtrace hook for importlib

2017-09-25 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue31569] inconsistent case of PCbuild/ directory

2017-09-25 Thread Steve Dower

Changes by Steve Dower :


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



[issue31578] Unexpected Floating Point Division Result

2017-09-25 Thread hw

New submission from hw:

To reproduce:
>>> 480/1000/13.0
Actual result: 0.0

Expected result: 0.03692307692307692
Adding the zero decimal to any other combinations of the numbers produces the 
expected floating point result.

Working as expected in Python 3

--
components: Interpreter Core
messages: 302966
nosy: Hw
priority: normal
severity: normal
status: open
title: Unexpected Floating Point Division Result
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue31558] gc.freeze() - an API to mark objects as uncollectable

2017-09-25 Thread Neil Schemenauer

Neil Schemenauer added the comment:

I think the basic idea makes a lot of sense, i.e. have a generation that is 
never collected.  An alternative way to implement it would be to have an extra 
generation, e.g. rather than just 0, 1, 2 also have generation 3.  The 
collection would by default never collect generation 3.  Generation 4 would be 
equivalent to the frozen generation.  You could still force collection by 
calling gc.collect(3).  Whether that generation should be collected on shutdown 
would still be a question.

If this gets implemented, it will impact the memory bitmap based GC idea I have 
been prototyping.  Currently I am thinking of using two bits for each small GC 
object.  The bits would mean: 00 - untracked, 01 - gen 0, 10 - gen 1, 11 - gen 
2.  With the introduction of a frozen generation, I would have to use another 
bit I think.

Another thought is maybe we don't actually need 3 generations as they are 
currently used.  We could have gen 0 which is collected frequently and gen 1 
that is collected rarely.  The frozen objects could go into gen 2 which are not 
automatically collected or have a user adjustable collection frequency.  
Collection of gen 1 would not automatically move objects into gen 2.

I think issue 3110 (https://bugs.python.org/issue31105) is also related.  The 
current GC thresholds are not very good.  I've look at what Go does and the GC 
collection is based on a relative increase in memory usage.  Python could do 
perhaps something similar.  The accounting of actual bytes allocated and 
deallocated is tricky because the *_Del/Free functions don't actually know how 
much memory is being freed, at least not in a simple way.

--

___
Python tracker 

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



[issue31578] Unexpected Floating Point Division Result

2017-09-25 Thread R. David Murray

R. David Murray added the comment:

In the absence of the appropriate __future__ import, the python2 division 
operator uses integer division.

--
nosy: +r.david.murray
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



[issue31558] gc.freeze() - an API to mark objects as uncollectable

2017-09-25 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

I like the idea of a gen 4 that never gets collected.  This would have been 
useful for the original problem that inspired me to add the `generation` 
argument to `gc.collect()`.  The nice thing about this, is just as you suggest: 
you could force a collection of gen 4 by `gc.collect(3)`.

It's unfortunate that you'd have to add a bit to handle this, but maybe you're 
right that we only really need three generations.

--

___
Python tracker 

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



[issue31571] Redundand information on Doc/reference/lexical_analysis.rst

2017-09-25 Thread Guido van Rossum

Guido van Rossum added the comment:

That's *really* old. Please clean up as you see fit!

On Sep 24, 2017 10:33 PM, "Serhiy Storchaka"  wrote:

Serhiy Storchaka added the comment:

Guido, in 60f2f0cf8e10c94693dfea8937b7feabeffe5744 you added the phrase
"Note that numeric literals do not include a sign; ..." in the "Numeric
literals" section. Did you mean moving it from the "Floating point
literals" section or creating a duplicate?

--

___
Python tracker 

___

--

___
Python tracker 

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



[issue20827] IDLE : Display function argument list in ClassBrowser

2017-09-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Having fixed the nested functions and classes issue, and thought some more, I 
have two other concerns with adding signatures in the browser, and a different 
solution.

1. Time: When requested, the browser window comes up immediately with the 
module node.  There is a noticeable delay before the top level items are 
displayed, and it is longer than before.  Since pyclbr was already patched to 
deliver the information on nested items, this puzzles me, and I want to 
investigate the cause before possible slowing display even longer.

2. Space: For browser tree items, base 'Tree' is expanded to 
'idlelib.tree.Tree'.  With one base, this will usually not an issue.  With 
multiple bases, it could be, in the sense of making the single line too long.  
Signatures, like calls, can well be too long for a single line.

Alternatives:

1. Module Browser opens the file.  Single clicking a line in the browser moves 
the selection highlight in the browser.  Double clicking a line expands or 
contract the node if it is expandedable, and it highlights the corresponding 
line in the editor. So the new feature is not *necessary* for a user to get the 
information.

But we can make it easier.  First, move the editor highlight when moving the 
browser hightlight.  Second, move both highlights with the Up and Down keys 
(instead of just scrolling.  Expand/contract with Right and Left keys.  Third, 
with a bit more work, the entire header could be highlighted.  Fourth, position 
browser box and editor side-by-side with tops aligned, instead of overlapping.  
(Note: the positioning would be automatic if IDLE had side-by-side tabbed 
panes.)

2. Signatures might be displayed in a pop-up box.  But I like 1. above better.

So I am inclined to reject adding to the Python-code browser in favor of 
improving the coordination between browser and editor.

If we ever add the ability to browse imported modules by introspection, then 
making signatures, *and* docstrings, would be needed -- and easy.  (This would 
be be aimed at, but not limited to, non-Python coded modules.)

--

___
Python tracker 

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



[issue31558] gc.freeze() - an API to mark objects as uncollectable

2017-09-25 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 25/09/2017 à 20:55, Neil Schemenauer a écrit :
> 
> I think the basic idea makes a lot of sense, i.e. have a generation that is 
> never collected.  An alternative way to implement it would be to have an 
> extra generation, e.g. rather than just 0, 1, 2 also have generation 3.  The 
> collection would by default never collect generation 3.  Generation 4 would 
> be equivalent to the frozen generation.  You could still force collection by 
> calling gc.collect(3).

API-wise it would sound better to have a separate gc.collect_frozen()...

Though I think a gc.unfreeze() that moves the frozen generation into the
oldest non-frozen generation would be useful too, at least for testing
and experimentation.

> I think issue 3110 (https://bugs.python.org/issue31105) is also related.  The 
> current GC thresholds are not very good.  I've look at what Go does and the 
> GC collection is based on a relative increase in memory usage.  Python could 
> do perhaps something similar.  The accounting of actual bytes allocated and 
> deallocated is tricky because the *_Del/Free functions don't actually know 
> how much memory is being freed, at least not in a simple way.

Yeah... It's worse than that.  Take for example a bytearray object.  The
basic object (the PyByteArrayObject structure) is quite small.  But it
also has a separately-allocated payload that is deleted whenever
tp_dealloc is called.  The GC isn't aware of that payload.  Worse, the
payload can (and will) change size during the object's lifetime, without
the GC's knowledge about it ever being updated. (*)

IMHO, the only reliable way to use memory footprint to drive the GC
heuristic would be to force all allocations into our own allocator, and
reconcile the GC with that allocator (instead of having the GC be its
own separate thing as is the case nowadays).

(*) And let's not talk about hairier cases, such as having multiple
memoryviews over the same very large object...

PS: every heuristic has its flaws.  As I noted on python-(dev|ideas),
full GC runtimes such as most Java implementations are well-known for
requiring careful tuning of GC parameters for "non-usual" workloads.  At
least reference counting makes CPython more robust in many cases.

--

___
Python tracker 

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



[issue31530] Python 2.7 readahead feature of file objects is not thread safe

2017-09-25 Thread Guido van Rossum

Guido van Rossum added the comment:

It should be like 'if key in dct: del dct[key]'. It may fail when two
threads do this but the *internal* state of dct should not be compromised.

On Sep 25, 2017 2:45 AM, "Antoine Pitrou"  wrote:

>
> Antoine Pitrou added the comment:
>
> Le 25/09/2017 à 11:39, STINNER Victor a écrit :
> >
> > Antoine: "I'm wary of raising an exception.  Assuming Benjamin's patch
> is correct, I vote for it."
> >
> > Can you please elaborate? You are fine with the fact that iter(file) in
> two thread can return the same line?
>
> AFAIU it already could.  Iteration on Python 2 files is fragile, now is
> not the time to fix fundamental bugs in Python 2.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue31571] Redundand information on Doc/reference/lexical_analysis.rst

2017-09-25 Thread Guilherme Praciano Karst Caminha

Guilherme Praciano Karst Caminha added the comment:

In that case, I believe the PR I've opened should be fine?

--

___
Python tracker 

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



[issue31170] Update to expat 2.2.4 (expat: utf8_toUtf8 cannot properly handle exhausting buffer)

2017-09-25 Thread STINNER Victor

STINNER Victor added the comment:

Oh, it seems like Steve Dower found an issue on Windows: PR 3751.

I reopen the issue.

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



[issue31577] crash in os.utime() in case of a bad ns argument

2017-09-25 Thread Oren Milman

Changes by Oren Milman :


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

___
Python tracker 

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



[issue31577] crash in os.utime() in case of a bad ns argument

2017-09-25 Thread Oren Milman

Oren Milman added the comment:

I opened a PR.
I think another fix might be to use
PyLong_Type.tp_as_number->long_divmod() instead of PyNumber_Divmod().

--

___
Python tracker 

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



[issue31530] Python 2.7 readahead feature of file objects is not thread safe

2017-09-25 Thread STINNER Victor

STINNER Victor added the comment:

> Iteration on Python 2 files is fragile, now is not the time to fix 
> fundamental bugs in Python 2.

Right. I don't have a strong preference for Serhiy's PR 3672.

--

___
Python tracker 

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



[issue31571] Redundand information on Doc/reference/lexical_analysis.rst

2017-09-25 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
stage:  -> patch review
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



[issue31579] Reference leak in enumerate

2017-09-25 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

There is a possible leak of the value emitted by an underlying iterator in 
enumerate.__next__.

Proposed PR fixes it.

--
assignee: rhettinger
components: Interpreter Core
messages: 302978
nosy: rhettinger, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Reference leak in enumerate
type: resource usage
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



  1   2   >