[issue15427] Describe use of args parameter of argparse.ArgumentParser.parse_args

2017-09-09 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Thanks, David. I merged the backport PRs. Closing this. -- nosy: +Mariatta resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker

[issue31373] demoting floating float values to unrepresentable types is undefined behavior

2017-09-09 Thread Benjamin Peterson
Benjamin Peterson added the comment: I agree that's bad. Do you know a way to get the IEEE 754 rounding behavior without invoking C undefined behavior? -- ___ Python tracker

Re: Using Python 2

2017-09-09 Thread Steve D'Aprano
On Sun, 10 Sep 2017 02:04 pm, Rick Johnson wrote: > Can you imagine the rage that someone will feel after > climbing up the migration hill from Python2 to Python3, and > then suddenly, hearing the announcement that it's now time > to migrate to Python4? Guido has ruled that Python 4 will not be

[issue31373] demoting floating float values to unrepresentable types is undefined behavior

2017-09-09 Thread Mark Dickinson
Mark Dickinson added the comment: There's a (to my mind) unfortunate change in behaviour here. Under normal IEEE 754 rules, some C double values larger than FLT_MAX still round to FLT_MAX under conversion to float. Python 3.6: >>> import struct >>> x = 3.40282356e38 >>> struct.pack("

Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-09 Thread Gene Heskett
On Saturday 09 September 2017 21:48:44 Chris Angelico wrote: > On Sun, Sep 10, 2017 at 11:41 AM, Gregory Ewing > > wrote: > > Pavol Lisy wrote: > >> Interesting reading: > >> https://stackoverflow.blog/2017/09/06/incredible-growth-python/?cb= > >>1 > > > > So,

Re: Using Python 2

2017-09-09 Thread Rick Johnson
On Friday, September 8, 2017 at 8:57:56 AM UTC-5, Ned Batchelder wrote: > On 9/8/17 6:12 AM, Leam Hall wrote: > > I've read comments about Python 3 moving from the Zen of Python. I'm a > > "plain and simple" person myself. Complexity to support what CompSci > > folks want, which was used to

Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-09 Thread Rustom Mody
On Sunday, September 10, 2017 at 7:12:10 AM UTC+5:30, Gregory Ewing wrote: > Pavol Lisy wrote: > > Interesting reading: > > https://stackoverflow.blog/2017/09/06/incredible-growth-python/?cb=1 > > So, Python's rate of expansion is accelerating, like > the universe. Does that mean there's some

Re: Design: method in class or general function?

