[issue30844] selectors: Add urgent data to read event

2017-09-22 Thread Pim Klanke

Pim Klanke added the comment:

In the selectors module, the winsock select method is wrapped. The second 
parameter (writefds) is passed to both writefds and exceptfds and the returned 
number of fds for write and except are summed and returned in the second 
element of the tuple.

Can anyone explain to me why the winsock select method is wrapped like this?

--

___
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-22 Thread linkid

Changes by linkid :


--
nosy: +linkid

___
Python tracker 

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



[issue31478] assertion failure in random.seed() in case the seed argument has a bad __abs__() method

2017-09-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The more I think about this the more I like the idea of using int.__abs__() 
directly (PyLong_Type.tp_as_number->nb_absolute() in C). The C code doesn't 
call potentially overridable methods bit_length() and to_bytes(), it uses 
concrete implementations directly. I don't see reasons why it should obey 
overriding the __abs__() method.

This will save us from the problem with the wording of the error message.

I mentioned a drawback, but the current implementation has the same drawback. 
We can avoid copying positive integer subtypes by using more complex code, but 
I think it isn't worth.

--
versions: +Python 2.7, Python 3.6

___
Python tracker 

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



[issue31423] Error while building PDF documentation

2017-09-22 Thread linkid

Changes by linkid :


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

___
Python tracker 

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



[issue31551] test_distutils fails if current directory contains spaces

2017-09-22 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Running tests from the directory containing a space: '/home/serhiy/py/cpy thon'.

$ ./python -m test -vuall test_distutils
== CPython 3.7.0a1+ (heads/master:5e02c7826f, Sep 22 2017, 13:23:33) [GCC 6.3.0 
20170406]
== Linux-4.10.0-35-generic-x86_64-with-debian-stretch-sid little-endian
== cwd: /home/serhiy/py/cpy thon/build/test_python_11135
== CPU count: 8
== encodings: locale=UTF-8, FS=utf-8
Run tests sequentially
0:00:00 load avg: 0.09 [1/1] test_distutils
test_no_optimize_flag (distutils.tests.test_bdist_rpm.BuildRpmTestCase) ... 
/var/tmp/rpm-tmp.ufRiE4: 28: /var/tmp/rpm-tmp.ufRiE4: /home/serhiy/py/cpy: not 
found
error: Bad exit status from /var/tmp/rpm-tmp.ufRiE4 (%build)
Bad exit status from /var/tmp/rpm-tmp.ufRiE4 (%build)
ERROR
test_quiet (distutils.tests.test_bdist_rpm.BuildRpmTestCase) ... 
/var/tmp/rpm-tmp.uBva85: 28: /var/tmp/rpm-tmp.uBva85: /home/serhiy/py/cpy: not 
found
error: Bad exit status from /var/tmp/rpm-tmp.uBva85 (%build)
Bad exit status from /var/tmp/rpm-tmp.uBva85 (%build)
ERROR
...
==
ERROR: test_no_optimize_flag (distutils.tests.test_bdist_rpm.BuildRpmTestCase)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpy thon/Lib/distutils/tests/test_bdist_rpm.py", line 
120, in test_no_optimize_flag
cmd.run()
  File "/home/serhiy/py/cpy thon/Lib/distutils/command/bdist_rpm.py", line 366, 
in run
self.spawn(rpm_cmd)
  File "/home/serhiy/py/cpy thon/Lib/distutils/cmd.py", line 365, in spawn
spawn(cmd, search_path, dry_run=self.dry_run)
  File "/home/serhiy/py/cpy thon/Lib/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
  File "/home/serhiy/py/cpy thon/Lib/distutils/spawn.py", line 159, in 
_spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'rpmbuild' failed with exit status 
1

==
ERROR: test_quiet (distutils.tests.test_bdist_rpm.BuildRpmTestCase)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpy thon/Lib/distutils/tests/test_bdist_rpm.py", line 
77, in test_quiet
cmd.run()
  File "/home/serhiy/py/cpy thon/Lib/distutils/command/bdist_rpm.py", line 366, 
in run
self.spawn(rpm_cmd)
  File "/home/serhiy/py/cpy thon/Lib/distutils/cmd.py", line 365, in spawn
spawn(cmd, search_path, dry_run=self.dry_run)
  File "/home/serhiy/py/cpy thon/Lib/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
  File "/home/serhiy/py/cpy thon/Lib/distutils/spawn.py", line 159, in 
_spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'rpmbuild' failed with exit status 
1

--

See also issue31548.

--
components: Distutils, Tests
messages: 302741
nosy: dstufft, merwok, serhiy.storchaka
priority: normal
severity: normal
status: open
title: test_distutils fails if current directory contains spaces
type: 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



[issue31092] multiprocessing.Manager() race condition

2017-09-22 Thread Lang

Lang added the comment:

# code reproduce bug
# KeyError in lib\multiprocessing\managers.py in incref 

import multiprocessing as mp
from time import sleep

def func(queue):
pass

if __name__ == '__main__':
manager = mp.Manager()

pool = mp.Pool(1)

queue = manager.Queue()
r = pool.apply_async(func, args = [queue])
#sleep(1)
queue = None

pool.close()
pool.join()

--
nosy: +tlxxzj

___
Python tracker 

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



[issue31149] Add Japanese to the language switcher

2017-09-22 Thread Julien Palard

Changes by Julien Palard :


--
status: open -> closed

___
Python tracker 

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



[issue31452] asyncio.gather does not cancel tasks if one fails

2017-09-22 Thread Andrew Lytvyn

Andrew Lytvyn added the comment:

Guido, look. The point is that if you change run_forever with 
run_until_complete, then behavior changes: success_coro(5) will not be executed.

I think that it's strange that behavior differs depending on entrypoint: 
run_forever or run_untill_complete

--

___
Python tracker 

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



[issue31351] ensurepip discards pip's return code which leads to broken venvs

2017-09-22 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset eef49f5dd021d15396551880cf451042a79a1107 by Mariatta (Miss 
Islington (bot)) in branch '3.6':
bpo-31351: Set return code in ensurepip when pip fails (GH-3626) (GH-3683)
https://github.com/python/cpython/commit/eef49f5dd021d15396551880cf451042a79a1107


--
nosy: +Mariatta

___
Python tracker 

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



[issue31351] ensurepip discards pip's return code which leads to broken venvs

2017-09-22 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

This has been backported to 3.6. Is backport to 2.7 needed?

--

___
Python tracker 

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



[issue31443] Possibly out of date C extension documentation

2017-09-22 Thread Christoph Reiter

Christoph Reiter added the comment:

Building the following with gcc from msys2 (cygwin) worked fine here: 
https://bpaste.net/show/0cafd5fa8211

--
nosy: +lazka

___
Python tracker 

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



[issue31552] IDLE: Convert browswers to use ttk.Treeview

2017-09-22 Thread Terry J. Reedy

New submission from Terry J. Reedy:

ttk.Treeview should look as good as idlelib.tree, but will check.  It is more 
flexible.  Note that Treeview is low-level, need to add higher level functions 
or classes.  See if can more or less duplicate API of tree Items.

--
assignee: terry.reedy
components: IDLE
messages: 302747
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE: Convert browswers to use ttk.Treeview
type: enhancement
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



[issue31461] IDLE: Enhance class browser

2017-09-22 Thread Terry J. Reedy

Terry J. Reedy added the comment:

#31552 ttk.Treeview

--
dependencies: +IDLE: Convert browswers to use ttk.Treeview

___
Python tracker 

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



[issue31552] IDLE: Convert browswers to use ttk.Treeview

2017-09-22 Thread Terry J. Reedy

Terry J. Reedy added the comment:

>From #31461: Browsers currently use idlelib.tree.TreeWidget.  Treeview is not 
>a drop-in replacement because TreeWidget has some of the higher-level 
>app-specific functions that users are expected to add to Treeview.  But could 
>Treeview replace the low-level parts of TreeWidget that actually display stuff 
>on the screen?

--

___
Python tracker 

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



[issue31443] Possibly out of date C extension documentation

2017-09-22 Thread Stefan Krah

Stefan Krah added the comment:

Okay, thanks.

I found that bz2module.c has also used direct initialization for ages.
I'm going to commit the change.

--

___
Python tracker 

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



[issue31452] asyncio.gather does not cancel tasks if one fails

2017-09-22 Thread Guido van Rossum

Guido van Rossum added the comment:

> if you change run_forever with run_until_complete, then behavior changes: 
> success_coro(5) will not be executed

