[issue28512] PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject() always set the offset attribute to None

2016-12-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +martin.panter

___
Python tracker 

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



[issue28818] simplify lookdict functions

2016-12-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your work Inada.

--

___
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-11 Thread Xavier de Gaye

Xavier de Gaye added the comment:

> Now users have to specify the path manually even for native builds.

This does not make sense, the patch does not change anything for the native 
builds.

--

___
Python tracker 

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



[issue28512] PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject() always set the offset attribute to None

2016-12-11 Thread Martin Panter

Martin Panter added the comment:

Looks good apart from one quirky test case, see Reitveld

--

___
Python tracker 

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



[issue28711] IDLE doesn't open

2016-12-11 Thread Oliver Schode

Oliver Schode added the comment:

This is a bug you'll run into whenever you set a key binding that is somehow 
ambiguous to IDLE and for some other reason than being already assigned (for in 
that case, IDLE will warn, but only then). Like when you set a binding, that 
would normally be interpreted by the editor for some input modification or so. 
I think this should be handled more gracefully or at least fail in a more 
informative way, esp. since beginners on Windows may not be that comfortable on 
the command line.

A "hard" workaround for the time being is to simply remove your config-keys.cfg 
file, thus resetting all bindings to their default. On Windows this is usually 
located in your .idlerc directory in C:\Users\YourName\. You might also edit 
this file by hand and just remove the offending binding, although that assumes 
you know which one it is, of course.

--
nosy: +Ritornell

___
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-11 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Sorry I didn't read your patch carefully and it's surprising for me that you 
didn't remove/modify this line in configure.ac:

CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"

With this line left there, feature detections for _curses are broken as 
./configure check against native (/usr/include) headers, whose results make 
little sense for cross-builds.

--

___
Python tracker 

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



