[issue29441] Update examples to use async and await keywords in asyncio-task.rst

2017-02-07 Thread Roundup Robot

Roundup Robot added the comment:


New changeset dbfbdf9dce7889699e1eb7cc4644a911b16665ec by Berker Peksag in 
branch 'master':
Issue #29441: Update examples to use async and await keywords in 
asyncio-task.rst
https://github.com/python/cpython/commit/dbfbdf9dce7889699e1eb7cc4644a911b16665ec

New changeset f76fb14796715fc5abb5a2b68428b29063c3d48e by Berker Peksag in 
branch 'master':
Issue #29441: Merge from 3.5
https://github.com/python/cpython/commit/f76fb14796715fc5abb5a2b68428b29063c3d48e

New changeset 38c1fd9055ad58738643325a2c7682d76496f9ed by Berker Peksag in 
branch 'master':
Issue #29441: Merge from 3.6
https://github.com/python/cpython/commit/38c1fd9055ad58738643325a2c7682d76496f9ed


--

___
Python tracker 

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



[issue29441] Update examples to use async and await keywords in asyncio-task.rst

2017-02-07 Thread Roundup Robot

Roundup Robot added the comment:


New changeset dbfbdf9dce7889699e1eb7cc4644a911b16665ec by Berker Peksag in 
branch '3.6':
Issue #29441: Update examples to use async and await keywords in 
asyncio-task.rst
https://github.com/python/cpython/commit/dbfbdf9dce7889699e1eb7cc4644a911b16665ec

New changeset f76fb14796715fc5abb5a2b68428b29063c3d48e by Berker Peksag in 
branch '3.6':
Issue #29441: Merge from 3.5
https://github.com/python/cpython/commit/f76fb14796715fc5abb5a2b68428b29063c3d48e


--

___
Python tracker 

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



[issue29441] Update examples to use async and await keywords in asyncio-task.rst

2017-02-07 Thread Roundup Robot

Roundup Robot added the comment:


New changeset dbfbdf9dce7889699e1eb7cc4644a911b16665ec by Berker Peksag in 
branch '3.5':
Issue #29441: Update examples to use async and await keywords in 
asyncio-task.rst
https://github.com/python/cpython/commit/dbfbdf9dce7889699e1eb7cc4644a911b16665ec


--

___
Python tracker 

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



[issue29453] Remove reference to undefined dictionary ordering in Tutorial

2017-02-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I don't know. David, Raymond, what are your thoughts?

--

___
Python tracker 

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



