[issue26331] Tokenizer: allow underscores for grouping in numeric literals

2016-02-11 Thread Georg Brandl

Georg Brandl added the comment:

New patch matching revision of PEP.

--
Added file: http://bugs.python.org/file41892/numeric_underscores_v2.diff

___
Python tracker 

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



[issue23606] ctypes.util.find_library("c") no longer makes sense

2016-02-11 Thread Eryk Sun

Eryk Sun added the comment:

If the examples continue to use printf, then msvcrt.dll is the best option. The 
universal CRT exports a single Swiss-Army-knife function, 
__stdio_common_vfprintf, which requires 5 parameters, including a va_list for 
the variadic argument list. That's not appropriate for a tutorial. We just need 
a docs update to warn that msvcrt.dll has its own set of file descriptors, 
heap, and thread-locale state.

> Does it mean `cdll.msvcrt` is not the standard way to access 
> the C symbols anymore?

On a tangent, cdll.msvcrt shouldn't be recommended anywhere in the ctypes docs. 
All code that uses cdll.msvcrt shares the same restype, argtypes, and errcheck 
prototypes for each function pointer, which is an unholy mess. The docs should 
recommend CDLL('mscvrt') or CDLL('msvcrt', use_errno=True). Every module or 
package should use its own private instance of CDLL.

--

___
Python tracker 

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



[issue26337] Bypass imghdr module determines the type of image

2016-02-11 Thread Ramin Farajpour Cami

Changes by Ramin Farajpour Cami :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue25937] DIfference between utf8 and utf-8 when i define python source code encoding.

2016-02-11 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

Serhiy: Removing the shortcut would slow down the tokenizer a lot since UTF-8 
encoded source code is the norm, not the exception.

The "problem" here is that the tokenizer trusts the source code in being in the 
correct encoding when you use one of utf-8 or iso-8859-1 and then skips the 
usual "decode into unicode, then encode to utf-8" step.

>From a purist point of view, you are right, Python should always pass through 
>those steps to detect encoding errors, but from a practical point of view, I 
>think the optimization is fine.

--

___
Python tracker 

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



[issue26337] Bypass imghdr module determines the type of image

2016-02-11 Thread Steven D'Aprano

Steven D'Aprano added the comment:

I'm sorry, I don't understand what you think is the bug here. It looks like you 
are passing a corrupted file which has a PNG extension but is not actually a 
PNG file (it contains PHP code). What do you expect should happen?

--
nosy: +steven.daprano

___
Python tracker 

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



[issue26279] time.strptime does not properly convert out-of-bounds values

2016-02-11 Thread Ned Deily

Ned Deily added the comment:

Make that Issue23718

--
superseder: PEP 475: port test_eintr to Windows -> strptime() can produce 
invalid date with negative year day

___
Python tracker 

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



[issue23718] strptime() can produce invalid date with negative year day

2016-02-11 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +iaslan

___
Python tracker 

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



[issue26279] time.strptime does not properly convert out-of-bounds values

2016-02-11 Thread Ned Deily

Ned Deily added the comment:

Thanks for the report.  Closing this issue as a duplicate of Issue23719.

--
nosy: +ned.deily
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> PEP 475: port test_eintr to Windows

___
Python tracker 

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



[issue26339] Python rk0.3b1 KeyError: 'config_argparse_rel_path'

2016-02-11 Thread sherpa

New submission from sherpa:

Hi,
we use python 2.7.3 on Linux SuSe Enterprise 11 x86 64 bits.
After installing the python module rk0.3b1, we have this error when rk parse 
the configuration file: KeyError: 'config_argparse_rel_path' after this 
function dict.__getitem__(self, key)

You will find below the debugger trace:

# python -m pdb /opt/python-2.7.3/bin/rk

> /opt/python-2.7.3/bin/rk(3)()

-> __requires__ = 'rk==0.3b1'

(Pdb) cont

Traceback (most recent call last):

  File "/opt/python-2.7.3/lib/python2.7/pdb.py", line 1314, in main

pdb._runscript(mainpyfile)

  File "/opt/python-2.7.3/lib/python2.7/pdb.py", line 1233, in _runscript

self.run(statement)

  File "/opt/python-2.7.3/lib/python2.7/bdb.py", line 387, in run

exec cmd in globals, locals

  File "", line 1, in 

  File "/opt/python-2.7.3/bin/rk", line 3, in 

__requires__ = 'rk==0.3b1'

  File "build/bdist.linux-x86_64/egg/rk/rk.py", line 253, in main

create_dictionaries()

  File "build/bdist.linux-x86_64/egg/rk/rk.py", line 25, in create_dictionaries

config_argparse_rel_path = config["config_argparse_rel_path"]

  File "/opt/python-2.7.3/lib/python2.7/site-packages/configobj.py", line 554, 
in __getitem__

val = dict.__getitem__(self, key)

KeyError: 'config_argparse_rel_path'

Uncaught exception. Entering post mortem debugging

Running 'cont' or 'step' will restart the program

> /opt/python-2.7.3/lib/python2.7/site-packages/configobj.py(554)__getitem__()

-> val = dict.__getitem__(self, key)

(Pdb)

--
components: Installation
files: pdb_rk0.3b1.txt
messages: 260109
nosy: sherpa
priority: normal
severity: normal
status: open
title: Python rk0.3b1 KeyError: 'config_argparse_rel_path'
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file41899/pdb_rk0.3b1.txt

___
Python tracker 

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



[issue15068] fileinput requires two EOF when reading stdin

2016-02-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ping.

--

___
Python tracker 

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



[issue26086] Bug in os module

2016-02-11 Thread Steven D'Aprano

Steven D'Aprano added the comment:

I don't see any conclusive evidence that this is a bug in the Python 
interpreter, so I'm going to close the issue.

Hana, if you are still having this problem, please join the main python mailing 
list https://mail.python.org/mailman/listinfo/python-list or newsgroup 
comp.lang.python, and we should be able to help you there. (But please don't 
post screen shots, copy and paste the text of the exception into your message.)

--
nosy: +steven.daprano
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue26338] remove duplicate bind addresses in create_server

2016-02-11 Thread Sebastien Bourdeauducq

New submission from Sebastien Bourdeauducq:

https://github.com/python/asyncio/issues/315

