[issue28449] tarfile.open(mode = 'r:*', ignore_zeros = True) has 50% chance failed to open compressed tars?

2016-10-16 Thread Roland Bogosi

Roland Bogosi added the comment:

For anyone finding this bug through Google before it is fixed, a workaround 
could be to monkeypatch the OPEN_METH dict with an OrderedDict:

tarfile.TarFile.OPEN_METH = OrderedDict()
tarfile.TarFile.OPEN_METH['gz']  = 'gzopen'
tarfile.TarFile.OPEN_METH['bz2'] = 'bz2open'
tarfile.TarFile.OPEN_METH['xz']  = 'xzopen'
tarfile.TarFile.OPEN_METH['tar'] = 'taropen'

--
nosy: +RoliSoft

___
Python tracker 

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



[issue28451] pydoc.safeimport() raises ErrorDuringImport() if __builtin__.__import__ is monkey patched

2016-10-16 Thread R. David Murray

R. David Murray added the comment:

Can you provide a test case that shows when this condition might occur?  We'd 
want a test in any case if we accept the patch.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue27659] Check for the existence of crypt()

2016-10-16 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Android does not have crypt, but the crypt module is cross-built nevertheless 
after this warning has been issued:
warning: implicit declaration of function 'crypt' is invalid in C99 
[-Wimplicit-function-declaration]
And at runtime, importing the crypt module fails with:
ImportError: dlopen failed: cannot locate symbol "crypt" referenced by 
"_crypt.cpython-37m-i686-linux-android.so"

gcc and clang do not enforce the C99 rules and emit just a warning for implicit 
function declarations instead of the error that would be conforming to C99. 
This can be changed with the flag '-Werror=implicit-function-declaration' and 
the compilation of the crypt extension module rightly fails in that case.

I think this issue should be fixed by adding this flag to the Makefile.
Maybe in another issue.

--
nosy: +benjamin.peterson, haypo, martin.panter

___
Python tracker 

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



[issue22949] fnmatch.translate doesn't add ^ at the beginning

2016-10-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
keywords: +patch
Added file: http://bugs.python.org/file45116/doc_fnmatch_translate.patch

___
Python tracker 

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



[issue28455] argparse: convert_arg_line_to_args does not actually expect self argument

2016-10-16 Thread siccegge

New submission from siccegge:

Hi!

Both the 3.4 version and the current version of python documentation wrt the 
argparse module imply convert_arg_line_to_args replacements needs to accept two 
arguments while it acutally only works with one. (Not completely sure about 
details but documentation really could be clearer!)

https://docs.python.org/3.4/library/argparse.html#argparse.ArgumentParser.convert_arg_line_to_args

Example from documentation

def convert_arg_line_to_args(self, arg_line):
return arg_line.split()

If codeparser = argparse.ArgumentParser actually does

def convert_arg_line_to_args(self, arg_line):
return arg_line.split()
parser = argparse.ArgumentParser()
parser.convert_arg_line_to_args = convert_arg_line_to_args

The code fails

  File "/usr/lib/python3.5/argparse.py", line 1735, in parse_args
args, argv = self.parse_known_args(args, namespace)
  File "/usr/lib/python3.5/argparse.py", line 1767, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)
  File "/usr/lib/python3.5/argparse.py", line 1779, in _parse_known_args
arg_strings = self._read_args_from_files(arg_strings)
  File "/usr/lib/python3.5/argparse.py", line 2037, in _read_args_from_files
for arg in self.convert_arg_line_to_args(arg_line):
  TypeError: convert_arg_line_to_args() missing 1 required positional argument: 
'arg_line'

--
assignee: docs@python
components: Documentation
messages: 278771
nosy: docs@python, siccegge
priority: normal
severity: normal
status: open
title: argparse: convert_arg_line_to_args does not actually expect self argument
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue28115] Use argparse for the zipfile module

2016-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch makes zipfile using argparse and adds tests for zipfile CLI. 
Originally it is based on tarfile code and tests (but reworked, especially 
tests). Basically the interface is not changed, but added support of long 
options, and exit code in case of calling without options is changed from 1 to 
2 (the same as wrong option is specified). The format of help and usage info is 
changed of course.

Tests are passed with old releases of Python (except supporting long options). 
They will be backported.

--
Added file: http://bugs.python.org/file45117/zipfile_argparse.patch

___
Python tracker 

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



