[issue29910] Ctrl-D eats a character on IDLE

2017-08-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Adding 'break' to parenmatch.paren_closed_event prevented ')' from closing 
calltips.  Removing it reverts the regression.

I am leaving this open to re-review the other optional changes to see if ')' is 
unique or if anything else is being caught that needs to pass   I am thinking 
that 'break' should perhaps be limited to events that are associated with 
user-settable control sequences (those with modifiers other than Shift).

I am still looking at calltip_w.py to see whether, if the bindings were 
reversed, ')' could close a calltip but not pass on to parenmatch.

--
status: closed -> open

___
Python tracker 

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



[issue31029] test_tokenize fails when run directly

2017-08-03 Thread Rajath Agasthya

Changes by Rajath Agasthya :


--
pull_requests: +3035

___
Python tracker 

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



[issue29910] Ctrl-D eats a character on IDLE

2017-08-03 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +3034

___
Python tracker 

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



[issue31012] suggestion: allow termination argument in argparse to be specified as argument

2017-08-03 Thread paul j3

paul j3 added the comment:

The earlier issue for '--' as arguement

http://bugs.python.org/issue14364

With the patch I suggested there '-f--' and '--foo=--' work as arguments.  
'--foo --' is still interpreted as a positionals switch.

In optparse parsing, a flagged option gets all the remaining strings, and 
consume what it needs.  In the argparse parser, strings are classed as flag and 
argument and '--'.  The top level allocates strings to Actions.  '--' is 
handled at the top level.  This difference in parsing makes it impossible to 
complete replicate POSIX action.

See also http://bugs.python.org/issue13922

--

___
Python tracker 

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



[issue19903] Idle: Use inspect.signature for calltips

2017-08-03 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
stage: test needed -> commit review

___
Python tracker 

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



[issue30723] IDLE parenmatch - left and right highlighting, independent flash-delay

2017-08-03 Thread Louie Lu

Changes by Louie Lu :


--
pull_requests: +3033

___
Python tracker 

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



[issue27470] -3 commandline option documented differently via man

2017-08-03 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


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



[issue27470] -3 commandline option documented differently via man

2017-08-03 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset dd6e4aa113c6db4fcf9d252b5063ab217e8330a2 by Mariatta (Subhendu 
Ghosh) in branch '2.7':
bpo-27470: Improve doc for commandline -3 option
https://github.com/python/cpython/commit/dd6e4aa113c6db4fcf9d252b5063ab217e8330a2


--
nosy: +Mariatta

___
Python tracker 

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



[issue30928] Copy modified blurbs to idlelib/NEWS.txt

2017-08-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Next patch should correct bp0-30723.

--

___
Python tracker 

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



[issue27470] -3 commandline option documented differently via man

2017-08-03 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
stage: needs patch -> patch review

___
Python tracker 

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



[issue29427] Option to skip padding for base64 urlsafe encoding/decoding

2017-08-03 Thread Robert Xiao

Robert Xiao added the comment:

This sounds reasonable. I ran into a similar issue today trying to decode a 
JSON Web Key. Although I don't have any real say, I'd say that if you put 
together a patch it may have a higher chance to get reviewed.

I wonder about the following:

- What about adding a new kwarg to b64decode, passed through by 
urlsafe_b64decode, called "checkpad=True" which validates padding? Then we can 
just set that False when we need.
- At the same time it might be nice to pass "validate=False" through from 
urlsafe_b64decode and friends, so we can have some nicer validation of data.
- I like adding the "padding=True" arg to encode, but it may not be necessary 
given the ease of ".rstrip('=')" as an alternative. Anyway, if you will add it 
to encode, please add it to b64encode and pass through from the variant 
encoders to unify the API somewhat.

If you are still interested in putting together a patch, post a comment. 
Otherwise I may work on a patch for this.

--
nosy: +nneonneo
versions: +Python 3.6

___
Python tracker 

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



[issue30882] Built-in list disappeared from Python 2.7 intersphinx inventory

2017-08-03 Thread Benjamin Swan

Changes by Benjamin Swan :


--
nosy: +Benjamin Swan

___
Python tracker 

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



[issue31117] Intersphinx file objects.inv missing 'list' from py:class

2017-08-03 Thread R. David Murray

Changes by R. David Murray :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Built-in list disappeared from Python 2.7 intersphinx inventory

___
Python tracker 

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



[issue31117] Intersphinx file objects.inv missing 'list' from py:class

2017-08-03 Thread Benjamin Swan

New submission from Benjamin Swan:

The objects.inv file my project pulls in for python 2 
(https://docs.python.org/2/objects.inv) no longer contains an entry of list 
under py:class. This is causing sphinx to output

WARNING: py:obj reference target not found: list

for intershpinx links to the list class.

--
messages: 299725
nosy: Benjamin Swan
priority: normal
severity: normal
status: open
title: Intersphinx file objects.inv missing 'list' from py:class
versions: Python 2.7

___
Python tracker 

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



[issue31116] base85 z85 variant encoding

2017-08-03 Thread Derek Wilson

New submission from Derek Wilson:

Issue #17618 introduced base85 options into the base64 module including b85 and 
a85/adobe variants.

There has since been introduced a variant that is easier to work with 
specifically as it avoids " ' \ characters which avoids quoting/escaping issues 
when working with base85 literals in python, json, xml, etc.

https://rfc.zeromq.org/spec:32/Z85/

there is a reference implementation in c for which an extension could easily be 
built.

alternately it would be very easy to add a _z85alphabet etc. to the base64 
module to mirror what has been done with a/b85.

1) is there any interest in this being in the language
2) if so do we want python impl or c extension around ref impl?

--
components: Library (Lib)
messages: 299724
nosy: underrun
priority: normal
severity: normal
status: open
title: base85 z85 variant encoding
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue31002] IDLE: Add tests for configdialog keys tab

2017-08-03 Thread Cheryl Sabella

Cheryl Sabella added the comment:

I tried to minimize the changes to configdialog.  There were more I wanted to 
make, like reorganizing the order of the functions, but I didn't want to make 
the diff too crazy.  I changed some variable names because all of them had 
'keys' in it and I couldn't keep track of them.  It was almost as descriptive 
as single letter variables!  ;-)   I think I made the new names inline with 
what had been done on the font and general tabs.  Again, there were more 
renaming changes I wanted to make (such as key_set to keyset), but I didn't 
want every line to be a diff.

Also, I used the name 'keyset' to refer to the section names and the 
keybindings to refer to the option:value pairs.  Some old vars in configdialog 
weren't changed to reflect this 100%, but the comment should be correct.

I did not include deactivate_current_config and activate_config__changes since 
those are not really specific to keys.  There are also invoked from themes and 
from apply.

I have notes for some of the other coding changes I'd like to make once this is 
in its own class.

--

___
Python tracker 

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



[issue31002] IDLE: Add tests for configdialog keys tab

2017-08-03 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +3032

___
Python tracker 

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



[issue31115] Py3.6 threading/reference counting issues with `numexpr`

2017-08-03 Thread Robert McLeod

New submission from Robert McLeod:

I'm working on the development branch of the `numexpr` module and I've run into 
some problems on Python 3.6, where I seem to get a variety of errors relating 
to threading or reference counting errors. This module is commonly used for 
accelerating NumPy code, as it can parse an expression into a C-extension 
virtual machine program and break the calculations down into blocks which are 
then dispatched over multiple threads. I get similar errors on both Ubuntu 
16.04 with GCC5.4 and Win7 with MSVC2015.  I created an issue here where I 
provide some of the `gcc` error outputs.  

https://github.com/pydata/numexpr/issues/252

Typically I'm getting a different error on every run. 

We use a wrapper for Windows threads that emulated pthreads, and I found on 
Windows crashes occurred on calling the Windows system function 
`WaitForSingleObject(cond->sema, INFINITE);` in the file 
numexpr3/win32/pthread.c.  

I cannot replicate this problem in Python 2.7/3.4/3.5 on Windows or Linux. I'm 
using Anaconda in both instances, with nomkl NumPy on Linux and mkl NumPy on 
Windows.  

I tried valgrinding with Python 3.5 and 3.6, and I get numerous errors coming 
from places like pickle and ast (which the new NumExpr uses) in 3.6 and it's 
basically clean in 3.5.  The logs are attached to the issue linked above.

--
components: Extension Modules, Library (Lib)
messages: 299722
nosy: Robert McLeod
priority: normal
severity: normal
status: open
title: Py3.6 threading/reference counting issues with `numexpr`
type: crash
versions: Python 3.6

___
Python tracker 

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



[issue31103] Windows Installer Product Version 3.6.2150.0 Offset By 0.0.150.0

2017-08-03 Thread Steve Dower

Steve Dower added the comment:

There's an existing bug for the registration going to the wrong place. It 
requires changes to the Wix toolset to resolve. No need to conflate it with 
this issue.

As far as I can tell, the problem here is just the version string displayed in 
Programs and Features? Correct?

--

___
Python tracker 

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



[issue26901] Argument Clinic test is broken

2017-08-03 Thread Yaron de Leeuw

Yaron de Leeuw added the comment:

I have done some diving and git bisecting into this. There are at least two 
issues:

1. `Clinic.__init__` no longer works without passing in a filename. Because 
soon after `if filename` in line 1726 [1] it calls `d('file')` which only works 
if there is a `file` buffer.
This makes the odd line 38 [2] in clinic_test.py to fail miserably with 
sys.exit. Deleting this line results in a proper test failure (22 test fail out 
of 54), which is already much better than the sys exit message.

2. `Clinic` has shifted from using `field_destinations` to 
`destination_buffers` in issue 23500. The test code did not change accordingly.


This means that we need to adapt the test code to the use 
`destination_buffers`, and add it to the regular test suite. The whole 
situation could only have happened because the test were not run regularly.

I would like to tackle this, but I am not entirely sure yet what should the 
differences between FakeClinic and Clinic be. So I am studying it. Hints are 
welcome.




[1] 
https://github.com/python/cpython/blob/6969eaf4682beb01bc95eeb14f5ce6c01312e297/Tools/clinic/clinic.py#L1726

[2] 
https://github.com/python/cpython/blob/6969eaf4682beb01bc95eeb14f5ce6c01312e297/Tools/clinic/clinic_test.py#L38

--
nosy: +jarondl

___
Python tracker 

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



[issue24502] OS X installer provides flat sub-packages with no version numbers

2017-08-03 Thread Shea Craig

Shea Craig added the comment:

For what it's worth, I manage a lot of Macs and know a lot of people in similar 
roles at major enterprises. We greatly prefer installer packages for automated 
installation, and end up having to repackage installer apps routinely for 
products that don't use that mechanism. If it's not an app that can be dropped 
into the Applications folder, Apple installer packages really are the best 
format for enterprise deployment.

>From the development side I'm not familiar enough with the advantages of 
>trying to use a metapackage to bundle the contained packages, but I can say 
>that the version numbers all being 0 causes me to have to do some extra work 
>to ensure upgrades can be compared against what's already installed.

I assume the metapackage is used to create the ability for the user to choose 
to exclude some of the subpackages. This is not a feature I use in deploying 
the software, although I recognize its utility.

--
nosy: +Shea Craig

___
Python tracker 

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



[issue31114] 'make install' fails when exec_prefix is '/' and DESTDIR not empty

2017-08-03 Thread Xavier de Gaye

New submission from Xavier de Gaye:

The error messages:
running install_lib
creating /lib/python3.7
error: could not create '/lib/python3.7': Permission denied
make[1]: *** [Makefile:1449: sharedinstall] Error 1

The command that triggers this failure:

_PYTHON_PROJECT_BASE=/tmp/android-makesetup/build/python3.7-android-21-armv7 
_PYTHON_HOST_PLATFORM=linux-arm 
PYTHONPATH=/tmp/android-makesetup/build/python3.7-android-21-armv7/build/lib.linux-arm-3.7:/src/python/master/Lib
 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_m_linux_ python 
/src/python/master/setup.py install \
  --prefix=/ \
  --install-scripts=//bin \
  --install-platlib=//lib/python3.7/lib-dynload \
  --root=/tmp/android-makesetup/build/python3.7-install-android-21-armv7/

Note how some paths in the setup.py options start with two slashes.

The problem is that change_root() in Lib/distutils/util.py cannot concatenate 
'root' with 'pathname' as 'pathname' starts with two slashes and therefore 
cannot be made relative by just removing one slash.  The behavior of 
change_root() is correct (although it could be made more robust by calling 
os.path.normpath() first before removing the first slash) because according to 
POSIX a pathname starting with two slashes is implementation defined (but not 
when starting with three or more slashes).  And normpath respects this rule:
>>> from os.path import normpath
>>> normpath('//tmp')
'//tmp'
>>> normpath('///tmp')
'/tmp'
However for most posix systems (possibly except Cygwin ?), a path starting with 
two slashes is the same path as the path starting with one slash.

The problem lies with the Makefile. A workaround for the user is to set the 
--exec-prefix option to '/./' instead of '/' when running configure and this 
fixes the problem, the installation is successfull. So a fix could be to swap 
'/' for '/./' in configure itself.
Maybe there is a better solution.

References:
issue 1676135:
The changes made by this issue have excluded the case of '/' as there was a 
concern at that time that the sys.prefix value would be wrong.  I have checked 
that sys.prefix is correct when '/' is changed to '/./' (on configure command 
line). This is because the determination of sys.prefix made by Lib/site.py is 
quite different now from what it was 10 years ago.

issue 9674:
This is exactly the same issue as this one.  I have preferred to open a new 
issue here because the discussion on issue 9674 is focused on making changes to 
distutils while the problem is actually in the posixly incorrect use of paths 
starting with double slashes in the Makefile.

