[issue28917] Docs: Add missing protocol to pickle

2016-12-09 Thread Anand Reddy Pandikunta

Anand Reddy Pandikunta added the comment:

Yes, Thanks.

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

___
Python tracker 

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



[issue26937] the chown() method of the tarfile.TarFile class fails on Android

2016-12-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e4e7bc640865 by Xavier de Gaye in branch '3.6':
Issue #26937: The chown() method of the tarfile.TarFile class does not fail now
https://hg.python.org/cpython/rev/e4e7bc640865

New changeset da510d1aa683 by Xavier de Gaye in branch 'default':
Issue #26937: Merge 3.6.
https://hg.python.org/cpython/rev/da510d1aa683

--
nosy: +python-dev

___
Python tracker 

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



[issue28918] cross compiling xxlimited fails with "Py_LIMITED_API is incompatible with Py_DEBUG"

2016-12-09 Thread Xavier de Gaye

New submission from Xavier de Gaye:

This happens when the cross compilation is done with '--with-pydebug' while the 
native interpeter used to run setup.py has been built without it. The error 
message is:
Py_LIMITED_API is incompatible with Py_DEBUG, Py_TRACE_REFS, and 
Py_REF_DEBUG

--
assignee: xdegaye
components: Cross-Build
messages: 282771
nosy: Alex.Willmer, doko, xdegaye
priority: normal
severity: normal
stage: needs patch
status: open
title: cross compiling xxlimited fails with "Py_LIMITED_API is incompatible 
with Py_DEBUG"
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



[issue26937] the chown() method of the tarfile.TarFile class fails on Android

2016-12-09 Thread Xavier de Gaye

Changes by Xavier de Gaye :


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

___
Python tracker 

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



[issue28898] Can't compile gdb with Python 3.6

2016-12-09 Thread STINNER Victor

STINNER Victor added the comment:

> Why do you think this change caused that breakage? That bot looks like it's 
> been broken for days. This change should have no behavior change whatsoever 
> for Python itself.

It's right that the buildbot is broken for years:
https://mail.python.org/pipermail/python-dev/2016-September/146538.html

But the error changed, since the build 37, tests started to fail with a very 
specific error: "Fatal Python error: Aborted". The build 37 contains your 
change 1afc3f4f5502 and two other changes which only modify the Doc/ directory.

Sorry, I don't know more :-/ Maybe it's a false alarm, but it's worth to 
investigate.

--

___
Python tracker 

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



[issue28919] Simplify `_copy_func_details` in unittest.mock

2016-12-09 Thread Jiajun Huang

Changes by Jiajun Huang :


--
components: Library (Lib)
files: mock.patch
keywords: patch
nosy: Jiajun Huang
priority: normal
pull_requests: 2
severity: normal
status: open
title: Simplify `_copy_func_details` in unittest.mock
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file45811/mock.patch

___
Python tracker 

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



[issue28918] cross compiling xxlimited fails with "Py_LIMITED_API is incompatible with Py_DEBUG"

2016-12-09 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Patch attached.

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

___
Python tracker 

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



[issue28918] cross compiling xxlimited fails with "Py_LIMITED_API is incompatible with Py_DEBUG"

2016-12-09 Thread STINNER Victor

STINNER Victor added the comment:

xxlimited_abiflags.patch LGTM.

--
nosy: +haypo

___
Python tracker 

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



[issue25458] ftplib: command response shift - mismatch

2016-12-09 Thread Ivan Pozdeev

Changes by Ivan Pozdeev :


--
nosy: +Ivan.Pozdeev
versions: +Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.7

___
Python tracker 

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



[issue25458] ftplib: command response shift - mismatch

2016-12-09 Thread Ivan Pozdeev

Ivan Pozdeev added the comment:

The current solution looks fishy to me. We should stick to 
https://tools.ietf.org/html/rfc959 . In particular, 226 is sent when the server 
closes the auxiliary socket, so the module should react accordingly. Debug 
printing and/or issuing warnings is an obvious no-go.

Also attached a text file illustrating the problem.

--
Added file: http://bugs.python.org/file45813/ftp_error_illustration.txt

___
Python tracker 

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



[issue25711] Rewrite zipimport from scratch

2016-12-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Got rid of dependencies from os, stat and encodings.

--
Added file: http://bugs.python.org/file45814/zipimport-2.patch

___
Python tracker 

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



[issue25711] Rewrite zipimport from scratch

2016-12-09 Thread STINNER Victor

STINNER Victor added the comment:

> Here is preliminary translation of zipimport to Python. It is not frozen and 
> imports other modules.

Technically, will it be possible to freeze it? It seems useful to keep the 
ability to put the whole stdlib into a single ZIP. Using a ZIP is sometimes 
suggested to avoid fstat() on disk for example, to speedup Python startup.

But I also understand that the C code is painful to maintain and update.

Anyway, nice job Serhiy :-)

--

___
Python tracker 

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



[issue28920] Dangerous usage of "O" format string in _asynciomodule.c

2016-12-09 Thread STINNER Victor

New submission from STINNER Victor:

The new _asyncio module of Python 3.6 uses the _PyObject_CallMethodId() 
function to call functions. This function has a weird behaviour when using the 
format string "O": if the object is a tuple, the tuple is unpacked.

_PyObject_CallMethodId(obj, &PyId_meth, "O", tuple, NULL) calls 
obj.meth(*tuple) instead of obj.meth(tuple).

I only found one function which may have the bug: task_call_step(). But it 
seems like this function cannot be called with a tuple as "arg", only with an 
exception object.

But just in case, I would suggest to replace:
   _PyObject_CallMethodId(obj, nameid, "O", arg);
with
   _PyObject_CallMethodIdObjArgs(obj, nameid, arg, NULL);

Note: _PyObject_CallMethodId() is called with a NULL terminal in the argument 
list, but the NULL is useless. A terminator is only required by 
_PyObject_CallMethodIdObjArgs(). Yeah, Python has a wide choice of functions to 
call a callable object, with funny APIs... And I'm adding new ones to Python 
3.7 ;-)

--
components: asyncio
messages: 282778
nosy: gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: Dangerous usage of "O" format string in _asynciomodule.c
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



[issue28920] Dangerous usage of "O" format string in _asynciomodule.c