New patch attached.

--
components: asyncio
files: asyncio_norebind.diff
keywords: patch
messages: 260108
nosy: gvanrossum, haypo, sebastien.bourdeauducq, yselivanov
priority: normal
severity: normal
status: open
title: remove duplicate bind addresses in create_server
versions: Python 3.5
Added file: http://bugs.python.org/file41898/asyncio_norebind.diff

___
Python tracker 

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



[issue26342] Faster bit ops for single-digit positive longs

2016-02-11 Thread Yury Selivanov

New submission from Yury Selivanov:

This patch implements a fast path for &, |, and ^ bit operations for 
single-digit positive longs.  We already have fast paths for ~, and pretty much 
every other long op.


-m timeit -s "x=21827623" "x&2;x&2;x&2;x&333;x&3;x&3;x&;x&4"
with patch: 0.181  without patch: 0.403


-m timeit -s "x=21827623" "x|21222;x|23;x|2;x|333;x|3;x|3;x|;x|4"
with patch: 0.241  without patch: 0.342


-m timeit -s "x=21827623" "x^21222;x^23;x^2;x^333;x^3;x^3;x^;x^4"
with patch: 0.241  without patch: 0.332

--
assignee: yselivanov
components: Interpreter Core
files: fast_bits.patch
keywords: patch
messages: 260126
nosy: haypo, mark.dickinson, serhiy.storchaka, yselivanov
priority: normal
severity: normal
stage: patch review
status: open
title: Faster bit ops for single-digit positive longs
type: performance
Added file: http://bugs.python.org/file41901/fast_bits.patch

___
Python tracker 

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



[issue26341] Implement free-list for single-digit longs

2016-02-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This looks as a duplicate of issue24165.

--

___
Python tracker 

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



[issue24165] Free list for single-digits ints

2016-02-11 Thread Yury Selivanov

Yury Selivanov added the comment:

I think that we only need to add free-list for 1-digit longs.  Please see my 
patch & explanation in issue #26341.

--
nosy: +yselivanov

___
Python tracker 

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



[issue26341] Implement free-list for single-digit longs

2016-02-11 Thread Yury Selivanov

New submission from Yury Selivanov:

The attached patch implements a free-list for single-digit longs.  We already 
have free lists for many fundamental types, such as floats & unicode.

The patch improves performance in micro-benchmarks by 10-20%.  It'll also 
lessen memory fragmentation issues.


== Benchmarks ==

### spectral_norm ###
Min: 0.268018 -> 0.245042: 1.09x faster
Avg: 0.289548 -> 0.257861: 1.12x faster
Significant (t=18.82)
Stddev: 0.01004 -> 0.00640: 1.5680x smaller

-m timeit -s "loops=tuple(range(1000))" "for x in loops: x+x"
with patch: 34.5 usec   without patch: 45.9 usec


== Why only single-digit? ==

I've also a patch that implements free-lists for 1-digit, 2-digits and 3-digits 
longs, and collects statistics on them.  It looks like we only want to optimize 
1-digit longs:

* 2to3 benchmark (the first number is the number of all N-digit longs, the 
second number is the number of longs created via free-list):

===> d1_longs = 142384 124759
===> d2_longs = 6872 6264
===> d3_longs = 2907 2834

* richards:
===> d1_longs = 219630 219033
===> d2_longs = 1455 1096
===> d3_longs = 630 627

* spectral_norm:
===> d1_longs = 133928432 133927838
===> d2_longs = 1471 1113
===> d3_longs = 630 627

--
assignee: yselivanov
components: Interpreter Core
files: long_fl.patch
keywords: patch
messages: 260124
nosy: haypo, mark.dickinson, serhiy.storchaka, yselivanov
priority: normal
severity: normal
stage: patch review
status: open
title: Implement free-list for single-digit longs
type: performance
versions: Python 3.6
Added file: http://bugs.python.org/file41900/long_fl.patch

___
Python tracker 

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



[issue24165] Free list for single-digits ints

2016-02-11 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



[issue24165] Free list for single-digits ints

2016-02-11 Thread Yury Selivanov

Yury Selivanov added the comment:

> Did you test on platform with 30-bit digits?

Yes.

> Could you repeat my microbenchmarks from msg242919?

Sure. With your patches or with mine from issue #26341?

--

___
Python tracker 

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



[issue24712] Docs page's sidebar vibrates on mouse wheel scroll on Chrome.

2016-02-11 Thread Mike Taylor

Mike Taylor added the comment:

Great, thanks Ezio! Will take a stab now.

--

___
Python tracker 

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



[issue26341] Implement free-list for single-digit longs

2016-02-11 Thread Yury Selivanov

Yury Selivanov added the comment:

You're right Serhiy, closing this one.

--
resolution:  -> duplicate
superseder:  -> Free list for single-digits ints

___
Python tracker 

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



[issue24165] Free list for single-digits ints

2016-02-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Did you test on platform with 30-bit digits? I tested with 15-bit digits.

Could you repeat my microbenchmarks from msg242919?

--

___
Python tracker 

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



[issue24165] Free list for single-digits ints

2016-02-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

With all three patches if you want (I don't expect a difference between your 
patch and my single-digit patch).

--

___
Python tracker 

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



[issue26341] Implement free-list for single-digit longs

2016-02-11 Thread Yury Selivanov

Changes by Yury Selivanov :


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



[issue26312] Raise SystemError on programmical errors in PyArg_Parse*()

2016-02-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c7eff18f3840 by Serhiy Storchaka in branch 'default':
Issue #26312: SystemError is now raised in all programming bugs with using
https://hg.python.org/cpython/rev/c7eff18f3840

--
nosy: +python-dev

___
Python tracker 

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



[issue26325] Add helper to check that no ResourceWarning is emitted

2016-02-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue26200] SETREF adds unnecessary work in some cases

2016-02-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Py_SETREF() is used not only for fixing possible bugs. It can make the correct 
code shorter and cleaner. For example Stephan appreciated this in df78978dacab. 
In most case the difference between Py_DECREF and Py_XDECREF looks negligible.