--
components: Build
messages: 299718
nosy: xdegaye
priority: normal
severity: normal
status: open
title: 'make install' fails when exec_prefix is '/' and DESTDIR not empty
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue31103] Windows Installer Product Version 3.6.2150.0 Offset By 0.0.150.0

2017-08-03 Thread Damon Atkins

Damon Atkins added the comment:

Because this entry "python 3.5.3 (64-bit)" is the USER part of the registry, 
only the user who installs python can see that it is installed.

--

___
Python tracker 

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



[issue31103] Windows Installer Product Version 3.6.2150.0 Offset By 0.0.150.0

2017-08-03 Thread Damon Atkins

Damon Atkins added the comment:

The python 3.5.3 (64-bit) installer currently adds most of the components 
installed in the "MACHINE" Registry all but 1 item (2 entries)

"python 3.5.3 (64-bit)" software entry which it places in both the 32 bit and 
also the 64 bit registry.  It should be in the "MACHINE" Registry and only in 
the 64 bit registry, which is the default for 64 bit installer. 

For example a 32 bit installer would place "python 3.5.3 (32-bit)" only in the 
32 bit part of the registry.

--

___
Python tracker 

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



[issue31103] Windows Installer Product Version 3.6.2150.0 Offset By 0.0.150.0

2017-08-03 Thread Damon Atkins

Damon Atkins added the comment:

Hi Guys,

The reason I raise the original is for all those configuration management tools 
which need the version number.

In the uninstall registry is very much an inconsistent.
*Anything with a Display Name in the registry (name in the GUI) will be listed.
* Their are two places for version information.
** 1 "large int (DWORD) version number" called "version" store across several 
integers in the registry, which supports <0-255>.<0-255>.<0-65535> this is not 
visible in the GUI.
** display version, which is a string, and can be set to anything, this is 
visible in the GUI.

"display version" is set most of the time.
"large int version number" not always

"large int (DWORD) version number" I have actual see software which as created 
this as a text string, which is just wrong. e.g. Google Chrome, however Google 
Update Helper does the right thing.

People see the "display version" so this needs to match the version of python.  
I would expect most configuration management tools to use "display version" 
before "large int (DWORD) version number"

The following is based on installing python 3.6.2 (3.6.2150 not sure what this 
means)

display name should be "Python 3.6 (64-bit)" if you wish to encourage  only 
single version of 3.6 to be installed. or "Python 3.6.2 (64-bit)" if you wish 
to allow many versions of 3.6 to be installed. "3.6" matches closer to what 
happens in the unix/linux world (/usr/lib/python2.6).
 
display version string should 3.6.2 or 3.6.2.2150 never 3.6.2150 
"large int (DWORD) version number" should not be set, but you could force it to 
3.6.2 given your unlikely to go higher than 255.255.65535 the automatic builds 
might not like doing this, might be easier not to set it.

--

___
Python tracker 

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



[issue28777] Add asyncio.Queue __aiter__, __anext__ methods

2017-08-03 Thread Guido van Rossum

Guido van Rossum added the comment:

So that's an infinite loop right?

--

___
Python tracker 

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



[issue29304] dict: simplify lookup functions

2017-08-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thank you Inada!

--

___
Python tracker 

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



[issue29155] test.test_spwd.TestSpwdNonRoot failure with FileNotFoundError:

2017-08-03 Thread rgbyrnes

rgbyrnes added the comment:

We are seeing this too, on RHEL 7.

It happens when /etc/nsswitch.conf has ...

shadow: files ldap

The ldap nss back end seems to set errno = ENOENT when it gets no response from 
the ldap server.  If we remove ldap (leaving only files), then we see errno = 
EACCES.

Is it correct to insist on EACCES?  The man page cited in the last message says 
only that ...

The functions that return a pointer return NULL if no more entries are 
available or if an error occurs during processing.  The functions which have 
int as the return value return 0 for success and -1 for failure, with errno set 
to indicate the cause of the error.

getspnam isn't one of the "functions which have int as the return value," so it 
isn't clear whether application code should make any assumptions about errno 
when it returns.

--
components: +Tests
nosy: +rgbyrnes
type:  -> behavior

___
Python tracker 

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



[issue29304] dict: simplify lookup functions

2017-08-03 Thread INADA Naoki

Changes by INADA Naoki :


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



[issue29304] dict: simplify lookup functions

2017-08-03 Thread INADA Naoki

INADA Naoki added the comment:


New changeset 778928b0c7aa438c282727535814d73df850693a by INADA Naoki in branch 
'master':
bpo-29304: Simplify dict lookup functions (GH-2407)
https://github.com/python/cpython/commit/778928b0c7aa438c282727535814d73df850693a


--

___
Python tracker 

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



[issue31110] Small typo in plistlib docs