[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2016-12-11 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Issue27999 invalidated test_global_err_then_warn in 
Lib/test/test_syntax.py:567. That test was added in issue763201 for testing 
that SyntaxWarning emitted in symtable_global() doesn't clobber a SyntaxError. 
In issue27999 a SyntaxWarning was converted to SyntaxError, and the test no 
longer serves its purpose.

Issue28512 makes tests more strong (it tests the position of SyntaxError), but 
it can't be applied in 3.6, because _check_error() catches different 
SyntaxError.

--
components: Tests
keywords: 3.6regression
messages: 282916
nosy: Jeremy.Hylton, gvanrossum, levkivskyi, serhiy.storchaka
priority: normal
severity: normal
status: open
title: test_global_err_then_warn in test_syntax is no longer valid
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



[issue28512] PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject() always set the offset attribute to None

2016-12-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Good catch Martin! Opened issue28936 for that quirky test.

--

___
Python tracker 

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



[issue28512] PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject() always set the offset attribute to None

2016-12-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ea1c49ea8136 by Serhiy Storchaka in branch '3.5':
Issue #28512: Fixed setting the offset attribute of SyntaxError by
https://hg.python.org/cpython/rev/ea1c49ea8136

New changeset df59faf7fa59 by Serhiy Storchaka in branch '3.6':
Issue #28512: Fixed setting the offset attribute of SyntaxError by
https://hg.python.org/cpython/rev/df59faf7fa59

New changeset 72aaef2d144b by Serhiy Storchaka in branch 'default':
Issue #28512: Fixed setting the offset attribute of SyntaxError by
https://hg.python.org/cpython/rev/72aaef2d144b

--
nosy: +python-dev

___
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-11 Thread Steve Dower

Steve Dower added the comment:

MSVC automatically inlines it on Windows (and yes, it broke some of our 
debugging support in Visual Studio, but we can fix it by setting the eval func).

IMHO, inlining is best left to profiling optimizers. If you notice a 
regression, add a test case that drives it to the point where it gets inlined. 
But it's not worth reducing maintainability of the code base for this.

--

___
Python tracker 

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



[issue28936] test_global_err_then_warn in test_syntax is no longer valid

2016-12-11 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Serhiy, here is a patch that might be helpful. It detects global-and-parameter 
errors sooner (when possible). This will cause the following:

>>> if 1:
... def error(a):
... global a
... def error2():
... b = 1
... global b
... 
  File "", line 3
SyntaxError: name 'a' is parameter and global

However, in more complex (nested) cases, the global-after-assign will still be 
detected sooner:

>>> def error(a):
... def inner():
... global a
... def inner2():
... b = 1
... global b
... 
  File "", line 6
SyntaxError: name 'b' is assigned to before global declaration

Maybe there is a way to delay the detection of this error until second pass in 
symtable.c, but don't see now how to do this.

--
keywords: +patch
Added file: http://bugs.python.org/file45849/syntax-error-order.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-11 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Hum, I did miss that line in configure.ac, thanks for pointing that out.
New patch.

--
Added file: http://bugs.python.org/file45850/no-path-to-ncursesw_2.patch

___
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-11 Thread Matt Joiner

Matt Joiner added the comment:

This is why I stopped contributing to Python.

--

___
Python tracker 

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



[issue28937] str.split(): remove empty strings when sep is not None

2016-12-11 Thread Barry A. Warsaw

New submission from Barry A. Warsaw:

This has finally bugged me enough to file an issue, although I wouldn't be able 
to use it until Python 3.7.  There's a subtle but documented difference in 
str.split() when sep=None:

>>> help(''.split)
Help on built-in function split:

split(...) method of builtins.str instance
S.split(sep=None, maxsplit=-1) -> list of strings

Return a list of the words in S, using sep as the
delimiter string.  If maxsplit is given, at most maxsplit
splits are done. If sep is not specified or is None, any
whitespace string is a separator and empty strings are
removed from the result.

I.e., that empty strings are removed from the result.  This does not happen 
when sep is given, leading to this type of unfortunate code:

>>> 'foo,bar,baz'.split(',')
['foo', 'bar', 'baz']
>>> 'foo,bar,baz'.replace(',', ' ').split()
['foo', 'bar', 'baz']
>>> ''.split(',')
['']
>>> ''.replace(',', ' ').split()
[]

Specifically, code that wants to split on say commas, but has to handle the 
case where the source string is empty, shouldn't have to also filter out the 
single empty string item.

Obviously we can't change existing behavior, so I propose to add a keyword 
argument `prune` that would make these two bits of code identical:

>>> ''.split()
[]
>>> ''.split(' ', prune=True)
[]

and would handle the case of ''.split(',') without having to resort to creating 
an ephemeral intermediate string.

`prune` should be a keyword-only argument, defaulting to False.

--
components: Library (Lib)
messages: 282923
nosy: barry
priority: normal
severity: normal
status: open
title: str.split(): remove empty strings when sep is not None
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



[issue28739] PEP 498: docstrings as f-strings

2016-12-11 Thread Eric V. Smith

Eric V. Smith added the comment:

It looks good to me, save for one tiny issue. I left a review comment.

--

___
Python tracker 

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



[issue28937] str.split(): remove empty strings when sep is not None

2016-12-11 Thread Emanuel Barry

Emanuel Barry added the comment:

I understand the feeling. However, in a project I maintain, we want the other 
way around - to be able to never have an empty list, even if the string is 
empty (we resorted to using re.split in the end, which has this behaviour). 
Consider:

rest = re.split(" +", rest)[0].strip()

This gives us None-like behaviour in splitting, at the cost of not actually 
using str.split.

I'm +1 on the idea, but I'd like some way to better generalize str.split use 
(not everyone knows you can pass None and/or an integer).

(At the same time, the counter arguments where str has too many methods, or 
that methods shouldn't do too much, also apply here.)

But I don't like bikeshedding too much, so let's just count me as +1 for your 
way, if there's no strong momentum for mine :)

--
nosy: +ebarry
type:  -> enhancement

___
Python tracker 

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



[issue28937] str.split(): remove empty strings when sep is not None

2016-12-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Current behavior is consistent with str.count():

len(string.split(sep)) == string.count(sep) + 1

and re.split():

re.split(re.escape(sep), string) == string.split(sep)

May be the behavior when sep is None should be changed for consistency with the 
behavior when sep is not None?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue28937] str.split(): remove empty strings when sep is not None

2016-12-11 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Dec 11, 2016, at 03:32 PM, Serhiy Storchaka wrote:

>Current behavior is consistent with str.count():
>
>len(string.split(sep)) == string.count(sep) + 1
>
>and re.split():
>
>re.split(re.escape(sep), string) == string.split(sep)

Yep.  My suggestion is a straight up 'practicality beats purity' request.

>May be the behavior when sep is None should be changed for consistency with
>the behavior when sep is not None?

I'm very strongly -1 on changing any existing behavior.

--

___
Python tracker 

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



[issue28937] str.split(): remove empty strings when sep is not None

2016-12-11 Thread Emanuel Barry

Emanuel Barry added the comment:

Changing the behaviour when sep is None is a big backwards-compatibility break, 
and I'm not sure we'd even want that. It's logical to allow passing None to 
mean the same thing as NULL (i.e. no arguments), and the behaviour in that case 
has been like that for... well, long enough that changing it isn't really 
feasible.

I agree with Barry here, especially since this is a completely opt-in feature, 
and existing behaviour isn't changed without the user's knowledge.

--

___
Python tracker 

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



[issue28937] str.split(): remove empty strings when sep is not None

2016-12-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I meant adding boolean argument that changes the behavior when sep is None, not 
when it is not None.

--

___
Python tracker 

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



[issue28937] str.split(): remove empty strings when sep is not None

2016-12-11 Thread Emanuel Barry

Emanuel Barry added the comment:

That would work for my case, but it wouldn't for Barry's (unless I missed 
something). He wants a non-None argument to not leave empty strings, but I want 
a None argument to leave empty strings... I don't think there's a 
one-size-fits-all solution in this case, but feel free to prove me wrong :)