2016-12-09 Thread STINNER Victor

STINNER Victor added the comment:

Previous similar bug in generators: issue #21209.

--

___
Python tracker 

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



[issue28920] Dangerous usage of "O" format string in _asynciomodule.c

2016-12-09 Thread STINNER Victor

STINNER Victor added the comment:

The issue was in fixed in Python 3.7 with a change made for optimization, not 
directly to fix this issue:

changeset:   105547:b29c719d5992
tag: tip
user:Victor Stinner 
date:Fri Dec 09 14:24:02 2016 +0100
files:   Modules/_asynciomodule.c
description:
Use _PyObject_CallMethodIdObjArgs() in _asyncio

Issue #28915: Replace _PyObject_CallMethodId() with
_PyObject_CallMethodIdObjArgs() when the format string was only made of "O"
formats, PyObject* arguments.

_PyObject_CallMethodIdObjArgs() avoids the creation of a temporary tuple and
doesn't have to parse a format string.

--

___
Python tracker 

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



[issue28915] Modify PyObject_CallFunction() to use fast call internally

2016-12-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 39bed12135c1 by Victor Stinner in branch 'default':
Issue #28915: Use _PyObject_CallNoArg()
https://hg.python.org/cpython/rev/39bed12135c1

New changeset b29c719d5992 by Victor Stinner in branch 'default':
Use _PyObject_CallMethodIdObjArgs() in _asyncio
https://hg.python.org/cpython/rev/b29c719d5992

--

___
Python tracker 

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



[issue28190] Detect curses headers correctly for cross-compiling

2016-12-09 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

> second issue is that you apparently don't do the changes for term.h

term.h is included only if ncurses is missing and the system (SysV) curses is 
used, so I didn't change it. See below:

#ifdef __sgi
#include 
#endif

#ifdef HAVE_NCURSES_H
#include 
#else
#include 
#ifdef HAVE_TERM_H
/* for tigetstr, which is not declared in SysV curses */
#include 
#endif
#endif


> Third issue is that you can't make these changes for third party extensions

Did you mean 3rd party extensions that include py_curses.h may get broken with 
this patch? IMO they shouldn't include this as it's CPython's implementation 
detail and shouldn't be used outside Modules/_cursesmodule.c and 
Modules/_curses_panel.c

> however the ncursesw installation can be found in /include instead

This is what I want to solve at the first place - make _curses compatible with 
different configurations. In configure.ac, there's a line:

AC_CHECK_HEADERS(curses.h ncurses.h ncursesw/ncurses.h ncurses/ncurses.h 
panel.h ncursesw/panel.h ncurses/panel.h)

> so you apparently can assume that this directory name is fixed *iff* it exists

Did you mean there's no need to check panel.h? I'll try to update the patch.


There's something missing from this patch: if ncurses is built with 
--enable-reentrant, the library and include paths get an additional 't'. For 
example, the library name becomes libncursestw.so and includedir becomes 
$prefix/include/ncursestw. Note that 't' comes before 'w' as ncurses's 
configure.in handles --enable-widec before --enable-reentrant. I skip such 
cases as --enable-reentrant is not compatible with Modules/_cursesmodule.c yet 
(issue25720). I'd like to postpone it until issue25720 is resolved as it does 
not make sense to detect incompatible header paths.

--

___
Python tracker 

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



[issue28920] Dangerous usage of "O" format string in _asynciomodule.c

2016-12-09 Thread STINNER Victor

STINNER Victor added the comment:

Minimum patch for Python 3.6: only modify calls using the "O" format.

--
keywords: +patch
Added file: http://bugs.python.org/file45815/_asyncio.patch

___
Python tracker 

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



[issue28921] Make str.count one character for latin1 string faster

2016-12-09 Thread Xiang Zhang

New submission from Xiang Zhang:

I make a try to improve str.count one character for latin1 string. From 
benchmark, it could enhance the speed depending on the length of the string.

# short one, a little regression
./python3 -m perf timeit --compare-to ~/cpython/python -s 's="abcdefg"' 
's.count("a")'
python: . 190 ns +- 1 ns
python3: . 197 ns +- 2 ns

Median +- std dev: [python] 190 ns +- 1 ns -> [python3] 197 ns +- 2 ns: 1.04x 
slower

# a little longer
./python3 -m perf timeit --compare-to ~/cpython/python -s 's="abcdefghi"' 
's.count("a")'
python: . 192 ns +- 15 ns
python3: . 184 ns +- 2 ns

Median +- std dev: [python] 192 ns +- 15 ns -> [python3] 184 ns +- 2 ns: 1.05x 
faster

# longer
./python3 -m perf timeit --compare-to ~/cpython/python -s 
's="abcdefghihijklmnopqrstuvwxyz~!@##$%^&*()-=_+{}|"' 's.count("a")'
python: . 236 ns +- 12 ns
python3: . 209 ns +- 9 ns

Median +- std dev: [python] 236 ns +- 12 ns -> [python3] 209 ns +- 9 ns: 1.13x 
faster

# very long
./python3 -m perf timeit --compare-to ~/cpython/python -s 's="abcdefgHijk"*100' 
's.count("z")'
python: . 1.02 us +- 0.00 us
python3: . 610 ns +- 1 ns

Median +- std dev: [python] 1.02 us +- 0.00 us -> [python3] 610 ns +- 1 ns: 
1.67x faster

And since str.replace may also go through the code path involving count, it's 
somewhat affected:

./python3 -m perf timeit --compare-to ~/cpython/python -s 
's="abcdefghihijklmnopqrstuvwxyz~!@##$%^&*()-=_+{}|"' 's.replace("a", "ccc")'
python: . 318 ns +- 31 ns
python3: . 298 ns +- 19 ns

Median +- std dev: [python] 318 ns +- 31 ns -> [python3] 298 ns +- 19 ns: 1.07x 
faster

For ucs2 and ucs4, the benchmarks are not appealing so leave them untouched.

--
components: Interpreter Core
files: latin1-str-count-one-character.patch
keywords: patch
messages: 282784
nosy: haypo, serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
stage: patch review
status: open
title: Make str.count one character for latin1 string faster
type: enhancement
versions: Python 3.7
Added file: 
http://bugs.python.org/file45816/latin1-str-count-one-character.patch