2017-08-03 Thread cwee

cwee added the comment:

Just noticed the note was removed in commit edef358ed6d in the latest 3.7 docs. 
Closing issue.

Thanks for the intro on how to contribute though!

--
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue29304] dict: simplify lookup functions

2017-08-03 Thread INADA Naoki

INADA Naoki added the comment:

# microbench
https://gist.github.com/methane/db16224a99d12ad4ed170cf3bd45b819

Slower (2):
- fromkeys_str: 3.85 us +- 0.07 us -> 4.09 us +- 0.09 us: 1.06x slower (+6%)
- fromkeys_int: 4.24 us +- 0.13 us -> 4.48 us +- 0.16 us: 1.06x slower (+6%)

Faster (2):
- unicode_nodummy_6: 604 ns +- 37 ns -> 577 ns +- 8 ns: 1.05x faster (-4%)
- unicode_nodummy_5: 626 ns +- 31 ns -> 600 ns +- 21 ns: 1.04x faster (-4%)

Benchmark hidden because not significant (1): unicode_split

# pyperformance

Slower (10):  
- xml_etree_iterparse: 191 ms +- 5 ms -> 200 ms +- 5 ms: 1.05x slower (+5%) 
   
- pickle_list: 7.80 us +- 0.19 us -> 8.08 us +- 0.24 us: 1.04x slower (+4%)
- unpack_sequence: 116 ns +- 5 ns -> 119 ns +- 4 ns: 1.03x slower (+3%) 
- meteor_contest: 183 ms +- 3 ms -> 187 ms +- 2 ms: 1.02x slower (+2%)  
- logging_silent: 330 ns +- 6 ns -> 336 ns +- 5 ns: 1.02x slower (+2%)
- sqlite_synth: 8.65 us +- 0.16 us -> 8.78 us +- 0.14 us: 1.02x slower (+2%)
- sympy_sum: 172 ms +- 1 ms -> 174 ms +- 1 ms: 1.01x slower (+1%)   

 
- json_dumps: 27.0 ms +- 0.4 ms -> 27.3 ms +- 0.3 ms: 1.01x slower (+1%)
   
- pickle_dict: 65.1 us +- 1.9 us -> 65.8 us +- 1.7 us: 1.01x slower (+1%)   

- pickle: 20.4 us +- 0.3 us -> 20.6 us +- 0.2 us: 1.01x slower (+1%)

Faster (20):


- nbody: 287 ms +- 4 ms -> 231 ms +- 6 ms: 1.24x faster (-19%)  


- scimark_sparse_mat_mult: 8.94 ms +- 1.35 ms -> 8.26 ms +- 0.36 ms: 1.08x 
faster (-8%)
 
- chaos: 248 ms +- 3 ms -> 229 ms +- 2 ms: 1.08x faster (-8%)  
- pickle_pure_python: 1.01 ms +- 0.02 ms -> 953 us +- 13 us: 1.06x faster (-5%)
- scimark_fft: 689 ms +- 22 ms -> 654 ms +- 14 ms: 1.05x faster (-5%)
- regex_v8: 41.5 ms +- 1.8 ms -> 39.8 ms +- 0.2 ms: 1.04x faster (-4%)  
 
- xml_etree_parse: 279 ms +- 12 ms -> 271 ms +- 10 ms: 1.03x faster (-3%)
- chameleon: 23.2 ms +- 0.5 ms -> 22.6 ms +- 0.5 ms: 1.03x faster (-2%) 
- dulwich_log: 146 ms +- 2 ms -> 143 ms +- 1 ms: 1.02x faster (-2%) 
- unpickle_pure_python: 725 us +- 15 us -> 709 us +- 15 us: 1.02x faster (-2%)
- nqueens: 211 ms +- 3 ms -> 206 ms +- 2 ms: 1.02x faster (-2%) 
   
- json_loads: 56.6 us +- 2.6 us -> 55.7 us +- 0.4 us: 1.02x faster (-2%)  
- 2to3: 636 ms +- 3 ms -> 625 ms +- 4 ms: 1.02x faster (-2%)
- richards: 148 ms +- 4 ms -> 145 ms +- 2 ms: 1.02x faster (-2%)
- spectral_norm: 253 ms +- 9 ms -> 250 ms +- 5 ms: 1.01x faster (-1%)
- xml_etree_generate: 203 ms +- 5 ms -> 201 ms +- 4 ms: 1.01x faster (-1%)
- html5lib: 194 ms +- 6 ms -> 191 ms +- 6 ms: 1.01x faster (-1%)
- sqlalchemy_imperative: 55.0 ms +- 1.7 ms -> 54.3 ms +- 1.7 ms: 1.01x faster 
(-1%)
- sqlalchemy_declarative: 285 ms +- 3 ms -> 281 ms +- 3 ms: 1.01x faster (-1%)
- genshi_xml: 171 ms +- 2 ms -> 169 ms +- 2 ms: 1.01x faster (-1%)

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