2017-09-09 Thread Rick Johnson
On Thursday, September 7, 2017 at 7:35:45 AM UTC-5, Ben Finney wrote: > Another, more compelling, reason to follow [Steven's] > advice: Python 2 is in maintenance-only mode and will > receive no support at all in a few years. So what? The OP may not be the type who needs to have his diaper

Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-09 Thread Chris Angelico
On Sun, Sep 10, 2017 at 11:41 AM, Gregory Ewing wrote: > Pavol Lisy wrote: >> >> Interesting reading: >> https://stackoverflow.blog/2017/09/06/incredible-growth-python/?cb=1 > > > So, Python's rate of expansion is accelerating, like > the universe. Does that mean

Re: Design: method in class or general function?

2017-09-09 Thread Chris Angelico
On Sun, Sep 10, 2017 at 11:37 AM, Rick Johnson wrote: > On Thursday, September 7, 2017 at 7:16:25 AM UTC-5, Steve D'Aprano wrote: >> Python 2.6 is ancient, > > Enough with your hyperbole! Python 2.6 is no where near > being ancient. Python 2.6 is a stable version

[issue30788] email.policy.SMTP.fold() issue for long filenames with spaces

2017-09-09 Thread R. David Murray
R. David Murray added the comment: Thanks for the PR, but I've managd to finish my rewrite of the folder so that it not only doesn't traceback on this, but correctly folds it. I'll probably post the PR tomorrow. -- ___ Python tracker

[issue27240] 'UnstructuredTokenList' object has no attribute '_fold_as_ew'

2017-09-09 Thread R. David Murray
R. David Murray added the comment: I managed to finish the rewrite, and it does fix this issue. I'll probably post the PR tomorrow. -- ___ Python tracker

Re: array.array()'s memory shared with multiprocessing.Process()

2017-09-09 Thread MRAB
On 2017-09-09 22:23, iurly wrote: Hi, I'm writing a multiprocessing program whose behavior I don't understand. Essentially, the main process collects data and then passes it to a consumer process. For performance reasons I'm using a "static" circular buffer created through array.array(), and

[issue31401] Dynamic compilation that uses function in comprehension fails when compiled inside function

2017-09-09 Thread R. David Murray
R. David Murray added the comment: This is indeed not a bug, it it a consequence of the scoping rules. What surprises me is that it works without passing in an explicit scope in in 3.7. I'm not sure what we changed that makes that true. -- ___

[issue31401] Dynamic compilation that uses function in comprehension fails when compiled inside function

2017-09-09 Thread Vedran Čačić
Vedran Čačić added the comment: List comprehension is irrelevant here, any nested function has the same problem. And the inner name doesn't have to refer to a function. Also, compilation as a separate step is not necessary. So the minimal example is src = '''\ a = 5 def g(x):

[issue28972] Document all "python -m" utilities

2017-09-09 Thread Aaron Hall
Aaron Hall added the comment: I like this idea too, but perhaps it should just be a multi-column bulleted list (under the -m flag at https://docs.python.org/3/using/cmdline.html#interface-options) with links to the respective Standard Library doc? Then we just ensure the documentation for

array.array()'s memory shared with multiprocessing.Process()

2017-09-09 Thread iurly
Hi, I'm writing a multiprocessing program whose behavior I don't understand. Essentially, the main process collects data and then passes it to a consumer process. For performance reasons I'm using a "static" circular buffer created through array.array(), and then passing it "as-is" by pushing

[issue20580] IDLE should support platform-specific default config defaults

2017-09-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: Ned, config.py currently has def GetCurrentKeySet(self): "Return CurrentKeys with 'darwin' modifications." result = self.GetKeySet(self.CurrentKeys()) if sys.platform == "darwin": # OS X Tk variants do not support the

[issue31299] Add "ignore_modules" option to TracebackException.format()

2017-09-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think a more general facility to strip unwanted frames from traceback objects would be useful for more people (including importlib, I think). i.e. actually mutate the traceback object, not remove the unwanted frames when printing (since it only works if

[issue31401] Dynamic compilation that uses function in comprehension fails when compiled inside function

2017-09-09 Thread Jose Cambronero
Jose Cambronero added the comment: Woops, sorry about that, makes sense. Below an example (same idea as the files): ``` Python 3.6.2 (default, Sep 9 2017, 13:27:06) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin Type "help", "copyright", "credits" or "license" for more

[issue31398] TypeError: gdbm key must be string, not unicode

2017-09-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: has_key(u"x") works if x is a valid key. has_key() parses the argument with PyArg_ParseTuple("s#") which implicitly converts unicode to str. __contains__() explicitly checks for str type. -- nosy: +serhiy.storchaka

[issue31404] undefined behavior and crashes in case of a bad sys.modules

2017-09-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +eric.snow, serhiy.storchaka ___ Python tracker ___

[issue29639] test suite intentionally avoids referring to localhost, destroying abstraction away from IPv6 vs IPv4

2017-09-09 Thread R. David Murray
R. David Murray added the comment: Users on linux can and do screw this up too. I believe we also had a case where a distro screwed up the defaults for, I think, the reverse resolve? Not sure which test that was, and the test may since been fixed to not depend on that. The point is this

[issue30744] Local variable assignment is broken when combined with threads + tracing + closures

2017-09-09 Thread Nathaniel Smith
Nathaniel Smith added the comment: How does a trace function or debugger tell the difference between a closure cell and a fast local whose value happens to be a cell object? -- ___ Python tracker

[issue31405] shutil.which doesn't find files without PATHEXT extension on Windows

2017-09-09 Thread Ryan McCampbell
New submission from Ryan McCampbell: On windows, shutil.which does not match the semantics of built-in command lookup. If you pass the name of a script like foo.py and the PATHEXT variable doesn't include .py it will search for foo.py.exe, foo.py.bat, foo.py.cmd, etc. but not foo.py, which

[issue31401] Dynamic compilation that uses function in comprehension fails when compiled inside function

2017-09-09 Thread R. David Murray
R. David Murray added the comment: Could you please post the examples instead of a zip file? Zip files are hard to read on a mobile browser :) -- nosy: +r.david.murray ___ Python tracker

[issue31404] undefined behavior and crashes in case of a bad sys.modules

2017-09-09 Thread Oren Milman
New submission from Oren Milman: at least on my Windows, the following code: import sys sys.modules = [] - when run interactively, causes weird behavior, e.g. exit() doesn't exit the interpreter, and print() doesn't print. then, pressing Ctrl+C causes 'Assertion failed: !PyErr_Occurred(),

[issue31403] Remove WITHOUT_THREADS from _decimal

2017-09-09 Thread Stefan Krah
Changes by Stefan Krah : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue31398] TypeError: gdbm key must be string, not unicode

2017-09-09 Thread R. David Murray
R. David Murray added the comment: In python3, u"a" and "a" are the same thing. The equivalent in python3 would bee b"a" vs "a", but I have no idea if we even support bytes keys in python3 gdbm. In 2.7 does has_key(u"x") work if x is a valid key? -- nosy: +r.david.murray

[issue31403] Remove WITHOUT_THREADS from _decimal

2017-09-09 Thread Stefan Krah
New submission from Stefan Krah: New changeset c0c29dff7940b7e7ecc1dd051080c5d5f9e42ba8 by Stefan Krah in branch 'master': bpo-31403: Remove WITHOUT_THREADS from _decimal. (#3474) https://github.com/python/cpython/commit/c0c29dff7940b7e7ecc1dd051080c5d5f9e42ba8 --

[issue31397] does not work import in Python 3.6.2

2017-09-09 Thread R. David Murray
R. David Murray added the comment: Presumably the book didn't tell you everything you need to know to make this work, or you missed something in the instructions, since this certainly does work if the module is in a directory on sys.path. (The 'python module1.py' will only work at the

[issue31403] Remove WITHOUT_THREADS from _decimal

2017-09-09 Thread Stefan Krah
Changes by Stefan Krah : -- keywords: +patch pull_requests: +3466 stage: -> patch review ___ Python tracker ___

[issue31403] Remove WITHOUT_THREADS from _decimal

2017-09-09 Thread Stefan Krah
Changes by Stefan Krah : -- assignee: skrah components: Extension Modules nosy: skrah priority: normal severity: normal status: open title: Remove WITHOUT_THREADS from _decimal type: behavior versions: Python 3.7 ___ Python

[issue31361] Update feedparser.py to prevent theano compiling fail in python3

2017-09-09 Thread R. David Murray
R. David Murray added the comment: Can you figure out what the input to feedparser is in those cases? If pip or whatever is feeding in a None object, then that's not a bug in feedparser. However, if the input is a string (or bytes via the bytes interface) and this is heppening, then there's

[issue31402] Python won't load on Acer Aspire

2017-09-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: Please ask for installation help on python-list. It can also be accessed via news.gmane.org. Give following details: OS, including version; source of installer; how you tried to install; what error message you got. If you have Windows XP, 3.6 will not

[issue31394] Ellipsis_token.type != token.ELLIPSIS

2017-09-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: Once the CLA * shows up after your name, one of us should remove CLA needed tag and bot will verify. I believe tagging as trivial would also work. -- ___ Python tracker

[issue31392] Upgrade installers to OpenSSL 1.1.0f

2017-09-09 Thread Christian Heimes
Christian Heimes added the comment: New changeset 16f16dbd0ed02cd1a7b270eb6dd80d9bd179902e by Christian Heimes in branch '3.6': [3.6] bpo-31400: Improve SSL error handling on Windows (GH-3463) (#3466) https://github.com/python/cpython/commit/16f16dbd0ed02cd1a7b270eb6dd80d9bd179902e

[issue31400] SSL module returns incorrect error codes on Windows

2017-09-09 Thread Christian Heimes
Christian Heimes added the comment: New changeset 16f16dbd0ed02cd1a7b270eb6dd80d9bd179902e by Christian Heimes in branch '3.6': [3.6] bpo-31400: Improve SSL error handling on Windows (GH-3463) (#3466) https://github.com/python/cpython/commit/16f16dbd0ed02cd1a7b270eb6dd80d9bd179902e

[issue31345] Backport docstring improvements to the C version of OrderedDict

2017-09-09 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Thanks Henk-Jaap, 3.5 branch is now on security fix only, so only the backport to 3.6 will be accepted. It seems like you have two bug tracker accounts? Did you register with two different email address? It appears that the CLA is received for one of your

[issue31345] Backport docstring improvements to the C version of OrderedDict

2017-09-09 Thread Henk-Jaap Wagenaar
Henk-Jaap Wagenaar added the comment: I submitted a pull request for both 3.5 and 3.6 finding 2 locations using search and find. I also replayed Raymond's example (with _collections as well) and got the documentation as expected on my custom builds of 3.5/3.6. I submitted my CLA on 26th

[issue31345] Backport docstring improvements to the C version of OrderedDict

2017-09-09 Thread Roundup Robot
Changes by Roundup Robot : -- pull_requests: +3464 ___ Python tracker ___

[issue31345] Backport docstring improvements to the C version of OrderedDict

2017-09-09 Thread Roundup Robot
Changes by Roundup Robot : -- keywords: +patch pull_requests: +3463 stage: needs patch -> patch review ___ Python tracker

[issue29988] with statements are not ensuring that __exit__ is called if __enter__ succeeds

2017-09-09 Thread Nick Coghlan
Nick Coghlan added the comment: After chatting to Facebook's Carl Shapiro here at the core dev sprint, I'm going to start exploring a hopefully more robust white-listing based approach where we check for pending calls in the following cases: * the instruction pointer either hasn't changed or

[issue31392] Upgrade installers to OpenSSL 1.1.0f

2017-09-09 Thread Steve Dower
Steve Dower added the comment: New changeset b84bcc48ae31c385fe480c08c05d95212ef7fcdc by Steve Dower in branch 'master': bpo-31392: Update SSL build for 1.1.0 (#3448) https://github.com/python/cpython/commit/b84bcc48ae31c385fe480c08c05d95212ef7fcdc --

[issue30744] Local variable assignment is broken when combined with threads + tracing + closures

2017-09-09 Thread Nick Coghlan
Nick Coghlan added the comment: After drafting PEP 558, briefly chatting about it to Guido, and sleeping on the topic, I'm wondering if there might be answer that's simpler than any of the alternatives consider so far: what if PyFrame_FastToLocals added the *cell objects* to f_locals for any

[issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX

2017-09-09 Thread Masayuki Yamamoto
Masayuki Yamamoto added the comment: FYI, PEP 539 was accepted (see python-dev threads [1] [2]). The only thing missing is a reference implementation, next I complete it. [1] https://mail.python.org/pipermail/python-dev/2017-August/149091.html [2]

[issue29930] Waiting for asyncio.StreamWriter.drain() twice in parallel raises an AssertionError when the transport stopped writing

2017-09-09 Thread Aymeric Augustin
Aymeric Augustin added the comment: I worked around this bug in websockets by serializing access to `drain()` with a lock: https://github.com/aaugustin/websockets/commit/198b71537917adb44002573b14cbe23dbd4c21a2 I suspect this is inefficient but it beats crashing. --

[issue31402] Python won't load on Acer Aspire

2017-09-09 Thread Peter Cooney
New submission from Peter Cooney: Well I'm reading Al Sweigarts Automate the boring stuff, downloaded the exe for Python 3.6, and got the right 32-bit one, then nothing happens when I run it. It just does nothing. I do have it set up perfectly well on another computer, but it won't budge on

Case Solution: Doing Business in Sierra Leone Graeme Hossie at London Mining (A) by Brian C. Pinkham, Ken Mark

2017-09-09 Thread radhika . rainee76
Solutions of this case study -- https://mail.python.org/mailman/listinfo/python-list

[issue31394] Ellipsis_token.type != token.ELLIPSIS

2017-09-09 Thread Aivar Annamaa
Aivar Annamaa added the comment: Here is the PR: https://github.com/python/cpython/pull/3469 (It's my first, so I don't know if I should to also update NEWS file or add "skip news" label. I signed the CLA, so I hope this warning goes away.) -- ___

[issue31394] Ellipsis_token.type != token.ELLIPSIS

2017-09-09 Thread Roundup Robot
Changes by Roundup Robot : -- keywords: +patch pull_requests: +3461 stage: needs patch -> patch review ___ Python tracker

[issue29639] test suite intentionally avoids referring to localhost, destroying abstraction away from IPv6 vs IPv4

2017-09-09 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset efb1d0a3c001a6153211063ba439b9847aa03509 by Gregory P. Smith in branch 'master': bpo-29639: change test.support.HOST to "localhost" https://github.com/python/cpython/commit/efb1d0a3c001a6153211063ba439b9847aa03509 --

Hat difference between "" and '' in string definition

2017-09-09 Thread Andrej Viktorovich
Hello, What is difference between string definitions: s="aaa" and s='bbb' -- https://mail.python.org/mailman/listinfo/python-list

[issue30403] PEP 547: Running extension modules using -m switch

2017-09-09 Thread Stefan Behnel
Stefan Behnel added the comment: I'm a bit torn on this. On the one hand, it's basically saying, "Cython is probably going to do it right anyway, so let's just assume it does". That's nice, and might be applicable to other cases as well. But that also feels like it could need some kind of

Re: Key Error: "city"

2017-09-09 Thread Ben Finney
V Vishwanathan writes: > alert = "Today's forecast for {city}: The temperature will range > from{low_temperature} "" to ""{high_temperature}{temperature_unit}Conditions > will be >