--

___
Python tracker 

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



[issue28937] str.split(): remove empty strings when sep is not None

2016-12-11 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Dec 11, 2016, at 03:57 PM, Serhiy Storchaka wrote:

>I meant adding boolean argument that changes the behavior when sep is None,
>not when it is not None.

Ah, I understand now, thanks.  However, I'm not sure that addresses my
particular use case.  It's actually kind of handy to filter out the empty
strings.  But I'm open to counter arguments.

--

___
Python tracker 

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



[issue28818] simplify lookdict functions

2016-12-11 Thread INADA Naoki

Changes by INADA Naoki :


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



[issue28937] str.split(): remove empty strings when sep is not None

2016-12-11 Thread Emanuel Barry

Emanuel Barry added the comment:

Actually, there might be a way. We could make prune default to True if sep is 
None, and default to False if sep is not None. That way, we get to keep the 
existing behaviour for either case, while satisfying both of our use cases :)

If that's a bad idea (and it quite probably is), I'll retract it. But it's an 
interesting possibility to at least consider.

--

___
Python tracker 

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



[issue28867] NamedTemporaryFile does not generate a ResourceWarning for unclosed files (unlike TemporaryFile)

2016-12-11 Thread Jon Dufresne

Jon Dufresne added the comment:

I've taken a new approach to resolve the urllib issues.

I believe HTTPError _should not_ warn when __del__ is called as HTTPError wraps 
an existing resource instead of generating its own. IIUC, in this case, I 
believe it falls to the responsibility of code generating the resource to 
properly close and manage the resource (or pass that responsibility along). If 
I misunderstood, please let me know.

All feedback on the patch is welcome, thanks.

--
Added file: 
http://bugs.python.org/file45851/namedtemporaryfile-resourcewarning-3.patch

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

Roundup Robot added the comment:

New changeset 30341d5c1423 by Serhiy Storchaka in branch '3.6':
Issue #28739: f-string expressions no longer accepted as docstrings and
https://hg.python.org/cpython/rev/30341d5c1423

New changeset 8e0f147dfa3d by Serhiy Storchaka in branch 'default':
Issue #28739: f-string expressions no longer accepted as docstrings and
https://hg.python.org/cpython/rev/8e0f147dfa3d

--
nosy: +python-dev

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

Changes by Serhiy Storchaka :


--
assignee:  -> docs@python
components: +Documentation -Interpreter Core
keywords:  -patch
nosy: +docs@python
stage: patch review -> needs patch

___
Python tracker 

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



[issue28937] str.split(): remove empty strings when sep is not None

2016-12-11 Thread Matthew Barnett

Matthew Barnett added the comment:

So prune would default to None?

None means current behaviour (prune if sep is None else don't prune)
True means prune empty strings
False means don't prune empty string

--
nosy: +mrabarnett

___
Python tracker 

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



[issue28937] str.split(): remove empty strings when sep is not None

2016-12-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

A few randomly ordered thoughts about splitting:

* The best general purpose text splitter I've ever seen is in MS Excel and is 
called "Text to Columns".  It has a boolean flag, "treat consecutive delimiters 
as one" which is off by default.

* There is a nice discussion on the complexities of the current design on 
StackOverflow:  http://stackoverflow.com/questions/16645083  In addition, there 
are many other SO questions about the behavior of str.split().

* The learning curve for str.split() is already high.  The doc entry for it has 
been revised many times to try and explain what it does.  I'm concerned that 
adding another algorithmic option to it may make it more difficult to learn and 
use in the common cases (API design principle:  giving users more options can 
impair usability).  Usually in Python courses, I recommend using str.split() 
for the simple, common cases and using regex when you need more control.

* What I do like about the proposal is that that there is no clean way to take 
the default whitespace splitting algorithm and customize to a particular subset 
of whitespace (i.e. tabs only).

* A tangential issue is that it was a mistake to expose the maxsplit=-1 
implementation detail.   In Python 2.7, the help was "S.split([sep 
[,maxsplit]])".  But folks implementing the argument clinic have no way of 
coping with optional arguments that don't have a default value (like dict.pop), 
so they changed the API so that the implementation detail was exposed, 
"S.split(sep=None, maxsplit=-1)".   IMO, this is an API regression.  We really 
don't want people passing in -1 to indicate that there are no limits.  The 
Python way would have been to use None as a default or to stick with the 
existing API where the number of arguments supplied is part of the API (much 
like type() has two different meanings depending on whether it has an arity of 
1 or 3).