[issue28437] Documentation for handling of non-type metaclass hints is unclear

2016-10-16 Thread Neil Girdhar

Neil Girdhar added the comment:

Okay, I understand what you're saying, but I it says in the documentation that 
"if an explicit metaclass is given and it is not an instance of type(), then it 
is used directly as the metaclass".  My recent updated "metaclass_callable" is 
not an instance of type.  Why should it raise an exception?

--

___
Python tracker 

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



[issue26942] android: test_ctypes crashes on armv7 and aarch64

2016-10-16 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Thanks Chi Hsuan Yen for your contributions with this issue.

--

___
Python tracker 

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



[issue28437] Documentation for handling of non-type metaclass hints is unclear

2016-10-16 Thread Neil Girdhar

Neil Girdhar added the comment:

Thanks for taking the time to explain, but it's still not working for me:

from types import new_class


class MyMetaclass(type):
pass

class OtherMetaclass(type):
pass

def metaclass_callable(name, bases, namespace):
return new_class(name, bases, dict(metaclass=OtherMetaclass))

class MyClass(metaclass=MyMetaclass):
pass

try:
class MyDerived(MyClass, metaclass=metaclass_callable):
pass
except:
print("Gotcha!")


try:
MyDerived = new_class("MyDerived", (MyClass,), 
dict(metaclass=metaclass_callable))
except:
print("Gotcha again!")

So my questions are:

1. Why shouldn't Lib/types:new_class behave in exactly the same way as 
declaring a class using "class…" notation?

2. What's the point of checking if the metaclass is an instance of type?  It 
seems to me that in Python 2, non-type metaclasses did not have to be the "most 
derived class" (that's what the documentation seems to suggest with the second 
rule).  However, we no longer accept that in CPython 3 — neither in the 
Lib/types, nor in a regular declaration.  In fact, the exception is:

"metaclass conflict: "
"the metaclass of a derived class "
"must be a (non-strict) subclass "
"of the metaclasses of all its bases");

So why not just check that unconditionally in Lib/types.py?

--

___
Python tracker 

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



[issue28437] Documentation for handling of non-type metaclass hints is unclear

2016-10-16 Thread Nick Coghlan

Nick Coghlan added the comment:

Because they're checking for different things:

- types.prepare_class is only checking "How do I call __prepare__?". It only 
triggers type resolution at that point if the metaclass hint is an instance of 
type, otherwise it skips that process entirely and queries the metaclass hint 
directly.

- type.__new__ is checking "Can I actually create a new instance of this 
metaclass with these bases?". It can only do that if either the metaclass being 
instantiated is a subclass of all the bases of the type being defined, or else 
such a metaclass exists amongst the bases.

To be clear, your example isn't failing due to the way MyDerived is defined - 
it's failing because OtherMetaclass is itself an instance of type, and you're 
declaring it (directly or indirectly) as the metaclass of MyDerived, while 
inheriting from MyClass, which is an instance of MyMetaclass.

--

___
Python tracker 

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



[issue28450] Misleading/inaccurate documentation about unknown escape sequences in regular expressions

2016-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your report Lele. Agreed, the documentation looks misleading.

Do you want to provide more clear wording?

--
nosy: +Rosuav, mrabarnett, nedbat, serhiy.storchaka
stage:  -> needs patch
title: Misleading/inaccurate documentation about unknown escape sequences -> 
Misleading/inaccurate documentation about unknown escape sequences in regular 
expressions
type:  -> enhancement
versions: +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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-16 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Thanks for the reports. The next step is having the patch reviewed by one of 
the Python build machinery experts.
Nosying Martin, Zachary and Matthias.

--
nosy: +doko, martin.panter, zach.ware

___
Python tracker 

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



[issue22949] fnmatch.translate doesn't add ^ at the beginning

2016-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Since issue22493 fnmatch.translate() uses scoped modifiers: r'(?s:%s)\Z' % res.

Here is a patch that updates the documentation for fnmatch.translate().

--
stage: needs patch -> patch review
versions: +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



[issue23692] Undocumented feature prevents re module from finding certain matches

2016-10-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
stage:  -> needs patch
versions: +Python 2.7, 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



[issue28454] Spurious arguments to PyErr_Format in unicodeobject.c

2016-10-16 Thread Xiang Zhang

New submission from Xiang Zhang:

