[issue30642] Fix leaks in idlelib

2017-06-12 Thread Louie Lu

Changes by Louie Lu :


--
pull_requests: +2197

___
Python tracker 

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



[issue6519] Reorder 'with' statement for files in Python Tutorial

2017-06-12 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 81c05ccc10d044584dff3a69ee531094ed76ee2c by Mariatta in branch 
'3.6':
bpo-6519: Improve Python Input Output Tutorial (GH-2143) (GH-2145)
https://github.com/python/cpython/commit/81c05ccc10d044584dff3a69ee531094ed76ee2c


--

___
Python tracker 

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



[issue6519] Reorder 'with' statement for files in Python Tutorial

2017-06-12 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks everyone!
I merged the PR and backported to 3.6 and 3.5.

There are a bunch of conflicts when trying to backport to 2.7, so I decided not 
to bother.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue6519] Reorder 'with' statement for files in Python Tutorial

2017-06-12 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 5a86154a931083e6a9f9bdf9cc8b3bc33abb673d by Mariatta in branch 
'3.5':
bpo-6519: Improve Python Input Output Tutorial (GH-2143) (GH-2146)
https://github.com/python/cpython/commit/5a86154a931083e6a9f9bdf9cc8b3bc33abb673d


--

___
Python tracker 

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



[issue6519] Reorder 'with' statement for files in Python Tutorial

2017-06-12 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +2195

___
Python tracker 

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



[issue6519] Reorder 'with' statement for files in Python Tutorial

2017-06-12 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +2196

___
Python tracker 

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



[issue6519] Reorder 'with' statement for files in Python Tutorial

2017-06-12 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset bd4e9e0ca96dabf33605d9b1fd1e0562ece8ae18 by Mariatta (Andrew 
Kuchling) in branch 'master':
bpo-6519: Improve Python Input Output Tutorial (GH-2143)
https://github.com/python/cpython/commit/bd4e9e0ca96dabf33605d9b1fd1e0562ece8ae18


--

___
Python tracker 

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



[issue30642] Fix leaks in idlelib

2017-06-12 Thread Terry J. Reedy

New submission from Terry J. Reedy:

When Louie Lu posted a link to
https://blog.louie.lu/2017/06/12/diagnosing-and-fixing-reference-leaks-in-cpython/
on core-mentorship list, I tested idlelib.
python -m test -ugui test_idle  # SUCCESS, no extraneous output
python -m test -R: test_idle  # SUCCESS, no extraneous output
python -m test -R: -ugui test_idle  # error output, FAILURE
[So people who leaktest without a screen see nothing in idlelib.]

Error output is about 20 copies of the following:
can't invoke "event" command: application has been destroyed
while executing
"event generate $w <>"
(procedure "ttk::ThemeChanged" line 6)
invoked from within
"ttk::ThemeChanged"

At the end:
test_idle leaked [471, 471, 471, 471] references, sum=1884
test_idle leaked [209, 211, 211, 211] memory blocks, sum=842
[similar for python 3.6]

In a response email, I noted that test_idle gathers tests from 
idlelib.idle_test.test_* and that something extra is needed to pin leaks to 
specific test modules.

I don't know whether the absence of 'invoke event' error messages when not 
running -R means that there are also no refleaks, or not.
---
import os
import subprocess

os.chdir('f:/dev/3x/Lib/idlelib/idle_test')
testfiles = [name for name in os.listdir() if name.startswith('test_')]
for name in testfiles:
os.rename(name, 'x'+name)
for name in testfiles:
os.rename('x'+name, name)
try:
res = subprocess.run(
['f:/dev/3x/python.bat', '-m', 'test', '-R:', '-ugui', 'test_idle'],
 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if res.returncode:
print(name)
print(res.stderr)
except Exception as err:
print(name, err)
os.rename(name, 'x'+name)
for name in testfiles:
os.rename('x'+name, name)
---
reports
test_macosx.py
b'beginning 9 repetitions\r\n123456789\r\n\r\ntest_idle leaked [31, 31, 31, 31] 
references, sum=124\r\ntest_idle leaked [19, 21, 21, 21] memory blocks, 
sum=82\r\n'
test_query.py
b'beginning 9 repetitions\r\n123456789\r\n\r\ntest_idle leaked [429, 429, 429, 
429] references, sum=1716\r\ntest_idle leaked [190, 192, 192, 192] memory 
blocks, sum=766\r\n'
There are no 'invoke event' messages.

For further testing within each file, by commenting out code, as suggested in 
the link above, I replaced 'testfiles' in the middle loop with 
['testmacosx.py'] or ['test_query.py'].  For test_macosx, the culprit is class 
SetupTest.  For test_query, the culprit is class QueryGuiTest.  Adding 
cls.root.update_idletasks did not solve the problem by itself (as it has in 
other cases).  I plan to continue another time.

--
assignee: terry.reedy
components: IDLE
messages: 295846
nosy: louielu, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Fix leaks in idlelib
type: behavior
versions: 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



[issue30604] co_extra_freefuncs is stored thread locally and can lead to crashes

2017-06-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Avoid using double underscores in C code. C compiler uses names with double 
underscores for its own needs, and this can lead to conflicts.

--

___
Python tracker 

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



[issue30604] co_extra_freefuncs is stored thread locally and can lead to crashes

2017-06-12 Thread Dino Viehland

Changes by Dino Viehland :


--
pull_requests: +2194

___
Python tracker 

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



[issue30628] why venv install old pip?

2017-06-12 Thread Emily Morehouse

Emily Morehouse added the comment:

You're certainly right. venv uses ensurepip to install pip when creating a 
virtual environment and does not access the internet/upgrade any packages. 
ensurepip was specifically designed to use the bundled version of setuptools. 
The bundled version of setuptools was up to date as of the final Python 3.6.0 
beta, though it seems like it could be due for an upgrade.