[issue29470] [python] Error in `/usr/bin/python': free(): invalid size: 0x00007f628400d0e0

2017-02-07 Thread STINNER Victor

STINNER Victor added the comment:

Python 3.6 got a new PYTHONMALLOC env var which should help you ;-)

Please try to get the Python traceback on the crash and use Python builtin 
memory debugger:

PYTHONMALLOC=debug python3 -X faulthandler ...


> i've restarted this under valgrind to debug it. valgrind's startup of python 
> 3.6 is depressingly filled with invalid read of size n, (...)

Python memory allocator pymalloc causes false alarms. You can disable pymalloc 
to use Valgrind using:

PYTHONMALLOC=malloc valgrind python3 ...

--
nosy: +haypo

___
Python tracker 

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



[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-07 Thread STINNER Victor

STINNER Victor added the comment:

Oh, pyobject_fastcall-3.patch contains a performance bug :-p PyObject_Call() 
"unpacks" the tuple and then recreates a new tuple to call functions in for 
functions other than Python and C functions.

--

___
Python tracker 

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



[issue29441] Update examples to use async and await keywords in asyncio-task.rst

2017-02-07 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the reviews!

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



[issue29441] Update examples to use async and await keywords in asyncio-task.rst

2017-02-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 514571268743 by Berker Peksag in branch '3.5':
Issue #29441: Update examples to use async and await keywords in 
asyncio-task.rst
https://hg.python.org/cpython/rev/514571268743

New changeset 975e03b0aea6 by Berker Peksag in branch '3.6':
Issue #29441: Merge from 3.5
https://hg.python.org/cpython/rev/975e03b0aea6

New changeset ee074604bf0c by Berker Peksag in branch 'default':
Issue #29441: Merge from 3.6
https://hg.python.org/cpython/rev/ee074604bf0c

--
nosy: +python-dev

___
Python tracker 

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



[issue29469] AST-level Constant folding

2017-02-07 Thread STINNER Victor

STINNER Victor added the comment:

With this change, the Python compiler doesn't emit ast.Num nor ast.Str, right?

If we merge such change, we should prepare projects using AST. There is 
something like that in pip, but I failed to remind which one :-/ It should be 
easy: apply your patch, try to install something using pip and see the 
traceback ;-)

--

___
Python tracker 

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



[issue29471] AST: add an attribute to FunctionDef to distinguish functions from generators and coroutines

2017-02-07 Thread Vedran Čačić

Vedran Čačić added the comment:

I remember the message from Guido, long time ago when the syntax of generators 
was discussed. He said he has a hunch that new keyword will not be necessary, 
that the presence of yield will be enough. It'd be interesting to see if he has 
changed his mind, or he has some other excuse about async being fundamentally 
different. :-)

--
nosy: +veky

___
Python tracker 

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



[issue29256] Windows select() errors out when given no fds to select on, which breaks SelectSelector

2017-02-07 Thread STINNER Victor

STINNER Victor added the comment:

> 2) Modify the select.select() wrapper so that it behaves consistently on all 
> operating systems, by special-casing this situation on Windows.

Please don't do that. In Python, we have a long tradition of trying to provide 
thin wrappers to OS functions: os and select modules are good example.

To abstract the OS, there are higher level modules like: os=>shutil and 
select=>selectors.

About the Windows issue: I don't know what is the best fix (if any). The 
minimum change is to document Windows's special case in Python doc.

--

___
Python tracker 

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



[issue29463] Change docstring to attribute from first statement.

2017-02-07 Thread STINNER Victor

STINNER Victor added the comment:

I like the change because (IMHO) it makes the code simpler, and becase it also 
changes the first line of code object. I reviewed the patch: need basic unit 
tests.

--

___
Python tracker 

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



[issue29469] AST-level Constant folding

2017-02-07 Thread STINNER Victor

STINNER Victor added the comment:

I suggest you to look at my AST optimizer, especially the constant folding part:
https://github.com/haypo/fatoptimizer/blob/master/fatoptimizer/const_fold.py

And the unit tests, search for BaseConstantFoldingTests:
https://github.com/haypo/fatoptimizer/blob/master/test_fatoptimizer.py#L1980

IHMO we must have a long test suite on this AST optimizer, because it's common 
that the AST changes in subtle ways, AST is complex and so we should prevent 
regressions. You may simply copy my unit tests.

My optimizer implements more optimization: just remove unit tests on cases 
which you don't want to optimize.

--
nosy: +haypo

___
Python tracker 

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



[issue29471] AST: add an attribute to FunctionDef to distinguish functions from generators and coroutines

2017-02-07 Thread STINNER Victor

New submission from STINNER Victor:

Currently, symtable_visit_expr() has browse into the AST tree to look up yield, 
yield from or await to check if a function is a generator or a coroutine. If we 
choose to start to work on AST optimizers, I would suggest to add an attribute 
to ast.FunctionDef to announce if a function is a generator or a coroutine.

Currently, the peephole optimizer is unable to remove the deadcode, because 
otherwise the function is no more detected as a generator:

def generator():
  if 0: yield  # "hack" to get a generator
  pass

By the way, it would be nice to add a keyword similar to "async def" to be able 
to explicitly "document" generators as generators, and avoid the "if 0: yield" 
hack, but that's a different topic ;-) I feel less confortable to modify the 
Python language.

--
components: Interpreter Core
messages: 287216
nosy: haypo, inada.naoki, yselivanov
priority: normal
severity: normal
status: open
title: AST: add an attribute to FunctionDef to distinguish functions from 
generators and coroutines
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



[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2017-02-07 Thread STINNER Victor

STINNER Victor added the comment:

I created the issue #29471: "AST: add an attribute to FunctionDef to 
distinguish functions from generators and coroutines".

--

___
Python tracker 

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



[issue29469] AST-level Constant folding

2017-02-07 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Interpreter Core
nosy: +benjamin.peterson, brett.cannon, georg.brandl, ncoghlan, 
serhiy.storchaka, yselivanov
stage:  -> patch review
type:  -> enhancement

___
Python tracker 

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



[issue29425] File-altering aspects of pathlib should return new pathlib objects

2017-02-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Path.rename() is simple wrapper around os.rename() and returns the result of 
os.rename(). If os.rename() became returning something useful, this change will 
made impossible to return it from Path.rename().

Why not create destination Path object explicitly?

bar_var = pathlib.PosixPath('bar')
foo_var = pathlib.PosixPath('foo')
bar_var.rename(foo_var)

Note, that in 3.6 you can also write

os.rename(bar_var, foo_var)

--
nosy: +pitrou, serhiy.storchaka
versions: +Python 3.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



[issue29256] Windows select() errors out when given no fds to select on, which breaks SelectSelector

2017-02-07 Thread Berker Peksag

Berker Peksag added the comment:

See http://bugs.python.org/issue25680#msg255116 for Guido's comment on platform 
differences.

--
nosy: +berker.peksag

___
Python tracker 

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



[issue29256] Windows select() errors out when given no fds to select on, which breaks SelectSelector

2017-02-07 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-07 Thread STINNER Victor

STINNER Victor added the comment:

Benchmarks result. Some are slower (code placement issue?), the faster 
benchmark are not really much faster.

haypo@speed-python$ python3 -m perf compare_to 
/home/haypo/benchmarks/2017-02-06_07-15-default-e06af4027546.json 
pyobject_fastcall-3_ref_e06af4027546.json -G  --min-speed=4
Slower (4):
- scimark_lu: 352 ms +- 11 ms -> 374 ms +- 15 ms: 1.06x slower (+6%)
- float: 238 ms +- 3 ms -> 251 ms +- 4 ms: 1.05x slower (+5%)
- logging_silent: 558 ns +- 15 ns -> 585 ns +- 16 ns: 1.05x slower (+5%)
- raytrace: 1.04 sec +- 0.01 sec -> 1.09 sec +- 0.01 sec: 1.05x slower (+5%)

Faster (5):
- nbody: 233 ms +- 2 ms -> 216 ms +- 2 ms: 1.08x faster (-7%)
- pickle_dict: 56.6 us +- 4.3 us -> 52.9 us +- 2.2 us: 1.07x faster (-6%)
- nqueens: 217 ms +- 2 ms -> 205 ms +- 2 ms: 1.06x faster (-6%)
- unpickle_pure_python: 670 us +- 11 us -> 642 us +- 8 us: 1.04x faster (-4%)
- scimark_sor: 405 ms +- 11 ms -> 389 ms +- 10 ms: 1.04x faster (-4%)

Benchmark hidden because not significant (55): (...)

--

___
Python tracker 

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



[issue29438] use after free in key sharing dict

2017-02-07 Thread INADA Naoki

Changes by INADA Naoki :


Added file: 
http://bugs.python.org/file46556/29438-sharedkey-useafterfree-py36.patch

___
Python tracker 

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



[issue29462] RFC822-comments in email header fields can fool, e.g., get_filename()

2017-02-07 Thread Alessandro Vesely

Alessandro Vesely added the comment:

We can close this, then.  Let's hope migration to Python3 isn't going to last 
forever...

Thank you for your cooperation

--
resolution:  -> wont fix
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



[issue22594] Add a link to the regex module in re documentation

2017-02-07 Thread Marco Buttu

Marco Buttu added the comment:

IMHO the reference proposed in the patch is too verbose. Adding details like 
what is supported and how to use some features I think is out of the scope of 
the reference. Moreover, if the regex module changes the features we are 
reporting in the reference, we'll have an outdated reference.

In addition, as Brett Cannon pointed out in msg287159, the preferred way to 
mention a 3rd-party library should be by adding the reference at the top of the 
page, as in Doc/library/urllib.request.rst:19.

I propose to just add a more concise reference, at the beginning of the page, 
like the following:

.. seealso:: `regex `_,
   a third-party alternative regular expression module.

--
nosy: +marco.buttu

___
Python tracker 

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



[issue29463] Change docstring to attribute from first statement.

2017-02-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I like this change. Added comments on Rietveld.

Are changes in importlib.h only due to changing first line numbers?

--
components: +Interpreter Core
nosy: +benjamin.peterson, georg.brandl, serhiy.storchaka
stage:  -> patch review
type:  -> enhancement

___
Python tracker 

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



[issue26355] Emit major version based canonical URLs for docs

2017-02-07 Thread Nick Coghlan

Nick Coghlan added the comment:

OK, I've marked 2.7 and 3.5+ as the minimal set of versions to get the change 
via the CPython source repo.

However, looking at the results of 
https://www.google.com/search?q=python+httplib and 
https://www.google.com/search?q=python+http+client I think it's going to be 
worth backfilling the old branches as well - having multiple different versions 
of the 3.x documentation showing up in search results isn't helpful to anyone.

--
versions: +Python 2.7, 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



[issue27727] Update Tools/freeze to use .vcxproj files

2017-02-07 Thread Kaeptm Blaubaer

Changes by Kaeptm Blaubaer :


--
type:  -> behavior

___
Python tracker 

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



[issue27727] Update Tools/freeze to use .vcxproj files

2017-02-07 Thread Kaeptm Blaubaer

Changes by Kaeptm Blaubaer :


--
type: behavior -> 

___
Python tracker 

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



[issue29256] Windows select() errors out when given no fds to select on, which breaks SelectSelector

2017-02-07 Thread Nathaniel Smith

Nathaniel Smith added the comment:

> Please don't do that. In Python, we have a long tradition of trying to 
> provide thin wrappers to OS functions: os and select modules are good example.

I don't find this argument terribly convincing... Python also has a long 
history of papering over small issues when it can be done in a simple and 
tasteful way. select.select already overrides the Windows default for the 
maximum number of FDs, and the PEP 475 retry logic is definitely a non-trivial 
modification to the raw OS select semantics.

But I don't think it matters terribly much either, so long as we all agree that 
the SelectSelector behavior is definitely a bug :-)

--

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2017-02-07 Thread Joel Uckelman

Joel Uckelman added the comment:

I'm working on a patch now.

--

___
Python tracker 

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



[issue22594] Add a link to the regex module in re documentation

2017-02-07 Thread Matthew Barnett

Matthew Barnett added the comment:

I agree with Marco that it shouldn't be too verbose. I'd like to suggest that 
it says that it's compatible (i.e. has the same API), but with additional 
features.

--

___
Python tracker 

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



[issue29469] AST-level Constant folding

2017-02-07 Thread INADA Naoki

INADA Naoki added the comment:

Do you mean 
https://github.com/pypa/pip/blob/403e398330c8e841e4633aceda859430f5f7b913/pip/_vendor/distlib/markers.py
 ?

This doesn't affect, maybe.
Constant folding is executed right before producing bytecode.
It doesn't affect to PyCF_ONLY_AST.

BTW, how do you feel asdl_ct.py?

I feel it's too much only for constant folding, but it is too less for other 
advanced optimizations.
Actually, original patch in #11549 implements other optimizations
ported from peephole in compile.c.
And most tough part of updating this patch is resolve conflict with this commit.
https://github.com/python/cpython/commit/9cea398e237d4d75c6012e23a33d01b17f5dffcc

I'll try to remove asdl_ct.py and ast_opt.ct in next version.

--

___
Python tracker 

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



[issue29472] subprocess.communicate with timeout 0 and already terminated process generates TimeoutExpired on Linux

2017-02-07 Thread spoorcc

Changes by spoorcc :


--
nosy: +spoorcc

___
Python tracker 

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



[issue24363] httplib fails to handle semivalid HTTP headers

2017-02-07 Thread Guillaume Boudreau

Guillaume Boudreau added the comment:

Any chance this could get reviewed and merged soon? I got hit by a similar 
issue (see #29445) where the server, which I don't control, sends me invalid 
HTTP headers, and the prevents all the headers that follow it to not be parsed.
The latest attached patch fixed the issue for me.
Thanks.

--
nosy: +gboudreau

___
Python tracker 

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



[issue29472] subprocess.communicate with timeout 0 and already terminated process generates TimeoutExpired on Linux

2017-02-07 Thread Maurice van der Pot

New submission from Maurice van der Pot:

This only happens when:
- timeout is small enough
- at least one stream is redirected to a PIPE

When I know for certain that a subprocess has already terminated and I call 
communicate to retrieve its results with a timeout of 0 (or other small enough 
value), communicate will always return TimeoutExpired.

The cause is that the check on timeout is done before the ready file 
descriptors are checked: 
https://hg.python.org/cpython/file/tip/Lib/subprocess.py#l1484. With a small 
enough timeout, communicate will never check the file descriptors for EOF.

>From a user perspective I would expect to be able to use 
>communicate(timeout=0) to get the output for a process that I know has already 
>terminated or to poll without blocking.

Is this the intended behaviour of communicate or is it a bug? To me this 
behaviour is surprising.

--
components: Library (Lib)
messages: 287230
nosy: Griffon26
priority: normal
severity: normal
status: open
title: subprocess.communicate with timeout 0 and already terminated process 
generates TimeoutExpired on Linux
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue29472] subprocess.communicate with timeout 0 and already terminated process generates TimeoutExpired on Linux

2017-02-07 Thread Maurice van der Pot

Changes by Maurice van der Pot :


Added file: http://bugs.python.org/file46557/test.py

___
Python tracker 

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



[issue29439] _decimal on Android requires linking with libm

2017-02-07 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Actually my device is 6.0. Seems there's nothing interesting between API 23 and 
24 on android-changes-for-ndk-developers.md :)

Anyway, _decimal should not depend on the whether the python binary references 
to libm.so or not. Instead, _decimal should explicitly have an explicit 
DT_NEEDED entry to libm.so if it uses symbols from libm.

> Strange that on other systems the compilers don't complain (usually they do).

I guess on most system python is built with --enable-shared, so _decimal.so has 
an entry to libpython3.7m.so, and the latter references libm.so. If a linker 
supports recursive search, it can find the symbol.

For future references, here's the partial output of logcat when I run python 
with `LD_DEBUG=3 python3.7m` and import _decimal:

02-07 19:43:25.697  1026610266 linker  D  DEBUG: 
/data/local/tmp/python3/usr/lib/python3.7/lib-dynload/_decimal.cpython-37m.so: 
looking up log10 in python3.7m (from global group)
02-07 19:43:25.697  1026610266 linker  I  SEARCH log10 in 
python3.7m@0x55634f3000 h=735a40(elf) 452
02-07 19:43:25.697  1026610266 linker  I  NOT FOUND log10 
in python3.7m@0x55634f3000 735a40 452
02-07 19:43:25.698  1026610266 linker  D  DEBUG: 
/data/local/tmp/python3/usr/lib/python3.7/lib-dynload/_decimal.cpython-37m.so: 
looking up log10 in /system/vendor/lib64/libNimsWrap.so (from global group)
02-07 19:43:25.698  1026610266 linker  I  SEARCH log10 in 
/system/vendor/lib64/libNimsWrap.so@0x7f7c5fb000 (gnu)
02-07 19:43:25.698  1026610266 linker  I  NOT FOUND log10 
in /system/vendor/lib64/libNimsWrap.so@0x7f7c5fb000
02-07 19:43:25.698  1026610266 linker  D  DEBUG: 
/data/local/tmp/python3/usr/lib/python3.7/lib-dynload/_decimal.cpython-37m.so: 
looking up log10 in 
/data/local/tmp/python3/usr/lib/python3.7/lib-dynload/_decimal.cpython-37m.so 
(from local group)
02-07 19:43:25.698  1026610266 linker  I  SEARCH log10 in 
/data/local/tmp/python3/usr/lib/python3.7/lib-dynload/_decimal.cpython-37m.so@0x7f7c157000
 h=735a40(elf) 49
02-07 19:43:25.698  1026610266 linker  I  NOT FOUND log10 
in 
/data/local/tmp/python3/usr/lib/python3.7/lib-dynload/_decimal.cpython-37m.so@0x7f7c157000
 735a40 49
02-07 19:43:25.698  1026610266 linker  D  DEBUG: 
/data/local/tmp/python3/usr/lib/python3.7/lib-dynload/_decimal.cpython-37m.so: 
looking up log10 in libdl.so (from local group)
02-07 19:43:25.698  1026610266 linker  I  SEARCH log10 in 
libdl.so@0x0 h=735a40(elf) 0
02-07 19:43:25.698  1026610266 linker  I  NOT FOUND log10 
in libdl.so@0x0 735a40 0
02-07 19:43:25.698  1026610266 linker  D  DEBUG: 
/data/local/tmp/python3/usr/lib/python3.7/lib-dynload/_decimal.cpython-37m.so: 
looking up log10 in /system/lib64/libc.so (from local group)
02-07 19:43:25.698  1026610266 linker  I  SEARCH log10 in 
/system/lib64/libc.so@0x7f7c4f6000 (gnu)
02-07 19:43:25.698  1026610266 linker  I  NOT FOUND log10 
in /system/lib64/libc.so@0x7f7c4f6000
02-07 19:43:25.698  1026610266 linker  D  DEBUG: cannot 
locate symbol "log10" referenced by 
"/data/local/tmp/python3/usr/lib/python3.7/lib-dynload/_decimal.cpython-37m.so"...

And BioniC's linker only checks HASH table of ELF: 
https://android.googlesource.com/platform/bionic/+/master/linker/linker_soinfo.cpp#277,
 so log10 is not found in python3.7m

> This is misleading

Maybe it is. I mean "I didn't write a patch for _decimal at issue21668 as 
_decimal didn't build then"

> Perhaps test_decimal should fail for CPython if _decimal can't be imported.

I create a simple script to ensure all installed dynamic modules can be 
imported: 
https://github.com/yan12125/python3-android/blob/master/devscripts/import_all.py.
 It may be worth to transform it into a proper unittest and put it into 
Lib/test/

--

___
Python tracker 

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



[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-07 Thread STINNER Victor

STINNER Victor added the comment:

Ok, I fixed the PyObject_Call() bug, and tried a new approach to help the 
compiler for code placement: I moved all "call" functions into a new 
Objects/call.c file. It should help the compiler to inline more code, and I 
move functions which call themself closer: _PyObject_FastCall(), 
_PyCFunction_FastCall() and _PyFunction_FastCall() are now very close in the 
same file for example.

Not only the stack usage is better, but the performance seems also better: see 
benchmark results below.

Again, if you like the _PyObject_FastCall() idea (to reduce the stack 
consumption), I will split my big patch into smaller patches to have a 
"smoother" hg/git history.

Benchmark results on speed-python, CPython compiled with LTO+PGO:

haypo@speed-python$ python3 -m perf compare_to 
/home/haypo/benchmarks/2017-02-06_07-15-default-e06af4027546.json 
pyobject_fastcall-4_ref_e06af4027546.json -G  --min-speed=4
Faster (11):
- sympy_expand: 949 ms +- 12 ms -> 878 ms +- 7 ms: 1.08x faster (-8%)
- chameleon: 21.9 ms +- 0.2 ms -> 20.5 ms +- 0.3 ms: 1.07x faster (-7%)
- sympy_str: 425 ms +- 5 ms -> 399 ms +- 5 ms: 1.07x faster (-6%)
- sympy_integrate: 40.8 ms +- 0.3 ms -> 38.3 ms +- 0.4 ms: 1.06x faster (-6%)
- sympy_sum: 192 ms +- 6 ms -> 181 ms +- 7 ms: 1.06x faster (-6%)
- scimark_lu: 352 ms +- 11 ms -> 332 ms +- 13 ms: 1.06x faster (-6%)
- xml_etree_generate: 208 ms +- 2 ms -> 197 ms +- 3 ms: 1.05x faster (-5%)
- nbody: 233 ms +- 2 ms -> 222 ms +- 3 ms: 1.05x faster (-5%)
- telco: 14.7 ms +- 0.3 ms -> 14.0 ms +- 0.3 ms: 1.05x faster (-5%)
- scimark_fft: 662 ms +- 10 ms -> 633 ms +- 8 ms: 1.05x faster (-4%)
- genshi_text: 71.0 ms +- 0.8 ms -> 68.3 ms +- 0.7 ms: 1.04x faster (-4%)

Benchmark hidden because not significant (53): (...)

--
Added file: http://bugs.python.org/file46559/pyobject_fastcall-4.patch

___
Python tracker 

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



[issue29464] Specialize FASTCALL for functions with positional-only parameters

2017-02-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There was a bug in previous patch. The signature of generated by Argument 
Clinic functions was not changed. Updated patch fixes this bug and also fixes 
the use of fast call in deque methods.

--
Added file: http://bugs.python.org/file46558/fastcall-no-keywords-2.patch

___
Python tracker 

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



[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-07 Thread STINNER Victor

STINNER Victor added the comment:

Oh, with pyobject_fastcall-4.patch, the stack usage of test_python_iterator is 
even better. The reference is 1056 bytes/call,  pyobject_fastcall-2.patch  was 
944 bytes/call.

haypo@smithers$ ./python ../default/stack_overflow_28870-sp.py 
test_python_call: 9883 calls before crash, stack: 848 bytes/call
test_python_getitem: 10476 calls before crash, stack: 800 bytes/call
test_python_iterator: 9189 calls before crash, stack: 912 bytes/call

=> total: 29548 calls, 2560 bytes

--

___
Python tracker 

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



[issue19675] Pool dies with excessive workers, but does not cleanup

2017-02-07 Thread Vladimir Feinberg

Vladimir Feinberg added the comment:

I'm still hitting this issue in Python 3.6.0 :: Anaconda 4.3.0 (64-bit). Is 
there a reason this patch has been ignored?

This is on CentOS release 6.5

--
nosy: +Vladimir Feinberg
versions: +Python 3.6 -Python 2.7, Python 3.3
Added file: http://bugs.python.org/file46560/trace.txt

___
Python tracker 

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



[issue22594] Add a link to the regex module in re documentation

2017-02-07 Thread Matthew Barnett

Matthew Barnett added the comment:

With the VERSION0 flag (the default behaviour), it should behave the same as 
the re module, and that's not going to change.

--

___
Python tracker 

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



[issue28686] py.exe ignored PATH when using python3 shebang

2017-02-07 Thread Paul Moore

Paul Moore added the comment:

> - when inside a venv (almost always) go 'python' the old way, because 'py' is 
> unreliable here, *unless* you manually check the shebang of your scripts 
> before you execute them. 

No. When inside a venv:

- If you want to use the interactive interpreter, use 'py'.
- If you want to execute a script, use a shebang of #!/usr/bin/env python and 
then use `py myscript.py`

You should use /usr/bin/python[X[.Y]] shebangs specifically when you want to 
use the system Python, and bypass venvs. So that's typically for scripts you've 
installed in your PATH, not for working scripts in your project. You should 
never use versioned executable names in shebangs with /usr/bin/env.

Your issues seem to come from an insistence on using versioned interpreter 
names in /usr/bin/env shebangs, which does not work as you expect. (How it 
actually works is IMO not very helpful, but not easily fixable without shipping 
versioned executables, which is an entirely different debate which I don't 
intend to get into here).

--

___
Python tracker 

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



[issue29473] subprocces check_output

2017-02-07 Thread Steve Dower

Steve Dower added the comment:

What's your actual command? And what output is it producing? Without those, 
we've got no hope of guessing what is going on here.

Nothing in subprocess should have changed because of my PEPs, other than 
decoding bytes passed as arguments (which IIRC wasn't possible before anyway, 
and we may have left it that way).

--

___
Python tracker 

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



[issue29474] Grammatical errors in weakref.WeakValueDictionary docs

2017-02-07 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

You're right, Victor :)

The wording in 2.7 is a little bit different, but should be fixed too.

In 2.7:

These method have the same issues as the iterkeyrefs() and keyrefs() methods of 
WeakKeyDictionary objects.

Assigning this to myself.

--
assignee: docs@python -> Mariatta
nosy: +rhettinger
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



[issue29474] Grammatical errors in weakref.WeakValueDictionary docs

2017-02-07 Thread Mariatta Wijaya

New submission from Mariatta Wijaya:

https://docs.python.org/3/library/weakref.html?highlight=weakref#weakref.WeakValueDictionary

There are grammatical errors in the sentence:

These method have the same issues as the and keyrefs() method of 
WeakKeyDictionary objects.

Reported by Arthur Goldberg in 
https://mail.python.org/pipermail/docs/2017-February/029957.html

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 287241
nosy: Mariatta, docs@python
priority: normal
severity: normal
status: open
title: Grammatical errors in weakref.WeakValueDictionary docs
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



[issue28686] py.exe ignored PATH when using python3 shebang

2017-02-07 Thread Riccardo Polignieri

Riccardo Polignieri added the comment:

Paul:
> it's not possible to tell by inspection the version of a Python interpreter. 

True, but it's an implementation detail. Couldn't be solved? Versioned 
interpreters a la Linux, of course, or maybe how about including some kind of 
manifest file?


Steve:
> including versioned executables wouldn't that resolve this issue naturally? 

Definitely. 


Paul:
> 1. Use the Python executable that's first on PATH: "py"

Except, that's currently *almost never* true when I'm inside a venv! (For this 
to be true, I must give up on versioned shebangs). 
Now, if only 'py' could *always* look at the PATH *only*, ignoring shebangs - 
well this would be at least consistent behavior. 

Now, the absolute worst scenario here is when you have a prompt like "(myenv) 
$>" screaming to your face that you are inside a venv, and you go "py foo.py" 
expecting the venv interpreter to execute foo.py, because you are inside a 
venv, right? 
But wait!, foo.py was actually written by some Linux hacker, therefore 
*versioned* shebang, therefore 'py' fetches the wrong (system) Python, 
therefore no dependencies found, therefore crash. 
How I'm supposed to solve this? 


Paul: 
> The only change I'd consider reasonable here would be a doc change 

Thanks, it would really help, because I'm afraid I can't make it work for me. 
Most of all, I would really appreciate some sort of "best practice" suggestion 
on how to put together 'py', venvs and shebang. 
At the moment, I'm afraid my provisional policy is as follows: 
- when outside a venv (almost never) it's ok to 'py';
- when inside a venv (almost always) go 'python' the old way, because 'py' is 
unreliable here, *unless* you manually check the shebang of your scripts before 
you execute them. 

Which practically means - almost never use 'py'.
Is this the correct way to go?

--

___
Python tracker 

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



[issue29464] Specialize FASTCALL for functions with positional-only parameters

2017-02-07 Thread STINNER Victor

STINNER Victor added the comment:

Ok, so I looked again at your change: fastcall-no-keywords-2.patch LGTM,
I like the idea!

Since your patch is huge, I expect that it will be a pain to rebase it. I
suggest you to push it as soon as possible, to avoid conflicts. I will rework
my issue #29465 patch once this issue is done.


According to the number of modified functions and files, not accepting keyword
arguments is very common, and so it is annoying to have to call
_PyArg_NoStackKeywords() in each function. Avoiding the "PyObject *kwnames" can
also reduces the stack consumption per call, especially in long call stacks.

At least my assumption that almost no function will accept only positional
arguments is plain wrong :-) In practice, it's more the opposite!

I checked quickly fastcall-no-keywords-2.patch stack usage and performance.
It seems non significant, but I'm not surprised, it isn't really the purpose
of the change. IMHO the purpose of the change is more to simplify the code,
avoid to duplicate _PyArg_NoStackKeywords() everywhere, and only check
keyword arguments at one place.

For stack consumption and performances, I got good results on my issue #29465
which adds a new _PyObject_FastCall() function. IMHO this function fits well
with your new METH_FASTCALL (no keyword argument)! If we combine both changes,
we can get something very good ;-)

@Stefan Behnel: Thank you for you reply. So the backward compatibility was a
fake issue, and we are free to modify METH_FASTCALL. Anyway, *if* someone uses
METH_FASTCALL, IMHO it will be easy to update his/her code and add #ifdef on
the Python version if needed. Again, as Serhiy wrote, METH_FASTCALL is out of
the stable ABI, so we are safe on our warranties.

--

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2017-02-07 Thread Joel Uckelman

Joel Uckelman added the comment:

Here's a patch, complete with tests.

If the value is all CFWS, then get_cfws(value)[1], which is what's left after 
the CFWS is extracted, is the empty string---which is why value[0] throws in 
this case.

--
keywords: +patch
Added file: http://bugs.python.org/file46562/29412.patch

___
Python tracker 

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



[issue29474] Grammatical errors in weakref.WeakValueDictionary docs

2017-02-07 Thread STINNER Victor

STINNER Victor added the comment:

Would you mind to propose a patch? Thanks in advance.

Note: the sentence is also wrong in Python 2.7 doc, no?

--
nosy: +haypo

___
Python tracker 

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



[issue24363] httplib fails to handle semivalid HTTP headers

2017-02-07 Thread R. David Murray

R. David Murray added the comment:

Yeah, I'm going to try to get to this this weekend.

--

___
Python tracker 

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



[issue29473] subprocces check_output

2017-02-07 Thread Вадим Кара

New submission from Вадим Кара:

check_output(['command'])
Can't be decoded as it was in 3.5
check_output(['command']).decode('utf-8') returns UnicodeDecodeError: 'utf-8' 
codec can't decode byte 0x8d in position 2: invalid start byte error.

--
components: Windows
messages: 287239
nosy: paul.moore, steve.dower, tim.golden, zach.ware, Вадим Кара
priority: normal
severity: normal
status: open
title: subprocces check_output
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



[issue22594] Add a link to the regex module in re documentation

2017-02-07 Thread Marco Buttu

Marco Buttu added the comment:

Looking at the regex module and documentation, it is not clear to me whether 
its API behaves exactly as the re API. In addition, being a third-party module, 
things can change in the future.

To be defensive, IMO it is better to write as in the Ezio comment (in the 
review): "mostly compatible API". I propose a shorter patch, that adds the 
reference at the beginning of the page (right after the module introcution).

--
Added file: http://bugs.python.org/file46561/regex_reference.patch

___
Python tracker 

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



[issue19675] Pool dies with excessive workers, but does not cleanup

2017-02-07 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +davin

___
Python tracker 

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



[issue26355] Emit major version based canonical URLs for docs

2017-02-07 Thread Matthias Bussonnier

Changes by Matthias Bussonnier :


Added file: http://bugs.python.org/file46565/cannonical-doc-for-2.6.patch

___
Python tracker 

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



[issue19240] iglob should try to use `readdir`

2017-02-07 Thread Ben Longbons

Ben Longbons added the comment:

This is a duplicate of bug 25596, which is now fixed.

--
nosy: +o11c

___
Python tracker 

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



[issue29438] use after free in key sharing dict

2017-02-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

PyDict_SetItem() can trigger destructor which first call 
_PyObjectDict_SetItem() which change CACHED_KEYS(tp) and then call 
PyDict_SetItem() which call dictresize(). At the end it may be possible that 
cached != ((PyDictObject *)dict)->ma_keys and cached != CACHED_KEYS(tp) and 
CACHED_KEYS(tp) != ((PyDictObject *)dict)->ma_keys.

Wouldn't be better to just update the cached variable after calling 
PyDict_SetItem()?

if (was_shared && (cached = CACHED_KEYS(tp)) != NULL && cached != 
((PyDictObject *)dict)->ma_keys)

--

___
Python tracker 

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



[issue29475] option to not follow symlinks when globbing

2017-02-07 Thread Ben Longbons

New submission from Ben Longbons:

Background:
I have a data hierarchy with a lot of "sibling" symlinked directories/files. I 
want to glob only the non-symlink files, because it's a *huge* performance 
increase.

Before `os.scandir`, I was using a local copy of `glob.py` and calling 
`os.path.islink` every time, which was faster for *my* use case, but 
unacceptable for upstreaming. With `os.scandir`, my new patch should be 
acceptable.

The patch includes tests.

Current discussion points:
* Am I making the right decision to still accept symlinks for fully-literal 
components (in glob0)? It doesn't apply to my use-case, and I imagine some 
people might want to handle that case separately.
* Are my tests sufficient? I just copied and modified the existing symlink 
tests.
* Should my `flags` TODO be implemented *before* this patch? IMO it would be 
clearer after, even if it makes the diffs longer.

Future discussion points (don't derail):
* Should my `flags` TODO be implemented internally (this would significantly 
shrink any future patches)? (I can work on this)
* Should `flags` also be exposed externally?
* What additional `flags` might be useful? (my list: GLOB_ERR, GLOB_MARK, 
~GLOB_NOSORT, ~GLOB_NOESCAPE, GLOB_PERIOD, GLOB_BRACE, GLOB_TILDE_CHECK, 
GLOB_ONLYDIR (+ equivalent for files - also, why doesn't `os.scandir` have 
accessors for the other types without doing an unnecessary stat?))
* Is there a bitwise enum (or equivalently, enum set) in the standard library 
so `flags` can get sane reprs? (I've implemented this before, but imagine it 
would be overwhelmed with bikeshedding if it doesn't exist yet)
* Should `pathlib` really be implementing globbing on its own? That makes it 
hard to ensure feature parity. Perhaps the `glob` module needs some additional 
APIs? (I don't want to work on `pathlib` itself)

--
components: Library (Lib)
files: python-glob-symlink.diff
keywords: patch
messages: 287256
nosy: o11c
priority: normal
severity: normal
status: open
title: option to not follow symlinks when globbing
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file46566/python-glob-symlink.diff

___
Python tracker 

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



[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Awesome! This looks fantastic! I need to check the patch very carefully to be 
sure that we haven't missed something important.

Isn't the Python directory more appropriate place for call.c?

--
stage:  -> patch review

___
Python tracker 

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



[issue29438] use after free in key sharing dict

2017-02-07 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Interpreter Core
stage:  -> patch review

___
Python tracker 

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



[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-07 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy Storchaka added the comment:
> Isn't the Python directory more appropriate place for call.c?

I moved code from other .c files in Objects/, so for me it seems more
natural to add the code in Objects/ as well. It seems like most of the
code in Python/ is not "aware" of types defined in Objects/. But I
don't have a strong opinion on the right directory.

Objects/call.c is 1500 lines long. IMHO the code became big enough to
justify to move it to a new file ;-)

--

___
Python tracker 

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



[issue29465] Add _PyObject_FastCall() to reduce stack consumption

2017-02-07 Thread STINNER Victor

STINNER Victor added the comment:

pyobject_fastcall-4.patch combines a lot of changes. I wrote it to experiment 
_PyObject_FastCall().

I will rewrite these changes as a patch serie with smaller changes.

The design of PyObject_FastCall*() is to be short and simple.

Changes:

* Add _PyObject_FastCall(), _PyFunction_FastCall(), _PyCFunction_FastCall(): 
similar to the _PyObject_FastCallKeywords() but without keyword arguments. 
Without keyword arguments, the checks on keyword arguments can be removed, and 
it allows to reduce the stack usage: one less parameter to C functions.

* Move the slow path out of _PyObject_FastCallDict() and 
_PyObject_FastCallKeywords() in a new subfunction which is tagged with 
_Py_NO_INLINE to reduce the stack consumption of _PyObject_FastCallDict() and 
_PyObject_FastCallKeywords() in their fast paths, which are the most code paths.

* Move all "call" functions into a new Objects/call.c function. This change 
should help code placement to enhance the usage of the CPU caches (especially 
the CPU L1 instruction cache). In my long experience with benchmarking last 
year, I notice huge performance differences caused by code placement. See my 
blog post:
https://haypo.github.io/analysis-python-performance-issue.html
Sadly, _Py_HOT_FUNCTION didn't fix the issue completely.

* _PyObject_FastCallDict() and _PyObject_FastCallKeywords() "call" 
_PyObject_FastCall(). In fact, _PyObject_FastCall() is inlined manually in 
these functions, against, to minimize the stack usage. Similar change in 
_PyCFunction_FastCallDict() and PyCFunction_Call().

* Since the slow path is moved to a subfunction, I removed _Py_NO_INLINE from 
_PyStack_AsTuple() to allow the compiler to inline it if it wants to ;-) Since 
the stack usage is better with the patch, it seems like this strange has no 
negative impact on the stack usage.

* Optimize PyMethodDescr_Type (call _PyMethodDescr_FastCallKeywords()) in 
_PyObject_FastCallKeywords()

* I moved Py_EnterRecursiveCall() closer to the final function call, to 
simplify error handling. It would be nice to fix the issue #29306 before :-/

* I had to copy/paste the null_error() function from Objects/abstract.c. I 
don't think that it's worth it to add a _PyErr_NullError() function shared by 
abstract.c and call.c. Compilers are even able to merge duplicated functions ;-)

* A few other changes.

--

___
Python tracker 

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



[issue29464] Specialize FASTCALL for functions with positional-only parameters

2017-02-07 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy Storchaka: "I prefer to delay pushing the patch until we prove its 
usefulness, because the cost of this change is not zero. Is it a stopper for 
issue29465?"

Ok. No, it's not a blocker for my issue #29465.

About usefulness, I'm curious of the performance impact on this patch on top of 
the issue #29465. I tried to run a benchmark, but my tooling only works well 
with a single patch, not with two patches, and one based on the other. 
Moreover, our patches are in conflict.

So it seems like the issue #29465 makes Python faster and uses less stack 
memory, I suggest to first focus on that one, and then rebase your patch on top 
of that. What do you think?

--

___
Python tracker 

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



[issue29470] [python] Error in `/usr/bin/python': free(): invalid size: 0x00007f628400d0e0