In unicodeobject.c, there are some spurious arguments to PyErr_Format as the 
patch shows.

--
components: Interpreter Core
files: spurious_argument.patch
keywords: patch
messages: 278757
nosy: ncoghlan, xiang.zhang
priority: normal
severity: normal
stage: patch review
status: open
title: Spurious arguments to PyErr_Format in unicodeobject.c
type: enhancement
versions: Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45114/spurious_argument.patch

___
Python tracker 

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



[issue28454] Spurious arguments to PyErr_Format in unicodeobject.c

2016-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

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



[issue28437] Documentation for handling of non-type metaclass hints is unclear

2016-10-16 Thread Nick Coghlan

Nick Coghlan added the comment:

Why should it trip the PEP 3115 namespace preparation exception? We only check 
for __prepare__ (and hence need to do an early most-derived metaclass 
resolution) on instances of "type", not on arbitrary callables used as a 
metaclass hint

The checks are different in the two places because the rules are different in 
the two places. (One case that *can* be made is that we should be throwing 
different exceptions or chaining them to show which metaclass resolution 
failed, rather than re-using the same message in both places).

This means that when you define a non-type metaclass hint, you're bypassing 
*all* of the PEP 3115 machinery, including the early metaclass resolution.

However, if your metaclass hint still creates a type instance, you're not 
bypassing tp_new.

If you're asking "Where is the bug in the presented example code?", it's here, 
in the definition of your metaclass hint:

def metaclass_callable(name, bases, namespace):
return OtherMetaclass(name, bases, namespace)

Instantiating instances of "type" directly in Python 3 bypasses the PEP 3115 
machinery - that's the entire reason that types.new_class was added. So if you 
want that metaclass hint to be PEP 3115 compliant, you need to explicitly write 
it that way:

def metaclass_callable(name, bases, namespace):
return types.new_class(name, bases, dict(metaclass=OtherMetaclass)

--
resolution: not a bug -> 
stage: resolved -> 
status: closed -> open
title: Class definition is not consistent with types.new_class -> Documentation 
for handling of non-type metaclass hints is unclear

___
Python tracker 

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



[issue28437] Documentation for handling of non-type metaclass hints is unclear

2016-10-16 Thread Nick Coghlan

Nick Coghlan added the comment:

The "used directly as the metaclass" is a reference to 
https://docs.python.org/3/reference/datamodel.html#creating-the-class-object 
further down, and specifically the "metaclass(name, bases, namespace, **kwds)" 
call. It's not saying Python has a way to bypass that instantiation process.

As a result, your code is consistently getting to that step just fine, but 
*that call* is throwing an exception.

Hence my comment earlier that there's a case to be made that we should be 
better indicating where we were in the type creation process when the metaclass 
resolution failed.

--

___
Python tracker 

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



[issue27471] sre_constants.error: bad escape \d

2016-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

All behaves as purposed. But the documentation is not accurate, and even 
misleading. It should be enhanced (issue28450).

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

___
Python tracker 

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



[issue25550] RecursionError in re with '(' * 500

2016-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Closed as not a bug. Unlike to issue401612 this is not an infinite recursion. 
Raising RecursionError depends on the context (it is more likely in deeply 
nested call) and there is a common workaround -- just increase maximum 
recursion depth using sys.setrecursionlimit(). There is nothing specific to 
regular expressions.

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

___
Python tracker 

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



[issue26942] android: test_ctypes crashes on armv7 and aarch64

2016-10-16 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
status: open -> closed

___
Python tracker 

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



[issue26072] pdb fails to access variables closed over

2016-10-16 Thread Chun-Yu Tseng

Chun-Yu Tseng added the comment:

Surrender.

After digging into the implementation of how CPython handles closures, I am 
sure that it is impossible to solve this problem now correctly. What I can do 
is create a patch to let Pdb print enough information when the problem occurs. 
It would look like:

(Pdb) ll
  3  def f():
  4  x = 1
  5  ->import pdb; pdb.set_trace()
(Pdb) (lambda: x)()

Pdb can not use the local variable 'x' to create a closure in
your evaluation. Instead, it tries to use 'x' in globals().
This behavior is due to the limitation of dynamic
interpretation within a debugger session.

Hint: type 'help interact' to check 'interact' command.

*** NameError: name 'x' is not defined

I believe it would be helpful and less annoyed for those who encounters this 
problem. Call for maintainers review, please.


PS.
1. Ruby does not have this problem. Whether it exists depends on how a 
programming language to implement closures. However, I think that what CPython 
do (by `PyCellObject`) is smart and efficient.

2. I tried to solve the problem by copying local variables to globals() (just 
like what `interact` command do), but it results in **more** problems. The most 
typical one is that if I eval `globals()` in such an affected environment, I 
will always get the wrong result.

3. I also tried to patch and evaluate again what user inputs when catching a 
closure-related `NameError`. Obviously, it is not a good idea due to side 
effects of evaluation.

4. The last possible solution I think of is import `ast` and do some hacking 
... it's overkill, and it also brings up other side effects.

--
keywords: +patch
Added file: http://bugs.python.org/file45115/default.patch

___
Python tracker 

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



[issue15988] Inconsistency in overflow error messages of integer argument

2016-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Oren. I'll make a detailed review in next few days.

--
stage: needs patch -> 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



[issue28437] Documentation for handling of non-type metaclass hints is unclear

2016-10-16 Thread Nick Coghlan

Nick Coghlan added the comment:

Oops, couple of typos:

"... only triggers metaclass resolution at that point ..."

"... if either the metaclass being instantiated is a subclass of all the 
metaclasses of all of the bases ..."

But the only way to bypass the "most derived metaclass" rule is for the the 
metaclass hint to be a callable that creates something that *isn't* a subclass 
of type. If you look at the tracebacks you're getting, you should see that the 
failure *isn't* in the class statement or the outer dynamic type, it's in 
"metaclass_callable", where the *inner* dynamic type creation is failing.

--

___
Python tracker 

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



[issue24896] It is undocumented that re.UNICODE affects re.IGNORECASE

2016-10-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue28450] Misleading/inaccurate documentation about unknown escape sequences in regular expressions