___
Python tracker 

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



[issue28921] Make str.count one character for latin1 string faster

2016-12-09 Thread STINNER Victor

STINNER Victor added the comment:

Hum, Serhiy is better than me to review such hardcore C code :-) I let him 
review the patch ;-)

> short one, a little regression

In stringlib, the usual solution is to use a threshold: use a dummy loop for 
less than N bytes, otherwise use the ultra-optimized loop. Serhiy event 
implemented a "dynamic" threshold in some functions, when too many false 
positive are found. I don't recall where.

"And since str.replace may also go through the code path involving count, it's 
somewhat affected: (...) 1.07x faster"

I'm not really excited by optimizing str.count, since I don't think that this 
function is commonly used. But if str.replace is made faster, I'm interested :-)

I understand that count() is only used when the old and new patterns of 
str.replace() have a different length.

--

___
Python tracker 

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



[issue28915] Modify PyObject_CallFunction() to use fast call internally

2016-12-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 807688539b56 by Victor Stinner in branch 'default':
Fix refleak introduced in change 032cbdb596fe
https://hg.python.org/cpython/rev/807688539b56

New changeset ceb22b8f6d32 by Victor Stinner in branch 'default':
Use _PyObject_CallMethodIdObjArgs() in _ctypes
https://hg.python.org/cpython/rev/ceb22b8f6d32

New changeset ef05cc5cc651 by Victor Stinner in branch 'default':
Use _PyObject_CallMethodIdObjArgs() in _elementtree
https://hg.python.org/cpython/rev/ef05cc5cc651

New changeset 5b41b92a7ccf by Victor Stinner in branch 'default':
Use _PyObject_CallMethodIdObjArgs() in _datetime
https://hg.python.org/cpython/rev/5b41b92a7ccf

New changeset 434e76e0ee17 by Victor Stinner in branch 'default':
Use _PyObject_CallMethodIdObjArgs() in _io
https://hg.python.org/cpython/rev/434e76e0ee17

New changeset 4545a2293e01 by Victor Stinner in branch 'default':
Use _PyObject_CallMethodIdObjArgs()
https://hg.python.org/cpython/rev/4545a2293e01

New changeset 4321f833a4e0 by Victor Stinner in branch 'default':
Use PyObject_CallFunctionObjArgs()
https://hg.python.org/cpython/rev/4321f833a4e0

--

___
Python tracker 

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



[issue28912] collections.abc.OrderedMapping

2016-12-09 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue28922] Add fixer for "import exceptions"

2016-12-09 Thread ProgVal

New submission from ProgVal:

Hi,

Here is a fixer to remove "import exceptions" from Python 2 code and replace 
"exceptions.X" with "X".

Valentin

--
components: 2to3 (2.x to 3.x conversion tool)
files: fix_import_exceptions.py
messages: 282787
nosy: Valentin.Lorentz
priority: normal
severity: normal
status: open
title: Add fixer for "import exceptions"
type: enhancement
versions: Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45817/fix_import_exceptions.py

___
Python tracker 

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



[issue27200] make doctest in CPython has failures

2016-12-09 Thread Marco Buttu

Marco Buttu added the comment:

I isolated all snippets in the unittest.mock documentation, and now all 
doctests pass without surprises :-)

--
Added file: http://bugs.python.org/file45818/issue27200_3rd.patch

___
Python tracker 

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



[issue28915] Modify PyObject_CallFunction() to use fast call internally

2016-12-09 Thread STINNER Victor

STINNER Victor added the comment:

The main feature was implemented, so I close the issue.

Enjoy faster slots! (Many other less important functions are also faster.)

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

___
Python tracker 

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



[issue27200] make doctest in CPython has failures

2016-12-09 Thread Zachary Ware

Changes by Zachary Ware :


--
assignee: Jelle Zijlstra -> 
stage:  -> patch review
versions: +Python 3.7

___
Python tracker 

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



[issue28923] Nonexisting encoding specified in Tix.py

2016-12-09 Thread Ivan Pozdeev

New submission from Ivan Pozdeev:

$ head 'c:\Py\Lib\lib-tk\Tix.py' -n 1
# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-

There's no "iso-latin-1-unix" encoding in Python, so this declaration produces 
an error in some code analysis tools (I have it in PyScripter), as it should 
according to PEP263 .

In 3.x, this was fixed in changeset d63344ba187888b6792ba8362a0dd09e06ed2f9a .

--
components: Library (Lib)
files: 105052.patch
keywords: patch
messages: 282791
nosy: Ivan.Pozdeev
priority: normal
severity: normal
status: open
title: Nonexisting encoding specified in Tix.py
type: compile error
versions: Python 2.7
Added file: http://bugs.python.org/file45819/105052.patch

___
Python tracker 

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