2017-02-07 Thread David Ford (FirefighterBlu3)

David Ford (FirefighterBlu3) added the comment:

does the builtin memory debugger handle things well such as when involving 
external libraries like ssl/libcrypto?

--

___
Python tracker 

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



[issue29470] [python] Error in `/usr/bin/python': free(): invalid size: 0x00007f628400d0e0

2017-02-07 Thread STINNER Victor

STINNER Victor added the comment:

David Ford: "does the builtin memory debugger handle things well such as when 
involving external libraries like ssl/libcrypto?"

Nope, see:
http://bugs.python.org/issue18227#msg191610

Please try what I suggested. Buffer overflows may not crash immediatly, but 
PYTHONMALLOC=debug should help to detect some bugs in memory blocks allocated 
by Python.

--

___
Python tracker 

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



[issue29470] [python] Error in `/usr/bin/python': free(): invalid size: 0x00007f628400d0e0

2017-02-07 Thread David Ford (FirefighterBlu3)

David Ford (FirefighterBlu3) added the comment:

yes, it's running now, hasn't crashed yet

--

___
Python tracker 

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



[issue16011] "in" should be consistent with return value of __contains__

2017-02-07 Thread R. David Murray

R. David Murray added the comment:

Eric: that is not precise enough, I'm afraid :)  See msg171093 for the correct 
documentation update.  Specifically, in returns True if __contains__ returns a 
true value, and False otherwise (not the difference in case, it matters).  
There are more things than just None, False, and 0 that are false in Python.

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