2016-10-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Regular Expressions
nosy: +ezio.melotti

___
Python tracker 

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



[issue16007] Improved Error message for failing re expressions

2016-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Since 3.5 (issue22578) the re.error exception has attributes that contain a 
pattern and the position of the error. Error message contains the position of 
the error. A pattern is not included in the error message for purpose: it can 
be too long. Usually the pattern is clear from the context, and you always can 
check the pattern attribute.

--
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Add additional attributes to re.error

___
Python tracker 

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



[issue25953] re fails to identify invalid numeric group references in replacement strings

2016-10-16 Thread SilentGhost

SilentGhost added the comment:

Here is the updated patch with fixes to the test suite.

--
versions: +Python 3.7
Added file: http://bugs.python.org/file45113/25953_2.diff

___
Python tracker 

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



[issue14991] Option for regex groupdict() to show only matching names

2016-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Maybe start emitting FutureWarning when groupdict() is called without an 
argument? groupdict(None) returns the same result but without a warning. After 
1 or 2 releases the behavior can be changed: groupdict() will return only 
matched groups.

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



[issue26942] android: test_ctypes crashes on armv7 and aarch64

2016-10-16 Thread Xavier de Gaye

Xavier de Gaye added the comment:

At least for non-Darwin POSIX builds:
* Building _ctypes with the bundled copy of libffi is deprecated in 3.6 and the 
default is to use a system copy of libffi, issue 27976.
* The bundled libffi is removed in 3.7, issue 27979.

As this crash happens with the bundled libffi, closing this issue as won't fix.

--
resolution:  -> wont fix
stage: patch review -> resolved

___
Python tracker 

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



[issue28453] SSLObject.selected_alpn_protocol() not documented

2016-10-16 Thread Christian Heimes

Christian Heimes added the comment:

Cory, does it make sense to document some examples?

--
assignee: christian.heimes -> 
components: +Documentation
nosy: +Lukasa
type:  -> enhancement

___
Python tracker 

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



[issue28453] SSLObject.selected_alpn_protocol() not documented

2016-10-16 Thread Cory Benfield

Cory Benfield added the comment:

Yeah, probably! There aren't many protocols with defined ALPN identifiers, but 
we should still probably explain how this works. Do you want me to write them?

--

___
Python tracker 

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



[issue25953] re fails to identify invalid numeric group references in replacement strings

2016-10-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue27627] clang fails to build ctypes on Android armv7

2016-10-16 Thread Xavier de Gaye

Xavier de Gaye added the comment:

As this problem occurs with the bundled libffi, closing this issue as won't fix 
for the same reasons as those listed in msg278759.

