[issue29719] "Date" of what's new is confusing

2017-03-06 Thread INADA Naoki

Changes by INADA Naoki :


--
pull_requests: +408

___
Python tracker 

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



[issue29571] test_re is failing when local is set for `en_IN`

2017-03-06 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I don't see what's odd about it. re.LOCALE uses the C locale, which one
obtains from locale.getlocale(). getpreferredencoding() is not
documented to have anything to do with the C locale, and indeed on
Windows it may be completely different.

--

___
Python tracker 

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



[issue29732] Heap out of bounds read in tok_nextc()

2017-03-06 Thread Kamil Frankowicz

New submission from Kamil Frankowicz:

After some fuzz testing I found a crashing test case.

Version: 2.7.13 compiled from source with Clang 3.9.1.

To reproduce: python python_hoobr_tok_nextc.py

Extract from Valgrind log (full log file at 
https://gist.github.com/fumfel/f9780e567dec761f8524523fff040742):

==15583== Process terminating with default action of signal 11 (SIGSEGV)
==15583==  Bad permissions for mapped region at address 0x5F36000
==15583==at 0x41EBC4: tok_nextc (tokenizer.c:861)
==15583==by 0x41ABA2: tok_get (tokenizer.c:1568)
==15583==by 0x41ABA2: PyTokenizer_Get (tokenizer.c:1681)
==15583==by 0x4171D4: parsetok (parsetok.c:159)
==15583==by 0x417DC0: PyParser_ParseFileFlagsEx (parsetok.c:106)
==15583==by 0x5C4A1D: PyParser_ASTFromFile (pythonrun.c:1499)
==15583==by 0x5C4C28: PyRun_FileExFlags (pythonrun.c:1354)
==15583==by 0x5C4009: PyRun_SimpleFileExFlags (pythonrun.c:948)
==15583==by 0x5C34AA: PyRun_AnyFileExFlags (pythonrun.c:752)
==15583==by 0x416478: Py_Main (main.c:640)
==15583==by 0x578782F: (below main) (libc-start.c:291)

--
components: Interpreter Core
files: python_hoobr_tok_nextc.py
messages: 289078
nosy: Kamil Frankowicz
priority: normal
severity: normal
status: open
title: Heap out of bounds read in tok_nextc()
type: crash
versions: Python 2.7
Added file: http://bugs.python.org/file46704/python_hoobr_tok_nextc.py

___
Python tracker 

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



[issue29732] Heap out of bounds read in tok_nextc()

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue28667] FD_SETSIZE is unsigned on FreeBSD

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +409

___
Python tracker 

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



[issue25996] Add support of file descriptor in os.scandir()

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +410

___
Python tracker 

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



[issue25996] Add support of file descriptor in os.scandir()

2017-03-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm wondering is it possible to implement this feature on Windows?

--

___
Python tracker 

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



[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2017-03-06 Thread Xiang Zhang

Changes by Xiang Zhang :


--
pull_requests: +411

___
Python tracker 

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



[issue24821] The optimization of string search can cause pessimization

2017-03-06 Thread Serhiy Storchaka

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



[issue25996] Add support of file descriptor in os.scandir()

2017-03-06 Thread STINNER Victor

STINNER Victor added the comment:

> I'm wondering is it possible to implement this feature on Windows?

On Windows, scandir() is implemented with FindFirstFile() which takes strings. 
This function creates a handle which should then be passed to FindNextFile(). 
There is no similar function taking a directory handle, so it's not possible to 
implement os.scandir(fd) on Windows.

It seems like the gnulib emulates fdopendir() on Windows, and its documentation 
contains warnings:
https://www.gnu.org/software/gnulib/manual/html_node/fdopendir.html
"But the replacement function is not safe to be used in libraries and is not 
multithread-safe. Also, the replacement does not guarantee that 
‘dirfd(fdopendir(n))==n’ (dirfd might fail, or return a different file 
descriptor than n)."

--

___
Python tracker 

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



[issue29714] can't interpolate byte string with \x00 before replacement identifier

2017-03-06 Thread Xiang Zhang

Changes by Xiang Zhang :


--
pull_requests: +412

___
Python tracker 

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



[issue24821] The optimization of string search can cause pessimization

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +413

___
Python tracker 

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



[issue29595] Expose max_queue_size in ThreadPoolExecutor

2017-03-06 Thread prayerslayer

prayerslayer added the comment:

Hello again, there's a reviewed PR open for this issue and it hasn't even 
received authoritative feedback yet (ie whether or not you intend to support 
this feature at all). I would be very happy if a core dev could look over this 
change before everyone forgets about it :)

--

___
Python tracker 

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



[issue20087] Mismatch between glibc and X11 locale.alias

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage:  -> test needed
versions: +Python 3.6, Python 3.7 -Python 3.4

___
Python tracker 

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



[issue29571] test_re is failing when local is set for `en_IN`

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies: +Mismatch between glibc and X11 locale.alias

___
Python tracker 

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



[issue28974] Make default __format__ be equivalent to __str__

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +415

___
Python tracker 

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



[issue28974] Make default __format__ be equivalent to __str__

2017-03-06 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +rhettinger

___
Python tracker 

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



[issue28243] Performance regression in functools.partial()

2017-03-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Can this issue be closed now?

--

___
Python tracker 

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



[issue28692] gettext: deprecate selecting plural form by fractional numbers

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +416

___
Python tracker 

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



[issue25582] Fixed memory leaks in test_ctypes

2017-03-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I have no ideas how to fix the remained constant memory consumption. But this 
is 2.7 issue only, so I'm closing this.

--
resolution:  -> fixed
stage: needs patch -> 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