For now, you can either run `pip install --upgrade setuptools` after activating 
your environment (recommended) or give your environment access to your local 
site packages that has the upgraded setuptools using `python3 -m venv foo 
--system-site-packages` (not recommended, as this will include ALL global 
packages you have installed). Alternatively, virtualenv 
(https://virtualenv.pypa.io/en/stable/) maintains an updated version of 
setuptools more frequently, though it must be installed as an additional 
package.

It should also be noted that wheel is not installed by venv and must also be 
installed after the environment creation if needed.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue30571] Add integer formatting code for fixed-width signed arithmetic (2's complement)

2017-06-12 Thread Lisa Roach

Lisa Roach added the comment:

I can't see the drawback of being able to format two's complement easily, isn't 
it more common to represent negative binary numbers in two's complement form? I 
find the - sign a little odd myself.

I agree with the idea of using "!" with the precision to represent width.

--

___
Python tracker 

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



[issue30628] why venv install old pip?

2017-06-12 Thread Emily Morehouse

Changes by Emily Morehouse :


--
nosy: +emilyemorehouse

___
Python tracker 

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



[issue30038] Race condition in how trip_signal writes to wakeup fd

2017-06-12 Thread Ned Deily

Ned Deily added the comment:

Misc/NEWS entries for 3.6 and master for these changes?

--

___
Python tracker 

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



[issue29591] Various security vulnerabilities in bundled expat (CVE-2016-0718 and CVE-2016-4472)

2017-06-12 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +matrixise

___
Python tracker 

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



[issue29591] Various security vulnerabilities in bundled expat (CVE-2016-0718 and CVE-2016-4472)

2017-06-12 Thread Ned Deily

Ned Deily added the comment:

Note that a duplicate of this issue was opened as Issue30610 and @matrixise was 
working on a PR there to update the embedded expat to 2.2.0.  Since there are 
CVE's and a demo crash supplied in Issue30610, it seems to me we need to fix 
this for 3.6.2rc1 so I'm making this a "release blocker" and delaying the 
release.  I'm willing to be convinced otherwise.  Christian or Victor, can one 
of you please follow up on this for the 3.6 branch ASAP?  Thanks!

--
nosy: +benjamin.peterson, larry, ned.deily
priority: normal -> release blocker

___
Python tracker 

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



[issue26656] Documentation for re.compile is a bit outdated

2017-06-12 Thread Emily Morehouse

Emily Morehouse added the comment:

YAHO (yet another humble opinion), I support improving the current re.compile 
documentation by adding a link to the regular expression object documentation. 
Great way to point a user to the complete list of methods and attributes while 
keeping match() and search() listed explicitly.

--
nosy: +emilyemorehouse

___
Python tracker 

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



[issue30610] Python's libexpat vulnerable to CVE-2016-0718

2017-06-12 Thread Ned Deily

Ned Deily added the comment:

I am closing this issue as a duplicate of the existing Issue29591. We can 
retitle the PR to be associated with it.  And I am making Issue29591 a release 
blocker for 3.6.2; regardless of what we decide to for 3.7, we're not going to 
drop the embedded copies of expat for current releases.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Various security vulnerabilities in bundled expat 
(CVE-2016-0718 and CVE-2016-4472)

___
Python tracker 

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



[issue30633] Python 3.6.1 installation issues on OpenSuse 42.1: ModuleNotFoundError: No module named 'encodings'

2017-06-12 Thread Andreas Jung

Andreas Jung added the comment:

--enable-optimizations is not the issue

Seems to be somehow related to the locales.

My env is:

ALSA_CONFIG_PATH=/etc/alsa-pulse.conf
AUDIODRIVER=pulseaudio
AUTOJUMP_ERROR_PATH=/home/ajung/.local/share/autojump/errors.log
COLORTERM=1
CONFIG_SITE=/usr/share/site/x86_64-unknown-linux-gnu
CPU=x86_64
CSHEDIT=emacs
CVS_RSH=ssh
DISPLAY=localhost:10.0
EDITOR=vim
FOP_HOME=/opt/fop-1.0
FROM_HEADER=
G_BROKEN_FILENAMES=1
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-15,CP1252
GPG_TTY=/dev/pts/14
HISTSIZE=1000
HOME=/home/ajung
HOST=blackmoon2
HOSTNAME=blackmoon2
HOSTTYPE=x86_64
INPUTRC=/home/ajung/.inputrc
IRCNAME=Andreas Jung (www.andreas-jung.com)
IRCNICK=YET
IRCSERVER=irc.freenet.de irc.belwue.de
JAVA_BINDIR=/usr/java/latest/bin
JAVA_HOME=/usr/java/latest
JAVA_ROOT=/usr/java/latest
JDK_HOME=/usr/java/latest
JRE_HOME=/usr/lib64/jvm/jre
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
LESS_ADVANCED_PREPROCESSOR=no
LESSCLOSE=lessclose.sh %s %s
LESSKEY=/etc/lesskey.bin
LESS=-M -I -R
LESSOPEN=lessopen.sh %s
LIBGL_DEBUG=quiet
LOGNAME=ajung
LS_COLORS=no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.xz=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:
LS_OPTIONS=-N --color=tty -T 0
MACHTYPE=x86_64-suse-linux
MAIL=/var/mail/ajung
MANPATH=/usr/share/man:/opt/local/share/man:/usr/X11R6/man
MINICOM=-c on
MORE=-sl
NNTPSERVER=news
NO_AT_BRIDGE=1
OLDPWD=/home/ajung/src
OSTYPE=linux
PAGER=less
PATH=/home/ajung/.autojump/bin:/usr/java/jdk1.8.0_05/jre/bin:/opt/speedata-publisher/bin:/opt/php-7.1.2/bin:/opt/sphinx/bin:/opt/dita-ot-2.3.1/bin:/opt/ditac-2_6_1/bin:/opt/mongodb/bin:/usr/AHFormatterV64_64:/opt/calibre:/opt/xfc/bin:/opt/PDFreactor/bin:/opt/prince-11:/opt/local/bin:/opt/local/sbin:/usr/bin:/home/ajung/bin:/sbin:/bin:/home/ajung/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/opt/bin
PILOTPORT=usb:
PP_SERVER=https://demo:d...@pp-server.zopyx.com/
PROFILEREAD=true
PWD=/home/ajung/src/Python-3.6.1
PYTHONSTARTUP=/etc/pythonstart
QEMU_AUDIO_DRV=pa
QT_SYSTEM_DIR=/usr/share/desktop-data
SDK_HOME=/usr/java/latest
SDL_AUDIODRIVER=pulse
SHELL=/bin/bash
SHLVL=1
SSH_AUTH_SOCK=/tmp/ssh-sejLfLH4gS/agent.25203
SSH_CLIENT=192.168.0.66 50756 22
SSH_CONNECTION=192.168.0.66 50756 192.168.0.51 22
SSH_TTY=/dev/pts/14
TERM=xterm-256color
USER=ajung
_=/usr/bin/env
VDPAU_DRIVER=va_gl
WINDOWMANAGER=/usr/bin/startkde
XAUTHLOCALHOSTNAME=blackmoon2
XDG_CONFIG_DIRS=/etc/xdg
XDG_DATA_DIRS=/usr/local/share:/usr/share
XDG_RUNTIME_DIR=/run/user/1000
XDG_SESSION_ID=99
XFC_DIR=/opt/xfc/bin
XINC_HOME=/home/ajung/src/xinc
XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
XNLSPATH=/usr/share/X11/nls



Also tried to set LC_ALL=C but that does not make a difference.

--

___
Python tracker 

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



[issue29504] blake2: compile error with -march=bdver2

2017-06-12 Thread Ned Deily

Changes by Ned Deily :


--
priority: release blocker -> high

___
Python tracker 

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



[issue30633] Python 3.6.1 installation issues on OpenSuse 42.1: ModuleNotFoundError: No module named 'encodings'

2017-06-12 Thread Andreas Jung

Andreas Jung added the comment:

Just the standard

./configure --prefix=... --enable-optimizations

dance

--
nosy: +ajung

___
Python tracker 

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



[issue23894] lib2to3 doesn't recognize rb'...' and f'...' in Python 3.6

2017-06-12 Thread Ned Deily

Ned Deily added the comment:

Misc/NEWS entries for these changes?

--

___
Python tracker 

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



[issue30604] co_extra_freefuncs is stored thread locally and can lead to crashes

2017-06-12 Thread Ned Deily

Ned Deily added the comment:


New changeset 2997fec01ee7300c6d5940e6c55e4ccf9f56f1b5 by Ned Deily (Dino 
Viehland) in branch '3.6':
[3.6] bpo-30604: Move co_extra_freefuncs to interpreter state to avoid crashes 
in threads (#2015)
https://github.com/python/cpython/commit/2997fec01ee7300c6d5940e6c55e4ccf9f56f1b5


--

___
Python tracker 

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



[issue30636] Add PYTHONCOERCECLOCALE to the help of the command line

2017-06-12 Thread Nick Coghlan

Nick Coghlan added the comment:

Thanks once again! :)

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

___
Python tracker 

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



[issue30636] Add PYTHONCOERCECLOCALE to the help of the command line

2017-06-12 Thread Nick Coghlan

Nick Coghlan added the comment:


New changeset 81f67b6f48820beed6e138077fd785020bbfd5d6 by Nick Coghlan 
(Stéphane Wirtel) in branch 'master':
bpo-30636: Fix the indentation for the help (#2131)
https://github.com/python/cpython/commit/81f67b6f48820beed6e138077fd785020bbfd5d6


--

___
Python tracker 

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



[issue6519] Reorder 'with' statement for files in Python Tutorial

2017-06-12 Thread A.M. Kuchling

A.M. Kuchling added the comment:

PR filed against master: https://github.com/python/cpython/pull/2143

--
pull_requests: +2193

___
Python tracker 

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



[issue30641] No way to specify "File name too long" error in except statement.

2017-06-12 Thread Steven D'Aprano

Steven D'Aprano added the comment:

I don't understand what you actually are requesting here.

Are you requesting a way to tell whether or not the filename is too long? 
You've already been told that the way to do that is to check errno, and you say 
that you already knew that.

exc.errno == errno.ENAMETOOLONG

Or are you asking for a way to find out ahead of time what the maximum filename 
length will be? You say:

> it's almost impossible to reliably check the allowed filename length

I think that's right: it *is* almost impossible to reliably check the allowed 
filename length, except by trying it and seeing whether or not you can create 
the file.

The difficulty here is that there's no one maximum name length, it depends on 
the file system of the particular device you're accessing. So even if we had 
this `get_maximum_filename_length` function, and you wrote:

if len(fname) < get_maximum_filename_length():
with open(fname) as f: ...

the call to open might *still* fail with ENAMETOOLONG if you happen to be 
writing to a device or disk with a shorter than expected length.

E.g. FAT32 has a limit of either 8.3 bytes or 255 double-byte Unicode 
characters depending on the implementation; NTFS and HFS+ have a limit of 255 
characters; ext4 has a limit of 255 bytes; Joliet has a limit of 64 characters; 
etc.

And then there's the question of the maximum allowed path.

So I think the first thing you should do is clarify exactly what it is that 
you're asking for:

- a way to check whether the exception is ENAMETOOLONG;

- specifically a new sub-exception for that case;

- a constant or function that returns the maximum file name length;

- or the maximum path name length;

- or something else.


But any of these (except the first, which already exists) is a new feature, not 
a bug fix, to it can only go into 3.7.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue29514] Add a test case that prevents magic number changes in minor releases

2017-06-12 Thread Nick Coghlan

Nick Coghlan added the comment:

We don't use the alpha and beta phases for maintenance releases, so I think the 
checks are functionally equivalent.

For example, the 3.6 branch currently reports itself as "3.6.1 final", will 
temporarily report itself as "3.6.2 release" during the rc period, and then go 
back to reporting itself as "3.6.2 final".

Assigning to myself to do the backports.

--
assignee:  -> ncoghlan
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



[issue30633] Python 3.6.1 installation issues on OpenSuse 42.1: ModuleNotFoundError: No module named 'encodings'

2017-06-12 Thread Brett Cannon

Brett Cannon added the comment:

What commands did you use to launch this build? (E.g. I noticed you are trying 
to do a PGO build.)

--
nosy: +brett.cannon

___
Python tracker 

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



[issue30641] No way to specify "File name too long" error in except statement.

2017-06-12 Thread Max Staff

Max Staff added the comment:

...at least those are the only two ways that I can think of.

--

___
Python tracker 

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



[issue30641] No way to specify "File name too long" error in except statement.

2017-06-12 Thread Max Staff

Max Staff added the comment:

Yes I know about the errno. There would be two ways to resolve this:

One way would be by introducing a new exception class which would be nice 
because it's almost impossible to reliably check the allowed filename length 
(except for trial and error) and I have quite a few functions where I would 
want the error to propagate further as long as it's not an ENAMETOOLONG.

The other way would be by introducing a new syntax feature ("except OSError as 
e if e.errno == errno.ENAMETOOLONG:") but I don't think that that approach is 
reasonable.

--

___
Python tracker 

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



[issue30641] No way to specify "File name too long" error in except statement.

2017-06-12 Thread Antoine Pitrou

Antoine Pitrou added the comment:

On Unix, you can simply check the errno value:

>>> fn = "x" * 999
>>> try: open(fn, "r")
... except OSError as e: exc = e
... 
>>> exc.errno
36
>>> exc.errno == errno.ENAMETOOLONG
True

I don't know about Windows.

--

___
Python tracker 

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



[issue6519] Reorder 'with' statement for files in Python Tutorial

2017-06-12 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

@akuchling Can you prepare a PR on GitHub?

--
nosy: +Mariatta

___
Python tracker 

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



[issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows

2017-06-12 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> It would be nice if there were a way to disable this; perhaps something like: 
> signal.set_wakeup_fd(fd, warn_on_full_buffer=False)

That's a reasonable idea.  Nathaniel, would you like to submit a PR for this?

--
nosy: +pitrou

___
Python tracker 

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



[issue28994] Misc fixes and cleanups in error handling C code

2017-06-12 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Since I fetch, merge, and build with a .bat file that has worked fine at least 
10 times, with pushes in between, the glitch is a puzzle.  Next time I will 
just revert, as I did, or reclone and rebuild the 3.6 worktree.

--

___
Python tracker 

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



[issue28994] Misc fixes and cleanups in error handling C code

2017-06-12 Thread Zachary Ware

Zachary Ware added the comment:

Agreed, looks like something went wrong in your checkout, Terry.  Just 
confirmed that a 3.6 build on a fresh checkout on Windows is fine.

--
priority: release blocker -> normal

___
Python tracker 

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



[issue28994] Misc fixes and cleanups in error handling C code

2017-06-12 Thread Steve Dower

Steve Dower added the comment:

I just updated to the latest 3.6 commit and listobject.c doesn't even use 
clinic in this branch.

Serhiy is probably right - this is a workspace issue.

--

___
Python tracker 

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



[issue28994] Misc fixes and cleanups in error handling C code

2017-06-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Last time Objects/listobject.c was changed 2 months ago. This looks as an error 
in your workspace. Maybe something wrong happened when you switched from master 
to 3.6.

--

___
Python tracker 

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



[issue30217] Missing entry for the tilde (~) operator in the Index

2017-06-12 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


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



[issue30217] Missing entry for the tilde (~) operator in the Index

2017-06-12 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 37e04153d5e331162608b33639ecd3c9a5ae2432 by Mariatta (Marco 
Buttu) in branch '3.5':
bpo-30217: add the operators ~ and | to the index (GH-1502) (GH-2138)
https://github.com/python/cpython/commit/37e04153d5e331162608b33639ecd3c9a5ae2432


--

___
Python tracker 

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



[issue28994] Misc fixes and cleanups in error handling C code

2017-06-12 Thread Terry J. Reedy

Terry J. Reedy added the comment:

3.6 no longer compiles for me on Windows.  A repeat of pcbuild\build.bat -d 
gives the same error report as below.

My previous build was 25 hours ago.  atexitmodule.c is the only C file in the 
3.6 merge update, so the backport might be to blame.  Git status say that 
Objects/listobject is changed, even though not changed by PR 2121, and that 
there is an untracked Objects/clinic/listobject.c.h. (but there is one in 3.7, 
so...?).

chkdsk F: /F found one unrelated orphaned file but not other specific errors.  
It ended with this:

Stage 3: Examining security descriptors ...
Security descriptor verification completed.
  40783 data files processed.
CHKDSK is verifying Usn Journal...
  3224 USN bytes processed.
Usn Journal verification completed.
An unspecified error occurred (6e74667363686b2e 1475).

(which it also did a week ago) I don't remember what was done after the USN 
check.  Web search has not helped yet for the 63... error.  In any case, I 
thing someone else should verify building on Windows before 3.6.2 is tagged, if 
it has not yet been. 

  Building heads/3.6-dirty:8399a177de 3.6
  atexitmodule.c
  listobject.c
f:\dev\36\objects\clinic/listobject.c.h(24): warning C4133: 'function': 
incompatible type
s - from 'char [10]' to 'PyObject *' [f:\dev\36\PCbuild\pythoncore.vcxproj]
f:\dev\36\objects\clinic/listobject.c.h(25): warning C4133: 'function': 
incompatible type
s - from 'Py_ssize_t *' to '_PyArg_Parser *' 
[f:\dev\36\PCbuild\pythoncore.vcxproj]
f:\dev\36\objects\clinic/listobject.c.h(29): warning C4013: 
'_PyArg_NoStackKeywords' unde
fined; assuming extern returning int [f:\dev\36\PCbuild\pythoncore.vcxproj]
f:\dev\36\objects\clinic/listobject.c.h(112): warning C4133: 'function': 
incompatible typ
es - from 'char [7]' to 'PyObject *' [f:\dev\36\PCbuild\pythoncore.vcxproj]
f:\dev\36\objects\clinic/listobject.c.h(113): warning C4133: 'function': 
incompatible typ
es - from 'Py_ssize_t *' to '_PyArg_Parser *' 
[f:\dev\36\PCbuild\pythoncore.vcxproj]
f:\dev\36\objects\clinic/listobject.c.h(147): warning C4013: 
'_PyArg_ParseStackAndKeyword
s' undefined; assuming extern returning int 
[f:\dev\36\PCbuild\pythoncore.vcxproj]
f:\dev\36\objects\clinic/listobject.c.h(198): warning C4133: 'function': 
incompatible typ
es - from 'char [13]' to 'PyObject *' [f:\dev\36\PCbuild\pythoncore.vcxproj]
f:\dev\36\objects\clinic/listobject.c.h(199): warning C4047: 'function': 
'_PyArg_Parser *
' differs in levels of indirection from 'PyObject **' 
[f:\dev\36\PCbuild\pythoncore.vcxpr
oj]
f:\dev\36\objects\clinic/listobject.c.h(199): warning C4024: 
'_PyArg_ParseStack': differe
nt types for formal and actual parameter 4 
[f:\dev\36\PCbuild\pythoncore.vcxproj]
..\Objects\listobject.c(1979): error C2059: syntax error: '<<' 
[f:\dev\36\PCbuild\pythonc
ore.vcxproj]
..\Objects\listobject.c(1984): error C2014: preprocessor command must start as 
first nonw
hite space [f:\dev\36\PCbuild\pythoncore.vcxproj]
..\Objects\listobject.c(2015): error C2014: preprocessor command must start as 
first nonw
hite space [f:\dev\36\PCbuild\pythoncore.vcxproj]
..\Objects\listobject.c(2171): error C2143: syntax error: missing ';' before 
'<<' [f:\dev
\36\PCbuild\pythoncore.vcxproj]
..\Objects\listobject.c(2173): error C2143: syntax error: missing ';' before 
'==' [f:\dev
\36\PCbuild\pythoncore.vcxproj]
..\Objects\listobject.c(2175): error C2143: syntax error: missing ';' before 
'>>' [f:\dev
\36\PCbuild\pythoncore.vcxproj]
..\Objects\listobject.c(2175): error C2014: preprocessor command must start as 
first nonw
hite space [f:\dev\36\PCbuild\pythoncore.vcxproj]
..\Objects\listobject.c(2256): error C2143: syntax error: missing ';' before 
'<<' [f:\dev
\36\PCbuild\pythoncore.vcxproj]
..\Objects\listobject.c(2261): error C2143: syntax error: missing ';' before 
'==' [f:\dev
\36\PCbuild\pythoncore.vcxproj]
..\Objects\listobject.c(2262): error C2014: preprocessor command must start as 
first nonw
hite space [f:\dev\36\PCbuild\pythoncore.vcxproj]
..\Objects\listobject.c(2268): error C2059: syntax error: 'if' 
[f:\dev\36\PCbuild\pythonc
ore.vcxproj]
..\Objects\listobject.c(2273): error C2059: syntax error: 'for' 
[f:\dev\36\PCbuild\python
core.vcxproj]
..\Objects\listobject.c(2273): error C2143: syntax error: missing '{' before 
'<' [f:\dev\
36\PCbuild\pythoncore.vcxproj]
..\Objects\listobject.c(2273): error C2059: syntax error: '<' 
[f:\dev\36\PCbuild\pythonco
re.vcxproj]
..\Objects\listobject.c(2273): error C2143: syntax error: missing '{' before 
'++' [f:\dev
\36\PCbuild\pythoncore.vcxproj]
..\Objects\listobject.c(2273): error C2059: syntax error: '++' 
[f:\dev\36\PCbuild\pythonc
ore.vcxproj]
..\Objects\listobject.c(2273): error C2059: syntax error: ')' 
[f:\dev\36\PCbuild\pythonco
re.vcxproj]
..\Objects\listobject.c(2280): error C2059: syntax error: 'string' 
[f:\dev\36\PCbuild\pyt
honcore.vcxproj]
..\Objects\listobject.c(2280): error C2040: 'PyErr_Format': 'int ()' differs in 
levels of
 indirection from 

[issue30217] Missing entry for the tilde (~) operator in the Index

2017-06-12 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset bbb335891c2967bd13fbe2da775c0348260d95cb by Mariatta (Marco 
Buttu) in branch '2.7':
bpo-30217: add the operators ~ and | to the index (GH-1502) (GH-2137)
https://github.com/python/cpython/commit/bbb335891c2967bd13fbe2da775c0348260d95cb


--

___
Python tracker 

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



[issue30217] Missing entry for the tilde (~) operator in the Index

2017-06-12 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset f59cac4b6458e5c47e24a39ba46fb178c3766577 by Mariatta (Marco 
Buttu) in branch '3.6':
bpo-30217: add the operators ~ and | to the index (GH-1502) (GH-2136)
https://github.com/python/cpython/commit/f59cac4b6458e5c47e24a39ba46fb178c3766577


--
nosy: +Mariatta

___
Python tracker 

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



[issue30593] sqlite3 executescript does not respect isolation_level?

2017-06-12 Thread Noah Levitt

Changes by Noah Levitt :


Added file: http://bugs.python.org/file46943/issue30593-test.diff

___
Python tracker 

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



[issue30593] sqlite3 executescript does not respect isolation_level?

2017-06-12 Thread Noah Levitt

Noah Levitt added the comment:

And here's a fix.

Unfortunately I think the change could break people's scripts. If they have 
isolation_level set (not None) and use executescript(), they will have to issue 
an explicit call to connection.commit().

executescript() could do the commit itself explicitly after running the sql, I 
suppose. Then the behavior is much like the old behavior, but at least you get 
the performance boost of running inside a transaction. (Substantial if you pass 
10k insert statements to executescript(), or something like that.)

Or, we could not change the code, and instead change the documentation. The 
docs could suggest wrapping the sql script with "begin;" and "commit;".

--
keywords: +patch
Added file: http://bugs.python.org/file46942/issue30593-fix.diff

___
Python tracker 

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



[issue30641] No way to specify "File name too long" error in except statement.

2017-06-12 Thread R. David Murray

R. David Murray added the comment:

There appears to be an errno for file name too long, so I presume you are 
making a feature request for a new exception class.  I believe Antoine tried to 
strike a balance between the utility of the sub-exceptions and their number, so 
you'll have to make an argument for its utility.

--
components: +Library (Lib) -IO
nosy: +pitrou, r.david.murray
type: behavior -> 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



[issue30593] sqlite3 executescript does not respect isolation_level?

2017-06-12 Thread Noah Levitt

Noah Levitt added the comment:

Here's a test case

--

___
Python tracker 

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



[issue9566] Compilation warnings under x64 Windows

2017-06-12 Thread Steve Dower

Changes by Steve Dower :


--
pull_requests:  -2171

___
Python tracker 

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



[issue30630] Missing MSI files

2017-06-12 Thread Steve Dower

Steve Dower added the comment:

Try installing https://go.microsoft.com/fwlink/?LinkId=746572 separately. This 
should add the required files, and because it's the "official" installer will 
provide more details about the underlying error (if any).

You may also need to reboot your machine. This is a system update, not a 
trivial file installation.

--

___
Python tracker 

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



[issue30639] inspect.getfile(obj) calls object repr on failure

2017-06-12 Thread Thomas Kluyver

Thomas Kluyver added the comment:

OK, I've updated the PR to do that.

--

___
Python tracker 

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



[issue30641] No way to specify "File name too long" error in except statement.

2017-06-12 Thread Max Staff

New submission from Max Staff:

There are different ways to catch exceptions of the type "OSError": By using 
"except OSError as e:" and then checking the errno or by using "except 
FileNotFoundError e:" or "except FileExistsError e:" or whatever error one 
wants to catch. There's no such way for above mentioned error that occurs when 
a filename is too long for the filesystem/OS.

--
components: IO
messages: 295810
nosy: Max Staff
priority: normal
severity: normal
status: open
title: No way to specify "File name too long" error in except statement.
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4, 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



[issue30639] inspect.getfile(obj) calls object repr on failure

2017-06-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The address of the object is not informative. The possibility of getting a 
source file is determined by the type of the object.

--

___
Python tracker 

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




[issue30639] inspect.getfile(obj) calls object repr on failure

2017-06-12 Thread Thomas Kluyver

Thomas Kluyver added the comment:

Sure, I can do that if you want. The other thing I thought of was using 
object.__repr__, so the repr always shows like  .

--

___
Python tracker 

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



[issue30639] inspect.getfile(obj) calls object repr on failure

2017-06-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think in that case it is enough to report just type name.

--
nosy: +serhiy.storchaka
type: behavior -> 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



[issue30639] inspect.getfile(obj) calls object repr on failure

2017-06-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
keywords: +easy

___
Python tracker 

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



[issue30632] IDLE: add unittest to test_autocomplete

2017-06-12 Thread Terry J. Reedy

Terry J. Reedy added the comment:

This issue, and in part the patch, appears to be a duplicate of #30348.  What 
am I missing?  An issue can have multiple PRs, and one can either replace 
another one that is closed or augment one that must be applied first.

--

___
Python tracker 

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



[issue30571] Add integer formatting code for fixed-width signed arithmetic (2's complement)

2017-06-12 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The format code space is already crowded, and it isn't immediately obvious that 
'08B' will format the 2's complement representation of the number, as opposed 
to '08b' which prepends a sign bit.  Not to mention that, as Raymond remarked, 
we cannot use the same convention for hex formatting where 'X' already has a 
different meaning.

Instead, how about adding an optional argument to bin()?  And then we can also 
do the same for hex().

By the way, I do find annoying the default behaviour of prepending a sign bit 
on hexadecimal and binary displays (but I never use binary displays, so my 
annoyance is really with hexadecimal displays).

--
nosy: +pitrou

___
Python tracker 

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



[issue30217] Missing entry for the tilde (~) operator in the Index

2017-06-12 Thread Marco Buttu

Changes by Marco Buttu :


--
pull_requests: +2192

___
Python tracker 

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



[issue30217] Missing entry for the tilde (~) operator in the Index

2017-06-12 Thread Marco Buttu

Changes by Marco Buttu :


--
pull_requests: +2191

___
Python tracker 

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



[issue30217] Missing entry for the tilde (~) operator in the Index

2017-06-12 Thread Marco Buttu

Changes by Marco Buttu :


--
pull_requests: +2190

___
Python tracker 

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



[issue22559] [2.7] Backport ssl.MemoryBIO to Python 2.7 - PEP 546

2017-06-12 Thread Christian Heimes

Christian Heimes added the comment:

Sounds good to me! I'll take care of the other patch after you have committed 
your PR.

--

___
Python tracker 

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



[issue30596] Add close() to multiprocessing.Process

2017-06-12 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I've decided it's better to raise a ValueError if the child process hasn't 
stopped yet.  After all, join() alone may have no effect: often you want to 
send the process a signal (a literal signal in UNIX terms, or a figurative 
signal such as write something on a socket, etc.) to ask it to terminate gently.

I'm gonna update the PR soon.

--

___
Python tracker 

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



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-12 Thread Ned Deily

Ned Deily added the comment:


New changeset a77a35d70ba8aed047e63d4d9f7d0554e98d4c4b by Ned Deily (Antoine 
Pietri) in branch 'master':
bpo-30177: add NEWS entry (#2135)
https://github.com/python/cpython/commit/a77a35d70ba8aed047e63d4d9f7d0554e98d4c4b


--

___
Python tracker 

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



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-12 Thread Antoine Pietri

Changes by Antoine Pietri :


--
pull_requests: +2189

___
Python tracker 

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



[issue22559] [2.7] Backport ssl.MemoryBIO to Python 2.7 - PEP 546

2017-06-12 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy:  -pitrou

___
Python tracker 

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



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-12 Thread Ned Deily

Ned Deily added the comment:


New changeset 8399a177de8bfa860a66e96665488c17199cb9d2 by Ned Deily (Antoine 
Pietri) in branch '3.6':
[3.6] bpo-30177: add NEWS entry (#2134)
https://github.com/python/cpython/commit/8399a177de8bfa860a66e96665488c17199cb9d2


--

___
Python tracker 

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



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-12 Thread Antoine Pietri

Changes by Antoine Pietri :


--
pull_requests: +2188

___
Python tracker 

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



[issue22559] [2.7] Backport ssl.MemoryBIO to Python 2.7 - PEP 546

2017-06-12 Thread STINNER Victor

Changes by STINNER Victor :


--
title: [backport] ssl.MemoryBIO -> [2.7] Backport ssl.MemoryBIO to Python 2.7 - 
PEP 546

___
Python tracker 

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



[issue22559] [backport] ssl.MemoryBIO

2017-06-12 Thread STINNER Victor

STINNER Victor added the comment:

Christian Heimes: "You have to include the changes from #29334, too."

Right now, we are only allow to squash a patch serie into an unique patch. I 
would prefer to keep the fix of bpo-29334 as a separated commit, so merge it 
after MemoryBIO is merged. The change seems to change different lines, so it 
will be fine.

--

___
Python tracker 

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



[issue22559] [backport] ssl.MemoryBIO

2017-06-12 Thread STINNER Victor

STINNER Victor added the comment:

I converted issue22559.diff to a pull request. I only had one conflict!

--- Lib/ssl.py
+++ Lib/ssl.py
@@ -727,11 +857,7 @@ class SSLSocket(socket):
 if not self._sslobj:
 raise ValueError("Read on closed or unwrapped SSL socket.")
 try:
-if buffer is not None:
-v = self._sslobj.read(len, buffer)
-else:
-v = self._sslobj.read(len or 1024)
-return v
+return self._sslobj.read(len, buffer)
 except SSLError as x:
 if x.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs:
 if buffer is not None:

I fixed it by using "return self._sslobj.read(len, buffer)".

I added a second commit to synchronize Lib/ssl.py with master:

* add selected_alpn_protocol() method, needed by test_ssl
* change how the default size of read() is defined
* change how send()/write result is reported: handle 
SSL_ERROR_WANT_READ/SSL_ERROR_WANT_WRITE

I tagged my PR as [WIP] since I'm not sure if I backported bpo-20951 
"SSLSocket.send() returns 0 for non-blocking socket" by mistake or not :-)

Please review the PR carefully!

--

___
Python tracker 

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



[issue22559] [backport] ssl.MemoryBIO

2017-06-12 Thread Christian Heimes

Christian Heimes added the comment:

You have to include the changes from #29334, too.

--

___
Python tracker 

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



[issue29334] ssl.SSLObject method getpeercert() is buggy, do_handshake() is strange

2017-06-12 Thread Christian Heimes

Christian Heimes added the comment:

Also needs backport to 2.7 for #22559

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



[issue22559] [backport] ssl.MemoryBIO

2017-06-12 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2187

___
Python tracker 

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



[issue30639] inspect.getfile(obj) calls object repr on failure

2017-06-12 Thread Thomas Kluyver

Changes by Thomas Kluyver :


--
pull_requests: +2186

___
Python tracker 

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



[issue30639] inspect.getfile(obj) calls object repr on failure

2017-06-12 Thread Thomas Kluyver

Thomas Kluyver added the comment:

Not exactly a bug, but I think that an improvement is possible. My plan is to 
delay computing the repr until the error is formatted, so that code which 
catches the TypeError can carry on safely.

I think this is more relevant for inspect than for many other modules, because 
by design, we're often calling inspect functions on arbitrary objects which we 
can make few guarantees about.

--

___
Python tracker 

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



[issue30638] Additional dependencies and rule for `make regen-all`

2017-06-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> I don't think that we want `make regen-all` to require internet access.

Agree. I mentioned it only because these files also are generated.

--

___
Python tracker 

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



[issue30640] NULL + 1 in _PyFunction_FastCallDict()

2017-06-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, I mean the "k + 1" with k=NULL.

Even if _PyEval_EvalCodeWithName() ignores that value, this still is an 
undefined behavior. For example the compiler can decide that since NULL+1 is 
not valid, then k never is NULL, and ignore the branch that sets k to NULL. It 
can also not generate the code in _PyEval_EvalCodeWithName() for handling the 
case kwcount == 0.

--

___
Python tracker 

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



[issue30571] Add integer formatting code for fixed-width signed arithmetic (2's complement)

2017-06-12 Thread Stefan Krah

Stefan Krah added the comment:

To expand on what Mark said:  If the proposed format code implicitly
gives these results ...


>>> format(12 % 2**8, '08b')
'1100'
>>> format(-12 % 2**8, '08b')
'0100'

..., would students not expect that these two operations have the same
result?

>>> 0b0100 | 0b1100
252
>>> 
>>> -12 | 12
-4

--
nosy: +skrah

___
Python tracker 

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



[issue30639] inspect.getfile(obj) calls object repr on failure

2017-06-12 Thread R. David Murray

R. David Murray added the comment:

What is your proposed solution?  This doesn't at the moment sound like a bug in 
Python to me.

--
nosy: +r.david.murray

___
Python tracker 

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



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

2017-06-12 Thread STINNER Victor

STINNER Victor added the comment:

> Also with that, many implementors will not want to care about keyword 
> arguments and would thus appreciate it if they didn't have to. Forcing them 
> to test for keyword arguments and raising the correct error for it (with the 
> correct and consistent message) seems an entirely unnecessary imposition.

Ah, I took the habit of using Argument Clinic, so I don't have to both to thing 
anymore :-) But yes, writing manually the PyArg_XXX() code is boring and 
error-prone, I agree.

--

___
Python tracker 

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



[issue30617] IDLE: Add docstrings and unittests to outwin.py

2017-06-12 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Thanks!

I've added more unittests.  They are passing, but I'm getting a callback error 
that I don't understand.  The same _utest flag that's on the textview dialog 
didn't seem to work and I was just blindly trying things without success.  
Also, the window is briefly opening and closing on the screen.  Any suggestions 
on where I should look next?

B3 below.  Thanks for the link to that other message.  Combining that with some 
comments on SO, I tried to find unicode that would be selected by \d and would 
fail with int(), but couldn't find any.  However, I also realized that the 
try/except is checking for a TypeError and not a ValueError.  I went and looked 
at the change history for OutputWindow, but couldn't see anything that would 
show why there might be a TypeError check here.  If the match group is None, it 
wouldn't get this far in the code.

Additionally,
1.  I removed 'from tkinter import *' because it wasn't being used.
2.  I changed 'import tkinter.messagebox as tkMessageBox' per issue 30422.
3.  There were two lines:
edit = self.flist.open(filename)
edit.gotoline(lineno)
but flist had a gotofileline() that did the same thing.  In the historical 
code, the 'edit = ' line had and 'or', so maybe that's why it was separated.
4.  *args on the __init__.  I've seen *args used for passing config options and 
things like that, but I don't understand why it would be preferable here 
instead of listing the 4 arguments explicitly.

Thanks!

--

___
Python tracker 

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



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

2017-06-12 Thread Stefan Behnel

Stefan Behnel added the comment:

I do not see this as a matter of performance but as a matter of usability. 
Basically, CPython could do just fine with just a single catch-all calling 
convention that packs all pos/kw arguments into C arguments and passes them 
over, leaving it entirely to the callee to handle them. Why does it not do 
that? Because it's cumbersome for the callee to analyse what kind of arguments 
it received and how to handle them.

A surprisingly large number of functions take only a single argument, that's 
why METH_O exists. Many functions take no keyword arguments, that's why VARARGS 
and KEYWORDS are separate options. The same should apply to FASTCALL. Also with 
that, many implementors will not want to care about keyword arguments and would 
thus appreciate it if they didn't have to. Forcing them to test for keyword 
arguments and raising the correct error for it (with the correct and consistent 
message) seems an entirely unnecessary imposition.

--

___
Python tracker 

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



[issue30640] NULL + 1 in _PyFunction_FastCallDict()

2017-06-12 Thread STINNER Victor

STINNER Victor added the comment:

Can you please show me the line doing NULL+1? I don't see it. Or do you mean 
the "k + 1" with k=NULL?

_PyEval_EvalCodeWithName() ignores kwnames and kwargs when kwcount is zero. So 
I don't think that the value of NULL+1 matters here :-)

--

___
Python tracker 

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



[issue30571] Add integer formatting code for fixed-width signed arithmetic (2's complement)

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



[issue30640] NULL + 1 in _PyFunction_FastCallDict()

2017-06-12 Thread STINNER Victor

Changes by STINNER Victor :


--
title: NULL + 1 -> NULL + 1 in _PyFunction_FastCallDict()

___
Python tracker 

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



[issue30638] Additional dependencies and rule for `make regen-all`

2017-06-12 Thread Zachary Ware

Zachary Ware added the comment:

Agreed with all of the above, with the possible exception of 6; I don't think 
that we want `make regen-all` to require internet access.

Please make sure that the PR for this includes removing the explicit `make 
clinic` from .travis.yml.

--
nosy: +zach.ware

___
Python tracker 

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



[issue30640] NULL + 1

2017-06-12 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

In _PyFunction_FastCallDict() if nk == 0, k is set to NULL. After that k + 1 is 
passed to _PyEval_EvalCodeWithName(). NULL + 1 is an undefined behavior.

--
components: Interpreter Core
messages: 295786
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: NULL + 1
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



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

2017-06-12 Thread STINNER Victor

STINNER Victor added the comment:

Here are benchmark results. Sorry, but I'm not really convinced that this 
specialization is worth it.

The change adds yet another calling convention where we already have 
METH_NOARG, METH_VARARGS, METH_O, METH_NOARG | METH_KEYWORDS, METH_FASTCALL...

I'm ok to add a new calling convention but only if it's faster on more 
benchmarks or if it uses much less memory. It doesn't seem to be the case with 
the current change.


Differences of at least 5%:

haypo@speed-python$ python3 -m perf compare_to 
/home/haypo/json/2017-06-09_08-18-master-ef8320cf6f09.json.gz 
~/json/patch/2017-06-09_08-18-master-ef8320cf6f09-patch-1955.json.gz -G 
--min-speed=5 --table

+-+--+-+
| Benchmark   | 2017-06-09_08-18-master-ef8320cf6f09 | 
2017-06-09_08-18-master-ef8320cf6f09-patch-1955 |
+=+==+=+
| spectral_norm   | 283 ms   | 263 ms: 
1.08x faster (-7%)  |
+-+--+-+
| scimark_lu  | 294 ms   | 314 ms: 
1.07x slower (+7%)  |
+-+--+-+
| scimark_sparse_mat_mult | 8.15 ms  | 9.12 ms: 
1.12x slower (+12%)|
+-+--+-+


Differences of at least 2%:

haypo@speed-python$ python3 -m perf compare_to 
/home/haypo/json/2017-06-09_08-18-master-ef8320cf6f09.json.gz 
~/json/patch/2017-06-09_08-18-master-ef8320cf6f09-patch-1955.json.gz -G 
--min-speed=2 --table

+-+--+-+
| Benchmark   | 2017-06-09_08-18-master-ef8320cf6f09 | 
2017-06-09_08-18-master-ef8320cf6f09-patch-1955 |
+=+==+=+
| spectral_norm   | 283 ms   | 263 ms: 
1.08x faster (-7%)  |
+-+--+-+
| genshi_text | 73.1 ms  | 70.5 ms: 
1.04x faster (-3%) |
+-+--+-+
| scimark_monte_carlo | 209 ms   | 201 ms: 
1.04x faster (-3%)  |
+-+--+-+
| raytrace| 1.05 sec | 1.02 sec: 
1.02x faster (-2%)|
+-+--+-+
| regex_v8| 40.3 ms  | 41.4 ms: 
1.03x slower (+3%) |
+-+--+-+
| json_dumps  | 26.2 ms  | 27.0 ms: 
1.03x slower (+3%) |
+-+--+-+
| float   | 207 ms   | 215 ms: 
1.04x slower (+4%)  |
+-+--+-+
| crypto_pyaes| 199 ms   | 207 ms: 
1.04x slower (+4%)  |
+-+--+-+
| scimark_fft | 644 ms   | 675 ms: 
1.05x slower (+5%)  |
+-+--+-+
| scimark_lu  | 294 ms   | 314 ms: 
1.07x slower (+7%)  |
+-+--+-+
| scimark_sparse_mat_mult | 8.15 ms  | 9.12 ms: 
1.12x slower (+12%)|
+-+--+-+

--

___
Python 

[issue30596] Add close() to multiprocessing.Process

2017-06-12 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I want close() to be deterministic.  So I guess we have two simple 
possibilities:
1) close() raises if the process is still alive
2) close() calls join() implicitly if the process is still alive

--

___
Python tracker 

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



[issue30596] Add close() to multiprocessing.Process

2017-06-12 Thread Jim Jewett

Jim Jewett added the comment:

Could join be called in a background thread, or even asynchronously?  That
seems like mixing paradigms, but ...

On Jun 12, 2017 3:15 AM, "Antoine Pitrou"  wrote:

>
> Antoine Pitrou added the comment:
>
> That's a good question.  close() methods on other objects tend to avoid
> taking an infinite amount of time :-)  But then, Process objects are
> different enough that they don't need to follow that rule.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue30639] inspect.getfile(obj) calls object repr on failure

2017-06-12 Thread Thomas Kluyver

New submission from Thomas Kluyver:

This came up in IPython & Jedi: several functions in inspect end up calling 
getfile(). If the object is something for which it can't find the source file, 
it throws an error, the message for which contains the object's repr.

This is problematic for us because for some objects the repr may be expensive 
to calculate (e.g. data tables where the repr forms primary output, not just 
debugging information). In some cases, it could also throw another error.

I plan to make a PR for this, but I'm opening an issue so I've got a bpo number.

https://github.com/ipython/ipython/issues/10493
https://github.com/davidhalter/jedi/issues/919

--
components: Library (Lib)
messages: 295782
nosy: takluyver
priority: normal
severity: normal
status: open
title: inspect.getfile(obj) calls object repr on failure
type: behavior

___
Python tracker 

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



[issue30615] [EASY][2.7] test_recursive_repr() of test_xml_etree_c leaks references

2017-06-12 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


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



[issue30638] Additional dependencies and rule for `make regen-all`

2017-06-12 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

`make regen-all` regenerates many generated files. But not all.

1. Argument Clinic files has their own make target, `make clinic`. Perhaps 
"clinic" should be a dependency for "regen-all".

2. Lib/token.py and Lib/symbols.py are generated from Include/token.h and 
Include/graminit.h.

3. Lib/keyword.py is generated from graminit.c.

4. Modules/sre_constants.h is generated from Lib/sre_constants.py.

5. Lib/stringprep.py is generated by mkstringprep.py (currently it is slightly 
outdated).

6. Objects/unicodetype_db.h, Objects/unicodetype_db.h and 
Modules/unicodename_db.h are generated by makeunicodedata.py (it downloads 
Unicode data from Internet).

Some generating scripts support Python 2.7 and even older versions. Some 
generating scripts (in particular Argument Clinic) need recent Python version 
(3.5+ or like).

--
components: Build
messages: 295781
nosy: haypo, ncoghlan, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Additional dependencies and rule for `make regen-all`
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



[issue30615] [EASY][2.7] test_recursive_repr() of test_xml_etree_c leaks references

2017-06-12 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 41af942e57f9a450cf273ef6b72a21380c6ba8d1 by Victor Stinner 
(Stéphane Wirtel) in branch '2.7':
bpo-30615: Fix the leak reference in Modules/_elementtree.c (#2129)
https://github.com/python/cpython/commit/41af942e57f9a450cf273ef6b72a21380c6ba8d1


--

___
Python tracker 

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



[issue28180] sys.getfilesystemencoding() should default to utf-8

2017-06-12 Thread Nick Coghlan

Changes by Nick Coghlan :


--
pull_requests: +2184

___
Python tracker 

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



[issue30589] With forkserver, Process.exitcode does not get signal number

2017-06-12 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I've merged a fix for Python 3.7.  Since the fix is a bit delicate, I don't 
want to risk regression by merging it into 3.6 and 3.5. Closing now.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue30589] With forkserver, Process.exitcode does not get signal number

2017-06-12 Thread Antoine Pitrou

Antoine Pitrou added the comment:


New changeset dfd5f34634f9c505945e9348b4b799544680a7cf by Antoine Pitrou in 
branch 'master':
Fix bpo-30589: improve Process.exitcode with forkserver (#1989)
https://github.com/python/cpython/commit/dfd5f34634f9c505945e9348b4b799544680a7cf


--

___
Python tracker 

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



[issue30636] Add PYTHONCOERCECLOCALE to the help of the command line

2017-06-12 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


--
pull_requests: +2185

___
Python tracker 

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



[issue30636] Add PYTHONCOERCECLOCALE to the help of the command line

2017-06-12 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

yep, I see that, I fix it asap

--

___
Python tracker 

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



[issue30636] Add PYTHONCOERCECLOCALE to the help of the command line

2017-06-12 Thread Nick Coghlan

Nick Coghlan added the comment:

I just noticed that there's a line-wrapping problem in the patch as-merged. The 
output ends up being:

PYTHONCOERCECLOCALE: if this variable is set to 0, it disables the locale
coercion behavior

It should either match the immediately preceding settings, which use a three 
space indent:

PYTHONMALLOC: set the Python memory allocators and/or install debug hooks
   on Python memory allocators. Use PYTHONMALLOC=debug to install debug
   hooks.

While some of the earlier ones align the continuation line with the opening 
text on the first line, those are all for much shorter variable names.

--
components: +Interpreter Core
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open

___
Python tracker 

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



  1   2   >