--
resolution:  -> wont fix
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue28290] BETA report: Python-3.6 build messages to stderr: AIX and "not GCC"

2016-10-16 Thread Christian Heimes

Christian Heimes added the comment:

I'm cautious about messing with crypto code. The problem should be fixed 
upstream. Please talk the blake2 issue to https://github.com/BLAKE2/BLAKE2.

--

___
Python tracker 

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



[issue28453] SSLObject.selected_alpn_protocol() not documented

2016-10-16 Thread Alex Grönholm

Alex Grönholm added the comment:

HTTP/2 (h2) is kind of a biggie :)

--

___
Python tracker 

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



[issue28439] Remove redundant checks in PyUnicode_EncodeLocale and PyUnicode_DecodeLocaleAndSize

2016-10-16 Thread Xiang Zhang

Changes by Xiang Zhang :


--
title: Remove redundant checks in PyUnicode_EncodeLocale -> Remove redundant 
checks in PyUnicode_EncodeLocale and PyUnicode_DecodeLocaleAndSize
Added file: http://bugs.python.org/file45118/issue28349.patch

___
Python tracker 

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



[issue25953] re fails to identify invalid numeric group references in replacement strings

2016-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Needed new tests for changed behavior. Test re.sub() with incorrect groups and 
the string that doesn't match the pattern (e.g. empty string).

Added other comments on Rietveld.

--

___
Python tracker 

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



[issue28455] argparse: convert_arg_line_to_args does not actually expect self argument

2016-10-16 Thread R. David Murray

R. David Murray added the comment:

The documentation assumes you know how python class methods work, but I agree 
that the wording is not entirely obvious even then and could be improved.  In 
particular it should make clear that the example shows how to define the 
function for subclassing or assignment to the class object.  If you assign it 
to the instance, as in your example, then indeed self does not get passed and 
you want a true single argument function.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue28439] Remove redundant checks in PyUnicode_EncodeLocale

2016-10-16 Thread Xiang Zhang

Changes by Xiang Zhang :


Removed file: http://bugs.python.org/file45089/PyUnicode_EncodeLocale.patch

___
Python tracker 

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



[issue27896] Allow passing sphinx options to Doc/Makefile

2016-10-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3884a7e3df1c by Victor Stinner in branch 'default':
Issue #27896: Allow passing sphinx options to Doc/Makefile
https://hg.python.org/cpython/rev/3884a7e3df1c

--
nosy: +python-dev

___
Python tracker 

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



[issue28449] tarfile.open(mode = 'r:*', ignore_zeros = True) has 50% chance failed to open compressed tars?

2016-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch fixes the issue.

Existing test was passed by accident -- compressed tarfiles were too short for 
false detecting.

--
keywords: +patch
nosy: +serhiy.storchaka
stage:  -> patch review
Added file: http://bugs.python.org/file45119/tarfile_ignore_zeros_auto.patch

___
Python tracker 

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



[issue27896] Allow passing sphinx options to Doc/Makefile

2016-10-16 Thread STINNER Victor

STINNER Victor added the comment:

I pushed your patch to the default branch (Python 3.7). Thanks Julien.

--
nosy: +haypo
resolution:  -> fixed
status: open -> closed
type:  -> enhancement
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



[issue28432] Fix doc of PyUnicode_EncodeLocale

2016-10-16 Thread Berker Peksag

Berker Peksag added the comment:

Thanks.

--
nosy: +berker.peksag
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue23532] add example of 'first match wins' to regex "|" documentation?

2016-10-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Regular Expressions
type: behavior -> enhancement
versions: +Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue14991] Option for regex groupdict() to show only matching names

2016-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch makes groupdict() without argument emitting FutureWarning if the 
result includes unmatched groups. Maybe warning message and the documentation 
could be better.

Ned, I ask your permission for including this change in 3.6. Yes, it can break 
third-party code that ran with -Werror, but I think groupdict() is rarely used 
in comparison of other match object API. The workaround is simple -- just use 
groupdict(None). The earlier we add a warning, the earlier we can change the 
behavior of groupdict(). If we did it in 3.4 (the time Raymond opened this 
issue), we could get new behavior in 3.7.

--
keywords: +patch
nosy: +ned.deily
stage: needs patch -> patch review
Added file: 
http://bugs.python.org/file45120/re_groupdict_no_default_future_warning.patch