Overall, I'm +0 on the proposal but there should be good consideration given to 
1) whether there is a sufficient need to warrant increasing API complexity, 
making split() more difficult to learn and remember, 2) considering whether 
"prune" is the right word (can someone who didn't write the code read it 
clearly afterwards), 3) or addressing this through documentation (i.e. showing 
the simple regexes needed for cases not covered by str.split).

--
nosy: +rhettinger

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

Brett Cannon added the comment:

Thanks for the patch, Mariatta! Once we have migrated to GitHub we can apply 
the patch (don't let me forget :) ).

Any version still under active maintenance should probably be updated, so that 
would probably mean 2.7 but not the other versions.

--

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

Brett Cannon added the comment:

And having a private copy of os.fsdecode() isn't difficult as os.fspath() is in 
posix and after that it's four lines that only need access to the sys 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-11 Thread Brett Cannon

Brett Cannon added the comment:

Maybe we just need to clarify some documentation at this point? All of the 
differences in semantics make total sense when you realize `-m pkg` is really 
conceptually shorthand for `import pkg.__main__` (w/ the appropriate __name__ 
flourishes). When you begin to view it that way then specifying the file path 
starts to look like the odd way by bypassing import and simply running open() 
on a file and passing the result to exec() (once again, with the appropriate 
__name__ flourishes). It also makes the point that -m isn't really shorthand 
for specifying a script which seems to be where people are getting tripped up 
by the differences.

So instead of selling `-m` as a way to run a module/package as a script, I say 
we change the message/documentation to say it does an import with __name__ 
changed and make specifying a script as the weird reading-a-file-directly thing.

--

___
Python tracker 

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



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

2016-12-11 Thread Julien Palard

Changes by Julien Palard :


--
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-11 Thread Xavier de Gaye

Changes by Xavier de Gaye :


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

___
Python tracker 

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



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

2016-12-11 Thread Xavier de Gaye

Changes by Xavier de Gaye :


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

___
Python tracker 

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



[issue28783] Embedded/nuget packages incorrectly reference bdist_wininst

2016-12-11 Thread Ned Deily

Ned Deily added the comment:

I agree that the risk if this is applied appears to be minimal.  If Paul or 
Zack are OK with it and your testing is successful, I'll plan on cherrypicking 
it for 3.6.0 final.

--

___
Python tracker 

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



[issue28938] match_hostname treats SAN IP address as DNS name and fails to check CN then

2016-12-11 Thread Steffen Ullrich

New submission from Steffen Ullrich:

from Lib/ssl.py

303elif key == 'IP Address':
304if host_ip is not None and _ipaddress_match(value, host_ip):
305return
306dnsnames.append(value)
307if not dnsnames:
308# The subject is only checked when there is no dNSName entry
309# in subjectAltName

RFC 2818 and RFC 6125 say that CN should not be used if subjectAltNames 
contains DNS names. This means CN should still be checked if SAN contains only 
IP addresses. By appending IP address to dnsnames in line 306 it will not check 
the CN if there are no DNS names in SAN but only IP address.

See also 
http://stackoverflow.com/questions/41089539/authentication-issue-with-ssl-certificate-using-python-requests-lib/41090559#41090559

--
messages: 282940
nosy: noxxi
priority: normal
severity: normal
status: open
title: match_hostname treats SAN IP address as DNS name and fails to check CN 
then
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue28938] match_hostname treats SAN IP address as DNS name and fails to check CN then

2016-12-11 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +alex, christian.heimes, dstufft, janssen

___
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-11 Thread Jeroen Demeyer

Jeroen Demeyer added the comment:

Here is more minimal breaking example. This clearly shows that this patch 
breaks backwards compatibility.

```
$ cat obj.pyx
cdef class OBJ(object):
pass

$ ipython
Python 2.7.13rc1 (default, Dec 11 2016, 14:21:24) 
Type "copyright", "credits" or "license" for more information.

IPython 5.1.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help  -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import pyximport; pyximport.install()
Out[1]: (None, )

In [2]: import obj

In [3]: class X(obj.OBJ, dict):
   ...: pass
   ...: 

In [4]: X()
---
TypeError Traceback (most recent call last)
 in ()
> 1 X()

TypeError: obj.OBJ.__new__(X) is not safe, use dict.__new__()
```

--
nosy: +jdemeyer

___
Python tracker 

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



[issue28939] Groupby Is Roughly Equivalent To ...

