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



[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



[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



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



[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



[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



[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



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



[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



[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



[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



[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



[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



[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



[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



[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



[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



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

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



[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



[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



[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



[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



[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



[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



[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

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



[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



[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



[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



[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



[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

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

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

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



[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



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

2017-06-12 Thread Eryk Sun

Eryk Sun added the comment:

An exception specifically for ENAMETOOLONG would be limited to Unix systems.

The Windows CRT defines ENAMETOOLONG but doesn't use it. Windows file systems 
do not return a specific status code for a filename that's too long. Per MS-FSA 
2.1.5.1 [1], a request to open a file must fail with STATUS_OBJECT_NAME_INVALID 
if the name is invalid according to the spec in MS-FSCC 2.1.5 [2] (e.g. max 
component length cannot exceed 255 characters and may be less). This doesn't 
tell the caller why the filename is invalid. Anyway, for what it's worth, the 
Windows API translates this status code to ERROR_INVALID_NAME (0x007B), and the 
CRT in turn maps the latter to EINVAL.

Also, for versions prior to Windows 10, or Windows 10 without the 
LongPathsEnabled policy setting, the observed error is more commonly due to 
path preprocessing in user mode. In this case DOS paths are limited to MAX_PATH 
(260). The error depends on the called function -- e.g. CreateFileA vs 
SetCurrentDirectoryA, or calling the [A]NSI vs [W]ide-character version. It 
could be ERROR_PATH_NOT_FOUND (ENOENT), ERROR_FILENAME_EXCED_RANGE (ENOENT), or 
ERROR_INVALID_PARAMETER (EINVAL). 

[1]: https://msdn.microsoft.com/en-us/library/ff469536
[2]: https://msdn.microsoft.com/en-us/library/cc422524

--
nosy: +eryksun

___
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 Louie Lu

Louie Lu added the comment:

test_query were fixed in PR 2147, which is leak by not removing mock.Mock() in 
dialog.

--

___
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 Nick Coghlan

Nick Coghlan added the comment:

Indeed, Emily is correct: this is expected behaviour for system Python versions 
that don't patch their ensurepip modules, as the default pip (et al) used in 
virtual environments created with the venv module generally only gets upgraded 
when upgrading to a new maintenance release of CPython.

Some redistributors do patch the ensurepip module to seed virtual environments 
based on the installed system level packages, so if your redistributor is one 
that already does so (e.g. Fedora), then you may have a downstream bug to file, 
and if they don't, then you may have a downstream feature request to ask them 
to switch to that model rather than using the files bundled by upstream.

In the meantime, the two main approaches folks adopt to make sure that they 
always have the latest versions of these components installed by default are:

- using the latest version of the third party `virtualenv` module for venv 
management (as that gets updated independently of the CPython maintenance 
release cycle)
- running "python -m pip install --upgrade pip setuptools wheel" immediately 
after creating each virtual environment

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

___
Python tracker 

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



[issue30643] test_basic_script_no_suffix() of test_multiprocessing_main_handling timeout after 20 min on Travis CI

2017-06-12 Thread STINNER Victor

New submission from STINNER Victor:

https://travis-ci.org/python/cpython/jobs/242108490#L2211


0:22:46 load avg: 62.38 [406/406/1] test_multiprocessing_main_handling crashed 
(Exit code 1)

Timeout (0:20:00)!

Thread 0x2b175d341400 (most recent call first):

  File "/home/travis/build/python/cpython/Lib/selectors.py", line 415 in select

  File "/home/travis/build/python/cpython/Lib/subprocess.py", line 1488 in 
_communicate

  File "/home/travis/build/python/cpython/Lib/subprocess.py", line 840 in 
communicate

  File "/home/travis/build/python/cpython/Lib/test/support/script_helper.py", 
line 126 in run_python_until_end

  File "/home/travis/build/python/cpython/Lib/test/support/script_helper.py", 
line 135 in _assert_python

  File "/home/travis/build/python/cpython/Lib/test/support/script_helper.py", 
line 151 in assert_python_ok

  File 
"/home/travis/build/python/cpython/Lib/test/test_multiprocessing_main_handling.py",
 line 157 in _check_script

  File 
"/home/travis/build/python/cpython/Lib/test/test_multiprocessing_main_handling.py",
 line 169 in test_basic_script_no_suffix

  File "/home/travis/build/python/cpython/Lib/unittest/case.py", line 605 in run

  File "/home/travis/build/python/cpython/Lib/unittest/case.py", line 653 in 
__call__

  File "/home/travis/build/python/cpython/Lib/unittest/suite.py", line 122 in 
run

  File "/home/travis/build/python/cpython/Lib/unittest/suite.py", line 84 in 
__call__

  File "/home/travis/build/python/cpython/Lib/unittest/suite.py", line 122 in 
run

  File "/home/travis/build/python/cpython/Lib/unittest/suite.py", line 84 in 
__call__

  File "/home/travis/build/python/cpython/Lib/unittest/suite.py", line 122 in 
run

  File "/home/travis/build/python/cpython/Lib/unittest/suite.py", line 84 in 
__call__

  File "/home/travis/build/python/cpython/Lib/unittest/runner.py", line 176 in 
run

  File "/home/travis/build/python/cpython/Lib/test/support/__init__.py", line 
1896 in _run_suite

  File "/home/travis/build/python/cpython/Lib/test/support/__init__.py", line 
1936 in run_unittest

  File "/home/travis/build/python/cpython/Lib/test/libregrtest/runtest.py", 
line 164 in test_runner

  File "/home/travis/build/python/cpython/Lib/test/libregrtest/runtest.py", 
line 165 in runtest_inner

  File "/home/travis/build/python/cpython/Lib/test/libregrtest/runtest.py", 
line 119 in runtest

  File "/home/travis/build/python/cpython/Lib/test/libregrtest/runtest_mp.py", 
line 71 in run_tests_slave

  File "/home/travis/build/python/cpython/Lib/test/libregrtest/main.py", line 
481 in _main

  File "/home/travis/build/python/cpython/Lib/test/libregrtest/main.py", line 
474 in main

  File "/home/travis/build/python/cpython/Lib/test/libregrtest/main.py", line 
538 in main

  File "/home/travis/build/python/cpython/Lib/test/regrtest.py", line 46 in 
_main

  File "/home/travis/build/python/cpython/Lib/test/regrtest.py", line 50 in 


  File "/home/travis/build/python/cpython/Lib/runpy.py", line 85 in _run_code

  File "/home/travis/build/python/cpython/Lib/runpy.py", line 193 in 
_run_module_as_main

--
components: Tests
messages: 295854
nosy: davin, haypo, pitrou
priority: normal
severity: normal
status: open
title: test_basic_script_no_suffix() of test_multiprocessing_main_handling 
timeout after 20 min on Travis CI
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



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

2017-06-12 Thread Mark Dickinson

Mark Dickinson added the comment:

-1 from me. Using `format(x % 2**8, '08b')` seems both short enough to be easy 
to use, and long enough to remind one that there's something a little bit 
unnatural going on here, given that two's complement isn't something that makes 
sense for arbitrary-sized integers.

--
nosy: +eric.smith

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

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-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27240] 'UnstructuredTokenList' object has no attribute '_fold_as_ew'

2017-06-12 Thread Zhang Wenbo

Zhang Wenbo added the comment:

I think I find a case which can reproduct this bug: 
the UnstructuredTokenList has a ValueTerminal which is long enough(its encoded 
word is longer than policy.maxlen ) and not at the beginning.

For examples, the following subjects can cause this bug:

- 'Re: 我只是一个有那么一点点长的主题而已'
- '回复: 回复:【北京大学-2017年招生信息公告】'

So, the code can not fold a ValueTerminal correctly. 
Seems the method `_fold_as_ew` was designed to do this, but it is missing.

--
Added file: http://bugs.python.org/file46941/test2.py

___
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 Serhiy Storchaka

Serhiy Storchaka added the comment:

Concur with Mark. Similar issues already were raised multiple times on mailing 
lists and the conclusion is that explicit wrapping integers to specific range 
is better. Different behavior for integers out of range is needed in different 
applications.

--
nosy: +serhiy.storchaka

___
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 Raymond Hettinger

Raymond Hettinger added the comment:

This is a recurring need in my teaching of Python to hardware engineers.   The 
whole point of having a binary format code is to show which bits are set.  For 
negative values, that need is not being served by the current option.  And it 
makes it awkward when modeling the effects of bitwise operations on signed 
numbers.

I can understand a -1 if you think this is fundamentally broken, but if you're 
just saying that you've never personally needed this or casually dismissing the 
awkwardness of the usual workarounds, then it seems like a meaningless vote 
that blows-off my proposal which is based on real-world classroom experiences.

The idea is that modifier (such as "!" would require a width argument (the 
signed representation only make sense in fixed width concepts as every assembly 
language programmer knows).  Its presence would also imply the "0".

Serhiy, I believe you've either read different maillist posts than I have or 
that you're misinterpreting this as a proposal for a fixed width integer type 
with automatic wrap-around and truncation (full emulation of a register).  This 
proposal is for display formatting only.  IMO, it remedies a deficiency where 
the current option is more for our convenience (not wanting to deal with the 
width) rather than for the user's convenience where the user wants to see which 
bits are set rather than seeing a minus sign (which is both obvious and 
useless).

Also, when a senior coredev presents a proposal, I expect that it will be 
greeted with a little more open mindedness and not instantly shot down as if I 
have no idea what I'm talking about.

--

___
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 Serhiy Storchaka

Serhiy Storchaka added the comment:

> The idea is that modifier (such as "!" would require a width argument (the 
> signed representation only make sense in fixed width concepts as every 
> assembly language programmer knows).  Its presence would also imply the "0".

I would use the precision for this. Truncating the number of digits in integer 
representation is similar to truncating the number of characters for strings.

But actually I don't think we should add such feature in the core. It has very 
limited application. This can be implemented as a third-part library.

Actually I think the stdlib needs something like bitarray and/or bitset. The 
specially purposed types that allow testing and modifying separate bits and bit 
ranges.

--

___
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 Louie Lu

New submission from Louie Lu:

Add unittest to test_open_completions, test_fetch_copmletions, and 
test_get_entity in test_autocomplete

--
assignee: terry.reedy
components: IDLE
messages: 295755
nosy: louielu, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: add unittest to test_autocomplete
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



[issue30632] IDLE: add unittest to test_autocomplete

2017-06-12 Thread Louie Lu

Changes by Louie Lu :


--
pull_requests: +2178

___
Python tracker 

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



[issue23033] Disallow support for a*.example.net, *a.example.net, and a*b.example.net in certificate wildcard handling.

2017-06-12 Thread Christian Heimes

Christian Heimes added the comment:

It's probably not a good idea to port it to 3.6. It's a backwards incompatible 
change.

--

___
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

New submission from Andreas Jung:

Installing Python 3.6.1 from the sources on OpenSuse 42.1 gives me:

o Python/mystrtoul.o Python/mysnprintf.o Python/peephole.o Python/pyarena.o 
Python/pyctype.o Python/pyfpe.o Python/pyhash.o Python/pylifecycle.o 
Python/pymath.o Python/pystate.o Python/pythonrun.o Python/pytime.o 
Python/random.o Python/structmember.o Python/symtable.o Python/sysmodule.o 
Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o 
Python/pystrhex.o Python/dtoa.o Python/formatter_unicode.o Python/fileutils.o 
Python/dynload_shlib.o   Python/thread.o  Python/frozen.o
ar rc libpython3.6m.a Modules/config.o Modules/getpath.o Modules/main.o 
Modules/gcmodule.o
ar rc libpython3.6m.a Modules/_threadmodule.o  Modules/posixmodule.o  
Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  
Modules/_codecsmodule.o  Modules/_weakref.o  Modules/_functoolsmodule.o  
Modules/_operator.o  Modules/_collectionsmodule.o  Modules/itertoolsmodule.o  
Modules/atexitmodule.o  Modules/signalmodule.o  Modules/_stat.o  
Modules/timemodule.o  Modules/_localemodule.o  Modules/_iomodule.o 
Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o 
Modules/textio.o Modules/stringio.o  Modules/zipimport.o  
Modules/faulthandler.o  Modules/_tracemalloc.o Modules/hashtable.o  
Modules/symtablemodule.o  Modules/xxsubtype.o
ranlib libpython3.6m.a
gcc -pthread  -fprofile-generate  -Xlinker -export-dynamic -o python 
Programs/python.o libpython3.6m.a -lpthread -ldl  -lutil   -lm
gcc -pthread  -fprofile-generate  -Xlinker -export-dynamic -o 
Programs/_testembed Programs/_testembed.o libpython3.6m.a -lpthread -ldl  
-lutil   -lm
./python -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
echo "generate-posix-vars failed" ; \
rm -f ./pybuilddir.txt ; \
exit 1 ; \
fi
Could not find platform independent libraries 
Could not find platform dependent libraries 
Consider setting $PYTHONHOME to [:]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'

Current thread 0x7f8a8d4c6680 (most recent call first):
/bin/sh: line 5: 31168 Aborted ./python -E -S -m sysconfig 
--generate-posix-vars
generate-posix-vars failed
Makefile:595: recipe for target 'pybuilddir.txt' failed
make[2]: *** [pybuilddir.txt] Error 1
make[2]: Leaving directory '/data/home/ajung/src/Python-3.6.1'
Makefile:511: recipe for target 'build_all_generate_profile' failed
make[1]: *** [build_all_generate_profile] Error 2
make[1]: Leaving directory '/data/home/ajung/src/Python-3.6.1'
Makefile:492: recipe for target 'profile-opt' failed
make: *** [profile-opt] Error 2

Some search on Google reveals some dependency to PYTHONPATH but this variable 
is not set on my system

--
components: Installation
messages: 295757
nosy: zopyx
priority: normal
severity: normal
status: open
title: Python 3.6.1 installation issues on OpenSuse 42.1: ModuleNotFoundError: 
No module named 'encodings'
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



[issue30634] ctypes.cast(obj, ctypes.c_void_p) invalid return in linux_x64

2017-06-12 Thread fooofei

New submission from fooofei:

module:ctypes
pyversion: 2.7.13
python platform : win32, linux_x86_x64

I use ctypes.cast(v,ctypes.c_void_p).value to get address of 'helloworld' and 
u'helloworld' internal buffer address.

the result is both right in win32,but not in linux.

'helloworld'  is right, u'helloworld' is invalid.

please see 
https://github.com/fooofei/py_string_address
https://github.com/fooofei/py_string_address/blob/master/issue.py

--
components: ctypes
messages: 295758
nosy: fooofei
priority: normal
severity: normal
status: open
title: ctypes.cast(obj,ctypes.c_void_p) invalid return in linux_x64
type: behavior
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



[issue30635] Leak in test_c_locale_coercion

2017-06-12 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue30635] Leak in test_c_locale_coercion

2017-06-12 Thread Stéphane Wirtel

New submission from Stéphane Wirtel:

./python -m test -R 3:3  test_c_locale_coercion -m 
test_external_target_locale_configuration   

 Mon 12 Jun 2017 10:57:14 AM CEST
Run tests sequentially
0:00:00 load avg: 1.31 [1/1] test_c_locale_coercion
beginning 6 repetitions
123456
..
test_c_locale_coercion leaked [2, 2, 2] references, sum=6
test_c_locale_coercion failed

1 test failed:
test_c_locale_coercion

Total duration: 4 sec
Tests result: FAILURE

--
messages: 295759
nosy: matrixise
priority: normal
severity: normal
status: open
title: Leak in test_c_locale_coercion
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



[issue30635] Leak in test_c_locale_coercion

2017-06-12 Thread STINNER Victor

STINNER Victor added the comment:

Likely a leak in the implementation of the PEP 538, commit 
6ea4186de32d65b1f1dc1533b6312b798d300466, bpo-28180.

--
nosy: +haypo

___
Python tracker 

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



[issue11822] Improve disassembly to show embedded code objects

2017-06-12 Thread STINNER Victor

STINNER Victor added the comment:

Thanks Serhiy, it works and I like the result :-)

>>> def f():
...  def g():
...   return 3
...  return g
... 

>>> import dis; dis.dis(f)
  2   0 LOAD_CONST   1 (", line 2>)
  2 LOAD_CONST   2 ('f..g')
  4 MAKE_FUNCTION0
  6 STORE_FAST   0 (g)

  4   8 LOAD_FAST0 (g)
 10 RETURN_VALUE

Disassembly of ", line 2>:
  3   0 LOAD_CONST   1 (3)
  2 RETURN_VALUE

--

___
Python tracker 

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



[issue27425] Tests fail because of git's newline preferences on Windows

2017-06-12 Thread STINNER Victor

STINNER Victor added the comment:

I'm happy to see this "old" issue now fixed :-)

--

___
Python tracker 

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



[issue30609] Python 3.6.1 fails to generate 256 colors on Cygwin based 64-bit Windows 10

2017-06-12 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy:  -haypo

___
Python tracker 

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



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

2017-06-12 Thread Stéphane Wirtel

New submission from Stéphane Wirtel:

Add the description of PYTHONCOERCECLOCALE in the command line.

--
messages: 295763
nosy: matrixise, ncoghlan
priority: normal
severity: normal
status: open
title: Add PYTHONCOERCECLOCALE to the help of the command line
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



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

2017-06-12 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


--
pull_requests: +2179

___
Python tracker 

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



[issue30635] Leak in test_c_locale_coercion

2017-06-12 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2180

___
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 Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2017-06-12 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2181

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2017-06-12 Thread STINNER Victor

STINNER Victor added the comment:

I wrote https://github.com/python/cpython/pull/2127 to document "make 
regen-all". I'm not sure that it's the correct way to document such build 
change in minor 3.6 releases. Can someone please take a look?

--

___
Python tracker 

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



[issue29679] Add @contextlib.asynccontextmanager

2017-06-12 Thread Yury Selivanov

Changes by Yury Selivanov :


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

___
Python tracker 

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



[issue29406] asyncio SSL contexts leak sockets after calling close with certain Apache servers

2017-06-12 Thread Yury Selivanov

Yury Selivanov added the comment:

See also issue 29970.

--

___
Python tracker 

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



[issue30634] ctypes.cast(obj, ctypes.c_void_p) invalid return in linux_x64

2017-06-12 Thread Eryk Sun

Eryk Sun added the comment:

It's undocumented that cast() should work to directly convert Python strings to 
pointers. Even when it seems to work, it's a risky thing to depend on because 
there's no source ctypes data object to reference. Thus there's neither 
_b_base_ nor anything in _objects to support the reference. If the string has 
since been deallocated, the pointer is invalid.

What you've uncovered is an implementation detail. Windows has a 16-bit 
unsigned wchar_t type, so HAVE_USABLE_WCHAR_T is defined when building the 
default narrow build in Python 2. In this case ctypes can use 
PyUnicode_AS_UNICODE, which is why you can get the base address of the unicode 
object's internal buffer on Windows. 

Linux systems define wchar_t as a 4-byte signed value. IIRC it's a typedef for 
int. Because wchar_t is signed in this case, HAVE_USABLE_WCHAR_T is not defined 
even for a wide build. ctypes has to temporarily copy the string via 
PyUnicode_AsWideChar. It references the memory in a capsule object. You can see 
this by constructing a c_wchar_p instance, for example:

>>> p = ctypes.c_wchar_p(u'helloworld')
>>> p._objects


In your case, by the time you actually look at the address, the capsule has 
been deallocated, and the memory is no longer valid. For example:

>>> addr = ctypes.cast(u'helloworld', ctypes.c_void_p).value
>>> ctypes.wstring_at(addr, 10)
u'\U0150ccf0\x00\U0150cc00\x00oworld'

It works as expected if one instead casts a c_wchar_p instance, which 
references the capsule to keep the memory alive:

>>> addr = ctypes.cast(p, ctypes.c_void_p).value
>>> ctypes.wstring_at(addr, 10)
u'helloworld'

However, that's not what you want since we know it's a copy. I think your only 
option is to use the C API via ctypes.pythonapi. For example:

ctypes.pythonapi.PyUnicodeUCS4_AsUnicode.argtypes = (ctypes.py_object,)
ctypes.pythonapi.PyUnicodeUCS4_AsUnicode.restype = ctypes.c_void_p

s = u'helloworld'
addr = ctypes.pythonapi.PyUnicodeUCS4_AsUnicode(s)

>>> ctypes.wstring_at(addr, 10)
u'helloworld'

On narrow builds this function is exported a PyUnicodeUCS2_AsUnicode.

--
nosy: +eryksun
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2017-06-12 Thread Nick Coghlan

Changes by Nick Coghlan :


--
pull_requests: +2182

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2017-06-12 Thread Nick Coghlan

Nick Coghlan added the comment:

Thanks for that Victor. I started to review the PR, and then realised my 
suggestions were going to be extensive enough that it made more sense to post 
an alternate PR for you to review: https://github.com/python/cpython/pull/2128

--

___
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 7d1017d9ed3285857e827635eda966da246dcd5f by Nick Coghlan 
(Stéphane Wirtel) in branch 'master':
bpo-30636: Add PYTHONCOERCECLOCALE to the help of the command line (GH-2125)
https://github.com/python/cpython/commit/7d1017d9ed3285857e827635eda966da246dcd5f


--

___
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

Changes by Nick Coghlan :


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

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2017-06-12 Thread Nick Coghlan

Nick Coghlan added the comment:


New changeset e1b690370fd8f93bef1e69eeea2695f95a7cfff5 by Nick Coghlan in 
branch '3.6':
bpo-23404: `make regen-all` What's New entry (#2128)
https://github.com/python/cpython/commit/e1b690370fd8f93bef1e69eeea2695f95a7cfff5


--

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


--
pull_requests: +2183

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2017-06-12 Thread Nick Coghlan

Nick Coghlan added the comment:

Moving to deferred blocker and taking 3.6 off the affected versions list, since 
the 3.6 What's New has now been updated appropriately.

Items still to be done:

- make a similar change to the 3.5 What's New on the 3.5 branch
- update the maintenance release changes section in the 2.7 What's New on the 
2.7 branch
- cherry-pick the 2.7, 3.5, & 3.6 updates in order to make a combined PR for 
the development branch

--
priority: release blocker -> deferred blocker
stage: needs patch -> backport needed
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



[issue30637] Syntax error reported on compile(...), but not on compile(..., ast.PyCF_ONLY_AST)

2017-06-12 Thread Hrvoje Nikšić

New submission from Hrvoje Nikšić:

Our application compiles snippets of user-specified code using the compile 
built-in with ast.PyCF_ONLY_AST flag. At this stage we catch syntax errors and 
perform some sanity checks on the AST. The AST is then compiled into actual 
code using compile() and run using further guards.

We found that using a bare "return" in the code works with ast.PyCF_ONLY_AST, 
but raises SyntaxError when compiled without the flag:

>>> import ast
>>> compile('return', '', 'exec', ast.PyCF_ONLY_AST, True)
<_ast.Module object at 0x7f35df872310>

>>> compile('return', '', 'exec', 0, True)
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 1
SyntaxError: 'return' outside function

Is this intended behavior? It doesn't seem to be documented anywhere.

--
components: Interpreter Core
messages: 295771
nosy: hniksic
priority: normal
severity: normal
status: open
title: Syntax error reported on compile(...), but not on compile(..., 
ast.PyCF_ONLY_AST)
versions: Python 2.7, Python 3.7

___
Python tracker 

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



[issue30624] selectors should use bare except clauses

2017-06-12 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:


New changeset ced36a993fcfd1c76637119d31c03156a8772e11 by Giampaolo Rodola in 
branch 'master':
bpo-30624 remaining bare except (#2108)
https://github.com/python/cpython/commit/ced36a993fcfd1c76637119d31c03156a8772e11


--

___
Python tracker 

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



[issue30624] selectors should use bare except clauses

2017-06-12 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

I see that on 3.6 except BaseException: is used, so the backport should not be 
necessary.

--
resolution:  -> fixed
stage: backport needed -> 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



[issue28414] SSL match_hostname fails for internationalized domain names

2017-06-12 Thread Nick Lamb

Nick Lamb added the comment:

I endorse njs' recommended fix here. Don't try to get clever, this is a 
security component, it should be the dumbest it can be possibly be while being 
correct, because if it's smarter it will probably be wrong.

--
nosy: +tialaramex

___
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



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



[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



[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



[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



[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



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



[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



[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



[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



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

[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



[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



[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

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



  1   2   >