___
Python tracker 

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



[issue28456] Test failures under macOS 10.12 Sierra

2016-10-16 Thread Raymond Hettinger

New submission from Raymond Hettinger:

On a fresh checkout, I'm getting two test failures:

$ ./configure && make
$ ./python.exe -m test.regrtest -v test_asyncore
 [snip]
==
FAIL: test_handle_expt (test.test_asyncore.TestAPI_UseIPv4Poll)
--
Traceback (most recent call last):
  File "/Users/raymond/cleancpython/Lib/test/test_asyncore.py", line 674, in 
test_handle_expt
self.loop_waiting_for_flag(client)
  File "/Users/raymond/cleancpython/Lib/test/test_asyncore.py", line 514, in 
loop_waiting_for_flag
self.fail("flag not set")
AssertionError: flag not set

==
FAIL: test_handle_expt (test.test_asyncore.TestAPI_UseIPv6Poll)
--
Traceback (most recent call last):
  File "/Users/raymond/cleancpython/Lib/test/test_asyncore.py", line 674, in 
test_handle_expt
self.loop_waiting_for_flag(client)
  File "/Users/raymond/cleancpython/Lib/test/test_asyncore.py", line 514, in 
loop_waiting_for_flag
self.fail("flag not set")
AssertionError: flag not set

--
Ran 101 tests in 20.506s

FAILED (failures=2, skipped=6)
test test_asyncore failed
test_asyncore failed

1 test failed:
test_asyncore


$ ./python.exe -m test.regrtest -v test_eintr
  [snip]

==
FAIL: test_poll (__main__.SelectEINTRTest)
--
Traceback (most recent call last):
  File "/Users/raymond/cleancpython/Lib/test/eintrdata/eintr_tester.py", line 
446, in test_poll
self.assertGreaterEqual(dt, self.sleep_time)
AssertionError: 9.176997991744429e-06 not greater than or equal to 0.2

--
Ran 22 tests in 5.288s

FAILED (failures=1, skipped=5)
---

stderr:
---
Traceback (most recent call last):
  File "/Users/raymond/cleancpython/Lib/test/eintrdata/eintr_tester.py", line 
492, in 
test_main()
  File "/Users/raymond/cleancpython/Lib/test/eintrdata/eintr_tester.py", line 
488, in test_main
SelectEINTRTest)
  File "/Users/raymond/cleancpython/Lib/test/support/__init__.py", line 1849, 
in run_unittest
_run_suite(suite)
  File "/Users/raymond/cleancpython/Lib/test/support/__init__.py", line 1824, 
in _run_suite
raise TestFailed(err)
test.support.TestFailed: Traceback (most recent call last):
  File "/Users/raymond/cleancpython/Lib/test/eintrdata/eintr_tester.py", line 
446, in test_poll
self.assertGreaterEqual(dt, self.sleep_time)
AssertionError: 9.176997991744429e-06 not greater than or equal to 0.2
---

--
Ran 1 test in 5.424s

FAILED (failures=1)
test test_eintr failed
test_eintr failed

1 test failed:
test_eintr

Total duration: 5 sec
Tests result: FAILURE

--
components: Interpreter Core
messages: 278780
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Test failures under macOS 10.12 Sierra
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



[issue21720] "TypeError: Item in ``from list'' not a string" message

2016-10-16 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the reviews! I pushed the patch for 2.7.

Nick, what do you think about the case Serhiy mentioned in msg278515? Should we 
fix it or is issue21720_python3.diff good to go?

--

___
Python tracker 

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



[issue28456] Test failures under macOS 10.12 Sierra

2016-10-16 Thread STINNER Victor

STINNER Victor added the comment:

See https://daniel.haxx.se/blog/2016/10/11/poll-on-mac-10-12-is-broken/

C function poll() seems to be broken on Sierra.

--
nosy: +haypo, lukasz.langa, ned.deily, ronaldoussoren

___
Python tracker 

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



[issue26436] Add the regex-dna benchmark

2016-10-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Regular Expressions
nosy: +ezio.melotti, mrabarnett

___
Python tracker 

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



[issue28293] Don't completely dump the regex cache when full

2016-10-16 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: rhettinger -> serhiy.storchaka

___
Python tracker 

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



[issue21720] "TypeError: Item in ``from list'' not a string" message

2016-10-16 Thread Ben Finney