[issue16011] "in" should be consistent with return value of __contains__

2017-02-07 Thread Eric Lafontaine

Eric Lafontaine added the comment:

Hi,

For user-defined class, it's up to the class to do the right implementation in 
my opinion. It's true the description is wrong though. 

x in y means that x exist inside of y (so that the execution of 
y.__contain__(x) is executed successfully and (I guess) doesn't return 
None,False or 0).

I'll modify the doc to be :
For user-defined classes which define the __contains__() method, x in y is 
false if y.__contains__(x) is returning either None,False or 0.  Otherwise, x 
in y return true.

Regards,
Eric Lafontaine

--
nosy: +Eric Lafontaine

___
Python tracker 

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



[issue29232] Quiet Install

2017-02-07 Thread Earl Maier

Earl Maier added the comment:

Update. 

I have been able to reproduce the issue/pin point the problem.  The all user 
flag on the installer doesn't install under all users. I install as an admin 
(under a different user) but python doesn't install for the current user (user).

--

___
Python tracker 

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



[issue19217] Calling assertEquals for moderately long list takes too long

2017-02-07 Thread Eric Lafontaine

Eric Lafontaine added the comment:

Hi all,

What do we do with this ticket?

Patch were provided, People have agreed (I think).  So what's missing to close 
it (or pass to the next step)?  It's going to be a year that a high priority 
ticket has no update and I would like to accelerate it if I can :).  Let me 
know what I can do.

