[issue20211] setup.py: do not add system header locations when cross compiling

2016-12-10 Thread Xavier de Gaye

Xavier de Gaye added the comment:

When cross compiling, setup.py must not look for headers in the directory for 
installing C header files and must not look for libraries in the directory for 
installing object code libraries of the _native_ interpreter which is being 
used to run setup.py.
Thomas patch updated to the tip of the default branch.

--
assignee:  -> xdegaye
stage:  -> commit review
versions:  -Python 3.5
Added file: http://bugs.python.org/file45830/no-native-headers-libraries.patch

___
Python tracker 

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



[issue20211] setup.py: do not add system header locations when cross compiling

2016-12-10 Thread Matthias Klose

Matthias Klose added the comment:

this assumption is wrong for the multiarch case.

--

___
Python tracker 

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



[issue28190] Cross-build _curses failed if host ncurses headers and target ncurses headers have different layouts

2016-12-10 Thread Xavier de Gaye

Xavier de Gaye added the comment:

This patch does not add /usr/include/ncursesw to the include directories search 
paths when cross compiling.

Restoring the original title.

@Chi Hsuan Yen
Please open a new issue for the detection of the curses paths. The current 
issue is about the failure to cross compile _curses when /usr/include/ncursesw 
is added to these paths. See the original post and the original title.

--
assignee:  -> xdegaye
components:  -Build
stage:  -> patch review
title: Detect curses headers correctly for cross-compiling -> Cross-build 
_curses failed if host ncurses headers and target ncurses headers have 
different layouts
versions: +Python 3.6
Added file: http://bugs.python.org/file45831/no-path-to-ncursesw.patch

___
Python tracker 

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



[issue28190] Cross-build _curses failed if host ncurses headers and target ncurses headers have different layouts

2016-12-10 Thread Matthias Klose

Matthias Klose added the comment:

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

no, this is a very wrong simplification.  Both gcc and clang offer a method to 
search for header files and libraries in a target specific location. Please use 
these options.

--

___
Python tracker 

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



[issue28190] Cross-build _curses failed if host ncurses headers and target ncurses headers have different layouts

2016-12-10 Thread Xavier de Gaye

Xavier de Gaye added the comment:

> Both gcc and clang offer a method to search for header files and libraries in 
> a target specific location.

AFAIK there is no target specific location when cross compiling. What are those 
cross compilation target specific locations according to you ?

--

___
Python tracker 

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



[issue20211] setup.py: do not add system header locations when cross compiling

2016-12-10 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

xdegaye's explanation is incorrect. The actual scene is much more complicated. 
First, let me explain why things may be broken. The wrong directory is included 
only if all of the following conditions are met:

1. PYTHON_FOR_BUILD is not installed with --prefix=/usr. A common example is 
those which are installed with pyenv. This condition is here simply because of 
`os.path.normpath(sys.base_prefix) != '/usr'`
2. The build script uses $DESTDIR convention to compile CPython
3. Header files in $DESTDIR$PREFIX/include are not equivalent to 
$PREFIX/include. Here "equivalent" means they are for the same set of 
architecture/kernel/... This is a common case when cross compiling, while a 
famous exception is the multiarch framework on Debian-based systems.

For example, if I use --prefix=/usr and DESTDIR=/tmp/python3-android/build, 
INCLUDEDIR will be /usr/include, which should not be included. On the other 
hand, if I use --prefix=/tmp/python3-android/build/usr and omit DESTDIR, 
INCLUDEDIR is correct /tmp/python3-android/build/usr/include. With $DESTDIR 
specified, the build script has the responsibility to specify 
$DESTDIR$PREFIX/include in CPPFLAGS, or CPython interpreter core won't even 
build, so skipping adding INCLUDEDIR in setup.py is safe. However, for the 
latter case (not using DESTDIR), the build script still needs to specify 
correct CPPFLAGS. I see it as a CPython limitation and worth documentation.