Ben Finney added the comment:

On 16-Oct-2016, Roundup Robot wrote:

> New changeset 7dd0910e8fbf by Berker Peksag in branch '2.7':
> Issue #21720: Improve exception message when the type of fromlist is unicode
> https://hg.python.org/cpython/rev/7dd0910e8fbf

This is an improvement, but it still should IMO show *which* item
caused the error.

Can it state “Item in from list must be str, not {type}: {item!r}”?
That would show the exact item so the reader has a better chance at
finding where it came from.

--

___
Python tracker 

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



[issue28432] Fix doc of PyUnicode_EncodeLocale

2016-10-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a4889719e3c2 by Berker Peksag in branch '3.5':
Issue #28432: Fix first parameter name in PyUnicode_EncodeLocale documentation
https://hg.python.org/cpython/rev/a4889719e3c2

New changeset 1fc08c283f8f by Berker Peksag in branch '3.6':
Issue #28432: Merge from 3.5
https://hg.python.org/cpython/rev/1fc08c283f8f

New changeset 767a78aacd29 by Berker Peksag in branch 'default':
Issue #28432: Merge from 3.6
https://hg.python.org/cpython/rev/767a78aacd29

--
nosy: +python-dev

___
Python tracker 

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



[issue21720] "TypeError: Item in ``from list'' not a string" message

2016-10-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7dd0910e8fbf by Berker Peksag in branch '2.7':
Issue #21720: Improve exception message when the type of fromlist is unicode
https://hg.python.org/cpython/rev/7dd0910e8fbf

--
nosy: +python-dev

___
Python tracker 

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



[issue28456] Test failures under macOS 10.12 Sierra

2016-10-16 Thread STINNER Victor

STINNER Victor added the comment:

Try to modify pyconfig.h to define HAVE_BROKEN_POLL. It should work around the 
bug.

configure.ac contains a test for HAVE_BROKEN_POLL. We need another test for 
poll() being broken differently.

Note: asyncio doesn't seem to be affect because it probably uses the more 
efficient kqueue by default on OS X.

--

___
Python tracker 

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



[issue28293] Don't completely dump the regex cache when full

2016-10-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Regular Expressions
nosy: +ezio.melotti, mrabarnett

___
Python tracker 

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



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

2016-10-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Regular Expressions
nosy: +ezio.melotti, mrabarnett
type: behavior -> enhancement
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



[issue28454] Spurious arguments to PyErr_Format in unicodeobject.c