--

___
Python tracker 

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



[issue30717] Add unicode grapheme cluster break algorithm

2017-08-03 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 03.08.2017 15:05, Guillaume Sanchez wrote:
> 
> Guillaume Sanchez added the comment:
> 
> I have a few criticism to do against that proto-PEP
> 
> http://mail.python.org/pipermail/python-dev/2001-July/015938.html
> 
> In particular, the fact that all those functions return an index prevents any 
> state keeping.

If you want state keeping for iterating over multiple 
parts of the string, you can use an iterator.

The APIs were inspired by the standard string.find() APIs, that's
why they work on indexes and don't return Unicode strings. As
such, they serve a different use case than an iterator.

With the APIs, scanning would always start at the given index
in the string and move forward/backward to the start of the next
.

--

___
Python tracker 

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



[issue30717] Add unicode grapheme cluster break algorithm

2017-08-03 Thread Steven D'Aprano

Steven D'Aprano added the comment:

On Thu, Aug 03, 2017 at 11:21:38AM +, Serhiy Storchaka wrote:

> Should iterators provide just substrings or their positions?
[...]

I think we're breaking new ground here and I'm not sure what the right 
API should be. Should we follow Perl 6?

https://docs.perl6.org/type/Str

Go has a "norm" package for dealing with normalised "characters" 
(graphemes).

https://blog.golang.org/normalization

http://godoc.org/golang.org/x/text/unicode/norm

Are my comments unacceptible scope-creep? We've gone from talking about 
a grapheme cluster break algorithm to me talking about Perl6 and Go 
which have rich string APIs based on graphemes.

I'm not even sure of the best place for this:

- unicodedata
- string
- a new module?

I don't think unicodedata is the right place -- that should be for data 
and processing of individual unicode code points, not string handling, 
and it shouldn't become a grab-bag of random unrelated functions just 
because they have something to do with Unicode.

Can we mark this as having a Provisional API to give us time to decide on the 
best API before locking it in permanently?

https://www.python.org/dev/peps/pep-0411/

I'm reluctant to say this, because it's a lot more work, but maybe this 
is complicated enough that we should go through a PEP.

--

___
Python tracker 

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



[issue30717] Add unicode grapheme cluster break algorithm

2017-08-03 Thread Guillaume Sanchez

Guillaume Sanchez added the comment:

I have a few criticism to do against that proto-PEP

http://mail.python.org/pipermail/python-dev/2001-July/015938.html

In particular, the fact that all those functions return an index prevents any 
state keeping.

That's a problem because:

> next_(u, index) -> integer

As you've seen it, in grapheme clustering (as well as words and line breaking), 
we have to have an automaton to decide on the breaking point. Which means that 
starting at an arbitrary index is not possible.

> prev_(u, index) -> integer

Is it really necessary? It means implementing the same logic to go backward. In 
our current case, we'd need a backward grapheme cluster break automaton too.

> _start(u, index) -> integer
> _end(u, index) -> integer

Not doable in O(1) for the same reason as next_(). We need a 
context, and the code point itself cannot give enough information to know if 
it's the start/end of a given indextype.

--

___
Python tracker 

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



[issue25711] Rewrite zipimport from scratch

2017-08-03 Thread Yaron de Leeuw

Yaron de Leeuw added the comment:

What is the status of this work? Is there anything I can do to help make this 
happen?

--
nosy: +jarondl

___
Python tracker 

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



[issue31109] zipimport argument clinic conversion

2017-08-03 Thread Yaron de Leeuw

Yaron de Leeuw added the comment:

Oh that's a cool idea which I was not aware of.

--

___
Python tracker 

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



[issue30717] Add unicode grapheme cluster break algorithm

2017-08-03 Thread Guillaume Sanchez

Guillaume Sanchez added the comment:

Thanks for your consideration. I'm currently fixing what's been asked in the 
reviews.

> But it would be useful to provide also word and sentence iterators.

I'll gladly do that as well!

> I think emitting a pair (pos, substring) would be more useful.

That means emitting a pair like ((start, end), substr) ? Is it pythonic to 
return a structure like this?

For what it's worth, I don't like it, but I definitely understand the value of 
it. I'd prefer having two versions. One returning indexes, the other returning 
substrings.

But...

> Alternatively an iterator could emit slice objects.

I really like that. Do we have a clear common agreement or preference on any 
option?

--

___
Python tracker 

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



[issue31105] Cyclic GC threshold may need tweaks