For Debian's multiarch framework, paths are already handled by 
add_multiarch_paths(). I'm not sure whether $PREFIX/include should still be 
included or not. (I don't use Debian-based systems)

--

___
Python tracker 

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



[issue28754] Argument Clinic for bisect.bisect_left

2016-12-10 Thread Julien Palard

Julien Palard added the comment:

I was able to simplify my patch a bit, I think I should also add a test to 
ensure we keep the hi=-1 and hi=None compatibility in the future.

--
Added file: http://bugs.python.org/file45832/issue28754-8.diff

___
Python tracker 

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



[issue20211] setup.py: do not add system header locations when cross compiling

2016-12-10 Thread Xavier de Gaye

Xavier de Gaye added the comment:

> this assumption is wrong for the multiarch case.

Please explain why it is wrong.

--

___
Python tracker 

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



[issue28190] Cross-build _curses failed if host ncurses headers and target ncurses headers have different layouts

2016-12-10 Thread Xavier de Gaye

Xavier de Gaye added the comment:

> no, this is a very wrong simplification.  Both gcc and clang offer a method 
> to search for header files and libraries in a target specific location. 
> Please use these options.

Please open a new issue for the detection of the curses paths. The current 
issue is about the failure to cross compile _curses when /usr/include/ncursesw 
is added to these paths. See the original post and the original title.

--

___
Python tracker 

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



[issue25677] Syntax error caret confused by indentation

2016-12-10 Thread Martin Panter

Martin Panter added the comment:

(Long story short: need to strip form feeds in print_error_text(), but I agree 
that this otherwise does fix a bug.)

There is one minor regression that this patch causes IMO. Given the following 
file, where  represents a form feed character ('\014')

if True:
1 + 1 = 2

the error report now has a blank line (due to outputting the FF character) and 
extra indentation that wasn’t stripped:

  File "indent.py", line 2

1 + 1 = 2
^
SyntaxError: can't assign to operator

I think the fix for this is to strip form feed characters in 
print_error_text(), in Python/pythonrun.c.

Apart from that, I agree with Serhiy and Michael that it is okay to push this 
change. The bug that we are fixing is that SyntaxError.offset does not 
correspond with SyntaxError.text, due to indentation. Before the patch, the 
offset refers to the line without indentation removed, but the text has 
indentation removed. Here is a really bad case, where there is more indentation 
than code, print_error_text() tries to find the next line, and ends up printing 
a blank line:

>>> code = "if True:\n" + " "*16 + "1 + 1 = 2\n"
>>> with open("indent.py", "wt") as f: f.write(code)
... 
35
>>> try: compile(code, "indent.py", "exec")
... except SyntaxError as err:
... print("offset={err.offset} text={err.text!r}".format(err=err))
... raise
... 
offset=16 text='1 + 1 = 2\n'
Traceback (most recent call last):
  File "", line 1, in 
  File "indent.py", line 2

 ^
SyntaxError: can't assign to operator

In Michael’s original report, I was curious why the caret is only shifted three 
spaces, despite there being four spaces of indentation. This is because offset 
points to the start of the line, but the caret points to the character _before_ 
offset. So offset=0 and offset=1 are both represented by pointing at the first 
character on the line. This is related to Serhiy’s bug with inserting “1;”. In 
some cases (e.g. the line “1 +”), the offset is the string index _after_ the 
error. But in the case of “1;1 + 1 = 2”, offset is the index where the error 
(statement) begins.

Both pieces of indentation stripping code were added in revision 27f04d714ecb 
(year 2001). It is strange that only one stripped form feeds though. The column 
offset was only added later (revision 861c35cef7aa). So Python 2 will have some 
of its SyntaxError.text lines stripped of indentation, but it does not matter 
so much because SyntaxError.offset is not set in those cases.

--

___
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-10 Thread Xiang Zhang

Xiang Zhang added the comment:

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

Yes. The only downside of this is some changes may recompile bytes_methods.c 
unnecessarily but this is not a matter.

> But be aware of possible differences in 3.5.

In 3.5 bytes_methods.c doesn't rely on stringlib/*.

--
nosy: +haypo
versions:  -Python 3.5
Added file: http://bugs.python.org/file45833/Makefile-bytes-methods-v2.patch

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

Serhiy Storchaka added the comment:

Makefile-bytes-methods-v2.patch LGTM.

--

___
Python tracker 

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



[issue28190] Cross-build _curses failed if host ncurses headers and target ncurses headers have different layouts

2016-12-10 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

@xdegaye: no-path-to-ncursesw.patch fixes a problem yet introducing a new one. 
With that patch auto-detection of ncurses include files are broken. Now users 
have to specify the path manually even for native builds.

--

___
Python tracker 

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



[issue28815] test_socket fails if /proc/modules is existent but not readable

2016-12-10 Thread patrila

patrila added the comment:

Oops, sorry that was the draft version of the patch.
Attached the correct version. It was tested against "default" branch (but not 
against 2.7).

--
Added file: 
http://bugs.python.org/file45834/test_socket_isTipcAvailable_proc_modules.patch

___
Python tracker 

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



[issue26960] urllib hangs when closing connection

2016-12-10 Thread Ivan Pozdeev

Ivan Pozdeev added the comment:

This fix has caused issue25458 to manifest itself in `urllib', too. AFAICS, 
it's impossible to fully fix `urllib' to correctly handle end-of-transmission 
response without fixing `ftplib' first.

--
nosy: +Ivan.Pozdeev

___
Python tracker 

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



[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

2016-12-10 Thread Aviv Palivoda

Aviv Palivoda added the comment:

Pinging as mentioned in the devguide.

--

___
Python tracker 

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



[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-10 Thread Tobias Hansen

Tobias Hansen added the comment:

This change breaks backward compatibility in Python 2.7. This is the example 
that also broke in #25731. In that case the change was reverted. See 
https://bugs.python.org/issue25731#msg262922

$ cat foo.pxd 
cdef class B:
cdef object b
$ cat foo.pyx 
cdef class A:
pass

cdef class B:
def __init__(self, b):
self.b = b
$ cat bar.py
from foo import A, B

class C(A, B):
def __init__(self):
B.__init__(self, 1)

C()
$ cython foo.pyx && gcc -I/usr/include/python2.7 -Wall -shared -fPIC -o foo.so 
foo.c
$ python -c 'import bar'
Traceback (most recent call last):
  File "", line 1, in 
  File "bar.py", line 7, in 
C()
TypeError: foo.A.__new__(C) is not safe, use foo.B.__new__()

--
nosy: +thansen

___
Python tracker 

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



[issue28931] urllib ignores FTP 226 response, breaking further FTP requests

2016-12-10 Thread Ivan Pozdeev

New submission from Ivan Pozdeev:

>>> urllib.urlretrieve("ftp://ftp.zlatkovic.com/pub/libxml/md5sum.txt","t.bin";)
('t.bin', )
>>> urllib.urlretrieve("ftp://ftp.zlatkovic.com/pub/libxml/md5sum.txt","t.bin";)
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Py\lib\urllib.py", line 98, in urlretrieve
return opener.retrieve(url, filename, reporthook, data)
  File "C:\Py\lib\urllib.py", line 245, in retrieve
fp = self.open(url, data)
  File "C:\Py\lib\urllib.py", line 213, in open
return getattr(self, name)(url)
  File "C:\Py\lib\urllib.py", line 558, in open_ftp
(fp, retrlen) = self.ftpcache[key].retrfile(file, type)
  File "C:\Py\lib\urllib.py", line 906, in retrfile
conn, retrlen = self.ftp.ntransfercmd(cmd)
  File "C:\Py\lib\ftplib.py", line 334, in ntransfercmd
host, port = self.makepasv()
  File "C:\Py\lib\ftplib.py", line 312, in makepasv
host, port = parse227(self.sendcmd('PASV'))
  File "C:\Py\lib\ftplib.py", line 830, in parse227
raise error_reply, resp
IOError: [Errno ftp error] 200 Type set to I

The cause is the 226 Transfer Complete response being ignored, causing further 
response lines to be incorrectly matched to request lines.

The bug is a result of issue16270 for 3.x and issue26960 for 2.7.

--
components: Library (Lib)
files: ftp_error_illustration.txt
messages: 282853
nosy: Ivan.Pozdeev
priority: normal
severity: normal
status: open
title: urllib ignores FTP 226 response, breaking further FTP requests
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45835/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



[issue28754] Argument Clinic for bisect.bisect_left

2016-12-10 Thread Julien Palard

Julien Palard added the comment:

Added a test to ensure compatibility of both hi=None (introduced in original 
Python version) and hi=-1 (Introduced by the C version).

Modified Python version to be compatible with the C-introduced hi=-1, so that 
the new test pass.

--

___
Python tracker 

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



[issue28754] Argument Clinic for bisect.bisect_left

2016-12-10 Thread Julien Palard

Changes by Julien Palard :


Added file: http://bugs.python.org/file45836/issue28754-9.diff

___
Python tracker 

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



[issue28931] urllib ignores FTP 226 response, breaking further FTP requests

2016-12-10 Thread Ivan Pozdeev

Ivan Pozdeev added the comment:

The attached patch fixes this case. It still leaves the following problem:

>>> u=urllib.urlopen("ftp://ftp.zlatkovic.com/pub/libxml/md5sum.txt";).read()
>>> urllib.urlretrieve("ftp://ftp.zlatkovic.com/pub/libxml/md5sum.txt","t.bin";)
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Py\lib\urllib.py", line 98, in urlretrieve
return opener.retrieve(url, filename, reporthook, data)
  File "C:\Py\lib\urllib.py", line 245, in retrieve
fp = self.open(url, data)
  File "C:\Py\lib\urllib.py", line 213, in open
return getattr(self, name)(url)
  File "C:\Py\lib\urllib.py", line 558, in open_ftp
(fp, retrlen) = self.ftpcache[key].retrfile(file, type)
  File "C:\Py\lib\urllib.py", line 906, in retrfile
conn, retrlen = self.ftp.ntransfercmd(cmd)
  File "C:\Py\lib\ftplib.py", line 334, in ntransfercmd
host, port = self.makepasv()
  File "C:\Py\lib\ftplib.py", line 312, in makepasv
host, port = parse227(self.sendcmd('PASV'))
  File "C:\Py\lib\ftplib.py", line 830, in parse227
raise error_reply, resp
IOError: [Errno ftp error] 200 Type set to I

I reckon this can't be fully fixed without fixing `ftplib' first, see 
issue25458.

--

___
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-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f9e0c864157c by Xavier de Gaye in branch '3.6':
Issue #28918: Fix the cross compilation of xxlimited when Python
https://hg.python.org/cpython/rev/f9e0c864157c

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

--
nosy: +python-dev

___
Python tracker 

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



[issue28779] set_forkserver_preload() can crash the forkserver if preloaded module instantiate multiprocessing classes

2016-12-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1a955981b263 by Antoine Pitrou in branch '3.5':
Issue #28779: multiprocessing.set_forkserver_preload() would crash the 
forkserver process if a preloaded module instantiated some multiprocessing 
objects such as locks.
https://hg.python.org/cpython/rev/1a955981b263

New changeset f3b9fd41b5cb by Antoine Pitrou in branch '3.6':
Issue #28779: multiprocessing.set_forkserver_preload() would crash the 
forkserver process if a preloaded module instantiated some multiprocessing 
objects such as locks.
https://hg.python.org/cpython/rev/f3b9fd41b5cb

New changeset 5456b699788f by Antoine Pitrou in branch 'default':
Issue #28779: multiprocessing.set_forkserver_preload() would crash the 
forkserver process if a preloaded module instantiated some multiprocessing 
objects such as locks.
https://hg.python.org/cpython/rev/5456b699788f

--
nosy: +python-dev

___
Python tracker 

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



[issue28779] set_forkserver_preload() can crash the forkserver if preloaded module instantiate multiprocessing classes

2016-12-10 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Now fixed, closing.

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



[issue28849] do not define sys.implementation._multiarch on Android

2016-12-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b3ba41bf92c7 by Xavier de Gaye in branch '3.6':
Issue #28849: Do not define sys.implementation._multiarch on Android.
https://hg.python.org/cpython/rev/b3ba41bf92c7

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

--
nosy: +python-dev

___
Python tracker 

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



[issue28932] Fail compile Python 3.6.0rc1 on OpenBSD 6.0

2016-12-10 Thread Alexandr Shadchin

New submission from Alexandr Shadchin:

In OpenBSD not exist sys/random.h.

--
components: Build, Installation
files: patch-Python_random_c
messages: 282860
nosy: Alexandr Shadchin
priority: normal
severity: normal
status: open
title: Fail compile Python 3.6.0rc1 on OpenBSD 6.0
type: compile error
versions: Python 3.6
Added file: http://bugs.python.org/file45837/patch-Python_random_c

___
Python tracker 

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



[issue28933] AC: Accept None as a default value for any type

2016-12-10 Thread Julien Palard

New submission from Julien Palard:

Today, writing an AC declaration like:

something: Py_ssize_t(c_default="-1") = None

Leads to the almost obvious "Py_ssize_t_converter: default value None for field 
something is not of type int".

But it actually make sense: 
 - Accept None as a default python value
 - Document "something=None" in the docstring
 - Write `Py_ssize_t something = -1` in the C code
 - Don't try to parse the argument if it's the default value, keeping the value 
from the C initialization

In other words, it's a "Give -1 to the C implementation when argument is not 
given or None, and it may be usefull, typically I'll use it in issue28754.

--
components: Argument Clinic
messages: 282861
nosy: larry, mdk
priority: normal
severity: normal
status: open
title: AC: Accept None as a default value for any type
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



[issue28933] AC: Accept None as a Py_ssize_t default value

2016-12-10 Thread Julien Palard

Changes by Julien Palard :


--
title: AC: Accept None as a default value for any type -> AC: Accept None as a 
Py_ssize_t default value

___
Python tracker 

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



[issue28933] AC: Accept None as a Py_ssize_t default value

2016-12-10 Thread Julien Palard

Julien Palard added the comment:

Proposed a patch, but I'm not a huge fan of modifying getargs.c. If it's 
accepted, I'll obviously need to write tests before this is merged.

--
keywords: +patch
Added file: http://bugs.python.org/file45838/issue28933.diff

___
Python tracker 

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



[issue28934] _mboxMMDF#get_message should delegate to get_bytes

2016-12-10 Thread bpoaugust

New submission from bpoaugust:

At present both _mboxMMDF#get_message and get_bytes read the file directly.

However the code in get_bytes duplicates some of the code in get_message. 
get_message should be recoded to use get_bytes.

It would then be possible to override get_bytes (which is also used by 
get_string) in order to transform the input stream e.g. to unmangle '>From ' 
lines.

But in any case it makes sense to reuse the code - DRY

--
components: email
messages: 282863
nosy: barry, bpoaugust, r.david.murray
priority: normal
severity: normal
status: open
title: _mboxMMDF#get_message should delegate to get_bytes
type: enhancement

___
Python tracker 

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



[issue28754] Argument Clinic for bisect.bisect_left

2016-12-10 Thread Julien Palard

Julien Palard added the comment:

Maybe wait for issue28933.

--

___
Python tracker 

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



[issue28935] distutils use ConfigParser in Python 3.x and fails to parse setup.cfg with percent sign

2016-12-10 Thread Axel Haustant

New submission from Axel Haustant:

Because of the Python 3.2 configparser renaming/refactoring, string 
interpolation has been enabled into distutils config parsing and so fails to 
read any setup.cfg with percent signs (try to perform string interpolation and 
fails).


To reproduce: create a project with a percent sign anywhere in the setup.cfg 
file and execute python setup.py egg_info.
It will pass on Python 2.x and fails on Python 3.x.

The attached patch suimply disable string interpolation in distutils config 
parsing.

That would be awesome to have this applied on any 3.x version (because project 
using tox to test against different Python versions also fails with the same 
issue Python 3.x and PyPI 3.x)

--
components: Distutils
files: disable-distutils-string-interpolation.patch
keywords: patch
messages: 282865
nosy: Axel Haustant, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: distutils use ConfigParser in Python 3.x and fails to parse setup.cfg 
with percent sign
type: crash
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: 
http://bugs.python.org/file45839/disable-distutils-string-interpolation.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-10 Thread Brett Cannon

Brett Cannon added the comment:

Either idea works, but I want a link that someone who finds a spelling mistake 
can easily follow and submit a PR to fix the issue.

--

___
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-10 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks, Brett :) I think it's easier to update the existing Source Link to 
github. I'll work on a patch for this.