Regards,
Eric Lafontaine

--
nosy: +Eric Lafontaine

___
Python tracker 

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



[issue19217] Calling assertEquals for moderately long list takes too long

2017-02-07 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords: +needs review

___
Python tracker 

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



[issue29464] Specialize FASTCALL for functions with positional-only parameters

2017-02-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The major part of the patch is generated by Argument Clinic. It is not a pain 
to rebase it. I prefer to delay pushing the patch until we prove its 
usefulness, because the cost of this change is not zero. Is it a stopper for 
issue29465?

--
assignee:  -> serhiy.storchaka
priority: normal -> low

___
Python tracker 

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



[issue29438] use after free in key sharing dict

2017-02-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you please write tests Inada? It would be nice to test also the case that 
fails with 29438-sharedkey-useafterfree-py36.patch. Actually I don't know if 
this is easy to reproduce, it was just my guessing.

--

___
Python tracker 

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



[issue29438] use after free in key sharing dict

2017-02-07 Thread INADA Naoki

INADA Naoki added the comment:

to: Serhiy

I can reproduce the issue by 29438-minimum.py, on Python 3.7 with pydebug.
But since this issue is "use after free", it may and may not crash.
It's up to how freed memory block is used from another part of Python.
Deterministic test which doesn't tied specific python version is difficult.