Most of the SETREFs in the next() functions in the itertools module replace 
Py_CLEAR and therefore don't add additional overhead (but may fix possible 
bugs). The only Py_DECREF were replaced in tee_next() and accumulate_next(). 
But they are used not in tight loop. Py_SETREF in tee_next() is executed only 
for every 57th call. It unlikely causes any measurable degradation. Py_SETREF 
in accumulate_next() is used together with calling PyIter_Next and 
PyNumber_Add() or PyObject_CallFunctionObjArgs() which takes much more time.

In any case it would be nice to see any measurements that show a degradation.

--

___
Python tracker 

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



[issue26328] shutil._copyxattr() function shouldn't fail if setting security.selinux xattr fails

2016-02-11 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +tarek

___
Python tracker 

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



[issue26337] Bypass imghdr module determines the type of image

2016-02-11 Thread Ramin Farajpour Cami

Ramin Farajpour Cami added the comment:

images can be served with a content type of text/html,(which means we can 
certainly inject HTML).

--

___
Python tracker 

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



[issue26325] Add helper to check that no ResourceWarning is emitted

2016-02-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e9a4b30e3e43 by Serhiy Storchaka in branch '3.5':
Issue #26325: Added test.support.check_no_resource_warning() to check that
https://hg.python.org/cpython/rev/e9a4b30e3e43

New changeset faf676d8c054 by Serhiy Storchaka in branch 'default':
Issue #26325: Added test.support.check_no_resource_warning() to check that
https://hg.python.org/cpython/rev/faf676d8c054

--
nosy: +python-dev

___
Python tracker 

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



[issue25985] Use sys.version_info instead of sys.version

2016-02-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue26337] Bypass imghdr module determines the type of image

2016-02-11 Thread Ramin Farajpour Cami

Ramin Farajpour Cami added the comment:

In normal if you choose a image and open image with editor set codes to image 
you get error , but I able to bypass image for upload if I use module imghdr 
for check valid image , booom upload image with malicious code ,

--

___
Python tracker 

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



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-02-11 Thread Marco Buttu

Marco Buttu added the comment:

I added the PyErr_WarnEx(PyExc_DeprecationWarning, ...) in Python/ast.c, right 
below the check for None, True and False as names. Running the following test 
the message is properly printed:

def test_async(self):
with self.assertWarnsRegex(DeprecationWarning, "reserved keyword"):
async = 33

However, the test does not pass, because the DeprecationWarning is not 
triggered. I am sorry but as a cpython beginner I can not figure out how to 
solve the problem, so I hope someone else can find the time to do it

--

___
Python tracker 

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



[issue26312] Raise SystemError on programmical errors in PyArg_Parse*()

2016-02-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

SystemError is not new exception. It could be raised on other programming bugs. 
In any case I doesn't expect that anybody catches such exceptions.

--

___
Python tracker 

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



[issue25994] File descriptor leaks in os.scandir()

2016-02-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f98ed0616d07 by Serhiy Storchaka in branch 'default':
Issue #25994: Added the close() method and the support of the context manager
https://hg.python.org/cpython/rev/f98ed0616d07

--
nosy: +python-dev

___
Python tracker 

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



[issue25995] os.walk() consumes a lot of file descriptors

2016-02-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e951d76f1945 by Serhiy Storchaka in branch '3.5':
Issue #25995: os.walk() no longer uses FDs proportional to the tree depth.
https://hg.python.org/cpython/rev/e951d76f1945

New changeset 6197a09a56b1 by Serhiy Storchaka in branch 'default':
Issue #25995: os.walk() no longer uses FDs proportional to the tree depth.
https://hg.python.org/cpython/rev/6197a09a56b1

--
nosy: +python-dev

___
Python tracker 

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



[issue25994] File descriptor leaks in os.scandir()

2016-02-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Committed with using the helper from issue26325 for testing.

Thank you all for your reviews, especially for help with the documentation.

--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-11 Thread STINNER Victor

STINNER Victor added the comment:

I'm working on the OpenStack project and iso8601 is heavily used.