--

___
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-10 Thread Brett Cannon

Brett Cannon added the comment:

Inlining wouldn't break Pyjion since all of its smarts would be in the 
trampoline function in PyInterpreterState. It may break other debuggers like 
Python Tools for Visual Studio, though (+steve.dower for that).

But is the overhead honestly that high to warrant inlining? What kind of perf 
gain do you see from doing this? My worry is that if the perf isn't that much 
better that inlining will simply make it harder to tweak that function in the 
future.

--
nosy: +dino.viehland, steve.dower

___
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-10 Thread Brett Cannon

Brett Cannon added the comment:

Those results are expected as passing in a file by path means it's just read by 
open() and then passed to exec() while the others pass through import itself 
which has the os.path.isfile() check.

Since this is a change from Python 2.7 I would be willing to look at a patch 
that loosened things that was fully backwards-compatible, but it would be an 
enhancement and not a bugfix.

--

___
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-10 Thread Brett Cannon

Brett Cannon added the comment:

Patch LGTM.

--
stage:  -> commit review

___
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-10 Thread Brett Cannon

Changes by Brett Cannon :


--
versions: +Python 3.7 -Python 3.4

___
Python tracker 

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



[issue28931] urllib ignores FTP 226 response, breaking further FTP requests

2016-12-10 Thread Ivan Pozdeev

