[issue23968] rename the platform directory from plat-$(MACHDEP) to plat-$(PLATFORM_TRIPLET)

2016-08-30 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Changeset 5c77488830bc brings a regression - Android build fails with the 
following message:

export H2PY; H2PY="$PYTHON_FOR_BUILD 
/home/yen/python3-android/src/cpython/build-target/../Tools/scripts/h2py.py"; \
cd ../Lib/plat-aarch64-linux-gnu;  ./regen
+ _PYTHON_PROJECT_BASE=/home/yen/python3-android/src/cpython/build-target 
_PYTHON_HOST_PLATFORM=linux-aarch64 
PYTHONPATH=/home/yen/python3-android/src/cpython/build-target/build/lib.linux-aarch64-3.6:../Lib:../Lib/plat-aarch64-linux-gnu
 python3.6 
/home/yen/python3-android/src/cpython/build-target/../Tools/scripts/h2py.py -i 
'(u_long)' 
/opt/android-ndk/platforms/android-21/arch-arm64/usr/include/sys/types.h 
/opt/android-ndk/platforms/android-21/arch-arm64/usr/include/netinet/in.h 
/opt/android-ndk/platforms/android-21/arch-arm64/usr/include/dlfcn.h
./regen: line 33: 
_PYTHON_PROJECT_BASE=/home/yen/python3-android/src/cpython/build-target: No 
such file or directory
make[1]: *** [Makefile:1324: ../Lib/plat-aarch64-linux-gnu] Error 127
make[1]: Leaving directory '/home/yen/python3-android/src/cpython/build-target'
make: *** [Makefile:36: python] Error 2

The previous changeset 1902e1d79e25 builds fine. Prepending `PYTHON_FOR_BUILD` 
in configure.ac with `env` makes the whole build work again.

>From the message seems plat-* directories are re-generated with a different 
>name. Is it expected?

--

___
Python tracker 

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



[issue23968] rename the platform directory from plat-$(MACHDEP) to plat-$(PLATFORM_TRIPLET)

2016-08-30 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Oh didn't see the title of this issue. Here's the patch for Android.

--
Added file: 
https://bugs.python.org/file44260/issue23968-android-regression.patch

___
Python tracker 

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



[issue27891] Consistently group and sort imports within idlelib modules.

2016-08-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Part of previous message should be 'at the top where it belongs'.

With attached patch, each file compiles and (incomplete) tests pass.  Will 
examine each with side-by-side diff.  There might be artifacts from another 
patch left.

--
keywords: +patch
Added file: https://bugs.python.org/file44261/imports-27891.diff

___
Python tracker 

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



[issue27891] Consistently group and sort imports within idlelib modules.

2016-08-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Followup is #27892

--

___
Python tracker 

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



[issue21085] compile error Python3.3 on Cygwin

2016-08-30 Thread Erik Bray

Changes by Erik Bray :


Added file: 
https://bugs.python.org/file44263/3.4-issue21085-struct_siginfo-2.patch

___
Python tracker 

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



[issue21085] compile error Python3.3 on Cygwin

2016-08-30 Thread Erik Bray

Changes by Erik Bray :


Added file: 
https://bugs.python.org/file44262/tip-issue21085-struct_siginfo-2.patch

___
Python tracker 

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



[issue21085] compile error Python3.3 on Cygwin

2016-08-30 Thread Erik Bray

Changes by Erik Bray :


Added file: 
https://bugs.python.org/file44264/3.3-issue21085-struct_siginfo-2.patch

___
Python tracker 

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



[issue21085] compile error Python3.3 on Cygwin

2016-08-30 Thread Erik Bray

Erik Bray added the comment:

I've reviewed masamoto's last patch 3.5-issue21085-struct_siginfo-2.patch

It applies cleanly and allows the signals module to compile on Cygwin64 2.5.1 / 
Windows 10.  I attached versions of the patch that apply cleanly to tip, 3.4, 
and 3.3 as well.

However, even with this issue resolved it can't be fully tested because there 
are other open issues preventing a successful build on Cygwin, including 
issue25658 and issue13756

Would it be ok to commit this even though it doesn't resolve all build issues?  
Or should I try to cobble together a meta-issue of current known build issues 
and make sure they all have working patches first?

--
stage: patch review -> commit review

___
Python tracker 

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



[issue17909] Autodetecting JSON encoding

2016-08-30 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

Hi Serhiy,

I have reviewed your patch, it seems to be ok.

--
nosy: +matrixise

___
Python tracker 

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



[issue17909] Autodetecting JSON encoding

2016-08-30 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


--
stage: patch review -> commit review

___
Python tracker 

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



[issue27861] sqlite3 type confusion and multiple frees

2016-08-30 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue27818] Speed up number format spec parsing

2016-08-30 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue27881] Fix possible bugs when setting sqlite3.Connection.isolation_level

2016-08-30 Thread Xiang Zhang

Xiang Zhang added the comment:

Serhiy, I've updated the patch. Looking forward to your feedback.

--
Added file: https://bugs.python.org/file44265/issue27881_v2.patch

___
Python tracker 

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



[issue27881] Fix possible bugs when setting sqlite3.Connection.isolation_level

2016-08-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In general LGTM. But added several style comments.

--

___
Python tracker 

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



[issue27413] Add an option to json.tool to bypass non-ASCII characters.

2016-08-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The last change just sweeps a problem under a rug.

For now json.tool never fails with valid data. But with the --no-ensure-ascii 
option it can fail when output a string not encodable with the locale encoding. 
All can work with common cases on common UTF-8 environment, but unexpectedly 
fail on nonstandard environment. It would be better to output encodable 
characters as is and represent unencodable characters with \u encoding.

--

___
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-08-30 Thread Dima Tisnek

Dima Tisnek added the comment:

Who can review Serhiy's patch?

P.S. core of the patch seems good to me, but I'm not an expert on stdlib.

--
nosy: +Dima.Tisnek

___
Python tracker 

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



[issue27889] ctypes interfers with signal handling

2016-08-30 Thread Andre Merzky

Andre Merzky added the comment:

I can confirm the same unexpected behavior for 

Python 2.7.6 / Linux radical 4.2.0-25-generic #30~14.04.1-Ubuntu (2nd attempt)
Python 2.7.9 / Linux login1.stampede.tacc.utexas.edu 2.6.32-431.17.1.el6.x86_64 
(32nd attempt)
Python 2.7.10 / Linux gordon-ln2.sdsc.edu 2.6.32-431.29.2.el6.x86_64 (5th 
attempt)

Any suggestion for further testing?

--

___
Python tracker 

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



[issue27881] Fix possible bugs when setting sqlite3.Connection.isolation_level

2016-08-30 Thread Xiang Zhang

Xiang Zhang added the comment:

Leave replies and make a trival change in v3. I don't change the other two just 
as I state in the replies. But please do what you like.

--
Added file: https://bugs.python.org/file44266/issue27881_v3.patch