2017-08-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> As a fast approximation the default implementation of the __sizeof__ method 
> can be used

This doesn't handle further resizing of containers, though.

--

___
Python tracker 

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



[issue31012] suggestion: allow termination argument in argparse to be specified as argument

2017-08-03 Thread Leon Avery

Leon Avery added the comment:

The POSIX guideline suggests that -- should be available as an option argument. 
One should be able to say "command --opt --" in order to make '--' the value of 
the '--opt' option. 

> There are some known problems with this '--', specially when there are more 
> than one.

Yes. That is exactly the problem I have.

--

___
Python tracker 

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



[issue31105] Cyclic GC threshold may need tweaks

2017-08-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There is an existing protocol for estimating the size of allocated memory. 
__sizeof__. Python API sys.getsizeof() and C API _PySys_GetSizeOf(). But it is 
too heavy for using in GC.

As a fast approximation the default implementation of the __sizeof__ method can 
be used:

tp_basicsize + tp_itemsize * Py_SIZE(self)

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue30717] Add unicode grapheme cluster break algorithm

2017-08-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Issue18406 is closed as a duplicate of this issue. There are useful links in 
issue18406. In particular see a proto-PEP of Unicode Indexing Helper Module:

http://mail.python.org/pipermail/python-dev/2001-July/015938.html

I agreed that providing grapheme iterator would be useful. But it would be 
useful to provide also word and sentence iterators.

Should iterators provide just substrings or their positions? I think emitting a 
pair (pos, substring) would be more useful. It is easier to create an iterator 
of substrings from the iterator of pairs than opposite.

Alternatively an iterator could emit slice objects. Or special objects similar 
to re match objects.

--
nosy: +mrabarnett

___
Python tracker 

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



[issue31105] Cyclic GC threshold may need tweaks

2017-08-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Yes, this is a potentially annoying limitation of the current scheme.

Note that it's not obvious how to proceed for resizable objects such as lists. 
Should the list inform the GC of every internal resizing? May a list resize 
trigger a GC run?

Also, a small container may keep alive a large non-GC object (think a 2-element 
list containing itself and a 1 GB bytestring).  How will the GC know?

--
nosy: +pitrou
type:  -> enhancement
versions:  -Python 2.7, Python 3.3, Python 3.4, 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



[issue18406] unicodedata.itergraphemes / str.itergraphemes / str.graphemes

2017-08-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Issue30717 has a patch.

--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Add unicode grapheme cluster break algorithm

___
Python tracker 

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



[issue30717] Add unicode grapheme cluster break algorithm

2017-08-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Unicode
nosy: +benjamin.peterson, ezio.melotti, lemburg, loewis
stage: needs patch -> patch review
title: str.center() is not unicode aware -> Add unicode grapheme cluster break 
algorithm

___
Python tracker 

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



[issue31113] Stack overflow with large program

2017-08-03 Thread Manuel Krebber

Manuel Krebber added the comment:

1) Yes.
2) A .pyc file was not generated.
3) It is always the same location where the error occurs.
4) It did not crash on the linux machine that I tested it on.

I have tried to split the code up into multiple files, but it still crashes. I 
have uploaded the file to http://wheerd.de/generated.zip
If you want I can also provide the code with multiple files.

--

___
Python tracker 

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



[issue31113] Stack overflow with large program

2017-08-03 Thread Stefan Behnel

Stefan Behnel added the comment:

1) Is this reproducible?

2) Getting a crash in compile.c indicates that this is happening at 
parse/compile time and not when your Python code is executing. Can you confirm 
that? Does it generate a .pyc file on import that would indicate a successful 
byte code compilation? If it's a compiler issue, then the dependencies won't 
actually matter.

2) Is the code position where the crash happens (in dfs()) predictable, or does 
it vary across multiple runs?

3) Does this appear to be specific to Windows, or can you reproduce it on other 
platforms, too?

And yes, seeing the file would be helpful. Could you at least compress it and 
make it available on the web somewhere for now?

--
nosy: +scoder

___
Python tracker 

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



[issue31071] *args unpacking can mask TypeErrors

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



[issue30978] str.format_map() silences exceptions in __getitem__

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



[issue30978] str.format_map() silences exceptions in __getitem__