Changes by Ivan Pozdeev :


--
keywords: +patch
Added file: http://bugs.python.org/file45840/105577.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-10 Thread Gregory P. Smith

Gregory P. Smith added the comment:

So long as this code block that imports os is avoided, I believe that this can 
be properly frozen:

+if not isinstance(path, str):
+import os
+path = os.fsdecode(path)

But it should be easy to avoid that code path when the standard library is a 
zip file.

Otherwise it uses importlib (frozen), marshal (builtin), sys (builtin), time 
(builtin), and zlib [if present] (extension module).

--

___
Python tracker 

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



[issue16737] Different behaviours in script run directly and via runpy.run_module

2016-12-10 Thread Jason R. Coombs

Jason R. Coombs added the comment:

I've found some other inconsistencies with the use of python -m. One is the 
surprising behavior when running pip:

$ touch logging.py
$ pip --help > /dev/null
$ python -m pip --help > /dev/null
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", 
line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", 
line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", 
line 109, in _get_module_details
__import__(pkg_name)
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/__init__.py",
 line 21, in 
from pip._vendor.requests.packages.urllib3.exceptions import 
DependencyWarning
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/requests/__init__.py",
 line 62, in 
from .packages.urllib3.exceptions import DependencyWarning
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/requests/packages/__init__.py",
 line 27, in 
from . import urllib3
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py",
 line 8, in 