2016-10-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cbe313cd1b55 by Benjamin Peterson in branch '3.5':
remove extra PyErr_Format arguments (closes #28454)
https://hg.python.org/cpython/rev/cbe313cd1b55

New changeset 738579b25d02 by Benjamin Peterson in branch '3.6':
merge 3.5 (#28454)
https://hg.python.org/cpython/rev/738579b25d02

New changeset b37db216c8e0 by Benjamin Peterson in branch 'default':
merge 3.6 (#28454)
https://hg.python.org/cpython/rev/b37db216c8e0

--
nosy: +python-dev
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



[issue28456] Test failures under macOS 10.12 Sierra

2016-10-16 Thread Ned Deily

Ned Deily added the comment:

This is a duplicate of Issue28087.

--

___
Python tracker 

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



[issue28456] Test failures under macOS 10.12 Sierra

2016-10-16 Thread Ned Deily

Changes by Ned Deily :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> macOS 12 poll syscall returns prematurely

___
Python tracker 

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



[issue14991] Option for regex groupdict() to show only matching names

2016-10-16 Thread Ned Deily

Ned Deily added the comment:

How do others feel about Serhiy's proposal for eventually changing the 
semantics of groupdict() to mean only return matched groups?  If that seems 
reasonable, then there is the separate question of how to make the transition.  
Adding a somewhat unpredictable FutureWarning, i.e. one that depends on the 
input, seems somewhat risky and user-unfriendly at this late stage of the 
release cycle.  But I'm open to persuasion.

--

___
Python tracker 

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



[issue28455] argparse: convert_arg_line_to_args does not actually expect self argument

2016-10-16 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Hello,

I updated the documentation with an example of how to override ArgumentParser 
class. Hope this is a clearer than before.

Please review.

Thanks :)

--
keywords: +patch
nosy: +Mariatta
Added file: http://bugs.python.org/file45121/issue28455.patch

___
Python tracker 

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



[issue28455] argparse: convert_arg_line_to_args does not actually expect self argument

2016-10-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4f8f7403881f by Berker Peksag in branch '3.5':
Issue #28455: Clarify example of overriding the convert_arg_line_to_args method
https://hg.python.org/cpython/rev/4f8f7403881f

New changeset 0b29adb5c804 by Berker Peksag in branch '3.6':
Issue #28455: Merge from 3.5
https://hg.python.org/cpython/rev/0b29adb5c804

New changeset a293e5db9083 by Berker Peksag in branch 'default':
Issue #28455: Merge from 3.6
https://hg.python.org/cpython/rev/a293e5db9083

--
nosy: +python-dev

___
Python tracker 

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



[issue28457] Make public the current private known hash functions in the C-API

2016-10-16 Thread Raymond Hettinger

New submission from Raymond Hettinger:

The known-hash variants for dict getitem/setitem/delitem have proven useful to 
us for writing fast C code.  They may be useful to others as well.  There does 
not seem to be any other way of getting to this functionality.

--
components: Interpreter Core
messages: 278788
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Make public the current private known hash functions in the C-API
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



[issue14991] Option for regex groupdict() to show only matching names

2016-10-16 Thread Matthew Barnett

Matthew Barnett added the comment:

I'd prefer an explicit suppression to changing a long-standing behaviour.

--

___
Python tracker 

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



[issue21720] "TypeError: Item in ``from list'' not a string" message

2016-10-16 Thread Nick Coghlan

Nick Coghlan added the comment:

@Berker: the warning under "-bb" is a separate issue related to the handling of 
wildcard imports (_handle_fromlist searches for '*' and then pops it from a 
copy of the input list, replacing it with __all__ if that's defined)

@Ben: As a general principle, we don't give value information in type errors, 
since the error is structural rather than value based. The closest equivalent 
to us doing that that I'm aware of is the sequence index being given in 
str.join's TypeError:

>>> "".join(["a", "b", b"c"])
Traceback (most recent call last):
  File "", line 1, in 
TypeError: sequence item 2: expected str instance, bytes found

By contrast, when sorting, we don't give *any* indication as to where in the 
sequence the problem was found or the specific values involved:

>>> sorted(["a", "b", b"c"])
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unorderable types: bytes() < str()

That doesn't make it a bad idea (as I think you're right that it would often 
make debugging easier), I'd just prefer to consider that as a separate question 
rather than introducing a one-off inconsistency with the general policy here 
(in particular, encountering TypeError is far more likely with str.join and 
sorted than it is with __import__, so it would be genuinely weird for the 
latter to have the most helpful error message).

--

___
Python tracker 

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



[issue28452] Remove _asyncio._init_module function

2016-10-16 Thread INADA Naoki

Changes by INADA Naoki :


Added file: http://bugs.python.org/file45122/asyncio-speedup-refactoring2.patch

___
Python tracker 

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



[issue28455] argparse: convert_arg_line_to_args does not actually expect self argument

2016-10-16 Thread Berker Peksag

Berker Peksag added the comment:

Thanks! I removed the import statement and simplified the last sentence a bit.

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
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



[issue28447] socket.getpeername() failure on broken TCP/IP connection

2016-10-16 Thread Georgey

Georgey added the comment:

Yes that is definitely a closed socket. But it is strange that in a single 
thread server without select module, the socket is never closed until I 
explicitly use close() method. 


except:
  print(sock)  #<- here it looks normal
  time.sleep(3)
  print(sock)  #<- here it still looks normal 
  sock.close()
  print(sock)  #<- finally the [closed] tag appears and all the details lost


So I guess the "Socket Automatically Closing" effect associate with "select" 
module? For when I run the single-thread server in the IDLE and called 
time.sleep(), it has been already treated as multi-thread.

--

___
Python tracker 

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



[issue28447] socket.getpeername() failure on broken TCP/IP connection

2016-10-16 Thread Martin Panter

Martin Panter added the comment:

So is your “automatic closing” due to your program, or a bug in Python? You 
will have to give more information if you want anyone else to look at this. 
When I run the code you posted (with various modules imported) all I get is

NameError: name 'yellow_page' is not defined

--

___
Python tracker 

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



[issue13322] buffered read() and write() does not raise BlockingIOError

2016-10-16 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy:  -petri.lehtinen

___
Python tracker 

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