2017-08-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset f08b2be4416163e3d18b8d09891e7cda0d8a21d4 by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-30978: str.format_map() now passes key lookup exceptions through. 
(GH-2790) (#2992)
https://github.com/python/cpython/commit/f08b2be4416163e3d18b8d09891e7cda0d8a21d4


--

___
Python tracker 

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



[issue31071] *args unpacking can mask TypeErrors

2017-08-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 946a0b69e217ff22a6c056047eab42053e9a2d5f by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-31071: Avoid masking original TypeError in call with * unpacking 
(GH-2957) (#2991)
https://github.com/python/cpython/commit/946a0b69e217ff22a6c056047eab42053e9a2d5f


--

___
Python tracker 

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



[issue30978] str.format_map() silences exceptions in __getitem__

2017-08-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +3031

___
Python tracker 

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



[issue30978] str.format_map() silences exceptions in __getitem__

2017-08-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 5075416b8fedc5526b643dabc915f7945fa0d969 by Serhiy Storchaka in 
branch 'master':
bpo-30978: str.format_map() now passes key lookup exceptions through. (#2790)
https://github.com/python/cpython/commit/5075416b8fedc5526b643dabc915f7945fa0d969


--

___
Python tracker 

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



[issue31080] Allow `logging.config.fileConfig` to accept kwargs

2017-08-03 Thread Vinay Sajip

Vinay Sajip added the comment:

No, that's OK - leave it as is, I'll consider it when next visiting the area.

--

___
Python tracker 

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



[issue31071] *args unpacking can mask TypeErrors

2017-08-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +3030

___
Python tracker 

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



[issue31071] *args unpacking can mask TypeErrors

2017-08-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 25e4f779d7ae9f37a1933cb5cbfad06e673c01f9 by Serhiy Storchaka in 
branch 'master':
bpo-31071: Avoid masking original TypeError in call with * unpacking (#2957)
https://github.com/python/cpython/commit/25e4f779d7ae9f37a1933cb5cbfad06e673c01f9


--

___
Python tracker 

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



[issue31113] Stack overflow with large program

2017-08-03 Thread Manuel Krebber

New submission from Manuel Krebber:

With a pattern matching library I am generating some Python code that matches 
patterns. For a very big pattern set I generate a Python file which is about 
20MB and has ~300K LOC. When I try to execute the file with Python 3.6.2 on 
Windows 10 (64bit), the interpreter crashes. I do not have the Python source 
locally, but I could get it if necessary. The crash is because of a stack 
overflow when calling dfs() in compile.c. I can attach you the program, but it 
needs some dependencies which currently are only availiable via some Github 
repos.

I will try to split the ig file into multiple smaller ones, but I thought you 
might want to know about an interpreter crash.

--
components: Interpreter Core, Windows
messages: 299689
nosy: Wheerd, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Stack overflow with large program
type: crash
versions: Python 3.6

___
Python tracker 

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



[issue28777] Add asyncio.Queue __aiter__, __anext__ methods

2017-08-03 Thread Georgy

Georgy added the comment:

I successfully use my code:

import asyncio, sanic

class MyQueue(asyncio.Queue):
def __aiter__(self): return self
async def __anext__(self): return await self.get()

app = sanic.Sanic()
ws_set = set()
app.static('/', 'async.html')

@app.websocket('/ws')
async def root_ws(request, ws):
ws_set.add(ws)
try:
while True: await ws.recv()
finally: ws_set.remove(ws)

async def postgres():
import aiopg
async with aiopg.create_pool('') as pool:
async with pool.acquire() as connection:
connection._notifies = MyQueue()
async with connection.cursor() as cursor:
await cursor.execute('LISTEN message')
async for message in connection.notifies:
for ws in ws_set: await ws.send(message.payload)

try: 
asyncio.get_event_loop().run_until_complete(asyncio.gather(app.create_server(), 
postgres()))
except KeyboardInterrupt: asyncio.get_event_loop().stop()

--

___
Python tracker 

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



[issue31109] zipimport argument clinic conversion

2017-08-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If zipimport will be reimplemented in Python (issue25711) this change will be 
not needed.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31108] add __contains__ for list_iterator (and others) for better performance

2017-08-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patch adds almost 40 line of the code and increases the performance of not 
well famous feature at best by 10-20%. Adding an optimization for every new 
iterator type will add a comparable quantity of the code. I think this is too 
high cost.

Using a common template implementation for iterators (issue27438) would 
decrease the relative cost of this feature.

--
components: +Interpreter Core
nosy: +rhettinger, serhiy.storchaka
stage:  -> patch review
versions: +Python 3.7

___
Python tracker 

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



[issue31110] Small typo in plistlib docs

2017-08-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

3.4 and 3.5 can take only security fixes. Create a PR for the master branch. 
After merging it the changes can be cherry-picked into the 3.6 branch. See 
details in Python Developer’s Guide (https://docs.python.org/devguide/).

--
stage:  -> needs patch
versions:  -Python 3.4, Python 3.5

___
Python tracker 

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



[issue31110] Small typo in plistlib docs

2017-08-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

https://github.com/python/cpython

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue25430] speed up ipaddress __contain__ method

2017-08-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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