Oh, that's a red herring. The reason is that the event loop stops when you use 
run_complete(), but the execution of success_coro(5) is still pending, and when 
you resume the loop (e.g. call run_until_complete() on the same loop with a 
different task) it will run.

So the issue is really the semantics of gather(), and I agree with Yury that we 
designed it intentionally that way, and if you want different behavior we'll 
have to provide a different API.

--

___
Python tracker 

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



[issue31443] Possibly out of date C extension documentation

2017-09-22 Thread Stefan Krah

Stefan Krah added the comment:


New changeset ca72589bfabe2fd0e12eebfeb770b6c7a499b3e6 by Stefan Krah in branch 
'master':
bpo-31443: Formulate the type slot initialization rules in terms of C99. (#3688)
https://github.com/python/cpython/commit/ca72589bfabe2fd0e12eebfeb770b6c7a499b3e6


--

___
Python tracker 

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



[issue31443] Possibly out of date C extension documentation

2017-09-22 Thread Stefan Krah

Changes by Stefan Krah :


--
pull_requests: +3681

___
Python tracker 

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



[issue31443] Possibly out of date C extension documentation

2017-09-22 Thread Stefan Krah

Stefan Krah added the comment:


New changeset b1558a0368949714f5765702a8d83a2d163eaacf by Stefan Krah in branch 
'master':
bpo-31443: Update included code. (#3697)
https://github.com/python/cpython/commit/b1558a0368949714f5765702a8d83a2d163eaacf


--

___
Python tracker 

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



[issue31389] Give pdb.set_trace() an optional `header` keyword argument

2017-09-22 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:


New changeset 35425d638c0eeb8377620e016f47df3ae08d7061 by Barry Warsaw in 
branch 'master':
bpo-31389 Add an optional `header` argument to pdb.set_trace() (#3438)
https://github.com/python/cpython/commit/35425d638c0eeb8377620e016f47df3ae08d7061


--

___
Python tracker 

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



[issue31389] Give pdb.set_trace() an optional `header` keyword argument

2017-09-22 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


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



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

2017-09-22 Thread Eric Moyer

New submission from Eric Moyer:

json.tool should have the ability to format jsonlines data. It is a very 
commonly used format in many industries. Right now when given jsonlines (for 
example):

echo -e '{"ingredients":["frog", "water", "chocolate", "glucose"]} | python 
-m json.tool

Works. But:

echo -e '{"ingredients":["frog", "water", "chocolate", 
"glucose"]}\n{"ingredients":["chocolate","steel bolts"]}' | python -m json.tool

Reports an error: "Extra data: line 2 column 1 - line 3 column 1 (char 58 - 
100)"

I propose that the above behavior be retained but:

echo -e '{"ingredients":["frog", "water", "chocolate", 
"glucose"]}\n{"ingredients":"chocolate","steel bolts"}' | python3.7 -m 
json.tool --jsonlines

Should print:
{
"ingredients": [
"frog",
"water",
"chocolate",
"glucose"
]
}
{
"ingredients": [
"chocolate",
"steel bolts"
]
}

If someone else agrees this is an appropriate enhancement, I can start work on 
a PR in a couple of weeks.

--
components: Library (Lib)
messages: 302755
nosy: Eric Moyer
priority: normal
severity: normal
status: open
title: Extend json.tool to handle jsonlines (with a flag)
type: enhancement
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



[issue1294959] Problems with /usr/lib64 builds.

2017-09-22 Thread jan matejek

Changes by jan matejek :


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

___
Python tracker 

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



[issue31550] Inconsistent error message for TypeError with subscripting

2017-09-22 Thread Anthony Sottile

Anthony Sottile added the comment:

All I'm really looking for is consistency -- should the change to 2.7 be 
reverted instead?

--

___
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-22 Thread Zachary Ware

Zachary Ware added the comment:


New changeset da9b4cfb488119f2493a762fcb1d85c58494f51d by Zachary Ware 
(François Magimel) in branch 'master':
bpo-31423: Fix building the PDF documentation (GH-3693)
https://github.com/python/cpython/commit/da9b4cfb488119f2493a762fcb1d85c58494f51d


--
nosy: +zach.ware

___
Python tracker 

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



[issue17852] Built-in module _io can lose data from buffered files at exit

2017-09-22 Thread Neil Schemenauer

Neil Schemenauer added the comment:


New changeset 0a1ff24acfc15d8c7f2dc41000a6f3d9a31e7480 by Neil Schemenauer in 
branch 'master':
bpo-17852: Maintain a list of BufferedWriter objects.  Flush them on exit. 
(#3372)
https://github.com/python/cpython/commit/0a1ff24acfc15d8c7f2dc41000a6f3d9a31e7480


--

___
Python tracker 

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



[issue31443] Possibly out of date C extension documentation

2017-09-22 Thread Stefan Krah

Changes by Stefan Krah :


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



[issue31494] Valgrind suppression file

2017-09-22 Thread Terry J. Reedy

Terry J. Reedy added the comment:

3.5 only gets security fixes, and this does not seem to be a security issue.  
Please retest with 3.6 or 3.7.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue31502] IDLE: Config dialog again deletes custom themes and keysets.

2017-09-22 Thread Terry J. Reedy

Changes 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



[issue31494] Valgrind suppression file

2017-09-22 Thread Stefan Krah

Stefan Krah added the comment:

The suppressions are mainly for "invalid access" due to a gc trick.

The primary goal is to be definitely-lost-clean.


I would say it works as expected.

--
nosy: +skrah

___
Python tracker 

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



[issue31534] python 3.6.2 installation failed 0x80070002 error

2017-09-22 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
components: +Windows -Installation
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue31494] Valgrind suppression file

2017-09-22 Thread Stefan Krah

Stefan Krah added the comment:

Also, I don't think --with-pydebug works well with valgrind.

It's either:
   1) --with-pydebug
   2) CFLAGS="-O0 -g" --with-valgrind
   3) CFLAGS="-O0 -g" --without-pymalloc

Combining 2) and 3) probably does not hurt, but is not necessary.

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



[issue31423] Error while building PDF documentation

2017-09-22 Thread Zachary Ware

Changes by Zachary Ware :


--
pull_requests: +3683

___
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-22 Thread Zachary Ware

Changes by Zachary Ware :


--
pull_requests: +3684

___
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-22 Thread Zachary Ware

Zachary Ware added the comment:


New changeset 6de35849cb7a18bfaad828eb57a2e6caa7978690 by Zachary Ware in 
branch '3.6':
[3.6] bpo-31423: Fix building the PDF documentation (GH-3693) (GH-3699)
https://github.com/python/cpython/commit/6de35849cb7a18bfaad828eb57a2e6caa7978690


--

___
Python tracker 

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



[issue21937] IDLE interactive window doesn't display unsaved-indicator

2017-09-22 Thread Cheryl Sabella

Changes by Cheryl Sabella :


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



[issue31423] Error while building PDF documentation

2017-09-22 Thread Zachary Ware

Zachary Ware added the comment:


New changeset da86874a3d8f882d6aedd882b2e27f59b59d6798 by Zachary Ware in 
branch '2.7':
[2.7] bpo-31423: Fix building the PDF documentation (GH-3693) (GH-3700)
https://github.com/python/cpython/commit/da86874a3d8f882d6aedd882b2e27f59b59d6798


--

___
Python tracker 

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



[issue31554] Warn when __loader__ != __spec__.loader

2017-09-22 Thread Brett Cannon

New submission from Brett Cannon:

There a couple of places where __loader__ is directly used (the biggest one 
probably being importlib.reload()). It would probably be good to warn when 
module.__loader__ != module.__spec__.loader like we do for __package__ to start 
transitioning people over to specs for accessing the loader instead of the 
direct module attribute.

--
components: Library (Lib)
messages: 302764
nosy: brett.cannon, eric.snow, ncoghlan
priority: low
severity: normal
stage: test needed
status: open
title: Warn when __loader__ != __spec__.loader
type: enhancement
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



[issue31423] Error while building PDF documentation

2017-09-22 Thread Zachary Ware

Zachary Ware added the comment:

Pending results of actual builds on docs.p.o, this should be fixed.

--
resolution:  -> fixed
stage: patch review -> commit review
status: open -> pending

___
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-22 Thread Ned Deily

Ned Deily added the comment:

Thanks for looking into this.  See also 
https://github.com/python/psf-salt/issues/118 where the question arose whether 
the version of Tex Live on docs is new enough.  I'm no expert at anything Tex 
but the odd thing is that I had been able to build dist docs on my current 
Debian (testing) system without this change.  Let's see what happens on docs 
after the daily full doc build.