[issue29714] can't interpolate byte string with \x00 before replacement identifier

2017-03-06 Thread Xiang Zhang

Xiang Zhang added the comment:

Thanks for the report, Nick!

--
resolution:  -> fixed
stage: needs patch -> 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



[issue15954] No error checking after using of the wcsxfrm()

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +417

___
Python tracker 

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



[issue15695] Correct __sizeof__ support for StgDict

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
versions: +Python 3.7 -Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue29714] can't interpolate byte string with \x00 before replacement identifier

2017-03-06 Thread STINNER Victor

STINNER Victor added the comment:

I confirm that I introduced the regression with the commit 
fa7762ec066aa3632a25b6a52bb7597b8f17c2f3: "Issue #25349: Optimize bytes % args 
using the new private _PyBytesWriter API". Sorry about that, I always forget 
that str*() functions should not be used in Python since we support embedded 
null bytes :-/ It seems like only Python 3.6.0 release is affected.

"git tag --contains fa7762ec066aa3632a25b6a52bb7597b8f17c2f3" also returns 
v3.5.2, but I don't understand since I only pushed my change to the 3.6 
branch...

--

___
Python tracker 

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



[issue29714] can't interpolate byte string with \x00 before replacement identifier

2017-03-06 Thread STINNER Victor

STINNER Victor added the comment:

Oh, and thank you for adding new unit tests ;-) Do we need similar unit tests 
for str%args and str.format()?

--

___
Python tracker 

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



[issue28243] Performance regression in functools.partial()

2017-03-06 Thread STINNER Victor

STINNER Victor added the comment:

I just ran a microbenchmark, 3.6 compared to 3.5:

haypo@smithers$ ./python -m perf timeit -s 'from functools import partial; f = 
lambda x, y: None; g = partial(f, 1)' 'g(2)' --duplicate=100 --compare-to 
../3.5/python  --python-names=3.5:3.6
3.5: . 151 ns +- 4 ns
3.6: . 150 ns +- 4 ns

Median +- std dev: [3.5] 151 ns +- 4 ns -> [3.6] 150 ns +- 4 ns: 1.00x faster 
(-0%)
Not significant!

=> not significant, so I close the issue.


FYI 3.7 is not significant neither:

$ ./python -m perf timeit -s 'from functools import partial; f = lambda x, y: 
None; g = partial(f, 1)' 'g(2)' --duplicate=100 --compare-to ../3.5/python  
--python-names=3.5:3.7

Median +- std dev: [3.5] 150 ns +- 4 ns -> [3.7] 150 ns +- 3 ns: 1.00x faster 
(-0%)
Not significant!

--
resolution:  -> out of date
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



[issue28243] Performance regression in functools.partial()

2017-03-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks Victor!

--

___
Python tracker 

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



[issue29700] readline memory corruption when sys.stdin fd >= FD_SETSIZE for select()

2017-03-06 Thread Marien Zwart

Changes by Marien Zwart :


--
nosy: +marienz

___
Python tracker 

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



[issue29565] Still broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2017-03-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

New test causes a compiler warning:

/home/serhiy/py/cpython/Modules/_ctypes/_ctypes_test.c: In function 
‘_testfunc_large_struct_update_value’:
/home/serhiy/py/cpython/Modules/_ctypes/_ctypes_test.c:53:42: warning: 
parameter ‘in’ set but not used [-Wunused-but-set-parameter]
 _testfunc_large_struct_update_value(Test in)
  ^

Could it be silenced?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue15695] Correct __sizeof__ support for StgDict

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +418

___
Python tracker 

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



[issue15695] Correct __sizeof__ support for StgDict

2017-03-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Now changes are simpler since _PyDict_SizeOf() already was implemented.

--
priority: normal -> low

___
Python tracker 

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



[issue29655] Certain errors during IMPORT_STAR can leak a reference

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +419

___
Python tracker 

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



[issue28231] zipfile does not support pathlib

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +420

___
Python tracker 

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



[issue29714] can't interpolate byte string with \x00 before replacement identifier

2017-03-06 Thread Xiang Zhang

Xiang Zhang added the comment:

I think no. String is not affected now and its code uses related macros so I 
don't think it could suffer possible regression.

--

___
Python tracker 

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



[issue29733] concurrent.futures as_completed raise TimeoutError wrong

2017-03-06 Thread jiangwanwei

New submission from jiangwanwei:

when I use as_completed function to wait my futures, if I sleep more than 
timeout seconds in each iteration , I found that futures has been set result, 
but raise TimeoutError. as my test example code shows:

from concurrent import futures
from multiprocessing import current_process
import time


def run(count):
cp = current_process()
print(cp.name, 'begin', count, 'at', time.time())
time.sleep(count)
print(cp.name, 'end', count, 'at', time.time())
return count


if __name__ == '__main__':
ppe = futures.ProcessPoolExecutor(max_workers=4)
cp = current_process()

fs = [ppe.submit(run, i) for i in range(4)]

print('begin receive at', time.time())
for f in futures.as_completed(fs, timeout=5):
time.sleep(5)
print(cp.name, 'receive', f.result(), 'at', time.time())
print(cp.name, 'receive', [f.result() for f in fs], 'at', time.time())
print('end receive at', time.time())


run above-mentioned example code, it will output :
begin receive at 1488799136.471536
Process-1 begin 0 at 1488799136.472969
Process-1 end 0 at 1488799136.473114
Process-3 begin 1 at 1488799136.473741
Process-2 begin 2 at 1488799136.474226
Process-4 begin 3 at 1488799136.474561
Process-3 end 1 at 1488799137.474495
Process-2 end 2 at 1488799138.475289
Process-4 end 3 at 1488799139.475696
MainProcess receive 0 at 1488799141.478663
MainProcess receive [0, 1, 2, 3] at 1488799141.478787
Traceback (most recent call last):
  File "test_futures.py", line 23, in 