2016-12-11 Thread Greg Solomon

New submission from Greg Solomon:

https://docs.python.org/3/library/itertools.html#itertools.groupby

I found the "equivalent" code a bit hard to read. Is there any merit in 
changing it to something a bit like the following ?

Kind Rgds, Greg

class groupby:
def __init__( self , iterable , key_function = ( lambda x: x ) ):
self.iterable = iter( iterable )
self.key_function = key_function
self.FINISHED = object()
try:
self.next_value = next( self.iterable )
except StopIteration: 
self.next_value = self.FINISHED
def __iter__( self ):
return self
def __next__( self ):
if self.next_value == self.FINISHED:
raise StopIteration
self.group_key_value = self.key_function( self.next_value )
return ( self.group_key_value , self._group() )
def _group( self ):
while self.next_value != self.FINISHED \
  and self.group_key_value == self.key_function( self.next_value ):
yield self.next_value
try:
self.next_value = next( self.iterable )
except StopIteration:
self.next_value = self.FINISHED 
return

--
assignee: docs@python
components: Documentation
messages: 282943
nosy: docs@python, greg.solomon
priority: normal
severity: normal
status: open
title: Groupby Is Roughly Equivalent To ...
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



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

2016-12-11 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy:  -pitrou

___
Python tracker 

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



[issue28783] Embedded/nuget packages incorrectly reference bdist_wininst

2016-12-11 Thread Paul Moore

Paul Moore added the comment:

I'm OK for this to go in.

--

___
Python tracker 

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



[issue28938] match_hostname treats SAN IP address as DNS name and fails to check CN then

2016-12-11 Thread Christian Heimes

Christian Heimes added the comment:

Python's implementation of host name verification conforms to RFC 6125, section 
6.4.4. The CN check is optional (MAY). Python treats the presence of an IP 
Address as indicator that CN check should not be performed. 

In fact hostname verification code should be more strict and not fall back to 
CN when a SRV-ID or URI is present. But the ssl module lacks support to fetch 
SRV-ID, see #28191. Since public CAs and members of the CAB forum are not yet 
allowed to issue certificates with SRV-ID, it's not a security issue.


https://tools.ietf.org/html/rfc6125#section-6.4.4

6.4.4.  Checking of Common Names

   As noted, a client MUST NOT seek a match for a reference identifier
   of CN-ID if the presented identifiers include a DNS-ID, SRV-ID,
   URI-ID, or any application-specific identifier types supported by the
   client.

   Therefore, if and only if the presented identifiers do not include a
   DNS-ID, SRV-ID, URI-ID, or any application-specific identifier types
   supported by the client, then the client MAY as a last resort check
   for a string whose form matches that of a fully qualified DNS domain
   name in a Common Name field of the subject field (i.e., a CN-ID).

--
assignee:  -> christian.heimes
components: +SSL
resolution:  -> not a bug
status: open -> pending

___
Python tracker 

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



[issue28940] __length_hint__ isn't a hint for list()

2016-12-11 Thread Ronald Oussoren

New submission from Ronald Oussoren:

The following code raises MemoryError instead of creating an empty list:

# START
import sys

class CustomIter:
def __iter__(self):
return self
def __next__(self):
raise StopIteration
def __length_hint__(self):
return sys.maxsize

l = list(CustomIter())
#END

That's because this empty iterator has a __length_hint__ that claims it returns 
a very large number of methods. 

The function listextend in Objects/listobject.c already ignores 
__length_hint__() when using it would overflow the size of the list, it would 
IMHO also be better to ignore the length hint when the attempt to resize fails 
as __length_hint__() is documented as a hint that may be incorrect.

--
components: Interpreter Core
messages: 282946
nosy: ronaldoussoren
priority: normal
severity: normal
status: open
title: __length_hint__ isn't a hint for list()
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue28939] Groupby Is Roughly Equivalent To ...

2016-12-11 Thread Julien Palard

Julien Palard added the comment:

I renamed your function groupby2 to compare it with itertools.groupby and 
tested but:

>>> print(list(groupby2(['A', 'B'])))

does not returns, looks like your implementation have a bug, so I tried:

>>> for k in groupby2(['A', 'B']):
... print(k)

and I'm getting loads of:

('A', )
('A', )
('A', )
('A', )
('A', )
('A', )
('A', )
('A', )
('A', )
('A', )

You may also want to test your implementation against 
https://github.com/python/cpython/blob/master/Lib/test/test_itertools.py#L699

--
nosy: +mdk

___
Python tracker 

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



[issue28938] match_hostname treats SAN IP address as DNS name and fails to check CN then

2016-12-11 Thread Cory Benfield

Changes by Cory Benfield :


--
nosy: +Lukasa
status: pending -> open