___
Python tracker 

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



[issue21085] compile error Python3.3 on Cygwin

2016-08-30 Thread R. David Murray

R. David Murray added the comment:

I think it would be reasonable to apply it, unless other devs object, given 
your confirmation that it solves this particular problem (and, looking at the 
code, it won't break anything...which the buildbots will confirm).

This will only be applied to 3.5 and 3.6, since this is not a security issue.  
I've updated the versions accordingly.

--
versions: +Python 3.6 -Python 3.3, Python 3.4

___
Python tracker 

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



[issue27350] Compact and ordered dict

2016-08-30 Thread INADA Naoki

Changes by INADA Naoki :


Added file: https://bugs.python.org/file44267/compact-dict.patch

___
Python tracker 

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



[issue27744] Add AF_ALG (Linux Kernel crypto) to socket module

2016-08-30 Thread Christian Heimes

Changes by Christian Heimes :


Added file: 
https://bugs.python.org/file44268/AF_ALG-kernel-crypto-support-for-socket-module-3.patch

___
Python tracker 

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



[issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX

2016-08-30 Thread Erik Bray

Erik Bray added the comment:

Here's a first stab at a patch for this.  A linked list is maintained which 
maps pthread_key_t instances to an int "key_id" that is used for the PyThread 
API.  Each function needs to map a given key_id to the actual pthread_key_t.  
This adds a little bit of overhead of course, but in typical usage I don't 
think there are many entries in this list to loop over.

This also reverts the change from #22206 which is no longer relevant.  No 
synchronization is provided for PyThread_create_key and PyThread_delete_key, 
but in typical usage that would be the user's responsibility anyways.  
Otherwise every PyThread_*_key function would have to have a mutex around it.

--

___
Python tracker 

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



[issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX

2016-08-30 Thread Erik Bray

Changes by Erik Bray :


--
stage:  -> patch review

___
Python tracker 

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



[issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX

2016-08-30 Thread Erik Bray

Changes by Erik Bray :


--
keywords: +patch
Added file: https://bugs.python.org/file44269/issue25658-1.patch

___
Python tracker 

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



[issue27818] Speed up number format spec parsing

2016-08-30 Thread STINNER Victor

STINNER Victor added the comment:

> Moving some functions to template file adds yet about 2%. This is too small 
> for adding new file.

I agree. I checked just after writing my previous comment and in fact
str%args doesn't use a C template neither, it also uses
PyUnicode_READ() which is fine. The code is probably already fast
enough.

--

___
Python tracker 

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



[issue27893] BytesParser.parsebytes docstring fix

2016-08-30 Thread Ville Skyttä

Changes by Ville Skyttä :


--
assignee: docs@python
components: Documentation
files: parser.patch
keywords: patch
nosy: docs@python, scop
priority: normal
severity: normal
status: open
title: BytesParser.parsebytes docstring fix
type: enhancement
Added file: http://bugs.python.org/file44270/parser.patch

___
Python tracker 

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



[issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX

2016-08-30 Thread STINNER Victor

STINNER Victor added the comment:

-1 for your change issue25658-1.patch.

It adds a O(n) slowdown to PyThread_set_key_value() whereas the performance of 
this function matters. Moreover, the code currently works fine on Linux, I fail 
to see why we should make Python slower to support a new platform.

The PEP 11 explains the criteria to support a new platform in Python. Before we 
start to officially support CloudABI, you should start to work on a fork. When 
you will get enough users and have a better view of all requires changes, you 
can come back with a full plan to support officially this platform.

--

___
Python tracker 

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



[issue2445] Use The CygwinCCompiler Under Cygwin

2016-08-30 Thread Erik Bray

Erik Bray added the comment:

I have confirmed Masayuki's patch (3.4-distutils-shlibext.patch) fixes a few 
build issues on Cygwin.

At its core, what it's fixing is allowing UnixCCompiler.find_library_file to 
find import libraries on Cygwin.  

That in turn is necessary for --with-system-ffi to work, which is currently 
needed; on Cygwin64 at least the ffi compile as part of _ctypes fails (a 
separate issue to be addressed separately).  But in the meantime making 
--with-system-ffi work again goes a long way.

It should be noted there is a patch at #18654 to make the CygwinCCompiler class 
work again, and switch to using it to handle Cygwin-specific build issues as 
origially intended.  I intend to review that ticket and spend some time on it, 
but it's more complex and not necessarily the simplest way forward.

In the meantime this one-line patch accomplishes a fair bit.

--
nosy: +erik.bray
stage: patch review -> commit review
versions: +Python 3.6 -Python 2.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



[issue2445] Use The CygwinCCompiler Under Cygwin

2016-08-30 Thread Christian Heimes

Changes by Christian Heimes :


--
nosy:  -christian.heimes

___
Python tracker 

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



[issue27894] Fix to_addrs refs in smtplib docs

2016-08-30 Thread Ville Skyttä

Changes by Ville Skyttä :


--
assignee: docs@python
components: Documentation
files: smtplib-doc.patch
keywords: patch
nosy: docs@python, scop
priority: normal
severity: normal
status: open
title: Fix to_addrs refs in smtplib docs
type: enhancement
Added file: http://bugs.python.org/file44271/smtplib-doc.patch

___
Python tracker 

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



[issue27895] Spelling fixes

2016-08-30 Thread Ville Skyttä

Changes by Ville Skyttä :


--
assignee: docs@python
components: Documentation
files: spelling.patch
keywords: patch
nosy: docs@python, scop
priority: normal
severity: normal
status: open
title: Spelling fixes
type: enhancement
Added file: http://bugs.python.org/file44272/spelling.patch

___
Python tracker 

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



[issue27895] Spelling fixes

2016-08-30 Thread Ville Skyttä

Changes by Ville Skyttä :


Removed file: http://bugs.python.org/file44272/spelling.patch

___
Python tracker 

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



[issue27895] Spelling fixes

2016-08-30 Thread Ville Skyttä

Changes by Ville Skyttä :


Added file: http://bugs.python.org/file44273/spelling2.patch

___
Python tracker 

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



[issue27895] Spelling fixes

2016-08-30 Thread Ville Skyttä

Changes by Ville Skyttä :


Removed file: http://bugs.python.org/file44273/spelling2.patch

___
Python tracker 

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



[issue27895] Spelling fixes

2016-08-30 Thread Ville Skyttä

Changes by Ville Skyttä :


Added file: http://bugs.python.org/file44274/spelling3.patch

___
Python tracker 

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



[issue27896] Allow passing sphinx options to Doc/Makefile

2016-08-30 Thread Julien

New submission from Julien:

Context: 

 - Providing french translation to docs.python.rg/fr/: 
http://bugs.python.org/issue26546
 - Simplifying my first proposition of docsbuild-scripts: 
https://github.com/python/docsbuild-scripts/pull/1

Goals:

 - Simplify my modifications of docsbuild-scripts to make it more robust
 - Avoid executing external (~untrusted) Makefile on docs.python.org servers

To achieve this, I need the ``Doc/Makefile`` to be sufficient to build 
internationalized versions by passing sphinx options to it, I'd like to call, 
typically:

make autobuild-stable SPHINXOPTS='-D language=fr -D locale_dirs=./locale/'

Which work if `Doc/Makefile` don't erase but append to the `SPHINXOPTS` 
variable. Which is done by `allow_sphinxopts.diff`.

We may simplify it further by adding `locale_dirs` to `Doc/conf.py` which does 
not break the english build, but I'm not sure if it's of any interest.

We may abstract it further by accepting a new parameter like SPHINXLANG='fr', 
with a default of 'en', but in every case I think it's a good thing to allow 
passing arbitrary SPHINXOPTS so let's start with this?

--
assignee: docs@python
components: Documentation
files: allow_sphinxopts.diff
keywords: patch
messages: 273921
nosy: docs@python, sizeof
priority: normal
severity: normal
status: open
title: Allow passing sphinx options to Doc/Makefile
versions: Python 3.6
Added file: http://bugs.python.org/file44275/allow_sphinxopts.diff

___
Python tracker 

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



[issue26284] Fix telco benchmark

2016-08-30 Thread STINNER Victor

STINNER Victor added the comment:

I worked on a new version of the benchmark suite, it is now called performance 
and moved to GitHub:
https://github.com/python/performance

In performance 0.1.2, bm_telco.py uses BytesIO for input and six.StringIO for 
output. The output is just one number per line, it's different than  
http://bugs.python.org/file41802/telco_haypo.py output.

I don't know which benchmark is "right".

I believe that bm_telco.py of performance is now much more stable thanks to the 
perf module which runs the benchmark in multiple processes (20 by default). It 
helps to get a better distribution of samples.

Example:

$ python3 -m performance run -b telco -o telco.json
(...)

$ python3 -m perf show --hist --stats --metadata telco.json 
Metadata:
- aslr: Full randomization
- cpu_config: 0-7=driver:intel_pstate, intel_pstate:no turbo, governor:powersave
- cpu_count: 8
- cpu_model_name: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
- description: Telco decimal benchmark
- hostname: smithers
- loops: 8
- name: telco
- perf_version: 0.7.4
- platform: Linux-4.5.7-300.fc24.x86_64-x86_64-with-fedora-24-Twenty_Four
- python_executable: 
/home/haypo/prog/python/performance/venv/cpython3.5-da07a9f70715/bin/python
- python_implementation: cpython
- python_version: 3.5.1 (64bit)
- timer: clock_gettime(CLOCK_MONOTONIC), resolution: 1.00 ns

22.7 ms: 18 #
23.0 ms: 27 
###
23.4 ms:  7 
23.7 ms:  1 ###
24.1 ms:  2 ##
24.4 ms:  1 ###
24.7 ms:  0 |
25.1 ms:  1 ###
25.4 ms:  0 |
25.8 ms:  0 |
26.1 ms:  0 |
26.5 ms:  0 |
26.8 ms:  0 |
27.1 ms:  0 |
27.5 ms:  0 |
27.8 ms:  0 |
28.2 ms:  0 |
28.5 ms:  0 |
28.9 ms:  1 ###
29.2 ms:  1 ###
29.5 ms:  1 ###

Total duration: 15.1 sec
Start date: 2016-08-30T18:09:49
End date: 2016-08-30T18:10:07
Raw sample minimum: 182 ms
Raw sample maximum: 237 ms

Number of runs: 20
Total number of samples: 60
Number of samples per run: 3
Number of warmups per run: 1
Loop iterations per sample: 8

Minimum: 22.8 ms (-2%)
Median +- std dev: 23.2 ms +- 1.4 ms
Mean +- std dev: 23.6 ms +- 1.4 ms
Maximum: 29.7 ms (+28%)

Median +- std dev: 23.2 ms +- 1.4 ms


The histogram helps to see that there is no such "minimum", but more a gaussian 
curve. The perf module uses the median of samples rather than the minimum, it 
also displays and computes the standard deviation by default.

--

___
Python tracker 

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



[issue11734] Add half-float (16-bit) support to struct module

2016-08-30 Thread Mark Dickinson

Mark Dickinson added the comment:

Thanks, Raymond. I'll do a final pass and aim to apply this in the next couple 
of days.

--

___
Python tracker 

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



[issue26275] perf.py: calibrate benchmarks using time, not using a fixed number of iterations

2016-08-30 Thread STINNER Victor

STINNER Victor added the comment:

This issue was fixed in the new flavor of the benchmark, the new performance 
project:
https://github.com/python/performance

--
dependencies:  -Fix telco benchmark
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue25423] Deprecate benchmarks that execute too quickly

2016-08-30 Thread STINNER Victor

STINNER Victor added the comment:

I believe that this issue was indirectly fixed by the issue #26275. The new 
flavor of the benchmark suite now calibrates (computes the number of outter 
loop iterations) each benchmark based on time, no more using a fixed number of 
loop iteartions.

Brett: Can you please confirm that the issue was fixed in the new performance 
benchmark suite?
https://github.com/python/performance


$ python3 -m performance run -b silent_logging,unpack_sequence --fast -o json
Python benchmark suite 0.1.3dev
(...)
Report on Linux smithers 4.5.7-300.fc24.x86_64 #1 SMP Wed Jun 8 18:12:45 UTC 
2016 x86_64 x86_64
Total CPU cores: 8

### logging/no_output ###
Median +- std dev: 809 ns +- 16 ns

### unpack_sequence ###
Median +- std dev: 120 ns +- 4 ns


* silent_logging used 10 inner-loops and 2^14 outter-loops
* unpack_sequence used 400 inner-loops and 4096 outter-loops

You can you this using the "python3 -m perf dump -v json" command on the output 
JSON file (search for "loop").

--
nosy: +haypo

___
Python tracker 

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



[issue22458] Add fractions benchmark

2016-08-30 Thread STINNER Victor

STINNER Victor added the comment:

Can you please send a pull request to the new 
https://github.com/python/performance project?

--
nosy: +haypo

___
Python tracker 

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



[issue27897] Avoid possible crash in pysqlite_connection_create_collation

2016-08-30 Thread Xiang Zhang

New submission from Xiang Zhang:

When supplied a custom string with upper returning a non-string, 
pysqlite_connection_create_collation will fail assertion and crash. Serhiy, I 
think we can use the same way in set_isolation_level to avoid this.

--
components: Library (Lib)
files: create_collation.patch
keywords: patch
messages: 273927
nosy: serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
status: open
title: Avoid possible crash in pysqlite_connection_create_collation
type: crash
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file44276/create_collation.patch

___
Python tracker 

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



[issue22881] show median in benchmark results

2016-08-30 Thread STINNER Victor

STINNER Victor added the comment:

The new https://github.com/python/performance benchmark suite now displays the 
median rather than the arithmetic mean (average) by default (it also displays 
the standard deviation).

See the perf issue for a discussion about median vs mean:
https://github.com/haypo/perf/issues/1

Can we now close this issue?

--
nosy: +haypo

___
Python tracker 

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



[issue19108] Benchmark runner tries to execute external Python command and fails on error reporting

2016-08-30 Thread STINNER Victor

STINNER Victor added the comment:

The new https://github.com/python/performance benchmark suite has a very 
different design than the old https://hg.python.org/benchmarks benchmark suite:

* it now only runs benchmarks in a virtual environment
* dependencies are installed in the venv by pip
* there is a "run" command which now accepts a --python=PYTHON option to choose 
the Python binary (and so the tested Python version)

There is no more such thing as ported_lib().

Can I now close this issue as outdated, or do you consider that performance 
still has this issue?

--
nosy: +haypo

___
Python tracker 

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



[issue18899] make pystone.py Py3 compatible in benchmark suite

2016-08-30 Thread STINNER Victor

STINNER Victor added the comment:

> Oh, pystone... I didn't know we had included that particular horror in the 
> benchmark suite :-)

pystone was removed from the new https://github.com/python/performance 
benchmark suite.

I suggest to close this issue as outdated.

--
nosy: +haypo

___
Python tracker 

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



[issue25573] FrameSummary repr() does not support previously working uses of repr in traceback module

2016-08-30 Thread Tomas Orsava

Tomas Orsava added the comment:

This problem has already been addressed in issue 27208, and it was fixed by 
updating the documentation to reflect the new repr().

Therefore, I believe this issue can be closed.

--
nosy: +torsava

___
Python tracker 

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



[issue26284] Fix telco benchmark

2016-08-30 Thread STINNER Victor

STINNER Victor added the comment:

@Stefan: Can you please check bm_telco.py and maybe propose a pull request if 
something is wrong?

--

___
Python tracker 

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



[issue27898] regexp performance degradation between 2.7.6 and 2.7.12

2016-08-30 Thread Steve Newcomb

New submission from Steve Newcomb:

Our most regular-expression-processing-intensive Python 2.7 code takes 2.5x 
more execution time in 2.7.12 than it did in 2.7.6.  I discovered this after 
upgrading from Ubuntu 14.04 to Ubuntu 16.04.  Basically this code runs 
thousands of compiled regular expressions on thousands of texts.  Both the 
multiprocessing module and the re module are heavily used.

See attached profiler outputs, which look quite different in several respects.  
I used the profiling module to profile the same Python code, processing the 
same data, using the same hardware, under both Ubuntu 14.04 (Python 2.7.6) and 
Ubuntu 16.04 (Python 2.7.12).  

It is striking, for example, that cPickle.load appears so prominently in the 
2.7.12 profile -- a fact which appears to implicate the multiprocessing module 
somehow.  But I suspect that the re module is more likely the main source of 
the problem, because the execution times of other production steps -- steps 
that do not call the multiprocessing module -- also appear to be extended to a 
degree that is roughly proportional to the amount of regular expression 
processing done in those other steps.

I will happily provide any further information I can.  Any insights about this 
surprisingly severe performance degradation would be welcome.

--
files: profiles_2.7.6_vs_2.7.12
messages: 273932
nosy: steve.newcomb
priority: normal
severity: normal
status: open
title: regexp performance degradation between 2.7.6 and 2.7.12
Added file: http://bugs.python.org/file44277/profiles_2.7.6_vs_2.7.12

___
Python tracker 

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



[issue11734] Add half-float (16-bit) support to struct module

2016-08-30 Thread Mark Dickinson

Mark Dickinson added the comment:

There's some NaN behaviour that needs fixing in the packing code: packing a NaN 
currently creates a signalling NaN rather than a quiet NaN, and the sign of a 
NaN isn't respected. (One can make a strong argument that the sign of the NaN 
doesn't matter, but we're respecting the sign for '>> '{:064b}'.format(struct.unpack('>> '{:032b}'.format(struct.unpack('>> '{:016b}'.format(struct.unpack('>> '{:064b}'.format(struct.unpack('>> '{:032b}'.format(struct.unpack('>> '{:016b}'.format(struct.unpack('

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



[issue27895] Spelling fixes

2016-08-30 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: docs@python -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue23591] enum: Add Flags and IntFlags

2016-08-30 Thread Ethan Furman

Ethan Furman added the comment:

Patch includes tests, but not docs.

>From a previous comment:
---
> As it stands, Weird(7) would be , and if A was not
> defined an error would be raised.

Actually, it would be  since BC has a higher value than A.

--
stage:  -> patch review
Added file: http://bugs.python.org/file44278/issue23591.stoneleaf.02.patch

___
Python tracker 

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



[issue27898] regexp performance degradation between 2.7.6 and 2.7.12

2016-08-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

It would be helpful if you could run "hg bisect" with your set-up to isolate 
the change that causes the problem.  Alternatively, make a small set of regular 
expressions that demonstrate the performance regression.

--
nosy: +rhettinger

___
Python tracker 

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



[issue2445] Use The CygwinCCompiler Under Cygwin

2016-08-30 Thread David Stanek

Changes by David Stanek :


--
nosy:  -dstanek

___
Python tracker 

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



[issue26359] CPython build options for out-of-the box performance

2016-08-30 Thread Brett Cannon

Brett Cannon added the comment:

Just FYI, Alecsandru, I plan on applying your patches this week or next, so if 
you can just double-check they still apply cleanly that would be great.

--

___
Python tracker 

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



[issue27899] Apostrophe is not replace with ' ElementTree.tostring (also in Element.write)

2016-08-30 Thread Israel Fruchter

New submission from Israel Fruchter:

Both on python2.7 and python3.4
>>> from xml.etree import cElementTree as ET
>>> text = 'its > < & ''
>>> root = ET.fromstring(text.encode('utf-8'))
>>> ET.tostring(root, method="xml")
its > < & '

I would expected to return the same as the input to be a complient XML 1.0

I would understand why for html it would return something diffrent, see:
http://stackoverflow.com/questions/2083754/why-shouldnt-apos-be-used-to-escape-single-quotes

as a workaround I had to path ElementTree:

from xml.etree.ElementTree import _escape_cdata ,_raise_serialization_error
from mock import patch

def _escape_cdata(text):
# escape character data
try:
# it's worth avoiding do-nothing calls for strings that are
# shorter than 500 character, or so.  assume that's, by far,
# the most common case in most applications.
if "&" in text:
text = text.replace("&", "&")
if "<" in text:
text = text.replace("<", "<")
if ">" in text:
text = text.replace(">", ">")
if "'" in text:
text = text.replace("'", "'")
return text
except (TypeError, AttributeError):
_raise_serialization_error(text)

from xml.etree import cElementTree as ET

text = 'its > < & ''
root = ET.fromstring(text.encode('utf-8'))

with patch('xml.etree.ElementTree._escape_cdata', new=_escape_cdata):

s = ET.tostring(root, encoding='unicode', method="xml")
print(s)

--
components: XML
messages: 273937
nosy: fruch
priority: normal
severity: normal
status: open
title: Apostrophe is not replace with ' ElementTree.tostring (also in 
Element.write)
type: behavior
versions: Python 2.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



[issue25423] Deprecate benchmarks that execute too quickly

2016-08-30 Thread Brett Cannon

Brett Cannon added the comment:

I trust you fixed it. :)

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

___
Python tracker 

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



[issue2445] Use The CygwinCCompiler Under Cygwin

2016-08-30 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



[issue23591] enum: Add Flags and IntFlags

2016-08-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

[Ethan]
> My experience is that a module maintainer, or somebody claiming to speak
> for the module maintainer, can close any issue in their area at any 
> time regardless of the number of core devs in favor of a change.

Ethan, it is still up to you and the other module maintainers to decide whether 
this goes in or whether to defer it for a release cycle.  If you have any 
concerns about having too many enum variants and think this is at odds with 
your goals for the module, say so here and we can resolve it at the sprints.  
On the other hand, if you're happy with it, we should get it applied as soon as 
possible.

[Serhiy]
> If general IntFlags will not added, I'm going to open separate issues
> for adding specialized class for every particular case (re, os, etc).

When enum went in, I thought Guido had said and everyone agreed to refrain 
sweeping through the standard lib and applying enums broadly to long standing 
and stable APIs.  Perhaps something has changed since them but there was a 
clear intention to show restraint, let enums mature, respect stable APIs, and 
to wait for demonstrated need (i.e. actual rather than imagined user 
difficulties).

--
nosy: +rhettinger

___
Python tracker 

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



[issue27898] regexp performance degradation between 2.7.6 and 2.7.12

2016-08-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

According to your profile results all re functions are 2.5-4 times faster under 
2.7.12 than under 2.7.6. May be I misinterpret it?

Note that 96-99% of time (2847.099 of 2980.718 seconds under 2.7.6 and 4474.890 
of 4519.872 seconds under 2.7.12) is spent in posix.waitpid. The rest of time 
is larger under 2.7.6 (2980.718 - 2847.099 = 133.619) than under 2.7.12 
(4519.872 - 4474.890 = 44.982).

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue27899] Apostrophe is not replace with ' ElementTree.tostring (also in Element.write)

2016-08-30 Thread Israel Fruchter

Israel Fruchter added the comment:

I've now found http://bugs.python.org/issue2647, and seem like this was 
classify as not a bug.

maybe documetion should say it ? or anther way to actuly decide about how to 
output those

--

___
Python tracker 

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



[issue27895] Spelling fixes

2016-08-30 Thread Raymond Hettinger

New submission from Raymond Hettinger:

Thanks for the patch.  Some of these were a bit embarrassing.

Removed the Lib/test/decimaltestdata because this is from an external source 
(not our code) that is periodically refreshed.   I had to hand edit some of the 
changes to test_asyncio because the patch was breaking those tests for some 
reason.  I had some hesitancy about changing function or variable names in real 
code and had to spend time looking at each in detail but they all seem 
legitimate.

--

___
Python tracker 

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



[issue27895] Spelling fixes

2016-08-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 75d6d5d9b674 by Raymond Hettinger in branch 'default':
Issue #27895:  Spelling fixes (Contributed by Ville Skyttä).
https://hg.python.org/cpython/rev/75d6d5d9b674

--
nosy: +python-dev

___
Python tracker 

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



[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2016-08-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Actually making slicing always working is easier than I expected. Maybe it is 
even easier than raise an error.

PySlice_GetIndicesEx() is split on two functions. First convert slice 
attributes to Py_ssize_t, then scale them to appropriate range depending on the 
length. Here is a sample patch.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file44279/slice_get_indices.patch

___
Python tracker 

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



[issue27895] Spelling fixes

2016-08-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

FYI, the patch did not apply cleanly to Python 3.5 so this was applied to 3.6 
only.  If someone feels this is important to them, they are welcome to backport 
the applicable parts of the patch.

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

___
Python tracker 

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



[issue27898] regexp performance degradation between 2.7.6 and 2.7.12

2016-08-30 Thread Steve Newcomb

Steve Newcomb added the comment:

On 08/30/2016 12:46 PM, Raymond Hettinger wrote:
> Raymond Hettinger added the comment:
>
> It would be helpful if you could run "hg bisect" with your set-up to isolate 
> the change that causes the problem.
I don't think I understand you.  There's no difference in the Python 
code we're using in both cases.  The only differences, AFAIK, are in the 
Python interpreter and in the Linux distribution.  I'm not qualified to 
analyze the differences in the latter items.
>Alternatively, make a small set of regular expressions that demonstrate 
> the performance regression.
It will be hard to do that, because the code is so complex, and because 
debugging in the multiprocessing context is so hairy. Still, it's the 
only approach I can think of, too.  Sigh.  I'm thinking about it.

--

___
Python tracker 

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



[issue27900] ctypes fails to find ncurses via ncursesw on Arch Linux

2016-08-30 Thread daniel hahler

New submission from daniel hahler:

The following code fails on Arch Linux:

import ctypes.util
print(ctypes.util.find_library("ncurses"))

It first looks at "ldconfig -p" (via _findSoname_ldconfig), which only
contains:

libncursesw.so.6 (libc6,x86-64) => /usr/lib/libncursesw.so.6
libncursesw.so.6 (libc6) => /usr/lib32/libncursesw.so.6
libncursesw.so (libc6,x86-64) => /usr/lib/libncursesw.so
libncursesw.so (libc6) => /usr/lib32/libncursesw.so
libncurses++w.so.6 (libc6,x86-64) => /usr/lib/libncurses++w.so.6
libncurses++w.so (libc6,x86-64) => /usr/lib/libncurses++w.so

/usr/lib/libncurses.so exists, but as a text file:

INPUT(-lncursesw)

Then "_findLib_gcc" is called, which tries to link a file, and then looks at
its output:

% if type gcc >/dev/null 2>&1; then CC=gcc; elif type cc >/dev/null 2>&1; 
then CC=cc;else exit 10; fi;LANG=C LC_ALL=C $CC -Wl,-t -o /tmp/tmp1ysftojh 2>&1 
-lncurses
/usr/bin/ld: mode elf_x86_64

   
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../lib/crt1.o
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../lib/crti.o
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/crtbegin.o
-lncursesw 
(/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../lib/libncursesw.so)
libgcc_s.so.1 
(/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../lib/libgcc_s.so.1)
/usr/lib/libc.so.6
(/usr/lib/libc_nonshared.a)elf-init.oS
/usr/lib/ld-linux-x86-64.so.2
/usr/lib/ld-linux-x86-64.so.2
libgcc_s.so.1 
(/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../lib/libgcc_s.so.1)
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/crtend.o
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../lib/crtn.o
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../lib/crt1.o: In function 
`_start':
(.text+0x20): undefined reference to `main'
/usr/bin/ld: link errors found, deleting executable `/tmp/tmp1ysftojh'
collect2: error: ld returned 1 exit status

I don't know if "ldconfig" could be made to display the "text symlink", but 
with the "cc"-method, it could look for an explicit "cannot find" error 
instead?!

% if type gcc >/dev/null 2>&1; then CC=gcc; elif type cc >/dev/null 2>&1; 
then CC=cc;else exit 10; fi;LANG=C LC_ALL=C $CC -Wl,-t -o /tmp/tmp1ysftojh 2>&1 
-lncursesxx
/usr/bin/ld: mode elf_x86_64
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../lib/crt1.o
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../lib/crti.o
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/crtbegin.o
libgcc_s.so.1 
(/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../lib/libgcc_s.so.1)
/usr/bin/ld: cannot find -lncursesxx
collect2: error: ld returned 1 exit status

The workaround is to also look for "ncursesw" explicitly.

I have noticed this with pyrepl, which uses it in 
https://bitbucket.org/pypy/pyrepl/src/9401662c4e6c11a4d66804361a7e7d09a1f379d7/pyrepl/_minimal_curses.py?at=default&fileviewer=file-view-default#_minimal_curses.py-19:26.

--
components: ctypes
messages: 273947
nosy: blueyed
priority: normal
severity: normal
status: open
title: ctypes fails to find ncurses via ncursesw on Arch Linux
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



[issue23591] enum: Add Flags and IntFlags

2016-08-30 Thread Ethan Furman

Ethan Furman added the comment:

Raymond, thanks for your support.

I am happy to have a flags variant.  The advice to wait and let Enum mature 
instead of adding the Flag variant at the beginning was sound, and we have a 
better product to show for it now.

The four base Enum-type classes will be:
- Enum
- IntEnum
- Flags
- IntFlags

I see no reason to add any more than these four to the stdlib -- further 
specializations can live in recipes, third-party modules, or private libraries.

While Enum and Flags are the heart of the enum module, IntEnum and IntFlags are 
present for two reasons:
- commonly needed when interfacing with other systems
- use in the stdlib itself

Pollution (otherwise known as enums escaping into other code where they don't 
make sense) is controlled by:
- IntEnums losing their enum status as soon as they are combined with
  any other number; and
- IntFlags losing their enum status as soon as a non-bitwise operator is
  used on them.

I'll commit as soon as the test suite is finished (and any failures are not 
attributable to these changes), and work on the docs later.

Serhiy, I'm not going to include your changes to re, os, etc., as they are not 
part of adding Flags/IntFlags.  Please open new issues for them.  I am not 
opposed to those changes, as

>>> re.I


is more useful than

>>> re.I
2

--

___
Python tracker 

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



[issue24139] Use sqlite3 extended error codes

2016-08-30 Thread Aviv Palivoda

Aviv Palivoda added the comment:

Attached is a patch to enable the extended error codes. This patch should be 
dependent on issue 16379.
Without returning the sqlite error code in the exception the extended error 
code does not reveal any information not currently available. As you can see in 
https://github.com/mackyle/sqlite/blob/ebb27fe5bd5045d924d99cdd7dec9b7064c24768/src/main.c#L1318
 there are messages only for the non-extended error codes and that is what is 
exposed now.

--
keywords: +patch
nosy: +palaviv
Added file: http://bugs.python.org/file44280/24139.patch

___
Python tracker 

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



[issue27899] Apostrophe is not replace with ' ElementTree.tostring (also in Element.write)

2016-08-30 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> XML munges apos entity in tag content

___
Python tracker 

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



[issue27899] Apostrophe is not replace with ' ElementTree.tostring (also in Element.write)

2016-08-30 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +skrah

___
Python tracker 

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



[issue11734] Add half-float (16-bit) support to struct module

2016-08-30 Thread Mark Dickinson

Mark Dickinson added the comment:

Updated patch:
- Fix NaN packing behaviour.
- Expand documentation note on the half-precision format, with links to the 
wikipedia pages for IEEE 754 and for half-precision. (No direct link to IEEE 
754 itself, since it isn't publicly available.)
- Use unpack_halffloat consistently; add pack_halffloat helper function.

If there's no further feedback, I'll apply this in the next day or two.

--
Added file: http://bugs.python.org/file44281/cpython-struct-float16-v8.patch

___
Python tracker 

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



[issue11734] Add half-float (16-bit) support to struct module

2016-08-30 Thread Mark Dickinson

Changes by Mark Dickinson :


--
versions: +Python 3.6 -Python 3.3

___
Python tracker 

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



[issue27898] regexp performance degradation between 2.7.6 and 2.7.12

2016-08-30 Thread Steve Newcomb

Steve Newcomb added the comment:

On 08/30/2016 01:24 PM, Serhiy Storchaka wrote:
> Serhiy Storchaka added the comment:
>
> According to your profile results all re functions are 2.5-4 times faster 
> under 2.7.12 than under 2.7.6. May be I misinterpret it?
I can't explain the profiler's report.  I'm kind of glad that you, too, 
find it baffling.  Is it possible that the profiler doesn't actually 
work predictably in the multiprocessing context?  If so, one thing I can 
*easily* do is to disable multiprocessing in that code and see what the 
profiler reports are then.  It will take all night, but I'm beginning to 
think it would be worthwhile, because it might point the finger of blame 
at either the multiprocessing module or the re module, but not both at once.

(I originally provided a "disable multiprocessing" capability in that 
code in order to use the Python debugger with it.  It would kind of make 
sense if the profiler had limitations similar to those of the debugger.)
>
> Note that 96-99% of time (2847.099 of 2980.718 seconds under 2.7.6 and 
> 4474.890 of 4519.872 seconds under 2.7.12) is spent in posix.waitpid. The 
> rest of time is larger under 2.7.6 (2980.718 - 2847.099 = 133.619) than under 
> 2.7.12 (4519.872 - 4474.890 = 44.982).
Yeah, I'm beginning to wonder if those strange statistics, too, are 
artifacts of using a single-process profiler in a multiprocessing context.

--

___
Python tracker 

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



[issue11734] Add half-float (16-bit) support to struct module

2016-08-30 Thread Mark Dickinson

Mark Dickinson added the comment:

I missed Antoine's 2015 comments on the test code. Here's one more version of 
the patch, which addresses those comments.

--
Added file: http://bugs.python.org/file44282/cpython-struct-float16-v9.patch

___
Python tracker 

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



[issue27889] ctypes interfers with signal handling

2016-08-30 Thread Andre Merzky

Andre Merzky added the comment:

I also see the problem on 2.7.11, on MacOS, but with significantly lower 
frequency.  I can't tell if that is due to changes in Python, the different 
architecture, or whatever...

$ python -V
Python 2.7.11

$ uname -a
Darwin cameo.local 14.4.0 Darwin Kernel Version 14.4.0: Thu May 28 11:35:04 PDT 
2015; root:xnu-2782.30.5~1/RELEASE_X86_64 x86_64

$ while true; do i=$((i+1)); echo -n "$i: "; python t.py || break; done
1: except: caught sigusr2
2: except: caught sigusr2
3: except: caught sigusr2
...
134: except: caught sigusr2
Traceback (most recent call last):
  File "t.py", line 30, in 
print 'unexcepted'
  File "t.py", line 14, in sigusr2_handler
raise RuntimeError('caught sigusr2')
RuntimeError: caught sigusr2

--

___
Python tracker 

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



[issue22458] Add fractions benchmark

2016-08-30 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



[issue23591] enum: Add Flags and IntFlags

2016-08-30 Thread Vedran Čačić

Vedran Čačić added the comment:

The weirdest thing is that it already works pretty well in output of re.compile.

>>> re.compile('', re.I | re.M)
re.compile('', re.IGNORECASE|re.MULTILINE)
>>> _.flags  # re.UNICODE == 32 added automatically
42

So the only thing we should enhance is the output of .flags, and it seems that 
all the necessary code is already in the source code of __repr__ of SRE_Pattern 
objects.

Also, I suppose that means you've given up on the autocreation (since the 
values _are_ semantical here), and I suppose you'll require all the declared 
values to be powers of 2. With those conditions, I think this is a good 
enhancement of Python.

--

___
Python tracker 

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



[issue27901] inspect.ismethod returns different results on the same basic code between Python2.7 Python3.5

2016-08-30 Thread Anthony Flury

New submission from Anthony Flury:

Consider the following code in Python2.7 & Python3.5 

import inspect

class a(object):
 def m(self):
 pass

in Python 2.7 

inspect.ismethod(a.m) returns True

in Python 3.5
 
inspect.ismethod(a.m) returns False

Not sure which is `correct`, but I can see the Python3.5 result causing some 
issues with automatic code documenters. 

I have code which will break under Python3.5 with this - my code performs 
static analysis of code, detecting functions, classes, attributes, and also 
traversing the mro to find inherited methods etc. Amongst other things this 
code identifies methods on classes, without instantiating those classes.

This may simply require a documentation change to explain the difference on 
Py3.5 - rather than a code change.

--
components: Library (Lib)
messages: 273955
nosy: anthony-flury
priority: normal
severity: normal
status: open
title: inspect.ismethod returns different results on the same basic code 
between Python2.7 Python3.5
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



[issue27842] Order CSV header fields

2016-08-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bb3e2a5be31b by Raymond Hettinger in branch 'default':
Issue #27842: The csv.DictReader now returns rows of type OrderedDict.
https://hg.python.org/cpython/rev/bb3e2a5be31b

--
nosy: +python-dev

___
Python tracker 

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



[issue27842] Order CSV header fields

2016-08-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Thanks Steve.

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

___
Python tracker 

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



[issue23591] enum: Add Flags and IntFlags

2016-08-30 Thread Ethan Furman

Ethan Furman added the comment:

Since we're using re as the sample, here's where re.I is defined:

Lib/re.py:
-
I = IGNORECASE = sre_compile.SRE_FLAG_IGNORECASE # ignore case

As already mentioned, re.I results in 2, and a re.compile object is not usable 
as a re flag.

> Also, I suppose that means you've given up on the autocreation

We decided auto-created values were too magical for the stdlib (see 
issue26988).  They will exist in my aenum package, though.

> (since the values _are_ semantical here),

The values have meaning because the underlying library gave them meaning; so 
assuming a type of Flags are used, they will be IntFlags.

> and I suppose you'll require all the declared values to be powers of 2.

Nope.  You are welcome to give more meaningful names to different combinations 
of powers of two.

> With those conditions, I think this is a good enhancement of Python.

Hopefully you still think so. ;)

--

___
Python tracker 

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



[issue27901] inspect.ismethod returns different results on the same basic code between Python2.7 Python3.5

2016-08-30 Thread Mark Dickinson

Mark Dickinson added the comment:

Note that Python 3 did away with unbound methods: in Python 3, `a.m` is simply 
a function, so there's little the `inspect` module can do to distinguish it 
from a regular top-level function.

https://docs.python.org/3/whatsnew/3.0.html#operators-and-special-methods

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue27901] inspect.ismethod returns different results on the same basic code between Python2.7 Python3.5

2016-08-30 Thread R. David Murray

R. David Murray added the comment:

They are both correct.  In 2.7 a class method is a method.  In python3, a class 
method is a function.

As for the docs, the python3 docs say that it returns true for "a bound method 
on an object", while the python2 docs say "a bound or unbound method".  A class 
method is not bound, and unbound method do not exist in python3.  So the docs 
are correct as well.  The notes about the difference could go into a porting 
guide, but I don't think they belong in the main docs.

To fix your code, just treat function objects on classes as what you are 
thinking of as methods.  Because they are: any function assigned to a class 
becomes a bound method when invoked through an instance.  I think that's even 
backward compatible, though I haven't checked.

--
nosy: +r.david.murray
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue27895] Spelling fixes

2016-08-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 89ce78ce1bfa by Raymond Hettinger in branch 'default':
Issue #27895: Strengthen the dict reader tests.
https://hg.python.org/cpython/rev/89ce78ce1bfa

--

___
Python tracker 

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



[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2016-08-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I like this. Very nice.  What I understand is that callers that access 
PySlice_GetIndicesEx via the header file (included with Python.h) will see the 
function as a macro.  When the macro is expanded, the length expression will be 
evaluated after any __index__ calls.

This approach requires that the length expression calculate the length from the 
sequence, rather than being a length computer before the call. I checked and 
all of our users in /Objects pass some form of seq.get_size().  This approach 
also requires that the function be accessed via .h rather than directly as the 
function in the .c file.  If we go this way, should he PySlice_GetIndicesEx doc 
say something?

I reviewed the two new functions and am satisfied a) that they correctly 
separate converting None and non-ints to ints from adjusting start and stop as 
ints according to length and b) that the effect of the change in logic for the 
latter is to stop making unnecessary checks that must fail.

--

___
Python tracker 

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



[issue27894] Fix to_addrs refs in smtplib docs

2016-08-30 Thread Raymond Hettinger

Changes by Raymond Hettinger :


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

___
Python tracker 

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



[issue27842] Order CSV header fields

2016-08-30 Thread Steve Holden

Steve Holden added the comment:

A pleasure. Pretty heavily committed at present, but all Python related so 
maybe there'll be more small positive improvements.

--

___
Python tracker 

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



[issue27902] pstats.Stats: strip_dirs() method cannot handle file paths from different OS

2016-08-30 Thread Jaroslav

New submission from Jaroslav:

Setup
=

profile data from machine
-
- Win 7 (64bit)
- Python 3.5.2 (32bit)

data analyzed on

- Lubuntu 16.04 (64bit) incl. Python 3

issue
-
method strip_dirs() cannot extract the base name since it assumes the 
Unix-style file paths. not tested for opposite direction. no exception emitted.

comment
---
1. optional argument controlling the used 'path' module can definitely help
2. documentation update will be welcome

--
components: Windows
messages: 273964
nosy: Jaroslav, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: pstats.Stats: strip_dirs() method cannot handle file paths from 
different OS
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



[issue11734] Add half-float (16-bit) support to struct module

2016-08-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Mark probably already knows this, but I found this SO answer to be informative: 
 
http://stackoverflow.com/questions/3886988/how-to-distinguish-different-types-of-nan-float-in-python

--

___
Python tracker 

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



[issue25446] smtplib.py AUTH LOGIN code messed up sending login and password data since 3.5

2016-08-30 Thread Miko Ohtamaa

Miko Ohtamaa added the comment:

I think there is something more in this. 

I am running Python 3.5.0 (default, Apr 24 2016, 12:47:36).

Sparkpost servers require AUTH LOGIN approach as per their instructions 
https://support.sparkpost.com/customer/portal/articles/1988470-smtp-connection-problems

When trying to use these (free) servers smtplib authentication will result to 
smtplib.SMTPAuthenticationError: (500, b'5.5.2 unrecognized command') like in 
the issue description earlier. I am still investigating this.

--
nosy: +miohtama, ned.deily

___
Python tracker 

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



[issue27901] inspect.ismethod returns different results on the same basic code between Python2.7 Python3.5

2016-08-30 Thread Anthony Flury

Anthony Flury added the comment:

Not sure I agree with closing this. I am not convinced (as a reasonably 
seasoned developer) that the documentation is clear.

It may not be a bug in the code, resulting as it does from a change in the way 
methods are implemented in Python 3.5, but I do think that the documentation 
could be a lot clearer. It does read as if it is written for someone who 
already knows what the library does, rather than as a guide for someone trying 
to work through it for the first time.

I have changed this to a documentation issue - I hope that this is ok.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
resolution: not a bug -> 
status: closed -> open

___
Python tracker 

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



[issue22450] urllib doesn't put Accept: */* in the headers

2016-08-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Update:  After more research, I learned that while 'Accept: */*' should not 
have an effect on the origin webserver, it can and does have an effect on proxy 
servers.

Origin servers are allowed to vary the content-type of responses when given 
different Accept headers.  When they do so, they should also send "Vary: 
Accept".   

Proxy servers such as NGinx and Varnish respond to the "Vary: Accept" by 
caching the different responses using a combination of url and the accept 
header as the cache key.  If the request has 'Accept: */*', then the cache 
lookup returns the same result as if the 'Accept: */*' had been passed directly 
to the server.  However, if the Accept header is omitted, the proxy cache can 
return any of the cached responses (typically the most recent, regardless of 
content-type).

Accordingly, it is a good practice to include 'Accept: */*' in the request so 
that you get a consistent result (what the server would have returned) rather 
than the inconsistent and unpredictable content-types you would receive in the 
absence of the Accept header.  I believe that is why the other tools and book 
examples use 'Accept: */*' even though the origin wouldn't care.

--

___
Python tracker 

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



[issue27903] Avoid ResourceWarnings from platform._dist_try_harder

2016-08-30 Thread Ville Skyttä

New submission from Ville Skyttä:

Use opened files as context managers.

--
components: Library (Lib)
files: platform-resourcewarning.patch
keywords: patch
messages: 273969
nosy: scop
priority: normal
severity: normal
status: open
title: Avoid ResourceWarnings from platform._dist_try_harder
type: enhancement
Added file: http://bugs.python.org/file44283/platform-resourcewarning.patch

___
Python tracker 

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



[issue22450] urllib doesn't put Accept: */* in the headers

2016-08-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Putting it another way:   To an origin server, 'Accept: */*' means it can 
return anything it wants.  To a proxy server, the absence of an accept header 
means in can return anything it has cached (possibly different from what the 
origin server would have returned).  In contract, to a proxy server, 'Accept: 
*/*' means return exactly what the origin server would have returned with the 
same headers.

--

___
Python tracker 

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



[issue27904] Let logging format more messages on demand

2016-08-30 Thread Ville Skyttä

New submission from Ville Skyttä:

Avoid some string formatting operations on disabled log levels.

--
files: logging.patch
keywords: patch
messages: 273971
nosy: scop
priority: normal
severity: normal
status: open
title: Let logging format more messages on demand
type: performance
Added file: http://bugs.python.org/file44284/logging.patch

___
Python tracker 

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



[issue27895] Spelling fixes

2016-08-30 Thread Ville Skyttä

Ville Skyttä added the comment:

Right, I noticed the asyncio test breakage as well, that was one of the reasons 
I attached a couple of versions of the patch. spelling3 was not supposed to 
contain the breaking changes any more, maybe you worked on an earlier one? 
Anyway, thanks.

--

___
Python tracker 

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



[issue18899] make pystone.py Py3 compatible in benchmark suite

2016-08-30 Thread Berker Peksag

Changes by Berker Peksag :


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



[issue27902] pstats.Stats: strip_dirs() method cannot handle file paths from different OS

2016-08-30 Thread R. David Murray

R. David Murray added the comment:

We could add to the compatibility paragraph that compatibility with files 
produced by the same program on a different platform is not guaranteed.

For the option, that would be an enhancement, and you should open a new issue 
for that.

--
assignee:  -> docs@python
components: +Documentation -Windows
nosy: +docs@python, r.david.murray
stage:  -> needs patch
type: behavior -> enhancement
versions: +Python 2.7, Python 3.6

___
Python tracker 

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



[issue27905] Add documentation for typing.Type

2016-08-30 Thread Michael Lee

New submission from Michael Lee:

This patch adds some documentation for typing.Type[C]. The content itself is 
mostly an abbreviated version of the description from PEP 484 -- let me know if 
the patch is too terse or needs more examples.

--
assignee: docs@python
components: Documentation
files: document-type.patch
keywords: patch
messages: 273974
nosy: docs@python, gvanrossum, michael0x2a
priority: normal
severity: normal
status: open
title: Add documentation for typing.Type
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file44285/document-type.patch

___
Python tracker 

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



[issue27893] email.parser.BytesParser.parsebytes docs fix

2016-08-30 Thread Martin Panter

New submission from Martin Panter:

Actually it seems the parameter is called *text*:

>>> BytesParser().parsebytes(bytes=b"")
TypeError: parsebytes() got an unexpected keyword argument 'bytes'
>>> BytesParser().parsebytes(text=b"")


--
components: +email
nosy: +barry, martin.panter, r.david.murray
title: BytesParser.parsebytes docstring fix -> 
email.parser.BytesParser.parsebytes docs fix
versions: +Python 3.5, Python 3.6

___
Python tracker 

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



  1   2   >