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

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

[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

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

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

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

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

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

[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

[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

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

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

[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

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

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

[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

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

[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

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

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

[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

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

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

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

[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

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

[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

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

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

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

[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

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

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

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

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

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

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

[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

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

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

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

[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

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

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

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

[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

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

[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

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

[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

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

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

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

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

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

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

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

[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(" +",

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

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

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

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

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

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

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

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

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

[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

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

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

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

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

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