for f in futures.as_completed(fs, timeout=5):
  File 
"/Users/jiangwanwei/anaconda3/lib/python3.5/concurrent/futures/_base.py", line 
213, in as_completed
len(pending), len(fs)))
concurrent.futures._base.TimeoutError: 3 (of 4) futures unfinished

--
messages: 289093
nosy: jiangwanwei
priority: normal
severity: normal
status: open
title: concurrent.futures as_completed raise TimeoutError wrong
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



[issue29410] Moving to SipHash-1-3

2017-03-06 Thread INADA Naoki

INADA Naoki added the comment:

microbench result: 
https://gist.github.com/methane/33c7b01c45ce23b67246f5ddaff9c9e7

Not significant ~ very little difference for small data.
For 4KB:
Median +- std dev: [python.default] 3.26 us +- 0.03 us -> [python.siphash13] 
2.03 us +- 0.02 us: 1.60x faster (-38%)

--

___
Python tracker 

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



[issue29734] nt._getfinalpathname handle leak

2017-03-06 Thread Eryk Sun

New submission from Eryk Sun:

The implementation of nt._getfinalpathname leaks a File handle if calling 
GetFinalPathNameByHandle fails. The latter function is practically guaranteed 
to fail when resolving the path for a non-file-system device. It also fails 
when VOLUME_NAME_DOS is requested for a volume GUID path that isn't currently 
mounted as either a DOS drive letter or an NTFS junction. In this case 
requesting VOLUME_NAME_GUID should work.

For example, when I try calling _getfinalpathname to resolve the device paths 
\\?\MAILSLOT, \\?\PIPE, \\?\UNC, \\?\C:, \\?\PhysicalDrive0, \\?\NUL, 
\\?\CONIN$, and \\?\COM1, I get the following list of leaked handles:

  0x168 File  \Device\Mailslot
  0x16c File  \Device\NamedPipe
  0x178 File  \Device\Mup
  0x17c File  \Device\HarddiskVolume2
  0x180 File  \Device\Harddisk0\DR0
  0x18c File  \Device\Null
  0x194 File  \Device\ConDrv
  0x198 File  \Device\Serial0

(The above is from a context manager that checks for leaked handles using 
ctypes to call the PssCaptureSnapshot API, which was introduced in Windows 8.1. 
I think Process Snapshotting is the only Windows API that uses the kernel's 
ability to fork a clone of a process.) 

The reason that GetFinalPathNameByHandle fails in these cases is that the 
information classes it queries are typically only serviced by file systems. 
Other I/O devices (e.g. disk and volume devices) will fail these I/O requests. 
It happens that GetFinalPathNameByHandle starts with an NtQueryObject request 
that succeeds in these cases (it's the source of the above native NT device 
names), but it doesn't stop there. It continues requesting information from the 
device and the mount-point manager until it either has everything or a request 
fails.

Also, in os__getfinalpathname_impl, I notice that it's switching from 
VOLUME_NAME_NT in the first call that's used to get the buffer size to 
VOLUME_NAME_DOS in the second call. It should use VOLUME_NAME_DOS in both 
cases, or better yet, add a keyword-only argument to select a different 
volume-name style (i.e. None, DOS, GUID, or NT).

--
components: Extension Modules, Windows
messages: 289095
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: nt._getfinalpathname  handle leak
type: behavior
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



[issue28230] tarfile does not support pathlib

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +421

___
Python tracker 

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



[issue28230] tarfile does not support pathlib

2017-03-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated documentation.

Note that path-like objects are supported only for external names. Internal 
names are not OS paths.

--

___
Python tracker 

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



[issue29568] undefined parsing behavior with the old style string formatting

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +422

___
Python tracker 

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



[issue25455] Some repr implementations don't check for self-referential structures

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +423

___
Python tracker 

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



[issue25455] Some repr implementations don't check for self-referential structures

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
versions: +Python 3.7 -Python 3.4

___
Python tracker 

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



[issue28243] Performance regression in functools.partial()

2017-03-06 Thread STINNER Victor

STINNER Victor added the comment:

Oh wait, there was a major regression in my perf module :-( The --compare-to 
option was completely broken in the development branch (but it works for timeit 
--compare-to in the latest release). It's now fixed! So please ignore results 
of my previous comment.


New benchmark, 3.6 compared to 3.5:

haypo@smithers$ ./python -m perf timeit -s 'from functools import partial; f = 
lambda x, y: None; g = partial(f, 1)' 'g(2)' --duplicate=100 --compare-to 
../3.5/python --python-names=ref:patch --python-names=3.5:3.6
3.5: . 152 ns +- 4 ns
3.6: . 152 ns +- 1 ns

Median +- std dev: [3.5] 152 ns +- 4 ns -> [3.6] 152 ns +- 1 ns: 1.00x faster 
(-0%)
Not significant!

=> Ah! No change, it's still not significant! Same speed.


3.7 compared to 3.6:

haypo@smithers$ ./python -m perf timeit -s 'from functools import partial; f = 
lambda x, y: None; g = partial(f, 1)' 'g(2)' --duplicate=100 --compare-to 
../3.6/python --python-names=ref:patch --python-names=3.6:3.7
3.6: . 152 ns +- 1 ns
3.7: . 138 ns +- 1 ns

Median +- std dev: [3.6] 152 ns +- 1 ns -> [3.7] 138 ns +- 1 ns: 1.10x faster 
(-9%)

=> Oh! 3.7 is 1.10x faster! I didn't compile Python with PGO, so maybe it's a 
minor change due to code placement? At least, it's not slower ;-)


I'm unable to see any performance slowdown in 3.6 compared to 3.5, so I keep 
the issue closed.

Anyway, thanks for the report Serhiy! Our performance watcher ;-)