> Otherwise, py8601 (https://bitbucket.org/micktwomey/pyiso8601/) looks pretty 
> popular and well maintained (various committers, started in 2012, last commit 
> in 2016).

I don't think that we should add the iso8601 module to the stdlib, but merge 
iso8601 "features" into the datetime module.

The iso8601 module supports Python 2.7 and so has to implement its own timezone 
classes. The datetime module now has datetime.timezone since Python 3.2 for 
fixed timezone.

The iso8601 module provides functions. I would prefer datetime.datetime 
*methods*.

Would you mind to try to implement that? It would be kind to contact iso8601 
author before.

The important part is also unit tests.

--
nosy: +haypo

___
Python tracker 

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



[issue26331] Tokenizer: allow underscores for grouping in numeric literals

2016-02-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch implements strict underscore rules. The implementation is not 
more complex.

--
Added file: http://bugs.python.org/file41893/numeric_underscores_strict.patch

___
Python tracker 

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



[issue24916] In sysconfig, don't rely on sys.version format

2016-02-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Most changes were committed in issue25985. Only _PY_VERSION is left. I have no 
strong opinion about this, but +0 for keeping "+".

--

___
Python tracker 

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



[issue25994] File descriptor leaks in os.scandir()

2016-02-11 Thread STINNER Victor

STINNER Victor added the comment:

> Committed with using the helper from issue26325 for testing.

Great! Good job.

--

___
Python tracker 

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



[issue25985] Use sys.version_info instead of sys.version

2016-02-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 935d7804d1be by Serhiy Storchaka in branch 'default':
Issue #25985: sys.version_info is now used instead of sys.version
https://hg.python.org/cpython/rev/935d7804d1be

--
nosy: +python-dev

___
Python tracker 

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



[issue26312] Raise SystemError on programmical errors in PyArg_Parse*()

2016-02-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks for your review.

--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed

___
Python tracker 

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



[issue25596] Use scandir() to speed up the glob module

2016-02-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patch is completed now. The with statement is used to avoid FD leaks.

--
Added file: http://bugs.python.org/file41895/glob_scandir_5.patch

___
Python tracker 

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-11 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

So, shall we include it ? Otherwise, py8601 
(https://bitbucket.org/micktwomey/pyiso8601/) looks pretty popular and well 
maintained (various committers, started in 2012, last commit in 2016).
I think we should hurry, that's a great shame it has been while Python is able 
to generate a 8601 datetime but not parsing it back.

--
nosy: +deronnax

___
Python tracker 

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



[issue26331] Tokenizer: allow underscores for grouping in numeric literals

2016-02-11 Thread Georg Brandl

Georg Brandl added the comment:

New patch with minimal doc updates.

--
Added file: http://bugs.python.org/file41896/numeric_underscores_v4_full.diff

___
Python tracker 

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



[issue25264] test_marshal always crashs on "AMD64 Windows10 2.7" buildbot

2016-02-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
priority: high -> critical

___
Python tracker 

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



[issue19543] Add -3 warnings for codec convenience method changes

2016-02-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Is there something left to do with this issue?

--

___
Python tracker 

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



[issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows

2016-02-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

New tests emit deprecation warnings on Windows and failed.

http://buildbot.python.org/all/builders/AMD64%20Windows8%203.x/builds/1753/steps/test/logs/stdio
test_rmdir_on_directory_link_to_missing_target (test.test_os.Win32SymlinkTests) 
... D:\buildarea\3.x.bolen-windows8\build\lib\os.py:447: DeprecationWarning: 
The Windows bytes API has been deprecated, use Unicode filenames instead
  for name in listdir(dir):
D:\buildarea\3.x.bolen-windows8\build\lib\os.py:441: DeprecationWarning: The 
Windows bytes API has been deprecated, use Unicode filenames instead
  return path.isdir(self.path)
D:\buildarea\3.x.bolen-windows8\build\lib\ntpath.py:249: DeprecationWarning: 
The Windows bytes API has been deprecated, use Unicode filenames instead
  st = os.lstat(path)
D:\buildarea\3.x.bolen-windows8\build\lib\test\test_os.py:2688: 
DeprecationWarning: The Windows bytes API has been deprecated, use Unicode 
filenames instead
  func(name, *func_args)
D:\buildarea\3.x.bolen-windows8\build\lib\unittest\case.py:176: 
DeprecationWarning: The Windows bytes API has been deprecated, use Unicode 
filenames instead
  callable_obj(*args, **kwargs)
D:\buildarea\3.x.bolen-windows8\build\lib\test\test_os.py:1881: 
DeprecationWarning: The Windows bytes API has been deprecated, use Unicode 
filenames instead
  sorted(os.listdir(path)),
D:\buildarea\3.x.bolen-windows8\build\lib\test\test_os.py:1867: 
DeprecationWarning: The Windows bytes API has been deprecated, use Unicode 
filenames instead
  sorted(os.listdir(os.fsencode(support.TESTFN))),
test test_os failed
skipped 'currently fails; consider for improvement'

==
FAIL: test_walk_bottom_up (test.test_os.BytesWalkTests)
--
Traceback (most recent call last):
  File "D:\buildarea\3.x.bolen-windows8\build\lib\test\test_os.py", line 894, 
in test_walk_bottom_up
self.sub2_tree)
AssertionError: Tuples differ: ('@test_4312_tmp\\TEST1\\SUB2', ['broken_link', 
'link'], ['tmp3']) != ('@test_4312_tmp\\TEST1\\SUB2', ['link'], ['broken_link', 
'tmp3'])

First differing element 1:
['broken_link', 'link']
['link']

- ('@test_4312_tmp\\TEST1\\SUB2', ['broken_link', 'link'], ['tmp3'])
? --

+ ('@test_4312_tmp\\TEST1\\SUB2', ['link'], ['broken_link', 'tmp3'])
? ++


==
FAIL: test_walk_prune (test.test_os.BytesWalkTests)
--
Traceback (most recent call last):
  File "D:\buildarea\3.x.bolen-windows8\build\lib\test\test_os.py", line 874, 
in test_walk_prune
self.assertEqual(all[1], self.sub2_tree)
AssertionError: Tuples differ: ('@test_4312_tmp\\TEST1\\SUB2', ['broken_link', 
'link'], ['tmp3']) != ('@test_4312_tmp\\TEST1\\SUB2', ['link'], ['broken_link', 
'tmp3'])

First differing element 1:
['broken_link', 'link']
['link']

- ('@test_4312_tmp\\TEST1\\SUB2', ['broken_link', 'link'], ['tmp3'])
? --

+ ('@test_4312_tmp\\TEST1\\SUB2', ['link'], ['broken_link', 'tmp3'])
? ++

Proposed patch should silence warnings. Could anyone please test it on Windows?

--
status: closed -> open
Added file: http://bugs.python.org/file41897/test_walk_bytes_deprecate.patch

___
Python tracker 

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



[issue25911] Regression: os.walk now using os.scandir() breaks bytes filenames on windows

2016-02-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution: fixed -> 
stage: resolved -> patch review

___
Python tracker 

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



[issue26214] textwrap should minimize number of breaks in extra long words

2016-02-11 Thread Steven D'Aprano

Changes by Steven D'Aprano :


--
nosy: +steven.daprano

___
Python tracker 

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



[issue26002] make statistics.median_grouped more efficient

2016-02-11 Thread Steven D'Aprano

Steven D'Aprano added the comment:

Looks good to me.

I've run some quick timing tests, and for very small lists, there's no 
significant difference, but for larger lists I'm getting up to a 50% speedup. 
Nicely done, thank you.

--

___
Python tracker 

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



[issue26317] Build Problem with GCC + Macintosh OS X 10.11 El Capitain

2016-02-11 Thread Ronald Oussoren

Ronald Oussoren added the comment:

The makefiles use CC throughout and don't look at and OBJC variable. Is that 
variable a standard way to specify an ObjC compiler in makefiles? 

Make's default ruleset for compiling .m files uses $(CC) and doesn't look at 
$(OBJC).

I wouldn't be opposed to a patch that makes it possible to specify an ObjC 
compiler, could you write such a patch?  BTW. The patch should also update the 
autoconf script (use AC_PROG_OBJC).

--
components: +Macintosh
nosy: +ned.deily

___
Python tracker 

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



[issue26315] Optimize mod division for ints

2016-02-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 37bacf3fa1f5 by Yury Selivanov in branch 'default':
Issues #26289 and #26315: Optimize floor/modulo div for single-digit longs
https://hg.python.org/cpython/rev/37bacf3fa1f5

--
nosy: +python-dev

___
Python tracker 

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



[issue26289] Optimize floor division for ints

2016-02-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 37bacf3fa1f5 by Yury Selivanov in branch 'default':
Issues #26289 and #26315: Optimize floor/modulo div for single-digit longs
https://hg.python.org/cpython/rev/37bacf3fa1f5

--
nosy: +python-dev

___
Python tracker 

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



[issue26315] Optimize mod division for ints

2016-02-11 Thread Yury Selivanov

Changes by Yury Selivanov :


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



[issue26289] Optimize floor division for ints

2016-02-11 Thread Yury Selivanov

Yury Selivanov added the comment:

Committed.  Thank you Serhiy, Mark and Victor for helping with the patch!

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



[issue26343] os.O_CLOEXEC not available on OS X

2016-02-11 Thread STINNER Victor

STINNER Victor added the comment:

What is __DARWIN_C_LEVEL? Are we supposed to define it directly? Or is it 
defined from other #define in features.h?

--

___
Python tracker 

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-11 Thread STINNER Victor

STINNER Victor added the comment:

See also #12006 for ISO 8601: "The datetime.strftime() and date.strftime() 
methods now support ISO 8601 date directives %G, %u and %V. (Contributed by 
Ashley Anderson in issue 12006.)".

--

___
Python tracker 

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



[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Wolfgang Richter

Changes by Wolfgang Richter :


--
versions: +Python 3.5

___
Python tracker 

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



[issue26345] Extra newline appended to UTF-8 strings on Windows

2016-02-11 Thread Egor Tensin

New submission from Egor Tensin:

I've come across an issue of Python 3.5.1 appending an extra newline when 
print()ing non-ASCII strings on Windows.

This only happens when the active "code page" is set UTF-8 in cmd.exe:

>chcp
Active code page: 65001

Now, if I try to print an ASCII character (e.g. LATIN CAPITAL LETTER A), 
everything works fine:

>python -c "print(chr(0x41))"
A

>

But if I try to print something a little less common (GREEK CAPITAL LETTER 
ALPHA), something weird happens:

>python -c "print(chr(0x391))"
Α


>

For another example, let's try to print CYRILLIC CAPITAL LETTER A:

>python -c "print(chr(0x410))"
А


>

This only happens if the current code page is UTF-8 though.
If I change it to something that can represent those characters, everything 
seems to be working fine.
For example, the Greek letter:

>chcp 1252
Active code page: 1253

>python -c "print(chr(0x391))"
Α

>

And the Cyrillic letter:

>chcp 1251
Active code page: 1251

>python -c "print(chr(0x410))"
А

>

This also happens if one tries to print a string with a funny character 
somewhere in it. Sometimes it's even worse:

>python -c "print('Привет!')"
Привет!
�т!


>

Look, guys, I know what a mess Unicode handling on Windows is, and I'm not even 
sure it's Python's fault, I just wanted to make sure I'm not delusional and not 
making stuff up.
Can somebody at least confirm this? Thank you.

I'm using x86-64 version of Python 3.5.1 on Windows 8.1.

--
components: Unicode, Windows
messages: 260153
nosy: Egor Tensin, ezio.melotti, haypo, paul.moore, steve.dower, tim.golden, 
zach.ware
priority: normal
severity: normal
status: open
title: Extra newline appended to UTF-8 strings on Windows
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue24165] Free list for single-digits ints

2016-02-11 Thread Yury Selivanov

Yury Selivanov added the comment:

I also ran benchmarks.  For me, django was 1% faster, telco 5% slower, and the 
rest were the same.  telco is a decimal benchmarks (ints aren't used there), 
and django/chameleon are unicode concatenation benchmarks.

I can see improvements in micro benchmarks, but even more importantly, Serhiy's 
patch reduces memory fragmentations.  99% of all long allocations are coming 
from freelist when it's there.

--

___
Python tracker 

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



[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Brett Cannon

Brett Cannon added the comment:

I'm at work and so I don't have access to tar on this machine ATM, so I can't 
look at your code example. But sys.meta_path might be one level above what you 
want; you might be looking for sys.path_hooks since 
https://docs.python.org/3/library/importlib.html#importlib.machinery.PathFinder 
is what searches entries on sys.path. This also means that if you don't put 
your finder on sys.meta_path before importlib.machinery.PathFinder then it will 
never pick up a directory since any directory will always be viewed as a 
namespace package by that meta path finder.

--

___
Python tracker 

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



[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Brett Cannon

Brett Cannon added the comment:

As I said, I can't look at your code unless you upload the file separately so I 
don't know how much help I can be. Did you check sys.modules to make sure the 
directory had not already been imported or sys.path_importer_cache to make sure 
the directory didn't already have a finder associated with it? I know 
sys.meta_path isn't bypassed as that's how the builtin and frozen importer work.

And have you tried this in a newer version of Python? 3.4 is no longer 
receiving bugfixes so even if there is a problem there it won't be changed. And 
you should try and use 
https://docs.python.org/3/library/importlib.html#importlib.util.find_spec 
instead of find_loader().

--

___
Python tracker 

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



[issue26200] SETREF adds unnecessary work in some cases

2016-02-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

It may just be me, but I find the code the be less readable.  The presence of 
the SETREFs in the itertools modules makes it harder for me to count and track 
all the references to make sure the code is correct.  For me, it is an obstacle 
to maintenance.

The itertools code was carefully thought-out, reviewed, clear (at least to its 
creator and maintainer), and finely tuned.   It has been stable for a very long 
time and I don't think it should have been changed.

The module was designed for high-performance and I'm opposed to adding 
unnecessary work.  As you know, these kind of things are very difficult to run 
timings on, but it is clear to both of us that the wholesale replacement of 
Py_DECREF with Py_XDECREF adds unnecessary load to the Branch Target Buffer and 
to the I-cache.  In general, unnecessary work is always a step in the wrong 
direction, particularly in a module designed for performance.

Another occasional issue with the SETREF macro is that gets it the way of 
trying to defer all decrefs until as late as possible in a function call.  The 
LRU cache is a example of a place where we want to bring the whole data 
structure into a coherent state prior to any of the decrefs (I even have to do 
that in the pure python lru cache code to guard against premature re-entrancy).

As the creator and principal maintainer of itertools, I'm stating a very strong 
preference to restore the code in the next() methods.

Please don't make this hard for me (When one of the most experienced of the 
active developers states a strong code preference and gives the reasons for it, 
there shouldn't have to be struggle to get it done).

--

___
Python tracker 

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



[issue26200] SETREF adds unnecessary work in some cases

2016-02-11 Thread Stefan Krah

Stefan Krah added the comment:

As Serhiy mentioned, I'm really happy with the Py_SETREF() macro and I 
understand the reasons why it was applied so broadly.

But if a module maintainer prefers not to change existing (and
correct) code, then that should have priority (also, the existing
version was quite readable).

--
nosy: +skrah

___
Python tracker 

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



[issue24165] Free list for single-digits ints

2016-02-11 Thread Yury Selivanov

Yury Selivanov added the comment:

Best of 5s:

-m timeit -s "r = range(10**4)" -- "for i in r: pass"
orig: 239 usec
my patch: 148
int_free_list_2: 151
int_free_list_multi: 156


-m timeit -s "r = range(10**5)" -- "for i in r: pass"
orig: 2.4 msec
my patch: 1.47
int_free_list_2: 1.53
int_free_list_multi: 1.57


-m timeit -s "a = list(range(10**4))" -- "for i, x in enumerate(a): pass"
orig: 416 usec
my: 314
int_free_list_2: 314
int_free_list_multi: 317


-m timeit -s "a = list(range(10**5))" -- "for i, x in enumerate(a): pass"
orig: 4.1 msec
my: 3.13
int_free_list_2: 3.14
int_free_list_multi: 3.13


-m timeit -s "from base64 import b85encode; a = bytes(range(256))*100" -- 
"b85encode(a)"
orig: 3.49 msec
my: 3.28
int_free_list_2: 3.30
int_free_list_multi: 3.31


-m timeit -s "loops=tuple(range(1000))" "for x in loops: x+x"
orig: 44.4 usec
my: 35.2
int_free_list_2: 35.4
int_free_list_multi: 35.5


spectral_norm (against default):
my: 1.12x faster
int_free_list_2: 1.12x faster
int_free_list_multi: 1.12x faster


==

All in all, all patches show the same performance improvement.  I guess we can 
go with int_free_list_multi.

--

___
Python tracker 

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



[issue26343] os.O_CLOEXEC not available on OS X

2016-02-11 Thread Gustavo Goretkin

Gustavo Goretkin added the comment:

It looks like cpython will check to see if O_CLOEXEC is #defined. 

In my system's /usr/include/sys/fcntl.h

#if __DARWIN_C_LEVEL >= 200809L
#define O_CLOEXEC   0x100   /* implicitly set FD_CLOEXEC */
#endif

--

___
Python tracker 

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



[issue26323] Add a assert_called() method for mock objects

2016-02-11 Thread Amit Saha

Amit Saha added the comment:

Please take a look at the attached patch.

--
keywords: +patch
Added file: http://bugs.python.org/file41903/issue26323.patch

___
Python tracker 

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



[issue26323] Add a assert_called() method for mock objects

2016-02-11 Thread Amit Saha

Amit Saha added the comment:

Fixed the test name

--
Added file: http://bugs.python.org/file41904/issue26323.patch

___
Python tracker 

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



[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Wolfgang Richter

Wolfgang Richter added the comment:

Brett thanks for the very quick response.

I've inserted my finder as the first element in sys.meta_path.

I also overrode the @classmethod find_loader, but it doesn't appear that it's 
being called.

--

___
Python tracker 

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



[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Wolfgang Richter

Wolfgang Richter added the comment:

Sure Brett I'll upload the code separately in an hour or two.

I've overridden all the publicly exposed functions (including find_spec).

I wanted to initially see if anything was passing through my finder in the 
first position of the meta_path.

--

___
Python tracker 

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



[issue24165] Free list for single-digits ints

2016-02-11 Thread STINNER Victor

STINNER Victor added the comment:

I ran perf.py on long_fl.patch of issue #26341. It looks slower and has no 
impact on such macro benchmark.

~/bin/taskset_isolated.py time python3 -u perf.py --rigorous 
../default/python.orig ../default/python_long_fl

# python rev 37bacf3fa1f5

Report on Linux smithers 4.3.4-300.fc23.x86_64 #1 SMP Mon Jan 25 13:39:23 UTC 
2016 x86_64 x86_64
Total CPU cores: 8

### chameleon_v2 ###
Min: 5.660445 -> 5.809548: 1.03x slower
Avg: 5.707313 -> 5.851431: 1.03x slower
Significant (t=-31.76)
Stddev: 0.03655 -> 0.02690: 1.3585x smaller

### json_dump_v2 ###
Min: 2.745682 -> 2.819627: 1.03x slower
Avg: 2.769530 -> 2.838116: 1.02x slower
Significant (t=-42.78)
Stddev: 0.01019 -> 0.01238: 1.2147x larger

### regex_v8 ###
Min: 0.041680 -> 0.041081: 1.01x faster
Avg: 0.042383 -> 0.041265: 1.03x faster
Significant (t=6.49)
Stddev: 0.00122 -> 0.00121: 1.0077x smaller

The following not significant results are hidden, use -v to show them:
2to3, django_v3, fastpickle, fastunpickle, json_load, nbody, tornado_http.

--

___
Python tracker 

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



[issue26200] SETREF adds unnecessary work in some cases

2016-02-11 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



[issue26343] os.O_CLOEXEC not available on OS X

2016-02-11 Thread Gustavo Goretkin

New submission from Gustavo Goretkin:

I am on OS X 10.9.5

Python 3.5.1 (v3.5.1:37a07cee5969, Dec  5 2015, 21:12:44) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.O_CLOEXEC
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: module 'os' has no attribute 'O_CLOEXEC'

I checked on my system
$ man 2 open | grep CLOEXEC
   O_CLOEXEC   mark as close-on-exec
 The O_CLOEXEC flag causes the file descriptor to be marked as close-on-
 exec, setting the FD_CLOEXEC flag.  The state of the file descriptor

I first noticed this on an anaconda distribution of python, but it looks like 
it is also present on the 3.5 .dmg file on https://www.python.org/downloads/

--
components: Macintosh
messages: 260135
nosy: Gustavo Goretkin, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: os.O_CLOEXEC not available on OS X
versions: Python 3.5

___
Python tracker 

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



[issue26343] os.O_CLOEXEC not available on OS X

2016-02-11 Thread Ronald Oussoren

Ronald Oussoren added the comment:

The lack of o_cloexec could be caused by the SDK used to build the binary 
installer. AFAIK _DARWIN_C_LEVEL is set automatically based on the deployment 
target. 

Ronald

Sent from my iPad

> On 11 feb. 2016, at 23:44, STINNER Victor  wrote:
> 
> 
> STINNER Victor added the comment:
> 
> What is __DARWIN_C_LEVEL? Are we supposed to define it directly? Or is it 
> defined from other #define in features.h?
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue26292] Raw I/O writelines() broken for non-blocking I/O

2016-02-11 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Raw I/O writelines() broken -> Raw I/O writelines() broken for 
non-blocking I/O

___
Python tracker 

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



[issue26342] Faster bit ops for single-digit positive longs

2016-02-11 Thread STINNER Victor

STINNER Victor added the comment:

fast_bits.patch LGTM. But it would be better to have at least two reviews.

--

___
Python tracker 

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



[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Wolfgang Richter

New submission from Wolfgang Richter:

My understanding of `sys.meta_path` is that it is supposed to allow customized 
loading of Python modules and packages.

In fact the `importlib` machinery appears to have support for identifying 
packages with `__init__` files with non-standard suffixes:

https://github.com/python/cpython/blob/master/Lib/importlib/_bootstrap_external.py#L645

https://github.com/python/cpython/blob/master/Lib/importlib/_bootstrap_external.py#L1233

However, I find that when I `import wolftest` inside a folder with structure:

./
/wolftest
/__init__.wolf
/something.wolf

None of my sys.meta_path finders are called at all, and instead a namespace is 
returned.

I was wondering why the `import` statement appears to short-circuit and not 
check with `sys.meta_path` handlers in this case?

--
components: Library (Lib)
files: PyMetaPath.tar.gz
messages: 260138
nosy: Wolfgang Richter
priority: normal
severity: normal
status: open
title: `sys.meta_path` Skipped for Packages with Non-Standard Suffixed 
`__init__` Files
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file41902/PyMetaPath.tar.gz

___
Python tracker 

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



[issue26343] os.O_CLOEXEC not available on OS X

2016-02-11 Thread STINNER Victor

STINNER Victor added the comment:

FYI Python creates non-inheritable file descriptors by default since Python 
3.4: PEP 446.

See also the PEP 433 which has more information on OS support, especially:
https://www.python.org/dev/peps/pep-0433/#atomic-flags

--
nosy: +haypo

___
Python tracker 

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



[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Eric V. Smith

Changes by Eric V. Smith :


--
nosy: +brett.cannon, eric.smith, eric.snow, ncoghlan

___
Python tracker 

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



[issue26346] PySequenceMethods documentation missing sq_slice and sq_ass_slice

2016-02-11 Thread Anthony Tuininga

New submission from Anthony Tuininga:

These methods are completely missing from the documentation found here:

https://docs.python.org/3/c-api/typeobj.html

--
assignee: docs@python
components: Documentation
messages: 260154
nosy: atuining, docs@python
priority: normal
severity: normal
status: open
title: PySequenceMethods documentation missing sq_slice and sq_ass_slice
versions: Python 3.5

___
Python tracker 

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



[issue19543] Add -3 warnings for codec convenience method changes

2016-02-11 Thread Nick Coghlan

Nick Coghlan added the comment:

I think so - if anyone spots another place a Py3k warning could be usefully 
emitted, it can be handled as a new issue.

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

___
Python tracker 

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



[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Brett Cannon

Brett Cannon added the comment:

I found the problem: you have a bug in your code at line 45 (the first line of 
WolfPathFinder.find_spec()). When you try and import a top-level package the 
path will always be None since __path__ doesn't exist for a top-level package. 
You only end up with a `path` value when there is a __path__ in the parent 
package. If you put your print() call before the None check it will print out 
that you actually did have the method called.

--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue26347] BoundArguments.apply_defaults doesn't handle empty arguments

2016-02-11 Thread Frederick Wagner

New submission from Frederick Wagner:

[First-time contributor, feedback appreciated.]

Found and fixed some unexpected behavior in 
inspect.BoundArguments.apply_defaults. Simplest explanation is the following 
test that I added:

# Make sure a no-args binding still acquires proper defaults.
def foo(a='spam'): pass
sig = inspect.signature(foo)
ba = sig.bind()
ba.apply_defaults()
self.assertEqual(list(ba.arguments.items()), [('a', 'spam')])

I've included the patch file; is there anything else I can do?

--
components: Library (Lib), Tests
files: 0001-Make-apply_defaults-work-for-empty-arguments.patch
keywords: patch
messages: 260157
nosy: Frederick Wagner
priority: normal
severity: normal
status: open
title: BoundArguments.apply_defaults doesn't handle empty arguments
type: behavior
versions: Python 3.5, Python 3.6
Added file: 
http://bugs.python.org/file41906/0001-Make-apply_defaults-work-for-empty-arguments.patch

___
Python tracker 

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



[issue26339] Python rk0.3b1 KeyError: 'config_argparse_rel_path'

2016-02-11 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the report, but both rk and configobj are not part of the Python 
standard library. Please use their issue tracker to report your problem.

--
nosy: +berker.peksag
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



[issue26180] multiprocessing.util._afterfork_registry leak in threaded environment

2016-02-11 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



[issue26347] BoundArguments.apply_defaults doesn't handle empty arguments

2016-02-11 Thread Martin Panter

Martin Panter added the comment:

Patch looks good to me

--
nosy: +martin.panter
stage:  -> patch review

___
Python tracker 

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



[issue26346] PySequenceMethods documentation missing sq_slice and sq_ass_slice

2016-02-11 Thread Martin Panter

Martin Panter added the comment:

Maybe they are missing because they don’t exist in Python 3 :) 


Perhaps what is needed instead is a list of the actual fields in order, since I 
assume Python supports compilers that can’t use the designated initializer 
(PySequenceMethods){.sq_contains=...} syntax.

--
nosy: +martin.panter

___
Python tracker 

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



[issue26346] PySequenceMethods documentation missing sq_slice and sq_ass_slice

2016-02-11 Thread Anthony Tuininga

Anthony Tuininga added the comment:

Ah yes. The fields are still there, though, just marked as not used. 
Interestingly enough they aren't documented in the Python 2 documentation 
eitherand they are in the Python 2.7 headers I have (not marked as unused 
either).

Your suggestion makes sense. The reason I ran into it is I followed an example 
found in the core code for Python 3.5.1which referenced sq_slice and 
sq_ass_slice in the order they are defined in the structure...

--

___
Python tracker 

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



[issue26317] Build Problem with GCC + Macintosh OS X 10.11 El Capitain

2016-02-11 Thread Robert P Fischer

Robert P Fischer added the comment:

> The makefiles use CC throughout and don't look at and OBJC variable. Is
> that variable a standard way to specify an ObjC compiler in makefiles?

I believe that OBJC and OBJCFLAGS are standard for Autoconf/Automake:

https://www.gnu.org/software/automake/manual/html_node/Objective-C-Support.html

https://www.gnu.org/software/autoconf/manual/autoconf-2.61/html_node/Output-Variable-Index.html#Output-Variable-Index

https://www.google.com/webhp?sourceid=chrome-instant=1=2=UTF-8#q=using%20objective%20c%20with%20autoconf%20automake

I wouldn't be opposed to a patch that makes it possible to specify an ObjC
> compiler, could you write such a patch?  BTW. The patch should also update
> the autoconf script (use AC_PROG_OBJC).

Sorry, I don't do Autotools --- a software package that came to us directly
from the seventh level of Hell.  CMake's main claim to fame is it's not as
bad.

--

___
Python tracker 

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



[issue26343] os.O_CLOEXEC not available on OS X

2016-02-11 Thread Gustavo Goretkin

Gustavo Goretkin added the comment:

Can the documentation be updated accordingly? Currently the documentation 
(roughly) says that this is available.

If not separately noted, all functions that claim “Availability: Unix” are 
supported on Mac OS X, which builds on a Unix core.


os.O_EXLOCK
os.O_CLOEXEC

These constants are only available on Unix.

--

___
Python tracker 

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



[issue26253] tarfile in stream mode always set zlib compression level to 9

2016-02-11 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +lars.gustaebel

___
Python tracker 

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



[issue26343] os.O_CLOEXEC not available on OS X

2016-02-11 Thread Ned Deily

Ned Deily added the comment:

This is only one example of many cases of calls and options that are exposed by 
the os module but are not available on specific platforms or platform releases. 
 It would be a huge documentation effort to try to identify and keep them all 
up-to-date.  The fourth bullet at the beginning of the "os" module doc page is 
intended to cover this:

"An “Availability: Unix” note means that this function is commonly found on 
Unix systems. It does not make any claims about its existence on a specific 
operating system."

https://docs.python.org/3/library/os.html#module-os

--

___
Python tracker 

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



[issue26340] modal dialog with transient method; parent window fails to iconify

2016-02-11 Thread vs

New submission from vs:

Consider the following code implementing a custom modal dialog:

from Tkinter import *

def dialog():
win = Toplevel()
Label(win, text='Modal Dialog').pack()
win.transient(win.master)
win.focus_set()
win.grab_set()
win.wait_window()

root = Tk()
Button(root, text='Custom Dialog', command=dialog).pack()
root.mainloop()

In Python 2.7.3, the parent window behaves as expected when the modal dialog is 
active. That is, the parent window responds to minimize, maximize, and close 
events. The modal dialog window iconifies and closes together with the parent 
window. If a user presses Show Desktop button in Windows OS, the parent and the 
dialog iconify together and can be restored from the Taskbar.

However, in more recent Python releases (I tested 2.7.8, 2.7.11 and 3.5.1), the 
parent window does not respond to any of the three window commands. If the 
modal dialog is open and the user presses Show Desktop, both windows iconify, 
but they CANNOT be restored or closed from the Taskbar. The only way to close 
such an application is to kill it through the Task Manager.

--
components: Tkinter, Windows
messages: 260114
nosy: paul.moore, steve.dower, tim.golden, vs, zach.ware
priority: normal
severity: normal
status: open
title: modal dialog with transient method; parent window fails to iconify
type: behavior
versions: Python 2.7, Python 3.5

___
Python tracker 

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



[issue25709] Problem with string concatenation and utf-8 cache.

2016-02-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee: serhiy.storchaka -> georg.brandl

___
Python tracker 

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



[issue26331] Tokenizer: allow underscores for grouping in numeric literals

2016-02-11 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-02-11 Thread Brett Cannon

Brett Cannon added the comment:

You need to temporarily turn on warnings for it to work. For example:

  with warnings.catch_warnings():
  warnings.simplefilter('always')
  with self.assertWarnsRegex(DeprecationWarning, "reserved keyword"):
exec('async = 33')

Do notice I used exec() as otherwise the warning will be triggered at import 
instead of when the test runs.

--

___
Python tracker 

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



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-02-11 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



[issue25709] Problem with string concatenation and utf-8 cache.

2016-02-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> I wait only Greg's approving for 3.3. If I'll not get it in a day, I'll 
> commit the patch for 3.4+.

Maybe it was my fault. I made a mistake in Georg's name.

--

___
Python tracker 

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



[issue26200] SETREF adds unnecessary work in some cases

2016-02-11 Thread STINNER Victor

STINNER Victor added the comment:

Raymond Hettinger: "Most of the SETREFs in the next() functions in the 
itertools module should also be restored to there former state.  They look to 
have been correct before the change, so there was no improvement, only 
degradation.  Much of that code had been finely tuned and battle tested over 
many years -- the addition of SETREFs was gratuitous."

I guess that your concern is performance. Did you notice a performance 
difference on a micro-benchmark? I don't think that it's possible to see any 
difference with the addition of a single if in C.

I disagree that the change is gratuitous: it was discussed at length and 
approved on python-dev and the issue #20440. The idea was not new, it was 
already proposed in issue #3081 (opened in 2008). The issue #20440 (Py_SETREF) 
is a generic fix of the bug #16447. PyPy dev found crazy bugs in CPython :-)

IMHO correctness matters more than performance here.

Oh, and by the way, I like a macro which avoids 3 lines of C code ;-) It makes 
the code shorter and more readable.

--

___
Python tracker 

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



  1   2   >