from .connectionpool import (
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py",
 line 35, in 
from .connection import (
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/connection.py",
 line 44, in 
from .util.ssl_ import (
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/util/__init__.py",
 line 20, in 
from .retry import Retry
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/util/retry.py",
 line 15, in 
log = logging.getLogger(__name__)
AttributeError: module 'logging' has no attribute 'getLogger'

Obviously this is a case of don't create any files that mask stdlib or other 
modules that your call stack might try to import. But the takeaway is that you 
can't in general rely on `python -m` to launch behavior comparable to launching 
a script.


Additionally, this inconsistency led to a [subtle bug in pytest when launched 
with -m](https://github.com/pytest-dev/pytest/issues/2104). In that ticket, the 
recommended solution (at least thusfar) is "don't use -m". I imagine that 
pytest (and every other project that exposes a module for launching core 
behavior) could work around the issue by explicitly removing the cwd from 
sys.path, but that seems messy.

I imagine it could prove difficult to overcome the backward incompatibilities 
of changing this behavior now, so I don't have a strong recommendation, but I 
wanted to share these experiences and get feedback and recommendations.

--
nosy: +jason.coombs

___
Python tracker 

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



[issue28933] AC: Accept None as a Py_ssize_t default value

2016-12-10 Thread Larry Hastings

Larry Hastings added the comment:

You propose an automatic conversion of "None" into "-1"?  That's awful.  Please 
don't commit that patch to CPython.

--

___
Python tracker 

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



[issue28933] AC: Accept None as a Py_ssize_t default value

2016-12-10 Thread Larry Hastings

Larry Hastings added the comment:

It looks like you did it with a converter for 28754.  That's okay.  But not in 
the default implementation.

--

___
Python tracker 

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



[issue28754] Argument Clinic for bisect.bisect_left

2016-12-10 Thread Larry Hastings

Larry Hastings added the comment:

FWIW, pypy uses defaults of lo=0, hi=None.

https://bitbucket.org/pypy/pypy/src/25da7bc9719457aee57547993833d5168ba6aded/lib-python/2.7/bisect.py?at=default&fileviewer=file-view-default

--

___
Python tracker 

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



[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

2016-12-10 Thread paul j3

Changes by paul j3 :


--
priority: normal -> high

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

Serhiy Storchaka added the comment:

> Technically, will it be possible to freeze it?

I think yes. But I don't know how to do this. I hope on Brett's (or other 
import machinery expert) help.

Since zipimporter constructor is called only with string path by import 
machinery, the os module is not imported at initialization stage.

--

___
Python tracker 

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



[issue28754] Argument Clinic for bisect.bisect_left

2016-12-10 Thread Julien Palard

Julien Palard added the comment:

Hi Larry,

In any cases it looks like supporting hi=-1 and hi=None is mandatory: 

hi=None is the current implementation in the bisect (Python) module.
hi=-1 is the current implementation in the _bisect (C) module.

Both are currently living together, the C version takes over the Python version 
when available, but the Python version is older, so both -1 and None has been 
the "current implementation" during some time.

Raymond legitimately fear that someone, somewhere, used -1 in some code. We 
should not break it (even if it had never been documented).

So let's just accept both for the moment, and if deprecation of one or another 
should be discussed, let's do it later, in another issue. I'm _just_ trying to 
make AC move forward here, without breaking anything.

--

___
Python tracker 

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



[issue28190] Cross-build _curses failed if host ncurses headers and target ncurses headers have different layouts

2016-12-10 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



[issue25035] Getter/setter for argparse keys

2016-12-10 Thread paul j3

paul j3 added the comment:

Yes, the information that `add_argument` returns a Action object is missing 
from the documentation.  It might be useful addition.

The documentation has many faults.  It isn't basic enough to be a tutorial, but 
many first time users use it as such, and get confused by its complexity.  But 
it also is not a formal reference document. And the automatic 'help(argparse)' 
isn't much better.

A regular user does not need to use the Action object directly.  But as a 
developer I often test argparse in an interactive shell (IPython), and the 
'out' line shows a 'str' of the object (as a summary of its attributes).  So 
assigning that object to a variable is just as natural to me as saving the 
parser object returned by argparse.ArgumentParser, or the group object returned 
by parser.add_argument_group.

--

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

Serhiy Storchaka added the comment:

I think it is better to remove this code.

--
keywords: +patch
stage: needs patch -> patch review
Added file: 
http://bugs.python.org/file45841/load_classic_instance_error-2.7.patch

___
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-10 Thread Brett Cannon

Brett Cannon added the comment:

Thanks for the patch, Douglas!

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



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

2016-12-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3484933ba904 by Brett Cannon in branch '3.5':
Issue #28424: Document pkgutil.get_data() doesn't work with namespace packages.
https://hg.python.org/cpython/rev/3484933ba904

New changeset c17d2a37d610 by Brett Cannon in branch '3.6':
Merge for issue #28424
https://hg.python.org/cpython/rev/c17d2a37d610

New changeset b396a2c97871 by Brett Cannon in branch 'default':
Merge for issue #28424
https://hg.python.org/cpython/rev/b396a2c97871

--
nosy: +python-dev

___
Python tracker 

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



[issue28754] Argument Clinic for bisect.bisect_left

2016-12-10 Thread Larry Hastings

Larry Hastings added the comment:

Okay, but do it with a converter function, not by changing the default behavior 
for Py_ssize_t.  The vast majority of uses of Py_ssize_t should not accept None.

--

___
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-10 Thread wkdewey

wkdewey added the comment:

The ultimate solution was to uninstall homebrew, since there is no obvious way 
to get it to use the right version of Tcl/Tk (8.5.18). And then to install the 
python binary from python.org, which does pick up the right version of Tcl/Tk. 

I can't remember why I was using homebrew, but the instructions at 
https://www.python.org/download/mac/tcltk/ (where you get pointed from IDLE) 
were a little unclear. I didn't realize that "if you are using OS X 10.9 or 
later and a Python from a python.org 64-bit/32-bit installer" didn't refer to 
the Python that came with macOS, or that I had to (or even could) install the 
python.org binary on top of the Python that was already there.

--
status: pending -> open

___
Python tracker 

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



[issue28902] 3.6.0rc1 installer fails to install / uninstall.

2016-12-10 Thread Decorater

Decorater added the comment:

Well, not only that but now when I try to uninstall the 64 bit version it seems 
to not be able to find when on the "Add to path" part of Uninstaller
E:\ProgramData\Package Cache\{815FC13F-79DD-484C-8788-028D69569000}v3.6.121.0\
and some other folders.

I think What the webinstaller should do when it cant find the file/files is to 
download them again and then run the uninstall in case otherwise there is no 
other way to actually uninstall it.

--

___
Python tracker 

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



[issue28902] 3.6.0rc1 installer fails to install / uninstall.

2016-12-10 Thread Decorater

Changes by Decorater :


Removed file: http://bugs.python.org/file45842/Python 3.6.0rc1 
(64-bit)_20161210164706.log

___
Python tracker 

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



[issue28902] 3.6.0rc1 installer fails to install / uninstall.

2016-12-10 Thread Decorater

Changes by Decorater :


Added file: http://bugs.python.org/file45842/Python 3.6.0rc1 
(64-bit)_20161210164706.log

___
Python tracker 

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



[issue28902] 3.6.0rc1 installer fails to install / uninstall.

2016-12-10 Thread Decorater

Changes by Decorater :


Added file: http://bugs.python.org/file45843/Python 3.6.0rc1 
(64-bit)_20161210164706.log

___
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-10 Thread Ned Deily

Ned Deily added the comment:

I'm glad you got it working.  The information at 
https://www.python.org/download/mac/tcltk/ pertains primarily to using Pythons 
from the python.org installers; it doesn't directly apply to Python instances 
built by and supplied by third-party distributors like Homebrew or MacPorts.  
So there is nothing wrong about them supplying and linking their Pythons with 
their own version of Tcl/Tk, be it 8.6.x or 8.5.x.  It would be good to figure 
out what the problem was that you saw and whether it is a general problem for 
other Homebrew users but that is out of scope for this tracker.

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



[issue28902] 3.6.0rc1 installer fails to install / uninstall.

2016-12-10 Thread Decorater

Decorater added the comment:

I found the registry keys for all python version Except for the keys that Adds 
it to path to manually uninstall the Add to Path. Other than that Everything 
Else has been found and take cared of manually thanks to Windows built in 
Registry Editor.

--

___
Python tracker 

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



[issue28582] Invalid backslash syntax errors are not always accurate as to the location on the line where the error occurs

2016-12-10 Thread Martin Panter

Martin Panter added the comment:

I think there are actually two issues at play here:

1. The caret is not compensated for indentation removed from the code. This is 
what Issue 25677 was originally about. The current patch there will ensure that 
the behaviour is always like the second (top-level) case, no matter what the 
indentation was.

2. The caret points at the character before SyntaxError.offset. Sometimes the 
offset identifies the _end_ of the erroneous syntax, and the caret makes sense, 
because it points at the end of an invalid word (or directly at an invalid 
character). But other times, such as the invalid escape sequence, offset points 
at the _start_ of the invalid syntax, and the caret will point to the end of 
the previous valid syntax. This issue was brought up at the end of Issue 25677, 
but should probably be dealt with separately.

If you take the first case (indented function), and change the size of the 
indentation, you will see that the caret is no longer correct. It just happens 
that with four spaces, the two bugs kind of cancel each other out, and the 
positioning is actually better than it was designed to be :)

--
nosy: +martin.panter

___
Python tracker 

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



[issue28754] Argument Clinic for bisect.bisect_left

2016-12-10 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Why does this need a converter function?  I there is any reason this can't use 
"O" with "hi" defaulting to None (matching the pure python API) and letting the 
C function handle both -1 and None in the implementation rather than in AC?

--

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



[issue28754] Argument Clinic for bisect.bisect_left

2016-12-10 Thread Julien Palard

Julien Palard added the comment:

Hi Raymond,

I don't like having the converters in the C implementation too, that's why I'm 
working on issue28933 to clean this.

> letting the C function handle both -1 and None in the implementation rather 
> than in AC?

It works, yes. But I prefer to clearly split responsibilities: AC being 
responsible of adapting argument from PyObjects to C types, and C functions 
being responsible of ... doing their job.

If the idea in issue28933 is accepted, we'll be able to declare hi as simply as:

hi: Py_ssize_t(c_default="-1") = None

meaning "C function will get a Py_ssize_t, default value for C code is -1, None 
is documented, and None can be passed to get the C default value", that's this 
last point "None can be passed to get the C default value" that I introduce in 
issue28933.

With this syntax, both C converters and the python hi_parameter_converter can 
be dropped.

--

___
Python tracker 

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



[issue25677] Syntax error caret confused by indentation

2016-12-10 Thread Martin Panter

Martin Panter added the comment:

Patch v6 strips the form feed, and adds an extra test.

--
Added file: http://bugs.python.org/file45844/cpython25677.v6.patch

___
Python tracker 

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



[issue28754] Argument Clinic for bisect.bisect_left

2016-12-10 Thread Larry Hastings

Larry Hastings added the comment:

We don't *have* to use a converter function, no.  But consider: someone 
somewhere will have to convert a PyObject * into a Py_ssize_t, also accepting 
None.  Doing it in a converter function means we can easily share the code with 
bisect_right, which should presumably behave the same way.  It also keeps all 
the argument parsing logic in the Argument Clinic domain instead of having some 
in AC and some in the implementation.

Is there some drawback to using a converter function?

--

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

Raymond Hettinger added the comment:

Thank you for the link, it was nice to see Guido's reasons for giving a -0 on 
the proposal.  I would add that I haven't see any code in the wild that would 
benefit from testing isinstance(m, OrderedMapping) and taking some different 
action depending on the result.

Grant's sortedcollection is more sequence-like than mapping-like and the bidict 
has its own interesting properties and neither are substitutable for an 
OrderedDict.  In other words, the only properties these cluster on is the 
ordered equality feature.  IMO, that particular feature hasn't established 
itself as being valuable (we don't see much use of it with the existing ordered 
dicts, and likewise in the database world, table equivalence based on exact 
order rather than content equivalence is uncommon).

Given the limited utility, I am going to decline the proposal.  It is an 
interesting idea but I believe it that it would clutter the module, slightly 
drowning-out the ABCs that have more broad and established utility.

One other thought is that the proposed OrderedMapping ABC might not fit well in 
a possible future Python where the behavior Python 3.6 ordered-and-compact 
dicts becomes guaranteed but where we retain the traditional unordered equality 
comparison.

--
resolution:  -> rejected
status: open -> closed

___
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-10 Thread Martin Panter

Martin Panter added the comment:

Julien, to help push these changes forward, I suggest start by rebasing and 
reviewing the conglomerate patch, since it seems that was almost ready.

Reading through the thread, it seems the current status is:

1. _crypt module handled elsewhere by Antoine

2. type, list, and float objects, the resource module, and Python/marshal.c are 
done by Vajrasky, in part of the conglomerate v4 patch. Zach said they look 
good, but wanted a second opinion from someone with good C knowledge. Check if 
Zach’s minor comments for float object and resource module were dealt with.

3. long object and gc module were updated by Vajrasky since last review, so 
probably need to check if there are any outstanding problems with them.

4. _bisect module by Julien via Issue 28754

5. Victor made a change to Python/_warnings.c, but there may be more to do

6. Not yet handled: Objects/exceptions.c, _thread, _bz2, nis modules.

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

___
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-10 Thread Martin Panter

Martin Panter added the comment:

Zach’s comments on float seem to have been addressed 
(https://bugs.python.org/review/20185/diff2/10940:10949/Objects/floatobject.c). 
The comments on the resource module were about return converters: 
. One 
has been addressed.

The other was about the rlimit2py() function, used in two places. One of these 
is resource.prlimit(), which is not converted to Arg Clinic in the patch. If we 
don’t convert it, I agree that leaving rlimit2py() as it is is simplest.

Given that the current prlimit() arg parsing is buggy (Issue 20191), it would 
be good to convert it to Arg Clinic in the process of solving the bug, but that 
could be done as a separate step.

Tangentially, the rlimit2py() function has special HAVE_LONG_LONG handling. 
This is no longer needed in 3.6; see Issue 27961. But again, I think it is 
better to review and commit the existing patch than to keep perfecting it :)

--

___
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-10 Thread Joshua Bronson

Joshua Bronson added the comment:

Sorry to hear but thanks for the consideration. To follow up on your comments:

> nice to see Guido's reasons for giving a -0 on the proposal.

(Guido was giving his -0 on a proposal for collections.abc.Ordered, whereas the 
main proposal here is collections.abc.OrderedMapping, sorry if that was 
confusing.)


> I would add that I haven't see any code in the wild that would benefit from 
> testing isinstance(m, OrderedMapping) and taking some different action 
> depending on the result.

Just to give you another data point, bidict.orderedbidict has been released 
into the wild for a little over 10 months, and people are using it. 
OrderedMapping would give users the following benefits:

>>> noble = orderedbidict([(2, 'helium'), (10, 'neon'), (18, 'argon')])

>>> b = bidict(noble)  # Discards the order.
>>> b  # Calls BidictBase.__repr__.
bidict({10: 'neon', 18: 'argon', 2: 'helium'})

>>> noble  # Also calls BidictBase.__repr__.
orderedbidict([('Cairo', 'Egypt'), ('Lima', 'Peru'), ('Tokyo', 'Japan')])

>>> # i.e. BidictBase.__repr__ interrogates isinstance(self, OrderedMapping)
>>> # to reflect any ordering correctly in the string representation.

>>> # OrderedMapping.__eq__ also checks isinstance(other, OrderedMapping)
>>> # to conditionally turn on order-sensitivity:
>>> noble == collections.OrderedDict(noble.items())
True
>>> noble == collections.OrderedDict(reversed(noble.items()))
False
>>> noble == dict(reversed(noble.items()))  # order-insensitive
True

(collections.OrderedDict and sortedcontainers.SortedDict could reap these same 
benefits from an OrderedMapping class.)


> Grant's sortedcollection is more sequence-like than mapping-like and the 
> bidict has its own interesting properties and neither are substitutable for 
> an OrderedDict.

Hm, I don't quite follow this. OrderedDict, SortedDict, and orderedbidict are 
all OrderedMappings, and should therefore be passable to any function that 
expects an OrderedMapping.

This part I do follow:

> In other words, the only properties these cluster on is the ordered equality 
> feature.  IMO, that particular feature hasn't established itself as being 
> valuable It is an interesting idea but I believe it that it would clutter 
> the module, slightly drowning-out the ABCs that have more broad and 
> established utility.

But based on this rationale, I would have thought Reversible wouldn't have been 
added. It was only after I found https://bugs.python.org/issue25987 the other 
day and saw that Reversible will be in 3.6 that I thought OrderedMapping had a 
case of similar strength, and so it seemed worth taking the time to try to 
contribute it for 3.7.

In any case, thanks again for your consideration, and if you have any further 
thoughts to share, it'd be much appreciated.

--
nosy: +abarnert

___
Python tracker 

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



[issue28934] _mboxMMDF#get_message should delegate to get_bytes

2016-12-10 Thread bpoaugust

bpoaugust added the comment:

On further investigation it sppears that overriding the get_bytes function does 
not help with unmangling >From.
However it would still be worth re-using the code.

--

___
Python tracker 

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



[issue6083] Reference counting bug in PyArg_ParseTuple and PyArg_ParseTupleAndKeywords

2016-12-10 Thread Martin Panter

Changes by Martin Panter :


--
dependencies: +resource.prlimit(int, int, str) crashs

___
Python tracker 

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



[issue20191] resource.prlimit(int, int, str) crashs

2016-12-10 Thread Martin Panter

Martin Panter added the comment:

Revision 4bac47eb444c fixed setrlimit(). Perhaps those changes can just be 
applied again to prlimit().

I’m not an Arg Clinic expert, but isn’t one of its purposes to imitate native 
Python function signatures? Since argument unpacking was dropped from Python 2 
to 3, I doubt Arg Clinic would grow support for this. I think the tuple should 
be unpacked inside the implementation body, just as a native Py 3 function has 
to unpack tuple arguments.

BTW I couldn’t get either Victor’s "\udbff" test case, nor Serhiy’s BadSequence 
test case to crash, but the original MyNum class from Issue 6083 does crash.

--
nosy: +martin.panter
versions: +Python 3.5, Python 3.6, Python 3.7 -Python 3.4

___
Python tracker 

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



[issue20191] resource.prlimit(int, int, str) crashs

2016-12-10 Thread Martin Panter

Changes by Martin Panter :


--
stage:  -> needs patch

___
Python tracker 

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



[issue20191] resource.prlimit(int, int, str) crashs

2016-12-10 Thread Larry Hastings

Larry Hastings added the comment:

Sorry, Argument Clinic doesn't support automatic tuple unpacking for arguments. 
 It was almost never used, I don't think it was ever a good idea, and it would 
have made an already-too-complicated program even more complicated-er.

--

___
Python tracker 

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



[issue28931] urllib ignores FTP 226 response, breaking further FTP requests

2016-12-10 Thread Ivan Pozdeev

Changes by Ivan Pozdeev :


Added file: http://bugs.python.org/file45845/105577.patch

___
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-10 Thread Ivan Pozdeev

Ivan Pozdeev added the comment:

Spawned the `urllib' issue to issue28931.

--

___
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-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 35e66eb101da by Martin Panter in branch '3.5':
Issue #28916: Correct description of %o and %x alternative forms
https://hg.python.org/cpython/rev/35e66eb101da

New changeset bc7fc85beed1 by Martin Panter in branch '3.6':
Issues #28916, #26483: Merge stdtypes.rst from 3.5
https://hg.python.org/cpython/rev/bc7fc85beed1

New changeset b11850871300 by Martin Panter in branch 'default':
Issues #28916, #26483: Merge stdtypes.rst from 3.6
https://hg.python.org/cpython/rev/b11850871300

New changeset 8359ee62dde3 by Martin Panter in branch '2.7':
Issue #28916: No special case for leading zeros with %x alternative form
https://hg.python.org/cpython/rev/8359ee62dde3

--
nosy: +python-dev

___
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-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c15f122617d5 by Martin Panter in branch '3.5':
Issue #26483: Clarify str.isdecimal() and isdigit()
https://hg.python.org/cpython/rev/c15f122617d5

New changeset bc7fc85beed1 by Martin Panter in branch '3.6':
Issues #28916, #26483: Merge stdtypes.rst from 3.5
https://hg.python.org/cpython/rev/bc7fc85beed1

New changeset b11850871300 by Martin Panter in branch 'default':
Issues #28916, #26483: Merge stdtypes.rst from 3.6
https://hg.python.org/cpython/rev/b11850871300

--
nosy: +python-dev

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



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

2016-12-10 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



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

2016-12-10 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Hi,
This patch updates the Show Source link on the left of Docs menu and point it 
to github.
I tested it locally, and works for versions >= 3.5 
Please let me know if you have any feedback about this.
Thanks :)

Not sure if the older docs versions should be updated too? In that case, I'll 
need to prepare different patches for 3.4, 3.3 and 2.7

--
keywords: +patch
Added file: http://bugs.python.org/file45846/issue28929dev.patch

___
Python tracker 

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



[issue28933] AC: Accept None as a Py_ssize_t default value

2016-12-10 Thread Julien Palard

Julien Palard added the comment:

> It looks like you did it with a converter for 28754.  That's okay.  But not 
> in the default implementation.

It's not by default, we have to declare "… = None" in the AC declaration, which 
was an error before my patch (incompatible types…).

Before:

something: Py_ssize_t(c_default="-1") = None

> Py_ssize_t_converter: default value None for field something is not of 
type int

After:

something: Py_ssize_t(c_default="-1") = None

> If the None (default) value is provided, the c_default is untouched.

--

___
Python tracker 

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



[issue28933] AC: Accept None as a Py_ssize_t default value

2016-12-10 Thread Julien Palard

Julien Palard added the comment:

> You propose an automatic conversion of "None" into "-1"?  That's awful.  
> Please don't commit that patch to CPython.

Not really, I propose a way to do it with AC when needed. And the AC semantics 
introduced are not "Automatic conversion of None into -1" but "automatic "don't 
touch the C default" when the python default is given", so it's reusable for 
other values:

something: Py_ssize_t(c_default="-1") = None
something: Py_ssize_t(c_default="0") = None
something: Py_ssize_t(c_default="42") = None
…

And this semantic can be extended to other types too if needed:

something: a_type(c_default="a_c_side_default_value") = None

To get "a_c_side_default_value" when None is given.

I however did not introduced a way to keep the C default value by using 
something else than None in the Python side:

 - I'm not sure this is usefull to allow it but it can still be implemented if 
needed
 - Limiting to None permits to keep a type check so ``something: 
Py_ssize_t(c_default="-1") = "bar"`` will still fail at clinic.py runtime.

--

___
Python tracker 

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



[issue25677] Syntax error caret confused by indentation

2016-12-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--
assignee: serhiy.storchaka -> martin.panter

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

Serhiy Storchaka added the comment:

Victor, you perhaps could just use NULL as default:

+source: object = NULL

--

___
Python tracker 

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



[issue28783] Embedded/nuget packages incorrectly reference bdist_wininst

2016-12-10 Thread Steve Dower

Steve Dower added the comment:

I have a better fix for this issue in the attached patch. It doesn't require 
any change to setuptools in order to avoid crashing when installing from sdist 
(e.g. Cython).

As before, this only involves changing the nuget package and its build scripts, 
so there is zero risk to the main installer. It's even simpler than before too, 
because I can reuse the infrastructure that was added. (That said, I haven't 
tested this patch with a real build on the real build machine yet - I will do 
so before committing.)

Ned - can I get this in for 3.6.0? If not, I'll patch the file by hand before 
publishing the nuget packages.

--
nosy: +larry
priority: normal -> release blocker
resolution: fixed -> 
stage: resolved -> patch review
status: closed -> open
Added file: http://bugs.python.org/file45847/28783_1.patch

___
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-10 Thread STINNER Victor

STINNER Victor added the comment:

LGTM, you can push it to 3.6 and default.

--

___
Python tracker 

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



[issue20191] resource.prlimit(int, int, str) crashs

2016-12-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Following patch applies to resource.prlimit() the same solution as to 
resource.setrlimit().

--
components: +Extension Modules
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file45848/prlimit_refcount.patch

___
Python tracker 

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



[issue21134] Segfault when stringifying UnicodeEncodeError (or UnicodeDecodeError) created with __new__()

2016-12-10 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
status: pending -> closed

___
Python tracker 

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



[issue28739] PEP 498: docstrings as f-strings

2016-12-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Eric, could you please make a review of the patch?

--
stage:  -> patch review
type:  -> behavior
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



[issue28826] Programming with Python 3.6

2016-12-10 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

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