--

___
Python tracker 

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



[issue29700] readline memory corruption when sys.stdin fd >= FD_SETSIZE for select()

2017-03-06 Thread Marien Zwart

Marien Zwart added the comment:

On Python 3, crash_readline_fdset.py does not crash for me, because its input() 
contains a check documented as:

   /* We should only use (GNU) readline if Python's sys.stdin and
  sys.stdout are the same as C's stdin and stdout, because we
  need to pass it those. */

and calls sys.stdin.getline() instead.

I don't understand why this was added 
(eba769657a32cb08d96f021f40c79a54ade0bffc's commit message "Make input9) behave 
properly with the new I/O library" does not explain it).

PyOS_Readline does still take sys_stdin and sys_stdout arguments, but the only 
callers in CPython itself pass the actual stdin and stdout. Not sure if it's 
still worth fixing (maybe just turn it from a crash into an error if the fd is 
too high, but don't add an alternative implementation?).

On Python 2, I can fix it, but then I hit the same problem in readline itself 
(http://git.savannah.gnu.org/cgit/readline.git/tree/input.c#n518).

So I suppose the next step is reporting it there, and see if they're interested 
in fixing it (looks like readline isn't currently using anything more fancy 
than select() and pselect(), and there's a few more calls to those that would 
probably also need fixing...). Doesn't seem useful to fix it here first.

--

___
Python tracker 

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



[issue26121] Use C99 functions in math if available

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +424

___
Python tracker 

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



[issue29700] readline memory corruption when sys.stdin fd >= FD_SETSIZE for select()

2017-03-06 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +xiang.zhang

___
Python tracker 

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



[issue26121] Use C99 functions in math if available

2017-03-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I don't know how to run custom build on buildbots with new workflow.

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



[issue9051] Improve pickle format for timezone aware datetime instances

2017-03-06 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



[issue29735] Optimize functools.partial() for positional arguments

2017-03-06 Thread STINNER Victor

New submission from STINNER Victor:

The pull request makes functools.partial() faster for positional arguments. It 
avoids the creation of a tuple for positional arguments. It allocates a small 
buffer for up to 5 parameters. But it seems like even if the small buffer is 
not used, it's still faster.

Use small buffer, total: 2 positional arguments.

haypo@smithers$ ./python -m perf timeit -s 'from functools import partial; f = 
lambda x, y: None; g = partial(f, 1)' 'g(2)' --duplicate=100 --compare-to 
../master-ref/python --python-names=ref:patch --python-names=ref:patch
ref: . 138 ns +- 1 ns
patch: . 121 ns +- 1 ns

Median +- std dev: [ref] 138 ns +- 1 ns -> [patch] 121 ns +- 1 ns: 1.14x faster 
(-12%)


Don't use small buffer, total: 6 positional arguments.

haypo@smithers$ ./python -m perf timeit -s 'from functools import partial; f = 
lambda a1, a2, a3, a4, a5, a6: None; g = partial(f, 1, 2, 3, 4, 5)' 'g(6)' 
--duplicate=100 --compare-to ../master-ref/python --python-names=ref:patch 
--python-names=ref:patch
ref: . 156 ns +- 1 ns
patch: . 136 ns +- 0 ns

Median +- std dev: [ref] 156 ns +- 1 ns -> [patch] 136 ns +- 0 ns: 1.15x faster 
(-13%)


Another benchmark  with 10 position arguments:

haypo@smithers$ ./python -m perf timeit -s 'from functools import partial; f = 
lambda a1, a2, a3, a4, a5, a6, a7, a8, a9, a10: None; g = partial(f, 1, 2, 3, 
4, 5)' 'g(6, 7, 8, 9, 10)' --duplicate=100 --compare-to ../master-ref/python 
--python-names=ref:patch --python-names=ref:patch
ref: . 193 ns +- 1 ns
patch: . 166 ns +- 2 ns

Median +- std dev: [ref] 193 ns +- 1 ns -> [patch] 166 ns +- 2 ns: 1.17x faster 
(-14%)

--
messages: 289100
nosy: haypo
priority: normal
severity: normal
status: open
title: Optimize functools.partial() for positional arguments
type: performance
versions: Python 3.7

___
Python tracker 

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



[issue29735] Optimize functools.partial() for positional arguments

2017-03-06 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +425

___
Python tracker 

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



[issue28243] Performance regression in functools.partial()

2017-03-06 Thread STINNER Victor

STINNER Victor added the comment:

> Oh, functools.partial.__call__() doesn't use fastcall yet.

This issue reminded me that I didn't finish to optimize partial_call(): see 
issue #29735 for a minor optimization.

--

___
Python tracker 

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



[issue29735] Optimize functools.partial() for positional arguments

2017-03-06 Thread STINNER Victor

STINNER Victor added the comment:

functools.partial() is commonly used in the the asyncio module. The asyncio doc 
suggests to use it, because of deliberate limitations of the asyncio API.

--
nosy: +inada.naoki, serhiy.storchaka, yselivanov

___
Python tracker 

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



[issue29735] Optimize functools.partial() for positional arguments

2017-03-06 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +ncoghlan, rhettinger

___
Python tracker 

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



[issue8256] input() doesn't catch _PyUnicode_AsString() exception; io.StringIO().encoding is None

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
versions: +Python 3.7 -Python 3.4

___
Python tracker 

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



[issue8256] input() doesn't catch _PyUnicode_AsString() exception; io.StringIO().encoding is None

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +427

___
Python tracker 

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



[issue15343] "pydoc -w " writes out page with empty "Package Contents" section

2017-03-06 Thread Wolfgang Maier

Wolfgang Maier added the comment:

Sorry, for generating noise on this very old issue, but was there a specific 
reason to duplicate the code of ImpImporter.find_module in changeset 
9101eab6178c instead of factoring it out?

--
nosy: +wolma

___
Python tracker 

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



[issue29695] Weird keyword parameter names in builtins

2017-03-06 Thread STINNER Victor

STINNER Victor added the comment:

> If you think that it would be better to remove without deprecation, the 
> following patch does this.

@Serhiy: Can you please create a PR for it?

--

___
Python tracker 

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



[issue29714] can't interpolate byte string with \x00 before replacement identifier

2017-03-06 Thread STINNER Victor

STINNER Victor added the comment:

Xiang Zhang added the comment:
> I think no. String is not affected now and its code uses related macros so I 
> don't think it could suffer possible regression.

Regressions are not something "expected", shit happens, all the time.
Unexpected corner cases are common :-)

--

___
Python tracker 

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



[issue29695] Weird keyword parameter names in builtins

2017-03-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If David agrees with this.

--

___
Python tracker 

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



[issue29695] Weird keyword parameter names in builtins

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +428

___
Python tracker 

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



[issue27577] Make implementation and doc of tuple and list more compliant

2017-03-06 Thread Xiang Zhang

Xiang Zhang added the comment:

This issue doesn't make any sense once #29695 is applied. So close.

--
resolution:  -> fixed
stage:  -> resolved

___
Python tracker 

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



[issue27577] Make implementation and doc of tuple and list more compliant

2017-03-06 Thread Xiang Zhang

Changes by Xiang Zhang :


--
status: open -> closed

___
Python tracker 

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



[issue29736] Optimize builtin types constructor

2017-03-06 Thread STINNER Victor

New submission from STINNER Victor:

Attached PR replaces PyArg_ParseTupleAndKeywords() with
_PyArg_ParseTupleAndKeywordsFast() to optimize the constructor of the
builtin types:

* bool: bool_new()
* bytes: bytes_new()
* complex: complex_new()
* float: float_new()
* int: long_new()
* list: list_init()
* str: unicode_new()
* tuple: tuple_new()

When using keywords, the speedup is between 1.55x faster and 1.92x faster.

When using only positional arguments, the speedup is between 1.07x faster and 
1.14x faster.

Results of attached bench.py:

+---++-+
| Benchmark | ref| changed |
+===++=+
| complex(real=0.0, imag=0.0)   | 452 ns | 1.92x faster (-48%) |
+---++-+
| bytes("x", encoding="ascii", errors="strict") | 498 ns | 1.88x faster (-47%) |
+---++-+
| str(b"x", encoding="ascii")   | 340 ns | 1.55x faster (-35%) |
+---++-+
| list([None])  | 208 ns | 1.14x faster (-12%) |
+---++-+
| int(0)| 113 ns | 1.11x faster (-10%) |
+---++-+
| float(1.0)| 110 ns | 1.10x faster (-9%)  |
+---++-+
| str("x")  | 115 ns | 1.10x faster (-9%)  |
+---++-+
| tuple((None,))| 111 ns | 1.10x faster (-9%)  |
+---++-+
| bytes(b"x")   | 126 ns | 1.10x faster (-9%)  |
+---++-+
| bool(True)| 107 ns | 1.09x faster (-8%)  |
+---++-+
| complex(0.0, 0.0) | 176 ns | 1.07x faster (-7%)  |
+---++-+

--
files: bench.py
messages: 289111
nosy: haypo
priority: normal
severity: normal
status: open
title: Optimize builtin types constructor
type: performance
versions: Python 3.7
Added file: http://bugs.python.org/file46705/bench.py

___
Python tracker 

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



[issue29736] Optimize builtin types constructor

2017-03-06 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +429

___
Python tracker 

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



[issue29695] Weird keyword parameter names in builtins

2017-03-06 Thread R. David Murray

R. David Murray added the comment:

If Raymond is on the side of skipping the deprecation than I'm good with it.  
Like I said, this is a marginal case.

--

___
Python tracker 

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



[issue29735] Optimize functools.partial() for positional arguments

2017-03-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What about C stack consumption? Is not this increase it?

Since nested partial()`s are collapsed, you need to interlace them with other 
wrapper for testing.

def decorator(f):
def wrapper(*args):
return f(*args)
return wrapper

def f(*args): pass

for i in range(n):
f = partial(f)
f = decorator(f)

f(1, 2)

--
components: +Extension Modules
stage:  -> patch review

___
Python tracker 

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



[issue29736] Optimize builtin types constructor

2017-03-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The half of constructors no longer use PyArg_ParseTupleAndKeywords().

I would wait until constructors be converted to Argument Clinic. There are 
ready patches for some of these builtin types, patches for other are in 
proggress.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29695] Weird keyword parameter names in builtins

2017-03-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks all!

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



[issue29695] Weird keyword parameter names in builtins

2017-03-06 Thread STINNER Victor

STINNER Victor added the comment:

Unhappy buildbot.

http://buildbot.python.org/all/builders/AMD64%20Debian%20root%203.x/builds/456/steps/test/logs/stdio

==
ERROR: test_keyword_arguments (test.test_descr.ClassPropertiesAndMethods)
--
Traceback (most recent call last):
  File 
"/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_descr.py", line 
3451, in test_keyword_arguments
list.__init__(a, sequence=[0, 1, 2])
TypeError: list() does not take keyword arguments

==
ERROR: test_keywords (test.test_descr.ClassPropertiesAndMethods)
--
Traceback (most recent call last):
  File 
"/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_descr.py", line 
2888, in test_keywords
self.assertEqual(int(x=1), 1)
TypeError: 'x' is an invalid keyword argument for this function

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

___
Python tracker 

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



[issue29695] Weird keyword parameter names in builtins

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +430

___
Python tracker 

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



[issue29733] concurrent.futures as_completed raise TimeoutError wrong

2017-03-06 Thread Josh Rosenberg

Josh Rosenberg added the comment:

The docs ( 
https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.as_completed
 ) do seem to indicate it shouldn't do so as long as results were available 
before the timeout expired:

"The returned iterator raises a concurrent.futures.TimeoutError if __next__() 
is called and the result isn’t available after timeout seconds from the 
original call to as_completed()."

My reading of that would be that it raises the error only when:

1. The timeout has expired
2. The call would block (or possibly, would have blocked after the timeout 
expired), indicating no result was available

Handling "would have blocked" is hard, but might it make sense to still allow a 
non-blocking wait on the event even if the timeout has expired, with the 
exception raised only if the non-blocking wait fails?

Side-note: Looks like this code is still using time.time, not time.monotonic, 
so it's vulnerable to system clock adjustments; NTP updates could cause a five 
second timeout to expire instantly, or take seconds or even minutes longer to 
expire.

--
nosy: +josh.r

___
Python tracker 

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



[issue29723] 3.6.1rc1 adds the current directory to sys.path when running a subdirectory's __main__.py; previous versions did not

2017-03-06 Thread Nick Coghlan

Nick Coghlan added the comment:

I think Eryk's diagnosis is correct: this is a straight up bug in the original 
patch, where it's missing the check to only use the new logic when in isolated 
mode (as it's compensating for the fact that there is no extra sys.path[0] 
entry inserted in that case).

I mentioned that on the original issue 
http://bugs.python.org/issue29319#msg285904 but hadn't noticed that the 
relevant check was missing from the applied patch.

--

___
Python tracker 

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



[issue29571] test_re is failing when local is set for `en_IN`

2017-03-06 Thread Nick Coghlan

Nick Coghlan added the comment:

Thanks for the explanation - given that, I agree that simply reverting the 
attempted test-based fix and instead relying on the issue 20087 updates is the 
way to go.

--

___
Python tracker 

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



[issue13566] Increase pickle compatibility

2017-03-06 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Right, but Antoine's objection is that suddenly strs pickled in Py3 can end up 
as strs in Py2, rather than unicode. If the library enforces a Py3-like type 
separation on Py2 (text arguments are unicode only, binary data is str only), 
then you have the problem where pickling on Py3 produces a pickle that will 
unpickle as str on Py2, and suddenly the library explodes because the argument, 
that should be unicode on Py2 and str on Py3, is suddenly str on both.

This means that, to fix a problem with non-forward compatible libraries (that 
accept text only as Py2 str), a Py2 library that's (very) forward thinking 
would have problems.

Admittedly, I wouldn't expect there to be very many such libraries, and many of 
them would have their own custom pickle formats, but stuff like numpy is quite 
sensitive to argument type; numpy.array(u'123') and numpy.array(b'123') are 
different. In numpy's case, each of those produces a derived datatype that is 
explicitly pickled and (I believe) would prevent the error, but some other more 
heuristic library might not do so.

--
nosy: +josh.r

___
Python tracker 

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



[issue29545] Python behavioral difference between Linux and AIX

2017-03-06 Thread Anna Henningsen

Changes by Anna Henningsen :


--
nosy: +addaleax

___
Python tracker 

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



[issue29735] Optimize functools.partial() for positional arguments

2017-03-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If the underlying function doesn't support fast call, and either args or 
pto->args are empty, partial_call() makes two unneeded copyings. Arguments are 
copied from a tuple to the raw array and from the array to new tuple. This is 
what the current code does, but this can be avoided.

If the underlying function doesn't support fast call, and both args and 
pto->args are not empty, patched partial_call() makes one unneeded copyings. 
Arguments are copied from tuples to the raw array and from the array to the new 
tuple. Only one copying is needed (from tuples to the new tuple).

--

___
Python tracker 

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



[issue29676] verbose output of test_cprofile

2017-03-06 Thread INADA Naoki

INADA Naoki added the comment:

OK, now I found what caused this difference.

lsprof expect `func` is PyCFunction object.  But it can be PyMethodDescrObject 
when LOAD_METHOD is used to call C method.

In Modules/_lsprof.c (line 459):

case PyTrace_C_CALL:
if ProfilerObject *)self)->flags & POF_BUILTINS)
&& PyCFunction_Check(arg)) {
ptrace_enter_call(self,
  ((PyCFunctionObject *)arg)->m_ml,
  arg);
}

Document says just it's "Function object being called."
https://docs.python.org/3.6/c-api/init.html#c.Py_tracefunc

If "function object" means "any C object having tp_call", most easy way to 
solve this issue is adding PyMethodDescrObject support to lsprof.
PyEval_GetFuncName() and PyEval_GetFuncDesc() should support it too.
As a bonus, `list.append(L, x)` will be profiled like `L.append(x)`.  It looks 
more consistent.

On the other hand, if it means it's PyCFunction, we can't call 
PyMethodDescrObject directly.

Since PyEval_SetProfile() is old function, I chose later way for now.

--

___
Python tracker 

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



[issue29676] verbose output of test_cprofile

2017-03-06 Thread INADA Naoki

Changes by INADA Naoki :


--
pull_requests: +431

___
Python tracker 

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



[issue29676] C method is not profiled by lsprof

2017-03-06 Thread INADA Naoki

Changes by INADA Naoki :


--
components: +Interpreter Core -Tests
title: verbose output of test_cprofile -> C method is not profiled by lsprof

___
Python tracker 

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



[issue9051] Improve pickle format for timezone aware datetime instances

2017-03-06 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


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



[issue29723] 3.6.1rc1 adds the current directory to sys.path when running a subdirectory's __main__.py; previous versions did not

2017-03-06 Thread Ned Deily

Ned Deily added the comment:

Thanks for the analysis, Eryk and Nick.  Then this sounds like a release 
blocker problem that should be fixed for 3.6.1.  Steve, can you take a look, 
please?

--
nosy: +steve.dower
priority: normal -> release blocker
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

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



[issue15954] No error checking after using of the wcsxfrm()

2017-03-06 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue29708] support reproducible Python builds

2017-03-06 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue29716] Python 3 Module doc still sounds like __init__.py is required

2017-03-06 Thread Brett Cannon

Brett Cannon added the comment:

I've gone ahead and closed this. Thanks for taking the time to check in on 
this, James!

--
nosy: +brett.cannon
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



[issue29691] Some tests fail in coverage Travis check

2017-03-06 Thread Brett Cannon

Brett Cannon added the comment:

The test_traceback changes should be easy to tweak to use a regex or 
startwith() check so the tests pass again.

For the test_xml_etree failures I'm not sure how best to fix that other than 
taking it out. Maybe if sys.gettrace() returns something then skip the test?

--
nosy: +brett.cannon

___
Python tracker 

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



[issue29691] Some tests fail in coverage Travis check

2017-03-06 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> brett.cannon

___
Python tracker 

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



[issue15954] No error checking after using of the wcsxfrm()

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.7 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue29691] Some tests fail in coverage Travis check

2017-03-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Is this a duplicate of issue29048?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29691] Some tests fail in coverage Travis check

2017-03-06 Thread Brett Cannon

Brett Cannon added the comment:

I don't think it's a duplicate because we had a passing coverage run when we 
initially made the migration so something got tweaked to lead to the failures.

--

___
Python tracker 

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



[issue29691] Some tests fail in coverage Travis check

2017-03-06 Thread Brett Cannon

Brett Cannon added the comment:

BTW, just because I assigned this to me doesn't mean others can't write a PR to 
solve this. :) I will review any PR that fixes this issue, I'm just going to 
make sure it gets solved no matter what if no one else creates a PR.

--

___
Python tracker 

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



[issue29691] Some tests fail in coverage Travis check

2017-03-06 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

I'll look into creating a PR when I have some time.

It would also be useful to tweak the Travis/coverage configuration so that it 
fails loudly if one of the tests doesn't pass in the coverage check.

--

___
Python tracker 

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



[issue29737] Optimize concatenating empty tuples

2017-03-06 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Since tuples are immutable, concatenating with empty tuple can be optimized by 
returning an opposite argument.

Microbenchmarks (the difference is larger for larger tuples):

$ ./python -m perf timeit --duplicate=100 -s 'a = (1, 2)' 'a + ()'
Unpatched:  Median +- std dev: 288 ns +- 12 ns
Patched:Median +- std dev: 128 ns +- 5 ns

$ ./python -m perf timeit --duplicate=100 -s 'a = (1, 2)' '() + a'
Unpatched:  Median +- std dev: 285 ns +- 16 ns
Patched:Median +- std dev: 128 ns +- 6 ns

Non-empty tuples are not affected:

$ ./python -m perf timeit --duplicate=100 -s 'a = (1, 2)' 'a + a'
Unpatched:  Median +- std dev: 321 ns +- 24 ns
Patched:Median +- std dev: 317 ns +- 26 ns

--
components: Interpreter Core
messages: 289129
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Optimize concatenating empty tuples
type: performance
versions: Python 3.7

___
Python tracker 

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



[issue29737] Optimize concatenating empty tuples

2017-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +432

___
Python tracker 

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



[issue29738] Fix memory leak in SSLSocket.getpeercert()

2017-03-06 Thread Olivier Vielpeau

New submission from Olivier Vielpeau:

The code snippet in #25569 reproduces the memory leak with Python 3.6.0 and 
2.7.13. The current memory leak is a regression that was introduced in #26470.

Going to attach a PR on github that fixes the issue shortly.

--
assignee: christian.heimes
components: SSL
messages: 289130
nosy: christian.heimes, olivielpeau
priority: normal
severity: normal
status: open
title: Fix memory leak in SSLSocket.getpeercert()
type: resource usage
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



[issue29738] Fix memory leak in SSLSocket.getpeercert()

2017-03-06 Thread Olivier Vielpeau

Changes by Olivier Vielpeau :


--
pull_requests: +433

___
Python tracker 

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



[issue29691] Some tests fail in coverage Travis check

2017-03-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The list of failing tests in issue29048 contains test_traceback and 
test_xml_etree. Thus this issue may be a part of issue29048. Some tests may be 
fixed since reporting issue29048.

--

___
Python tracker 

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



[issue29739] zipfile raises wrong exception for some incorrect passwords

2017-03-06 Thread Jack Cushman

New submission from Jack Cushman:

This bug arises when attempting to unzip a password-protected zipfile using the 
wrong password.

Usually when zipfile extraction is attempted with an incorrect password, 
zipfile raise `RuntimeError("Bad password for file")`. But for a small subset 
of passwords (about .4% of possible passwords), it instead raises 
`BadZipfile("Bad CRC-32 for file")`.

Attached is a script that attempts to decrypt a zip file using every 3-letter 
uppercase password. (This assumes you have first created the zip file, by 
running something like: `echo "stuff" > /tmp/foo.txt; zip -e -P password 
/tmp/foo.zip /tmp/foo.txt`.)

The specific passwords that trigger the wrong exception will vary each time the 
zip file is created. On my system, for a particular zip file, the result is 
this output:


BadZipFile b'ACB'
BadZipFile b'AMJ'
BadZipFile b'ASL'
BadZipFile b'AZV'
BadZipFile b'BCI'
BadZipFile b'BMV'
BadZipFile b'BQG'
BadZipFile b'BRB'
BadZipFile b'BYH'
BadZipFile b'CHU'
BadZipFile b'CTV'
BadZipFile b'DEF'
BadZipFile b'DHJ'
BadZipFile b'DSR'
BadZipFile b'EWG'
BadZipFile b'GOK'
BadZipFile b'GUK'
BadZipFile b'HGL'
BadZipFile b'HPV'
BadZipFile b'IAC'
BadZipFile b'IGQ'
BadZipFile b'IHG'
BadZipFile b'ILB'
BadZipFile b'IRJ'
BadZipFile b'JDW'
BadZipFile b'JIT'
BadZipFile b'JMK'
BadZipFile b'JPD'
BadZipFile b'JWL'
BadZipFile b'JXS'
BadZipFile b'KAR'
BadZipFile b'KKH'
BadZipFile b'LNW'
BadZipFile b'MEL'
BadZipFile b'NDY'
BadZipFile b'NFJ'
BadZipFile b'NLU'
BadZipFile b'NQU'
BadZipFile b'OXC'
BadZipFile b'PHA'
BadZipFile b'PQY'
BadZipFile b'QCN'
BadZipFile b'QFT'
BadZipFile b'QMB'
BadZipFile b'QWZ'
BadZipFile b'QYS'
BadZipFile b'RBR'
BadZipFile b'SKU'
BadZipFile b'SLG'
BadZipFile b'STU'
BadZipFile b'SUP'
BadZipFile b'UCD'
BadZipFile b'UOA'
BadZipFile b'UQM'
BadZipFile b'VAO'
BadZipFile b'VEQ'
BadZipFile b'VJW'
BadZipFile b'VVH'
BadZipFile b'WDA'
BadZipFile b'XCR'
BadZipFile b'XIY'
BadZipFile b'XLG'
BadZipFile b'YJA'
BadZipFile b'YMA'
BadZipFile b'YRB'
BadZipFile b'ZHT'
BadZipFile b'ZVJ'
BadZipFile b'ZWR'
BadZipFile b'ZZT'
69 out of 17576 passwords raise BadZipFile


Versions:

I reproduced this in Python 2.7.10 and 3.6.0, using a zip file created on Mac 
OS 10.12.3 with this zip version: 


$ zip --version
Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
This is Zip 3.0 (July 5th 2008), by Info-ZIP.
Compiled with gcc 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34) for Unix 
(Mac OS X) on Jul 30 2016.

--
components: Library (Lib)
files: fail.py
messages: 289132
nosy: jcushman
priority: normal
severity: normal
status: open
title: zipfile raises wrong exception for some incorrect passwords
type: behavior
versions: Python 2.7, Python 3.6
Added file: http://bugs.python.org/file46706/fail.py

___
Python tracker 

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



[issue29700] readline memory corruption when sys.stdin fd >= FD_SETSIZE for select()

2017-03-06 Thread Martin Panter

Martin Panter added the comment:

“Input9)” is probably a typo for “input()”.

In Python 2, sys.stdin etc are by default wrappers around ’s “stdin” 
etc, and can easily be wrappers around other  FILE objects, so the 
PyOS_Readline API and Python’s “readline” module pass these  objects 
directly to rl_instream etc.

In Python 3, sys.stdin etc are not directly related to  objects. But 
the PyOS_Readline API was not changed, and the “readline” module still uses the 
rl_instream API which requires a  FILE object. So the new code decides 
if it is reasonable to substitute  “stdin” etc objects for the Python 
“sys” objects.

--

___
Python tracker 

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



[issue29736] Optimize builtin types constructor

2017-03-06 Thread STINNER Victor

STINNER Victor added the comment:

> I would wait until constructors be converted to Argument Clinic. There are 
> ready patches for some of these builtin types, patches for other are in 
> proggress.

Do you have links for these changes? It's painful to search for Argument Clinic 
changes, the issue title doesn't say anything except "derby " :-/

--

___
Python tracker 

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



[issue29740] Visual C++ CRT security update from 14 June 2011

2017-03-06 Thread Markus

New submission from Markus:

In 14 June 2011 Microsoft released Visual C++ 2008 runtime MFC Security Update 
https://www.microsoft.com/en-us/download/details.aspx?id=26368

The Security Update also updates the CRT runtime (used by Python 2.7)

Without the security update, Python 2.7.13 uses vc90.crt 9.0.30729.4940
With the security  update, Python 2.7.13 uses vc90.crt 9.0.30729.6161
(Use e.g. Sysinternals procexp to see)

Why does Python not install the vc90.crt of the security update?

--
components: Build, Windows
messages: 289135
nosy: markuskramerIgitt, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Visual C++ CRT security update from 14 June 2011
type: security
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



  1   2   >