--

___
Python tracker 

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



[issue29463] Change docstring to attribute from first statement.

2017-02-07 Thread INADA Naoki

Changes by INADA Naoki :


Added file: http://bugs.python.org/file46569/ast-docstring-3.patch

___
Python tracker 

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



[issue29474] Grammatical errors in weakref.WeakValueDictionary docs

2017-02-07 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

And here is the patch that fixes the issue for python 2.7.

--
Added file: http://bugs.python.org/file46571/issue29474py2.patch

___
Python tracker 

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



[issue29474] Grammatical errors in weakref.WeakValueDictionary docs

2017-02-07 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Attached is the patch to fix the grammatical errors for versions 3.5+

--
keywords: +patch
Added file: http://bugs.python.org/file46570/issue29474py3.patch

___
Python tracker 

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



[issue29326] Blank lines in ._pth file are not ignored

2017-02-07 Thread Ammar Askar

Changes by Ammar Askar :


--
status: open -> closed

___
Python tracker 

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



[issue29438] use after free in key sharing dict

2017-02-07 Thread INADA Naoki

Changes by INADA Naoki :


Added file: 
http://bugs.python.org/file46572/29438-sharedkey-useafterfree-py36-2.patch

___
Python tracker 

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



[issue29438] use after free in key sharing dict