___
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-11 Thread paul j3

paul j3 added the comment:

The problem with the argparse backlog is that the original author of the module 
is too busy with other things.  And no one has stepped into his shoes.  There 
are people with experience in apply patches, and people who know the argparse 
code well, but few, if any with both skills (and/or the time to invest in this 
module).  

In addition the module has some serious backward compatibility issues.  I know 
of several patches that were applied, and then withdrawn because of unforseen 
(or at least untested) compatibility problems.  

While I commented earlier, I don't recall testing it.  I just tried it now, and 
ran into problems - until I realized this isn't compatible with Python2.7.  Py3 
is the development world, but there's still a lot of PY2 use (e.g look at 
Stackoverflow argparse questions).  On SO if people have problems with 
FileType, I often recommend that they just accept the filename, and take care 
of opening it themselves.  

To raise the attention to this patch I'd suggest 

- making the case that it is really needed

- demonstrating that it has been field tested, and is free of backward 
compatibility issues.

--

___
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-11 Thread Steve Dower

Steve Dower added the comment:

Is it easy to cherry pick a merge commit? This will go into 3.5 first, but I 
can null merge and then clean commit it if that's easier?

--

___
Python tracker 

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



[issue28938] match_hostname treats SAN IP address as DNS name and fails to check CN then

2016-12-11 Thread Steffen Ullrich

Steffen Ullrich added the comment:

On Sun, Dec 11, 2016 at 08:26:32PM +, Christian Heimes 
 wrote:
> 
> Christian Heimes added the comment:
> 
> Python's implementation of host name verification conforms to RFC 6125, 
> section 6.4.4. The CN check is optional (MAY). Python treats the presence of 
> an IP Address as indicator that CN check should not be performed. 

RFC 6125 does not obsolete RFC 2818. In fact it says in section 1.4:

   This document also does not supersede the rules for verifying service
   identity provided in specifications for existing application
   protocols published prior to this document, such as those excerpted
   under Appendix B...

Where Appendix B.2 explicitly cites the relevant parts from RFC 2818 like this
in section 3.1:

  If a subjectAltName extension of type dNSName is present, that MUST
  be used as the identity. Otherwise, the (most specific) Common Name
  field in the Subject field of the certificate MUST be used.

Thus while RFC 6125 might say MAY for checking the CN the more specific RFC
2818 says clearly MUST. Also, the intention of RFC 6125 in 6.4.4 is in my
opinion to distinguish between applications never checking the CN and
applications which check the CN, while addressing the last ones that CN
should not be checked for specific SAN record types. iPAddress is not a type
which is considered for this special treatment.

Regards,
Steffen

--

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

Ned Deily added the comment:

Just do your normal thing.  I'll make it work.

--

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

Roundup Robot added the comment:

New changeset 47bf09270027 by Steve Dower in branch '3.5':
Issue #28783: Replaces bdist_wininst in nuget packages with stub
https://hg.python.org/cpython/rev/47bf09270027

New changeset b8b1ad21e073 by Steve Dower in branch '3.6':
Issue #28783: Replaces bdist_wininst in nuget packages with stub
https://hg.python.org/cpython/rev/b8b1ad21e073

New changeset 402a227564f5 by Steve Dower in branch 'default':
Issue #28783: Replaces bdist_wininst in nuget packages with stub
https://hg.python.org/cpython/rev/402a227564f5

--

___
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-11 Thread Steve Dower

Steve Dower added the comment:

Thanks Ned, it's all yours.

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



[issue28938] match_hostname treats SAN IP address as DNS name and fails to check CN then

2016-12-11 Thread Ray Satiro

Changes by Ray Satiro :


--
nosy: +raysatiro

___
Python tracker 

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



[issue28937] str.split(): remove empty strings when sep is not None

2016-12-11 Thread Emanuel Barry

Emanuel Barry added the comment:

Matthew: Yes, that's exactly the way I was going about it.

Thank you Raymond for your comments (and your informative answer on that SO 
question).

I think that part of the problem is that no delimiter (or None) behaves 
differently than with a delimiter. If we wanted proper consistency, we would 
have needed to make passing None (or nothing) the same as passing whitespace, 
but alas, we have to work with what we have.

As you said, API complexity is a concern that needs to be addressed. I think 
that the most important part is how it's documented, and, if phrased correctly 
(which is non-trivial), could actually simplify the explanation.

Consider this draft:

***

The value of the `prune` keyword argument determines whether or not consecutive 
delimiters should be grouped together. If `prune` is not given or None, it 
defaults to True if sep is None or not given, and False otherwise.

If `prune` is True, consecutive delimiters (all whitespace if None or not 
given) are regarded as a single separator, and the result will not contain any 
empty string. The resulting list may be empty.