[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2016-12-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c62352ec21bc by Victor Stinner in branch 'default':
Issue #20185: Convert _warnings.warn() to Argument Clinic
https://hg.python.org/cpython/rev/c62352ec21bc

--
nosy: +python-dev

___
Python tracker 

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



[issue28425] Python3 ignores __init__.py that are links to /dev/null

2016-12-09 Thread Brett Cannon

Brett Cannon added the comment:

There's probably a place to mention it in the language spec for import and/or 
importlib.

--

___
Python tracker 

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



[issue25458] ftplib: command response shift - mismatch

2016-12-09 Thread Ivan Pozdeev

Ivan Pozdeev added the comment:

Found the root problem: a 1xx response doesn't complete a LIST command, it 
should wait further for a 2xx one. See RFC 959 section 6 (state diagrams).

This could be `urllib`'s rather than `ftplib`'s fault: the former calls 
low-level subroutines of the latter.

--
Added file: http://bugs.python.org/file45820/ftp_error_illustration.txt

___
Python tracker 

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



[issue25458] ftplib: command response shift - mismatch

2016-12-09 Thread Ivan Pozdeev

Changes by Ivan Pozdeev :


Removed file: http://bugs.python.org/file45813/ftp_error_illustration.txt

___
Python tracker 

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



[issue28924] Inline PyEval_EvalFrameEx() in callers

2016-12-09 Thread STINNER Victor

New submission from STINNER Victor:

Inline PyEval_EvalFrameEx() in callers. The PEP 523 modified 
PyEval_EvalFrameEx(): it's now an indirection to interp->eval_frame().

Inline the call in performance critical code. Leave PyEval_EvalFrame() 
unchanged, this function is only kept for backward compatibility (and so not 
important for performance).

I pushed directly my change as the revision 99c34e47348b, but it broke 
test_gdb. So now I doubt that it's 100% "safe" to inline the code. Outside 
test_gdb, does something else rely on PyEval_EvalFrameEx()? So I chose to open 
an issue to discuss the change. By "something", I'm thinking to Pyjion :-)

Attached patch updates also python-gdb.py to fix test_gdb.

--
files: inline_evalframeex.patch
keywords: patch
messages: 282794
nosy: brett.cannon, haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Inline PyEval_EvalFrameEx() in callers
type: performance
versions: Python 3.7
Added file: http://bugs.python.org/file45821/inline_evalframeex.patch

___
Python tracker 

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



[issue28925] Confusing exception from cPickle on reduce failure

2016-12-09 Thread Raoul Gough

New submission from Raoul Gough:

Description
===

Running the attached example program with Python 2.7.12 produces the output 
below. The demo deliberately raises a user-defined exception during the 
unpickling process, but the problem is that this exception does not propagate 
out of the unpickle call. Instead, it gets converted into a TypeError which is 
confusing and does not help identify the original problem.

INFO:root:Creating BadReduce object
INFO:root:Pickling
INFO:root:Unpickling
INFO:root:Raising exception "BadReduce init failed"
Traceback (most recent call last):
  File "cpickle_reduce_failure.py", line 48, in 
main()
  File "cpickle_reduce_failure.py", line 41, in main
pickler.loads(s1)
  File "cpickle_reduce_failure.py", line 27, in __init__
raise exception
TypeError: __init__() takes exactly 2 arguments (4 given)

If you change the demo to use the Python pickle module, i.e. "import pickle as 
pickler", it produces the expected output below:

INFO:root:Creating BadReduce object
INFO:root:Pickling
INFO:root:Unpickling
INFO:root:Raising exception "BadReduce init failed"
INFO:root:Got MyException "BadReduce init failed"
INFO:root:Done

Analysis


The following code in Modules/cPickle.c in the function Instance_New (around 
https://github.com/python/cpython/blob/2.7/Modules/cPickle.c#L3917) does a 
PyErr_Restore with the exception type MyException, as raised from 
BadReduce.__init__, but it replaces the exception value with a tuple 
(original_exception, cls, args):

PyObject *tp, *v, *tb, *tmp_value;

PyErr_Fetch(&tp, &v, &tb);
tmp_value = v;
/* NULL occurs when there was a KeyboardInterrupt */
if (tmp_value == NULL)
tmp_value = Py_None;
if ((r = PyTuple_Pack(3, tmp_value, cls, args))) {
Py_XDECREF(v);
v=r;
}
PyErr_Restore(tp,v,tb);

Later, PyErr_NormalizeException attempts to convert the exception value (the 
tuple) to the original exception type. This fails because 
MyException.__init__() can't handle the multiple arguments. This is what 
produces the TypeError "__init__() takes exactly 2 arguments (4 given)"


Proposed Fix


I think it would be better if Instance_New did the PyErr_NormalizeException 
itself instead of allowing it to be done lazily. If the normalize works, i.e. 
the exception type accepts the extra arguments, the behaviour would be almost 
unchanged - the only difference being the PyErr_NormalizeException happens 
earlier. However, if the normalize fails, Instance_New can restore the original 
exception unchanged. That means that we lose the cls, args information in this 
case, but not the original exception.

--
components: Library (Lib)
files: cpickle_reduce_failure.py
messages: 282795
nosy: raoul_gough_baml
priority: normal
severity: normal
status: open
title: Confusing exception from cPickle on reduce failure
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file45822/cpickle_reduce_failure.py

___
Python tracker 

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



[issue25458] ftplib: command response shift - mismatch

2016-12-09 Thread Ivan Pozdeev

Ivan Pozdeev added the comment:

Darn, my problem _is_ in urllib and thus is different that the one in this 
ticket. Though it too results in a "command response shift".

--

___
Python tracker 

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



[issue25458] ftplib: command response shift - mismatch

2016-12-09 Thread Ivan Pozdeev

Ivan Pozdeev added the comment:

The solution for the OP's problem is:

* after closing the data socket (whether it was returned by 
`transfercmd()'/`ntransfercmd()' or opened manually), an additional 
`FTP.getresp()'/`FTP.voidresp()' is required to process the 226 response.

The built-in `retrbinary()' and `retrlines()' do implement this logic.

But the documentation doesn't mention this requirement in 
`transfercmd()'/ntransfercmd()` entries (and `getresp()'/`voidresp()' are 
undocumented outright).

`urllib' authors have fallen into this same trap: they use `transfercmd' 
directly but don't call `voidresp()' afterwards.

--

___
Python tracker 

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



[issue27584] New addition of vSockets to the python socket module

2016-12-09 Thread Cathy Avery

Cathy Avery added the comment:

Is there anything else that is needed for this patch?

Thanks!

--

___
Python tracker 

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



[issue28922] Add fixer for "import exceptions"

2016-12-09 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the report and for the patch! This is a duplicate of issue 2350.

Note that we accept patches from hg.python.org, not standalone Python files. 
See http://cpython-devguide.readthedocs.io/en/latest/patch.html for details.

--
nosy: +berker.peksag
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> 'exceptions' import fixer

___
Python tracker 

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



[issue28921] Make str.count one character for latin1 string faster

2016-12-09 Thread Xiang Zhang

Xiang Zhang added the comment:

> I understand that count() is only used when the old and new patterns of 
> str.replace() have a different length.

Yes. I thought it won't help much since str.replace get many operations. But 
for long string, looks good:

./python3 -m perf timeit --compare-to ~/cpython/python -s 
's="abcdefghihijklmnopqrstuvwxyz~!@##$%^&*()-=_+{}|"*100' 's.replace("a", "bc")'
python: . 7.36 us +- 0.04 us
python3: . 4.91 us +- 0.04 us

Median +- std dev: [python] 7.36 us +- 0.04 us -> [python3] 4.91 us +- 0.04 us: 
1.50x faster  # 50% ??!! how?

And this patch also applies to bytes since they share codes.

--

___
Python tracker 

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



[issue28882] Slice confusing with negative stop and strides and the 0th element.

2016-12-09 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Steven, your initial 'sentence' is missing something needed to make it a proper 
English sentence, and I cannot exactly guess what you meant.  But your later 
confusion is clear enough.

This tracker is for patching the Python docs and CPython code.  I believe the 
entry for the slice function/class, 
https://docs.python.org/3/library/functions.html#slice, could be improved.

First the word 'slice' is linked to the Glossary entry for 'slice'.  However, 
the latter is about subsequences, not about slice objects. It should instead 
link to the entry that contains the method description as 
https://docs.python.org/3/reference/datamodel.html#slice.indices.  (This is the 
target for the Index entry 'indices (slice method)'.  The 'slick objects' label 
needs to be made a target.

Second, the description "representing the set of indices specified by 
range(start, stop, step)" is only true when start and stop are valid 
non-negative indexes when applied to a particular sequence.  It is never true 
for negative values and not true when greater to or equal to the length of a 
particular sequence.  As the slice.indices entry says, 'Missing or 
out-of-bounds indices are handled in a manner consistent with regular slices."

In the example above, the issue is the negative stop, not the negative step.  
Steven's problem was expecting the description to be true (whether or not he 
read it.)  It is worth noting, nowever, that reversed() was added because 
people had trouble using negative steps.  The following is much clearer than 
the corrected code above that the object is to separately reverse two haves of 
a list.

>>> n = 8
>>> a = range(8)
>>> [list(reversed(a[:n//2])), list(reversed(a[n//2:]))]
[[3, 2, 1, 0], [7, 6, 5, 4]]

As the Library Function entry hints, slice() is mainly intended for use 
internally and by 3rd-party extensions.

The description is even more wrong because the three arguments/attributes 'can 
have any type' (from the Data model slice object entry) whereas range arguments 
must be int-like.  (Allowing non-int-like arguments is for external extension 
use.)  In particular, slice(None) == slice(None, None) == slice(None, None, 
None) 'represents' all the indices of a particular sequence, in normal order, 
whereas None is not a valid argument for range().

I am not sure what replacement to propose.  I'd like to see if there is any 
previous discussion on the tracker.

A third and minor issue is that 'Numerical Python' should? be updated to 
"Numpy'.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python, terry.reedy
stage:  -> needs patch
title: RFC: Slice confusing with negative strides and the 0th element. -> Slice 
confusing with negative stop and strides and the 0th element.
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



[issue28091] Document PEP 525

2016-12-09 Thread Yury Selivanov

Yury Selivanov added the comment:

> 1. In PEP525 the documentation for aclose() is a bit terse and unclear to me. 
> It appeared to suggest that you could catch GeneratorExit and yield, but I 
> found this to result in a RuntimeError like a normal generator. I tried to 
> document this as it actually behaves.

Yes, it should result in a RuntimeError. What PEP 525 is trying to explain is 
that it's OK to do this (although 'finally' is better):

   async def gen():
  try:
 yield
  except GeneratorExit:
 await smth()
 # using 'yield' here will trigger a RuntimeError
 raise

> 2. One thing that I noticed documented about normal generators is that they 
> raise a ValueError if you try to run send() while another send() call is 
> currently running. I verified this using threads. I looked into corresponding 
> behavior for asynchronous generators, calling asend(), running the awaitable 
> halfway through, and then calling asend() again to get a second awaitable 
> before the first one finished. Asyncio seems to prevent more than one 
> awaitable from a single async generator running at the same time, but I 
> couldn't figure out how. Running some coroutines "by hand" calling asend() 
> and send(), I was permitted to run multiple awaitables concurrently which 
> produced odd results.

Interesting.  This is something that has to be fixed (in 3.6.1)

--

___
Python tracker 

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



[issue28921] Make str.count one character for latin1 string faster

2016-12-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The code looks too complex. I think that it is not worth to complicate the code 
so much for optimizing just few non-critical string operations.

Many optimizations were rejected in the past due to high cost and low benefit.

--

___
Python tracker 

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



[issue28925] Confusing exception from cPickle on reduce failure

2016-12-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka
stage:  -> needs patch

___
Python tracker 

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



[issue28926] subprocess.Popen + Sqlalchemy doesn't wait for process

2016-12-09 Thread Steven

New submission from Steven:

Called subprocess.Popen("python_file.py", shell=True).wait(), which triggered a 
call to `Base.metadata.create_all(engine)` inside `python_file.py`

This caused nothing after the `create_all(engine)` call to execute in 
`python_file.py` But, if I changed `subprocess.Popen` to 
`subprocess.check_call("python_file", shell=True).wait()`, the desired behavior 
was achieved.

I was able to continue past `create_all(engine)` if there was an error in the 
parent script after the subprocess call. In this case, then `python_file.py` 
was able to execute fully as expected.

--
components: Library (Lib)
messages: 282804
nosy: s1113950
priority: normal
severity: normal
status: open
title: subprocess.Popen + Sqlalchemy doesn't wait for process
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



[issue28091] Document PEP 525

2016-12-09 Thread Yury Selivanov

Yury Selivanov added the comment:

Eric, I've left you some review comments.

Guido, Nick, I have a question I hope you have an opinion on: for synchronous 
generators we define the following (sometimes confusing) terminology:

- "generator" = generator function
- "generator iterator" = generator object

I'm thinking if we can define asynchronous generators slightly differently:

- "asynchronous generator function"
- "asynchronous generator"

--
nosy: +gvanrossum, ncoghlan

___
Python tracker 

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



[issue28190] Detect curses headers correctly for cross-compiling

2016-12-09 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The only change that is needed here is to not include /usr/include/ncursesw in 
setup.py when cross compiling to ensure that the headers of the build platform 
are not included.  When cross compiling Python, it is the responsability of the 
packager to set the appropriate CPPFLAGS and LDFLAGS upon invoking configure, 
so that the curses headers are included and the curses libraries are linked at 
build time.
The same is true for the other extension modules, readline, openssl, libffi, 
etc...

--

___
Python tracker 

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



[issue28091] Document PEP 525

2016-12-09 Thread Guido van Rossum

Guido van Rossum added the comment:

It sounds particularly confusing that an "[XXX] generator" is the function
in one case and the object in the other case.

There's of course also Nathaniel Smith's opinion that we should switch away
from the term coroutine and call those "async def". Is that relevant?

--

___
Python tracker 

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



[issue28091] Document PEP 525

2016-12-09 Thread Yury Selivanov

Yury Selivanov added the comment:

> It sounds particularly confusing that an "[XXX] generator" is the function
in one case and the object in the other case.

Right, this is the biggest argument against having slightly different 
terminology between async generators and sync generators.

Maybe we should update docs for synchronous generators and replace "generator" 
with "generator function" and "generator iterable" with "generator"?

Most of the existing documentation refers to generator objects when the term 
"generator" is used anyways.

> There's of course also Nathaniel Smith's opinion that we should switch away
from the term coroutine and call those "async def". Is that relevant?

IIRC he's advocating to refer to "coroutine functions" as "async functions" and 
to "coroutines" as "async something". I personally don't buy his arguments and 
think that the current terminology is good and people already seem to 
understand/like it.

--

___
Python tracker 

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



[issue28091] Document PEP 525

2016-12-09 Thread Guido van Rossum

Guido van Rossum added the comment:

I think that most documentation uses "generator" to refer to both functions
and objects. So whenever you want to be clear you have to write the long
form.

--

___
Python tracker 

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



[issue28882] Slice confusing with negative stop and strides and the 0th element.

2016-12-09 Thread Martin Panter

Martin Panter added the comment:

I think Steven’s main complaint is that it is hard to make a reversed slice 
extend to the start of the original sequence, unless you omit (or use None as) 
the endpoint:

>>> "01234567"[4:0:-1]  # Includes index [4], stops before reaching index [0]
'4321'
>>> "01234567"[3::-1]  # Includes index [3], stop omitted for start of string
'3210'
>>> "01234567"[3:None:-1]  # None means the same
'3210'
>>> "01234567"[3:-1:-1]  # Negative means len(...) - 1, i.e. index [7]
''

This is a consequence of (a) the stop parameter meaning “stop _before_ reaching 
this index”, and (b) negative indexes are interpreted specially as being 
relative to the end.

--
nosy: +martin.panter

___
Python tracker 

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



[issue28927] bytes.fromhex should ignore all whitespace

2016-12-09 Thread Robert Xiao

New submission from Robert Xiao:

bytes.fromhex ignores space characters now (yay!) but still barfs if fed 
newlines or tabs:

>>> bytes.fromhex('ab\ncd')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: non-hexadecimal number found in fromhex() arg at position 2
>>> bytes.fromhex('ab\tcd')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: non-hexadecimal number found in fromhex() arg at position 2

It's often quite useful to paste blobs of hex into source code (or the REPL) 
and call ".fromhex" on them. These might include spaces, tabs and/or newlines, 
and barfing on these other whitespace characters is inconvenient.

I propose that bytes.fromhex should ignore all whitespace. A patch + test is 
attached.

--
files: fromhex.patch
keywords: patch
messages: 282811
nosy: nneonneo
priority: normal
severity: normal
status: open
title: bytes.fromhex should ignore all whitespace
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file45823/fromhex.patch

___
Python tracker 

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



[issue28425] Python3 ignores __init__.py that are links to /dev/null

2016-12-09 Thread Douglas Greiman

Douglas Greiman added the comment:

To be thorough, I looked at non __init__.py source files as well, with erratic 
results.  And who knows what would happen on other OS's.  So a blanket "must be 
a regular file" seems reasonable.

$ ls -l b.*
lrwxrwxrwx 1 dgreiman eng 9 Dec  9 16:05 b.py -> /dev/null

$ python2.7 -m b # Success
$ python2.7 -c 'import b'# Success
$ python2.7 b.py # Success

$ python3.5 b.py # Success
$ python3.5 -m b # Failure
/opt/python3.5/bin/python3.5: No module named b
$ python3.5 -c 'import b'# Failure
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named 'b'

$ uname -a
Linux 53334eb940e6 3.13.0-101-generic #148-Ubuntu SMP Thu Oct 20 22:08:32 UTC 
2016 x86_64 GNU/Linux

--

___
Python tracker 

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



[issue1446619] extended slice behavior inconsistent with docs

2016-12-09 Thread Martin Panter

Martin Panter added the comment:

Fumihiro’s suggestion seems reasonable to me (assuming it still applies to the 
current text)

--
nosy: +martin.panter

___
Python tracker 

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



[issue28882] Slice confusing with negative stop and strides and the 0th element.

2016-12-09 Thread Martin Panter

Martin Panter added the comment:

See also Issue 11842 about the behaviour of slice.indices() in this situation, 
and Issue 1446619 about fixing the documentation for reverse slices regarding 
positive out-of-range indexes.

--

___
Python tracker 

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



[issue28928] IDLE crashes when opening .py file from Finder

2016-12-09 Thread wkdewey

New submission from wkdewey:

Every time I try to open a .py file from the Finder (macOS Sierra), IDLE opens 
up and then immediately "unexpectedly quits." I can open them from within IDLE 
without the same problem

I've attached Apple's crash report. Additionally, in the Console I get an error 
message like "IDLE[14872]: objc[14872]: Invalid or prematurely-freed 
autorelease pool 0x7f81bf959048." every time the crash happens 

I am using Python 2.7.12; I installed the correct version of tcltk (something 
that is frequently mentioned when I search online for this problem) so that 
isn't the issue.

--
assignee: terry.reedy
components: IDLE
files: error.txt
messages: 282815
nosy: terry.reedy, wkdewey
priority: normal
severity: normal
status: open
title: IDLE crashes when opening .py file from Finder
type: crash
versions: Python 2.7
Added file: http://bugs.python.org/file45824/error.txt

___
Python tracker 

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



[issue28927] bytes.fromhex should ignore all whitespace

2016-12-09 Thread Robert Xiao

Robert Xiao added the comment:

I used Py_ISSPACE, which uses the .strip() default charset - I think this is a 
reasonable choice. We don't have to go crazy and support all the Unicode spaces.

--

___
Python tracker 

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



[issue28927] bytes.fromhex should ignore all whitespace

2016-12-09 Thread Martin Panter

Martin Panter added the comment:

Seems a reasonable feature. The documentation would also need updating.

Which specific (whitespace) characters do you propose to ignore? Just ASCII 
ones, as in bytes.isspace(), or others like b"\xA0" (non-breaking space) and 
U+2028 (line separator), as in str.isspace()? Perhaps you should add test cases 
to clarify.

--
nosy: +martin.panter
stage:  -> patch review
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue28929] Provide a link from documentation back to its source file

2016-12-09 Thread Brett Cannon

New submission from Brett Cannon:

It would be great if we provided a link from a documentation page back to the 
source file that the page is produced from, e.g. have 
https://docs.python.org/3.6/library/abc.html provide a link to 
https://github.com/python/cpython/blob/3.6/Doc/library/abc.rst.

--
assignee: docs@python
components: Documentation
messages: 282818
nosy: brett.cannon, docs@python
priority: normal
severity: normal
stage: needs patch
status: open
title: Provide a link from documentation back to its source file
type: enhancement

___
Python tracker 

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



[issue28424] pkgutil.get_data() doesn't work with namespace packages

2016-12-09 Thread Douglas Greiman

Douglas Greiman added the comment:

Patch attached.  Feel free to wordsmith.

--
keywords: +patch
Added file: http://bugs.python.org/file45825/issue28424.patch

___
Python tracker 

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



[issue28912] collections.abc.OrderedMapping

2016-12-09 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

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



[issue28928] IDLE crashes when opening .py file from Finder

2016-12-09 Thread Ned Deily

Ned Deily added the comment:

>From the crash report, it appears you are using a Python 2.7.12 and Tcl/Tk 8.6 
>installed from Homebrew.  The crash appears to be happening as a result of the 
>Open Apple Event from the Finder to Tk.  At first glance, I'm not able to 
>reproduce the crash using a python.org 2.7.12 with an ActiveState Tcl/Tk 
>8.5.18 also on macOS 10.12.1. I don't have a Homebrew installation handy to 
>test with and I don't really have time right now to dig into it but I think it 
>very unlikely to be an issue with Python itself.  You might want to open a 
>Homebrew issue and/or a Tk issue.

--
nosy: +ned.deily
resolution:  -> third party
status: open -> pending

___
Python tracker 

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



[issue28916] Not matched behavior of modulo operator % with the description of the documentation

2016-12-09 Thread Martin Panter

Martin Panter added the comment:

The documentation for %x etc also had the same problem, and it applies to 
Python 2 for %x. Here is a patch for Python 3. The behaviour is already tested, 
but there were some quirks due to porting from Py 2 tests, and duplicate tests 
which I removed.

--
keywords: +patch
stage: needs patch -> patch review
versions: +Python 2.7
Added file: http://bugs.python.org/file45826/py3-octal.patch

___
Python tracker 

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



[issue28190] Detect curses headers correctly for cross-compiling

2016-12-09 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

> The only change that is needed here is to not include /usr/include/ncursesw 
> in setup.py when cross compiling

No. Lots of codes in _cursesmodule.c need to know whether it's ncursesw, 
ncurses, or SysV's curses. For example: (segments below are from unpatched 
codebase)

#if !defined(__hpux) || defined(HAVE_NCURSES_H)
/* On HP/UX 11, these are of type cchar_t, which is not an
   integral type. If this is a problem on more platforms, a
   configure test should be added to determine whether ACS_S1
   is of integral type. */
SetDictInt("ACS_S1",(ACS_S1));
SetDictInt("ACS_S9",(ACS_S9));
SetDictInt("ACS_DIAMOND",   (ACS_DIAMOND));
SetDictInt("ACS_CKBOARD",   (ACS_CKBOARD));
SetDictInt("ACS_DEGREE",(ACS_DEGREE));
SetDictInt("ACS_PLMINUS",   (ACS_PLMINUS));
SetDictInt("ACS_BULLET",(ACS_BULLET));
SetDictInt("ACS_LARROW",(ACS_LARROW));
SetDictInt("ACS_RARROW",(ACS_RARROW));
SetDictInt("ACS_DARROW",(ACS_DARROW));
SetDictInt("ACS_UARROW",(ACS_UARROW));
SetDictInt("ACS_BOARD", (ACS_BOARD));
SetDictInt("ACS_LANTERN",   (ACS_LANTERN));
SetDictInt("ACS_BLOCK", (ACS_BLOCK));
#endif

And

static int
PyCurses_ConvertToCchar_t(PyCursesWindowObject *win, PyObject *obj,
  chtype *ch
#ifdef HAVE_NCURSESW
  , wchar_t *wch
#endif
  )

So detecting ncurses's actual include path is necessary.

--

___
Python tracker 

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



[issue28091] Document PEP 525

2016-12-09 Thread Nick Coghlan

Nick Coghlan added the comment:

I agree with Guido that the in-practice terminology for synchronous generators 
is:

 "generator" = infer from context (and/or the ambiguity doesn't matter)
 "generator function" = generator iterator factory defined with "def"
 "generator iterator" = result of calling a generator function

Hence the caveat on https://docs.python.org/3/glossary.html#term-generator: 
"Usually refers to a generator function, but may refer to a generator iterator 
in some contexts. In cases where the intended meaning isn’t clear, using the 
full terms avoids ambiguity."

For async I believe you may be better off avoiding the term "generator" 
entirely, and instead going with "native async iterator":

  "native async iterator" = infer from context
  "native async iterator function" = async iterator factory defined with "async 
def"
  "native async iterator object" = result of calling a native async iterator 
function

Yes, technically there's generator machinery under the hood, but I think we're 
better off letting the discovery of "Oh, coroutines, native async iterators, 
and generators are all basically the same thing at runtime" be delayed until 
new users are further along in the process of using Python productively.

--

___
Python tracker 

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



[issue28755] Rework syntax highlighing in howto/clinic.rst

2016-12-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3795ba7490b1 by Martin Panter in branch '3.5':
Issue #28755: Improve syntax highlighting in Arg Clinic howto
https://hg.python.org/cpython/rev/3795ba7490b1

New changeset d0859a11322c by Martin Panter in branch '3.6':
Issues #28755, #28753: Merge Arg Clinic howto from 3.5
https://hg.python.org/cpython/rev/d0859a11322c

New changeset 889cb7ebc38d by Martin Panter in branch 'default':
Issue #28755: Merge Arg Clinic howto from 3.6
https://hg.python.org/cpython/rev/889cb7ebc38d

--
nosy: +python-dev

___
Python tracker 

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



[issue28753] Clinic: Converting Your First Function is not up to date

2016-12-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7a93d1a0a1cf by Martin Panter in branch '3.5':
Issue 28753: Argument Clinic howto docfix, courtesy Julien Palard.
https://hg.python.org/cpython/rev/7a93d1a0a1cf

New changeset d0859a11322c by Martin Panter in branch '3.6':
Issues #28755, #28753: Merge Arg Clinic howto from 3.5
https://hg.python.org/cpython/rev/d0859a11322c

--

___
Python tracker 

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



[issue1446619] extended slice behavior inconsistent with docs

2016-12-09 Thread Martin Panter

Martin Panter added the comment:

Patch ruling out the len(s) corner case. I use a modified version of Fumihiro’s 
suggestion.

--
versions: +Python 3.6, Python 3.7 -Python 3.4
Added file: http://bugs.python.org/file45827/extended_slicing_docs.v2.diff

___
Python tracker 

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



[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-12-09 Thread Martin Panter

Martin Panter added the comment:

I’m okay with this version unless anyone has any more improvements.

--
stage: patch review -> commit review

___
Python tracker 

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



[issue28755] Rework syntax highlighing in howto/clinic.rst

2016-12-09 Thread Martin Panter

Changes by Martin Panter :


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

___
Python tracker 

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



[issue28928] IDLE crashes when opening .py file from Finder

2016-12-09 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
assignee: terry.reedy -> 
components: +Installation, Tkinter, macOS
nosy: +ronaldoussoren
status: pending -> open

___
Python tracker 

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



[issue28928] IDLE crashes when opening .py file from Finder

2016-12-09 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
status: open -> pending

___
Python tracker 

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



[issue28820] Typo in section 6 of the Python 3.4 documentation

2016-12-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8e36c04d0e3e by Martin Panter in branch '3.5':
Issue #28820: Fix spelling of “practice” as a noun
https://hg.python.org/cpython/rev/8e36c04d0e3e

New changeset e9b78a42e6c0 by Martin Panter in branch '3.6':
Issue #28820: Merge spelling fixes from 3.5
https://hg.python.org/cpython/rev/e9b78a42e6c0

New changeset d786c620838c by Martin Panter in branch 'default':
Issue #28820: Merge typo fixes from 3.6
https://hg.python.org/cpython/rev/d786c620838c

--

___
Python tracker 

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



[issue28916] Not matched behavior of modulo operator % with the description of the documentation

2016-12-09 Thread Martin Panter

Martin Panter added the comment:

Patch for %x in Py 2.

--
Added file: http://bugs.python.org/file45828/alt-zero.py2.patch

___
Python tracker 

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



[issue28929] Provide a link from documentation back to its source file

2016-12-09 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

On the left menu, there's already a Show Source link. 
Is the idea to replace that link to github.com/python/cpython/blob/ ?

Or, are you thinking about adding a new link under the main heading, similar to 
**Source code:** :source:`Lib/abc.py` 
but for the docs, so maybe by creating a new role like:
**Docs Source code:** :docs_source:`Doc/library/abc.rst`

--
nosy: +Mariatta

___
Python tracker 

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



[issue28771] Update documented signatures of tp_get/setattr

2016-12-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5d51ac0be72a by Martin Panter in branch '3.5':
Issue #28771: Update tp_get/setattr signature documentation
https://hg.python.org/cpython/rev/5d51ac0be72a

New changeset ee8c8b79d1d5 by Martin Panter in branch '3.6':
Issue #28771: Merge C API doc fix from 3.5
https://hg.python.org/cpython/rev/ee8c8b79d1d5

New changeset c4865975b804 by Martin Panter in branch 'default':
Issue #28771: Merge C API doc fix from 3.6
https://hg.python.org/cpython/rev/c4865975b804

--

___
Python tracker 

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



[issue28930] bytes_methods.c won't recompile if related stringlib/* changed

2016-12-09 Thread Xiang Zhang

New submission from Xiang Zhang:

bytes_methods.c includes files in stringlib, for example, stringlib/count.h. 
But if count.h changes, simply running make won't recompile bytes_methods.c and 
the methods of bytes remain unchanged. You have to make distclean and compile 
from scratch.

--
components: Build
messages: 282832
nosy: xiang.zhang
priority: normal
severity: normal
status: open
title: bytes_methods.c won't recompile if related stringlib/* changed
type: behavior

___
Python tracker 

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



[issue28930] bytes_methods.c won't recompile if related stringlib/* changed

2016-12-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Needed a rule in Makefile.

--
nosy: +serhiy.storchaka
stage:  -> needs patch

___
Python tracker 

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



[issue28771] Update documented signatures of tp_get/setattr

2016-12-09 Thread Martin Panter

Changes by Martin Panter :


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

___
Python tracker 

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



[issue28820] Typo in section 6 of the Python 3.4 documentation

2016-12-09 Thread Martin Panter

Changes by Martin Panter :


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

___
Python tracker 

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



[issue28930] bytes_methods.c won't recompile if related stringlib/* changed

2016-12-09 Thread Xiang Zhang

Changes by Xiang Zhang :


--
assignee:  -> xiang.zhang
keywords: +patch
stage: needs patch -> patch review
type: behavior -> 
versions: +Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45829/Makefile-bytes-methods.patch

___
Python tracker 

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



[issue28916] Not matched behavior of modulo operator % with the description of the documentation

2016-12-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Both patches LGTM.

--
assignee: docs@python -> martin.panter
nosy: +serhiy.storchaka
stage: patch review -> commit review

___
Python tracker 

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



[issue28930] bytes_methods.c won't recompile if related stringlib/* changed

2016-12-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM. But be aware of possible differences in 3.5.

Alternatively just BYTESTR_DEPS can be used instead of BYTESMETHODS_DEPS. This 
would make easier moving implementations between bytesobject.c and 
bytes_methods.c.

--

___
Python tracker 

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



[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-12-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee: docs@python -> martin.panter

___
Python tracker 

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