2017-02-07 Thread Xiang Zhang

Xiang Zhang added the comment:

I left one review about the comment on Rietvied last patch. :-)

--

___
Python tracker 

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



[issue29463] Add `docstring` attribute to AST nodes

2017-02-07 Thread INADA Naoki

Changes by INADA Naoki :


--
title: Change docstring to attribute from first statement. -> Add `docstring` 
attribute to AST nodes

___
Python tracker 

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



[issue29449] clear() should return prior state in threading.Event

2017-02-07 Thread Tim Peters

Tim Peters added the comment:

I can't judge a use case for a thread gimmick in the absence of wholly 
specified examples.  There are too many possible subtleties.  Indeed, if I'd do 
anything with Event.clear() it would be to remove it - I've seen too much code 
that suffers subtle race bugs when trying to reset an event.  The one thing 
it's clearly good for is announcing a one-time global state change, for which 
it's sufficient, efficient, clear, and hard to get wrong.

Can you use a Barrier instead?  The Barrier design allows reuse with no special 
care, Barrier.wait() already returns a little integer unique to each thread, 
and the Barrier constructor even allows a function to be passed in to be 
executed by (exactly) one of the threads when the Barrier is complete.

--

___
Python tracker 

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



[issue29476] Simplify set_add_entry()

2017-02-07 Thread INADA Naoki

INADA Naoki added the comment:

I like this idea.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue16011] "in" should be consistent with return value of __contains__

2017-02-07 Thread R. David Murray

R. David Murray added the comment:

>>> bool(())
False
>>> bool([])
False
>>> bool('')
False

What you want to say is that 'in' coerces the result returned by __contains__ 
to a boolean value.

--

___
Python tracker 

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



[issue29463] Change docstring to attribute from first statement.

2017-02-07 Thread INADA Naoki

Changes by INADA Naoki :


Added file: http://bugs.python.org/file46567/ast-docstring-2.patch

___
Python tracker 

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



[issue29438] use after free in key sharing dict

2017-02-07 Thread Xiang Zhang

Xiang Zhang added the comment:

> if (was_shared && (cached = CACHED_KEYS(tp)) != NULL && cached != 
> ((PyDictObject *)dict)->ma_keys)

+1 on this and I think the deletion should also use

if ((cached = CACHED_KEYS(tp) != NULL)

--

___
Python tracker 

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



[issue29474] Grammatical errors in weakref.WeakValueDictionary docs

2017-02-07 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
stage:  -> patch review

___
Python tracker 

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



[issue29475] option to not follow symlinks when globbing

2017-02-07 Thread Ethan Furman

Ethan Furman added the comment:

Before talking about the patch, have you signed the Contributer License 
Agreement yet?  The issue tracker isn't showing that you have.  Check out 
https://www.python.org/psf/contrib/contrib-form/ to do so.

---

The `symlinks` flag: can you give some glob examples showing when, and when 
not, symlinks will be matched when the symlinks param is False?

A bit flags enum:  There is now an IntFlag Enum type which implements bit flags.

--
nosy: +ethan.furman

___
Python tracker 

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



[issue16011] "in" should be consistent with return value of __contains__

2017-02-07 Thread Eric Lafontaine

Eric Lafontaine added the comment:

(first time trying to reply through email)

thanks for the example and you are right :
class Foo_emptylist(object):
def __contains__(self,item): return []

class Foo_emptydict(object):
def __contains__(self,item): return {}

class Foo_emptystring(object):
def __contains__(self,item): return ''

for foo in
[Foo_false(),Foo_None(),Foo_emptylist(),Foo_emptydict(),Foo_emptystring(),Foo_neg(),Foo_true(),Foo_42()]:
print("3 in foo:" + str(3 in foo))
print("foo.__contains__(3)" + str(foo.__contains__(3)))

3 in foo:False
foo.__contains__(3)False
3 in foo:False
foo.__contains__(3)None
3 in foo:False
foo.__contains__(3)[]
3 in foo:False
foo.__contains__(3){}
3 in foo:False
foo.__contains__(3)
3 in foo:True
foo.__contains__(3)-42
3 in foo:True
foo.__contains__(3)True
3 in foo:True
foo.__contains__(3)42

So the proposition should be this then?
For user-defined classes which define a __contains__() method, the in
operator will apply bool() on the __contains__() method.  In other words,  "x
in y" is equivalent to "bool(y.__contains__(x))" and will return False if
bool(y.__contains__(x)) is equivalent to false.

Éric Lafontaine |  Membre du Projet VUE, Groupe Contrôle
Génie électrique, 54ème promotion UdeS | Étudiant en maitrise TI à l'ETS
VAS OPS chez Bell Mobility

« Nous voulons proposer une alternative de transport en présentant un
véhicule électrique spécifiquement conçu pour les déplacements urbains. »

2017-02-07 21:10 GMT-05:00 R. David Murray :

>
> R. David Murray added the comment:
>
> >>> bool(())
> False
> >>> bool([])
> False
> >>> bool('')
> False
>
> What you want to say is that 'in' coerces the result returned by
> __contains__ to a boolean value.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue29476] Simplify set_add_entry()

2017-02-07 Thread Raymond Hettinger

New submission from Raymond Hettinger:

Dummy entries created by deletions are currently handled in two places.  The 
code in set_add_entry() tracks a freeslot to allow dummy slots to be reused 
when new elements are inserted. The dummies are also eliminated during resizing.