Otherwise, if `prune` is False, consecutive delimiters are not grouped 
together, and the result may contain one or more empty string. The resulting 
list will never be empty.

***

I may be oversimplifying this, but it seems to me that this might help some 
people by hopefully streamlining the explanation.

This still doesn't solve the issue where a user can't say "split on a space or 
a tab, but not newlines", which IMO is lacking in the design, but that may be 
for another issue ;)

I've wrapped up a basic patch which probably doesn't work at all; I'll put it 
up when it's at least partly working for everyone to look at.

--

___
Python tracker 

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



[issue28867] NamedTemporaryFile does not generate a ResourceWarning for unclosed files (unlike TemporaryFile)

2016-12-11 Thread Jon Dufresne

Jon Dufresne added the comment:

I decided to try a new direction.

Instead of modifying _TemporaryFileCloser to handle urllib, I've changed urllib 
classes to not inherit from _TemporaryFileCloser. The urllib classes are not 
temporary files as built by tempfile, so I believe this makes more sense. There 
is a small amount of code copied to the existing class, but I believe this 
cleans up the inheritance in a way that makes more sense for the given objects 
and requires fewer workarounds.

All feedback on this alternative approach is welcome. Thanks.

--
Added file: 
http://bugs.python.org/file45852/namedtemporaryfile-resourcewarning-4.patch

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

Nick Coghlan added the comment:

Something we don't really have anywhere is a short summary of how sys.path[0] 
gets initialised - it's scattered through the descriptions of the various 
invocation options in 
https://docs.python.org/3/using/cmdline.html#interface-options

I figure it's also worth mentioning https://bugs.python.org/issue13475 where we 
discussed the idea of a "--nopath0" option so folks could easily disable 
imports from the current directory (-c, -m) or from the script directory 
(direct execution) without otherwise impacting startup behaviour. (Specifying 
--nopath0, and then requesting execution of a directory or zipfile would 
necessarily be an error, since modifying sys.path[0] is an essential part of 
making those work)

--

___
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-12-11 Thread John Huang

John Huang added the comment:

The same issue in Python 2.7.12. Some extensions modules are not built if 
cross-compiling.

--
nosy: +John Huang

___
Python tracker 

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



[issue28937] str.split(): remove empty strings when sep is not None

2016-12-11 Thread Emanuel Barry

Emanuel Barry added the comment:

Here's an initial patch. It works exactly as discussed earlier, doesn't break 
any tests, and retains full backwards compatibility. No doc changes (except for 
the docstrings of str.[r]split) and no tests, as this is just a preliminary 
patch to see if there's any merit to the idea.

--
keywords: +patch
stage:  -> test needed
Added file: http://bugs.python.org/file45853/split_prune_1.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-11 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks, Brett.

Here's the patch that will work for the 2.7 branch.

--
Added file: http://bugs.python.org/file45854/issue28929-v27.patch

___
Python tracker 

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



[issue26546] Provide translated french translation on docs.python.org

2016-12-11 Thread INADA Naoki

Changes by INADA Naoki :


--
dependencies: +"CPython implementation detail:" removed when content translated

___
Python tracker 

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



[issue28941] Update the link to Source Code in Python Docs from hg to github

2016-12-11 Thread Mariatta Wijaya

New submission from Mariatta Wijaya:

Some Python docs include a link to the Source Code, for example: 
https://docs.python.org/3.6/library/abc.html

Once the repo is moved to github, the link should probably be updated to point 
to github:
https://github.com/python/cpython/blob/master/Lib/abc.py

--
assignee: docs@python
components: Documentation
messages: 282960
nosy: Mariatta, docs@python
priority: normal
severity: normal
status: open
title: Update the link to Source Code in Python Docs from hg to github
versions: Python 2.7, 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



[issue28941] Update the link to Source Code in Python Docs from hg to github

2016-12-11 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue28937] str.split(): remove empty strings when sep is not None

2016-12-11 Thread Sye van der Veen

Sye van der Veen added the comment:

In the sep!=None case, there are existing alternatives to prune=True that 
aren't many more keystrokes:

>>> ''.split(' ', prune=True)
[]
>>> [x for x in ''.split(' ') if x]
[]
>>> list(filter(bool, ''.split(' '))) # or drop list() and use the iterator 
>>> directly
[]

This becomes even fewer keystrokes for users that create a prune() or 
split_prune() function.

For the sep==None case, I agree there are no alternatives to prune=False (aside 
from rolling your own split function).  However, instead of prune, what if sep 
accepted a tuple of strings, similar to startswith.  In this case, each string 
would be considered one possible, yet distinct, delimiter:

>> ''.split(prune=False)
['']
>> ''.split((' ', '\t')) # typical whitespace
['']
>> ''.split(tuple(string.whitespace)) # ASCII whitespace
['']

Once again, this becomes even easier for users that create a split_no_prune() 
function, or that assign tuple(string.whitespace) to a variable.  It would also 
nicely handle strings with non-homogeneous delimiters:

>>> '1?2,,3;'.split((',', ';', '?'))
['1', '2', '', '3', '']

I personally find the 0-argument str.split() one of the great joys of Python.  
It's common to have to split out words from a sentence, and having that 
functionality just 8 characters away at all times has been very useful.

--
nosy: +syeberman

___
Python tracker 

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



[issue28937] str.split(): remove empty strings when sep is not None

2016-12-11 Thread Emanuel Barry

Emanuel Barry added the comment:

Yes, I agree that being able to pass in a tuple would be really useful. As far 
as rolling out a custom function goes, I'd sooner reach for re.split than do 
that, so I don't really have a strong argument for either side. Feel free to 
play with the patch or make an entirely new one, though! I mainly submitted the 
patch to keep the discussion going, and eventually come to a concensus, but I 
don't have a strong opinion either way :)

--

___
Python tracker 

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



[issue28937] str.split(): remove empty strings when sep is not None

2016-12-11 Thread Vedran Čačić

Vedran Čačić added the comment:

The problem with .split is its split (pun intended) personality: it really is 
two functions that have separate use cases, and have different algorithms; and 
people think about them as separate functions. In that view, we have just 
fallen afoul of Guido's rule of no literal passing bool arguments. The true 
solution would probably be to bite the bullet and have two separate methods. 
After all, .splitlines is a separate method for precisely such a reason.

--
nosy: +veky

___
Python tracker 

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



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

2016-12-11 Thread Nick Coghlan

Nick Coghlan added the comment:

I think we're genuinely getting to the point now where the majority of "LANG=C" 
cases are misconfigurations rather than intended behaviour. We're also to the 
point where:

- on Mac OS X, binary system interfaces have been handled as UTF-8 by default 
since 3.0
- on Windows, as of 3.6, the OS native binary system interfaces are now 
bypassed entirely in favour of transcoding from UTF-8 to UTF-16-LE 

So I think for Python 3.7 it makes sense to do the following on other *nix 
systems:

- very early in CPython startup (even before argument processing), if the 
detected locale is "C", force it to "C.UTF-8" if possible, and print a warning 
either way
- add a PYTHONKEEPASCIILOCALE environment variable to turn that behaviour off

I do think we actually want to *change* the C level locale in the process 
though, as otherwise we can expect to see weird interactions where CPython and 
extension modules disagree about the default text encoding.

--
nosy: +ncoghlan

___
Python tracker 

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



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

2016-12-11 Thread Nick Coghlan

Nick Coghlan added the comment:

Note also that if we say we're going to do this for 3.7, *and* go ahead and 
implement it, then distros may be more inclined to incorporate the same 
behavioural changes into distro-provided releases of 3.6, providing real world 
testing of the concept before we make it the default behaviour.

--

___
Python tracker 

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



[issue28939] Groupby Is Roughly Equivalent To ...

2016-12-11 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: docs@python -> rhettinger
nosy: +rhettinger
priority: normal -> low

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

Changes by Raymond Hettinger :


--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +bethard, docs@python
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



[issue28937] str.split(): remove empty strings when sep is not None

2016-12-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Guido, do you have an option on this?  IIRC, this was an API you created.

Nick's thought (posted on twitter) is that 'filter(None, sep.split(input)' 
already covers the "drop the empty values" case. 

My feelings are mixed.  Though I've never needed in practice, it would be nice 
if the whitespace removal algorithm could be customized to just a space or just 
a tab.   On the other hand, I think the new parameter would make the API more 
confusing and harder to learn.  It might be better to just document either the 
filter(None) approach or a simple regex for the less common cases.

--
nosy: +gvanrossum

___
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-12-11 Thread Xavier de Gaye

Xavier de Gaye added the comment:

AFAIK many changes that have been made in Python 3 for the support of the cross 
compilation have not been backported to 2.7, including this one.

--

___
Python tracker 

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



[issue28939] Groupby Is Roughly Equivalent To ...

2016-12-11 Thread Greg Solomon

Greg Solomon added the comment:

Oh, I get it. There needs to be a next(self.it) loop in __next__ as well as in 
_grouper in case the user doesn't call _grouper.

My test was 
for ( k , g ) in groupby( L ):
print ( k , len( list( g ) ) )
so I was executing _grouper on every row.

Thanks !!!

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

___
Python tracker 

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



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

2016-12-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Does changing the order of base classes help or there is an unavoidable 
conflict?

--

___
Python tracker 

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