--
nosy: +ned.deily
status: pending -> open

___
Python tracker 

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



[issue19907] gettext - Non ascii chars in header

2017-09-22 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

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



[issue1612262] Class Browser doesn't show internal classes

2017-09-22 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 058de11360ea6816a6e978c7be0bcbea99a3f7da by Terry Jan Reedy 
(Cheryl Sabella) in branch 'master':
bpo-1612262: IDLE: Class Browser shows nested functions, classes (#2573)
https://github.com/python/cpython/commit/058de11360ea6816a6e978c7be0bcbea99a3f7da


--

___
Python tracker 

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



[issue31555] Windows pyd slower when not loaded via load_dynamic

2017-09-22 Thread S Safihre

New submission from S Safihre:

I have a Python 2.7 C-extension that was made for performance, however, I 
noticed something strange on Windows:
When I run locally python setup.py install and it installs it the "egg" way, 
the performance of calling the function in the module 500x in a loop is:

 yEnc C New  took   579 ms
 yEnc C New  took   580 ms
 yEnc C New  took   580 ms

But when I install it as a wheel locally or via pip without a single change to 
the C-code, this is the result:

 yEnc C New  took   702 ms
 yEnc C New  took   694 ms
 yEnc C New  took   691 ms

That's a 10-15% difference. I also checked macOS and Ubuntu, here it does not 
seem to be the case.
By investigating (https://github.com/pypa/setuptools/issues/1154) I found that 
the difference is only that the "egg" way the module gets loaded via 
imp.load_dynamic 

I cannot test under Python 3, since the module is (not yet) converted to Python 
3-style.


To reproduce run and look at the yEnc C New score between the 2 ways (on 
Windows only of course):

git clone https://github.com/sabnzbd/sabyenc.git
cd sabyenc
python setup.py install
python .\tests\speed_compare.py; python .\tests\speed_compare.py;python 
.\tests\speed_compare.py;
pip uninstall sabyenc -y

pip install sabyenc
# Or this:
# python setup.py install bdist_wheel
# pip install .\dist\sabyenc-3.3.1-cp27-cp27m-win_amd64.whl
python .\tests\speed_compare.py; python .\tests\speed_compare.py;python 
.\tests\speed_compare.py;

--
components: Extension Modules, Windows
messages: 302768
nosy: S Safihre, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Windows pyd slower when not loaded via load_dynamic
type: performance
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



[issue31534] python 3.6.2 installation failed 0x80070002 error

2017-09-22 Thread Steve Dower

Steve Dower added the comment:

If you look in your %TEMP% directory, there should be more log files near the 
one you attached (most of the filename will be the same).

Could you zip them up and attach all of them here? I think there's some 
information in one of the others that I'll need to see.

Also, you shouldn't have to run this installer as admin. If you are not 
planning to install for all users on your machine (and according to the log, 
you did not select that option), then it may work better if you just run it as 
yourself.

--

___
Python tracker 

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



[issue12301] Use :role:`sys.thing` instead of ``sys.thing`` throughout

2017-09-22 Thread Éric Araujo

Changes by Éric Araujo :


--
resolution:  -> rejected
stage: patch review -> resolved
status: pending -> closed

___
Python tracker 

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



[issue31556] asyncio.wait_for can cancel futures faster with timeout==0

2017-09-22 Thread Viktor Kovtun

New submission from Viktor Kovtun:

There is no need to create extra future and use loop.call_later to cancel base 
future from asyncio.wait_for when timeout==0. If loop is heavy loaded it can be 
cancelled simnifically later then 0 seconds later.

--
components: asyncio
messages: 302770
nosy: asvetlov, hellysmile, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.wait_for can cancel futures faster with timeout==0
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



[issue1612262] Class Browser doesn't show internal classes

2017-09-22 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +3686

___
Python tracker 

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



[issue31556] asyncio.wait_for can cancel futures faster with timeout==0

2017-09-22 Thread Viktor Kovtun

Changes by Viktor Kovtun :


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

___
Python tracker 

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



[issue31556] asyncio.wait_for can cancel futures faster with timeout==0

2017-09-22 Thread Yury Selivanov

Yury Selivanov added the comment:

Do you have a use case where this optimization is important?

--

___
Python tracker 

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



[issue31556] asyncio.wait_for can cancel futures faster with timeout==0

2017-09-22 Thread Viktor Kovtun

Viktor Kovtun added the comment:

If coroutine function has some blocking calls before first await/yield from 
statement maybe makes sense do no let them be executed, if timeout equals 0

--

___
Python tracker 

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



[issue31556] asyncio.wait_for can cancel futures faster with timeout==0

2017-09-22 Thread Yury Selivanov

Yury Selivanov added the comment:

I think this is a backwards incompatible change and thus will be rejected.  
Currently there's a guarantee that "wait_for" can throw a TimeoutError *only* 
when when you await it.

   fut = wait_for(something, 0)

   # some important code

   try:
   await fut
   except TimeoutError:
   # do something

With your PR merged, the above asyncio code would be broken, because asyncio 
users can guard with try..except only the await expression.

--

___
Python tracker 

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



[issue31556] asyncio.wait_for can cancel futures faster with timeout==0

2017-09-22 Thread Viktor Kovtun

Viktor Kovtun added the comment:

asyncio.wait_for is coroutine itself, to start executing code, no matter with 
this PR or not it needs to be awaited/yield from

import asyncio

@asyncio.coroutine
def foo():
print(1)

loop = asyncio.get_event_loop()

fut = asyncio.wait_for(foo(), 0)

print('it is not raised yet')

try:
loop.run_until_complete(fut)
except asyncio.TimeoutError:
print('raised here')


will print 
it is not raised yet
raised here

--

___
Python tracker 

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



[issue31556] asyncio.wait_for can cancel futures faster with timeout==0

2017-09-22 Thread Yury Selivanov

Yury Selivanov added the comment:

You're right!  Let's work on the PR then, I've left a review comment.

--

___
Python tracker 

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



[issue1612262] Class Browser doesn't show internal classes

2017-09-22 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset fa1cae5832cbcfafedc4b1879c2abc85452f4edd by Terry Jan Reedy in 
branch '3.6':
 [3.6] bpo-1612262: IDLE: Class Browser shows nested functions, classes 
(GH-2573)  (#3702)
https://github.com/python/cpython/commit/fa1cae5832cbcfafedc4b1879c2abc85452f4edd


--

___
Python tracker 

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



[issue1612262] Class Browser doesn't show internal classes

2017-09-22 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I settled on 'transform_children' for the new function. #31461 is the master 
issue for improving the browsers.

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



[issue31557] tarfile: incorrectly treats regular file as directory

2017-09-22 Thread Joe Tsai

New submission from Joe Tsai:

The original V7 header only allocates 100B to store the file path. If a path 
exceeds this length, then either the PAX format or GNU formats must be used, 
which can represent arbitrarily long file paths. When doing so, most tar 
writers just store the first 100B of the file path in the V7 header.

When reading, a proper reader should disregard the contents of the V7 field if 
a previous and corresponding PAX or GNU header overrode it.

This currently not the case with the tarfile module, which has the following 
check 
(https://github.com/python/cpython/blob/c7cc14a825ec156c76329f65bed0d0bd6e03d035/Lib/tarfile.py#L1054-L1057):
# Old V7 tar format represents a directory as a regular
# file with a trailing slash.
if obj.type == AREGTYPE and obj.name.endswith("/"):
obj.type = DIRTYPE

This check should be further constrained to only activate when there were no 
prior PAX or GNU records that override that value of obj.name. This check was 
the source of a bug that caused tarfile to report a regular as a directory 
because the file path was extra long, and when the tar write truncated the path 
to the first 100B, it so happened to end on a slash.

--
messages: 302778
nosy: Joe Tsai
priority: normal
severity: normal
status: open
title: tarfile: incorrectly treats regular file as directory

___
Python tracker 

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



[issue31556] asyncio.wait_for can cancel futures faster with timeout==0

2017-09-22 Thread Viktor Kovtun

Viktor Kovtun added the comment:

Actually provided example without patch will print 1, which is not expected

--

___
Python tracker 

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



[issue31461] IDLE: Enhance module browser

2017-09-22 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
title: IDLE: Enhance class browser -> IDLE: Enhance module browser

___
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-22 Thread Łukasz Langa

New submission from Łukasz Langa:

When you're forking many worker processes off of a parent process, the 
resulting children are initially very cheap in memory.  They share memory pages 
with the base process until a write happens [1]_.

Sadly, the garbage collector in Python touches every object's PyGC_Head during 
a collection, even if that object stays alive, undoing all the copy-on-write 
wins.  Instagram disabled the GC completely for this reason [2]_.  This fixed 
the COW issue but made the processes more vulnerable to memory growth due to 
new cycles being silently introduced when the application code is changed by 
developers.  While we could fix the most glaring cases, it was hard to keep the 
memory usage at bay.  We came up with a different solution that fixes both 
issues.  It requires a new API to be added to CPython's garbage collector.


gc.freeze()
---

As soon as possible in the lifecycle of the parent process we disable the 
garbage collector.  Then we call a new API called `gc.freeze()` to move all 
currently tracked objects to a permanent generation.  They won't be considered 
in further collections.  This is okay since we are assuming that (almost?) all 
of the objects created until that point are module-level and thus useful for 
the entire lifecycle of the child process.

After calling `gc.freeze()` we call fork. Then, the child process is free to 
re-enable the garbage collector.

Why do we need to disable the collector on the parent process as soon as 
possible?  When the GC cleans up memory in the mean time, it leaves space in 
pages for new objects.  Those pages become shared after fork and as soon as the 
child process starts creating its own objects, they will likely be written to 
the shared pages, initiating a lot of copy-on-write activity.

In other words, we're wasting a bit of memory in the shared pages to save a lot 
of memory later (that would otherwise be wasted on copying entire pages after 
forking).


Other attempts
--

We also tried moving the GC head to another place in memory.  This creates some 
indirection but cache locality on that segment is great so performance isn't 
really hurt.  However, this change introduces two new pointers (16 bytes) per 
object.  This doesn't sound like a lot but given millions of objects and tens 
of processes per box, this alone can cost hundreds of megabytes per host.  
Memory that we wanted to save in the first place.  So that idea was scrapped.


Attribution
---

The original patch is by Zekun Li, with help from Jiahao Li, Matt Page, David 
Callahan, Carl S. Shapiro, and Chenyang Wu.


.. [1] https://en.wikipedia.org/wiki/Copy-on-write
.. [2] 
https://engineering.instagram.com/dismissing-python-garbage-collection-at-instagram-4dca40b29172

--
keywords: needs review
messages: 302780
nosy: haypo, lukasz.langa, nascheme, yselivanov
priority: normal
severity: normal
stage: patch review
status: open
title: gc.freeze() - an API to mark objects as uncollectable
type: resource usage
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



[issue31459] IDLE: Rename Class Browser as Module Browser

2017-09-22 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
keywords: +patch
pull_requests: +3689
stage: test needed -> patch review

___
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-22 Thread Roundup Robot

Changes by Roundup Robot :


--
keywords: +patch
pull_requests: +3690

___
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-22 Thread Łukasz Langa

Changes by Łukasz Langa :


--
components: +Interpreter Core

___
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-22 Thread Raymond Hettinger

Raymond Hettinger added the comment:

This seems like a reasonable enhancement.

--
nosy: +rhettinger

___
Python tracker 

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



[issue31478] assertion failure in random.seed() in case the seed argument has a bad __abs__() method

2017-09-22 Thread Raymond Hettinger

Raymond Hettinger added the comment:

>  I don't see reasons why it should obey overriding the __abs__() method.

I concur.

--

___
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-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Jsonlines is an external to JSON format. You should split the data on lines and 
pass every line to the JSON parser separately. The same you should do with 
json.tool.

$ echo -e '{"ingredients":["frog", "water", "chocolate", 
"glucose"]}\n{"ingredients":["chocolate","steel bolts"]}' | while read -r line; 
do echo -n "$line" | python -m json.tool; done
{
"ingredients": [
"frog",
"water",
"chocolate",
"glucose"
]
}
{
"ingredients": [
"chocolate",
"steel bolts"
]
}

--
nosy: +serhiy.storchaka

___
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-22 Thread Ned Deily

Ned Deily added the comment:

Good news! It appears that the changes supplied by @linkid have indeed fixed 
the daily downloadable doc build failures, 3.7, 3.6, and 2.7 docs were built 
successfully and the 404s are gone.  Thanks everyone for helping with this!

--
stage: commit review -> resolved
status: open -> closed

___
Python tracker 

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



[issue31425] Expose AF_QIPCRTR in socket module

2017-09-22 Thread Roundup Robot

Changes by Roundup Robot :


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

___
Python tracker 

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