The freeslot checks are made in the inner-loop of set_add_entry() and will only 
eliminate a few of the dummies (ones that happen to be in a slot that we want 
to use again).  In contrast, the resize routine eliminates 100% of the dummy 
entries -- this is where most dummies get reclaimed.

This is a preliminary draft of an idea to only use resizing for dummy 
reclamation.  It proposes eliminating the freeslot reuse step in 
set_add_entry().  One advantage is that the patch nicely simplifies the code in 
set_add_entry and makes its inner-loop tighter (eliminating one memory access 
out of the two on each iteration).  With the advent of linear probing and the 
60% set load factor, set resizing has become very cheap.

One issue with the current design is the while a few dummies get reclaimed 
earlier, others are left alive longer, causing more collisions during lookups. 
The reuse of a few dummies defers the resizing step that would actually clear 
out all of the dummies.

Another thought is that the proposal gives a better separation of concerns.  
Insertion focuses on adding entries without making inner loop checks for an 
uncommon case (the relevant note in dictobject.c says this is uncommon by a 
factor of hundreds).  The patch leaves the dummy cleanup to the fast, efficient 
resizing step.

Some areas for exploration:

* We know that the benefit to set_add_entry() will reduce the cost of building 
a set (which is the common case).  It simply does less work by using less code 
overall and by having less code in the inner loop (see the disassembly below 
(1) to see that we're now down to one memory access per iteration).  That said, 
it would be nice to quantify whether this is a small improvement or a big one 
(I expect the answer will be different for CLang vs GCC vs MSC, for 32-bit 
builds versus 64-builds, and for ARM versus x86, etc).

* It would also be nice see if there is an observable small benefit or small 
detriment to the uncommon case of building a set followed by cycling back and 
forth between removing elements and adding new elements.

In any case, the simplification of the code in set_add_entry() will be nice and 
it would be good to have a separation of concerns with only set_resize being 
responsible for clearing out dummies in a single high-speed pass.

(1) Inner-loop for the new set_add_entry() featuring only one memory access per 
iteration:

L383:
cmpq%r9, %rbx   ; entry < start + LINEAR_PROBES
je  L406
L388:
addq$16, %rbx   ; entry++ 
movq8(%rbx), %rax   ; load entry->hash from memory
testq   %rax, %rax  ; entry->hash == 0
jne L382; until zero found skip next test  
cmpq$0, (%rbx)  ; entry->key == NULL
je  L374; return entry
L382:
cmpq%rax, %r15  ; entry->hash == hash
jne L383; loop back
<... process to equality test >

--
assignee: rhettinger
components: Interpreter Core
files: set_no_dummy_reuse.diff
keywords: patch
messages: 287272
nosy: rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Simplify set_add_entry()
versions: Python 3.7
Added file: http://bugs.python.org/file46568/set_no_dummy_reuse.diff

___
Python tracker 

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



[issue16011] "in" should be consistent with return value of __contains__

2017-02-07 Thread Eric Lafontaine

Eric Lafontaine added the comment:

Hi all,

Here are the test I've made to understand the behavior :

class Foo_42(object):
def __contains__(self,item): return 42 

class Foo_neg(object):
def __contains__(self,item): return -42 

class Foo_None(object):
def __contains__(self,item): return  

class Foo_false(object):
def __contains__(self,item): return False 

class Foo_true(object):
def __contains__(self,item): return True

for foo in [Foo_false(),Foo_None(),Foo_neg(),Foo_true(),Foo_42()]:
print("3 in foo:" + str(3 in foo))
print("foo.__contains__(3)" + str(foo.__contains__(3)))


which output this :
3 in foo:False
foo.__contains__(3)False
3 in foo:False
foo.__contains__(3)None
3 in foo:True
foo.__contains__(3)-42
3 in foo:True
foo.__contains__(3)True
3 in foo:True
foo.__contains__(3)42

So as long as __contains__ return False or None, the 'in' operator will be 
False.  Otherwise true.

--

___
Python tracker 

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



[issue16011] "in" should be consistent with return value of __contains__

2017-02-07 Thread Eric Lafontaine

Eric Lafontaine added the comment:

Hi David, sorry for the delay on my part for providing how I was getting to 
that conclusion.  I've also resurrected an old post as I want to start 
contributing more seriously :).

As this is documentation only (not changing the code behavior), I didn't take a 
look at the implementation of "in".

Could you enlighten me on what else would be considered "False" in this case?

Regards,
Eric Lafontaine

--

___
Python tracker 

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



[issue29463] Change docstring to attribute from first statement.

2017-02-07 Thread INADA Naoki

INADA Naoki added the comment:

lnotab is changed too.

-0,0,0,115,12,0,0,0,8,4,4,2,8,8,8,12,
-8,25,8,13,114,18,0,0,0,99,0,0,0,0,0,0,
+0,0,0,115,10,0,0,0,12,6,8,8,8,12,8,25,
+8,13,114,18,0,0,0,99,0,0,0,0,0,0,0,0,

115 is header for bytes type.
next 4 bytes is it's length (little endian, 12->10 bytes)
and everything after that is slided by 2 bytes.

--

___
Python tracker 

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



[issue16011] "in" should be consistent with return value of __contains__

2017-02-07 Thread Eric Lafontaine

Eric Lafontaine added the comment:

oh, I've got what you meant!

Proposed change :
For user-defined classes which define the __contains__() method, the in 
operator will convert to False "x in y" if y.__contains__(x) return False, 0 or 
None.  Otherwise, the in operator will return True for any other value being 
returned by y.__contains__(x).


Would that make more sense?
Regards,
Eric Lafontaine

--

___
Python tracker 

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



[issue29425] File-altering aspects of pathlib should return new pathlib objects

2017-02-07 Thread Walter Szeliga

Walter Szeliga added the comment:

If Path.rename() were made to be slightly more than a wrapper around 
os.rename(), then any future changes to the return value of os.rename() could 
be taken into consideration in the return value of Path.rename(). I don't see 
how anything would become impossible then.

Creating the destination Path object explicitly is my solution right now. Since 
it had become such a pattern in my code, I figured it could be delegated up to 
the level of the Path object and make for cleaner looking code.

--

___
Python tracker 

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



[issue19240] iglob should try to use `readdir`

2017-02-07 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Use scandir() to speed up the glob module

___
Python tracker 

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



[issue26355] Emit major version based canonical URLs for docs

2017-02-07 Thread Matthias Bussonnier

Matthias Bussonnier added the comment:

Updated patch to take comments into account (added space before /> for 
consistency). I'm still unfamiliar with hg so let me know if I did anything 
wrong.

--
Added file: http://bugs.python.org/file46563/cannonical-doc-for-3.4plus.patch

___
Python tracker 

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



[issue29351] absolute imports for logging

2017-02-07 Thread Vinay Sajip

Changes by Vinay Sajip :


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



[issue29372] RotatingFileHandler rotates empty logfile if it emits a large string

2017-02-07 Thread Vinay Sajip

Changes by Vinay Sajip :


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



[issue26355] Emit major version based canonical URLs for docs

2017-02-07 Thread Matthias Bussonnier

Changes by Matthias Bussonnier :


Removed file: http://bugs.python.org/file46426/cannonical-doc-for-3.4plus.patch

___
Python tracker 

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



[issue26355] Emit major version based canonical URLs for docs

2017-02-07 Thread Matthias Bussonnier

Changes by Matthias Bussonnier :


Added file: http://bugs.python.org/file46564/cannonical-doc-for-2.7.patch

___
Python tracker 

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



  1   2   >