[issue28797] Modifying class __dict__ inside __set_name__

2016-11-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6b8f7d1e2ba4 by Serhiy Storchaka in branch '3.6': Issue #28797: Modifying the class __dict__ inside the __set_name__ method of https://hg.python.org/cpython/rev/6b8f7d1e2ba4 New changeset 18ed518d2eef by Serhiy Storchaka in branch 'default': Issue

[issue28821] generate_opcode_h.py crash when run with python2

2016-11-28 Thread Florin Papa
Florin Papa added the comment: Whenever I did a fresh clone, the Tools/scripts/generate_opcode_h.py would be called. Thank you for fixing this. -- ___ Python tracker

[issue28808] Make PyUnicode_CompareWithASCIIString() never failing

2016-11-28 Thread STINNER Victor
STINNER Victor added the comment: I reviewed PyUnicode_CompareWithASCIIString-no-errors.patch. -- ___ Python tracker ___

[issue28825] socket.SO_KEEPALIVE does not work on FreeBSD

2016-11-28 Thread Benjamin Peterson
Benjamin Peterson added the comment: Python just passes socket options to the operating system, so whatever behavior you're seeing is likely part of the OS. -- nosy: +benjamin.peterson resolution: -> not a bug status: open -> closed ___ Python

[issue28797] Modifying class __dict__ inside __set_name__

2016-11-28 Thread Nick Coghlan
Nick Coghlan added the comment: (Plus, as Martin noted, the tuple creation overhead could easily make the more complex patch slower in many cases) -- ___ Python tracker

[issue28797] Modifying class __dict__ inside __set_name__

2016-11-28 Thread Nick Coghlan
Nick Coghlan added the comment: I'd be OK with starting with the simpler patch, and only looking at the more complex one if the benchmark suite shows a significant slowdown (I'd be surprised if it did, as it should mainly impact start-up, and class dicts generally aren't that big) --

[issue28797] Modifying class __dict__ inside __set_name__

2016-11-28 Thread Martin Teichmann
Martin Teichmann added the comment: I personally prefer the first patch, which iterates over a copy of __dict__. Making a copy of a dict is actually a pretty fast operation, I would even expect that it is faster than the proposed alternative, creating tuples. Even if the second approach

Re: Asyncio -- delayed calculation

2016-11-28 Thread Marko Rauhamaa
Gregory Ewing : > All the terminology around async/await is inherently confusing and > counterintuitive, IMO. I'm disappointed that we've ended up here. I think the conceptual mess can be clarified over time. Coroutines are essentially threads. Why Python needs two

[issue28818] simplify lookdict functions

2016-11-28 Thread INADA Naoki
INADA Naoki added the comment: > Can you make the patch without the unnecessary variable name change from > "value_addr" to "pvalue". The former name is more communicative and is > self-describing. Done. I have changed the variable name to distinguish `PyObject**` with `PyObject***`. But

[issue28797] Modifying class __dict__ inside __set_name__

2016-11-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is much more complex patch that implements Nick's suggestion. -- Added file: http://bugs.python.org/file45681/set_name-filtered-copy.patch ___ Python tracker

Re: correct way to catch exception with Python 'with' statement

2016-11-28 Thread Ganesh Pal
Thanks Steve I got what you were trying to explain , nice learning from this conversation , what I was really doing wrong I had broken down my huge code into a simple program and had missed out returning False. On Tue, Nov 29, 2016 at 11:01 AM, Steven D'Aprano <

[issue28797] Modifying class __dict__ inside __set_name__

2016-11-28 Thread Nick Coghlan
Nick Coghlan added the comment: Ah, I'd missed that. In that case, I think my suggestion to change the name of the local variable is still valid, while the specific approach just needs a comment saying it's handled as a full namespace snapshot so the descriptor type name can be reported in

[issue28797] Modifying class __dict__ inside __set_name__

2016-11-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Have I missed something that would prevent that from working? Error message contains value->ob_type->tp_name. -- ___ Python tracker

[issue28797] Modifying class __dict__ inside __set_name__

2016-11-28 Thread Nick Coghlan
Nick Coghlan added the comment: I was thinking that the notification dict could consist of mappings from attribute names to already bound __set_name__ methods, so the double lookup would be avoided that way (but hadn't actually sent the review where I suggested that). That is, on the second

Re: Asyncio -- delayed calculation

2016-11-28 Thread Chris Angelico
On Tue, Nov 29, 2016 at 4:32 PM, Steven D'Aprano wrote: > On Tuesday 29 November 2016 14:21, Chris Angelico wrote: > >> On Tue, Nov 29, 2016 at 1:23 PM, Steve D'Aprano >> wrote: >>> This is confusing: why is this awaiting

Re: Asyncio -- delayed calculation

2016-11-28 Thread Chris Angelico
On Tue, Nov 29, 2016 at 4:13 PM, Paul Rubin wrote: > > I haven't gotten my head around Python asyncio and have been wanting > to read this: > >http://lucumr.pocoo.org/2016/10/30/i-dont-understand-asyncio/ It's talking a lot about how we got here, which isn't all

Re: Asyncio -- delayed calculation

2016-11-28 Thread Steven D'Aprano
On Tuesday 29 November 2016 14:21, Chris Angelico wrote: > On Tue, Nov 29, 2016 at 1:23 PM, Steve D'Aprano > wrote: >> This is confusing: why is this awaiting something inside an async function? >> Doesn't that mean that the await asyncio.gather(...) call is turned >>

Re: correct way to catch exception with Python 'with' statement

2016-11-28 Thread Steven D'Aprano
On Tuesday 29 November 2016 02:18, Ganesh Pal wrote: > On Mon, Nov 28, 2016 at 1:16 PM, Steven D'Aprano < > steve+comp.lang.pyt...@pearwood.info> wrote: > >> >> >> There is no need to return True. The function either succeeds, or it >> raises an >> exception, so there is no need to return any

[issue5225] OS X "Update Shell Profile" may not update $PATH if run more than once

2016-11-28 Thread Ned Deily
Changes by Ned Deily : -- resolution: out of date -> stage: -> needs patch status: closed -> open ___ Python tracker ___

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

2016-11-28 Thread Davin Potts
Davin Potts added the comment: I don't see any negative consequences for the helpers if the `force=True` is made in spawn.prepare's invocation of set_start_method(). In tracing backwards to figure out why this wasn't done already, it seems unchanged since sbt's patch in issue18999. This

Re: Asyncio -- delayed calculation

2016-11-28 Thread Paul Rubin
Chris Angelico writes: > Asynchronous I/O is something to get your head around I'd much > rather work with generator-based async functions... I haven't gotten my head around Python asyncio and have been wanting to read this:

Re: Asyncio -- delayed calculation

2016-11-28 Thread Nathan Ernst
To be fair, in other languages, such as C# or C++ with similar mechanisms, if you don't ask for the result from an async or future task, there's no guarantee the async task will be executed at all unless (or until) you ask for the result. C++'s futures even give an explicit flag indicating you

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

2016-11-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think we should discuss this on Python-Dev. -- ___ Python tracker ___

[issue27945] Various segfaults with dict

2016-11-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This issue is severe, but I don't consider it as release critical for 3.6.0. The patch fixes segfaults, but it can add unneeded overhead, and the dict performance is critical for Python core. The segfaults are not new. I'm trying to minimize the overhead of

[issue28797] Modifying class __dict__ inside __set_name__

2016-11-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I considered this option, but if save only descriptors with the __set_name__ attribute, this would need either double looking up the __set_name__ attribute or packing it in a tuple with a value. All this too cumbersome. I chose copying all dictionary as the

Re: Asyncio -- delayed calculation

2016-11-28 Thread Chris Angelico
On Tue, Nov 29, 2016 at 3:16 PM, Gregory Ewing wrote: > Chris Angelico wrote: >> >> "await" means "don't continue this function until that's done". It >> blocks the function until a non-blocking operation is done. > > > However, *not* using 'await' doesn't mean the

Re: Asyncio -- delayed calculation

2016-11-28 Thread Gregory Ewing
Chris Angelico wrote: "await" means "don't continue this function until that's done". It blocks the function until a non-blocking operation is done. However, *not* using 'await' doesn't mean the operation will be done without blocking. Rather, it won't be done at all (and is usually an error,

[issue27945] Various segfaults with dict

2016-11-28 Thread Ned Deily
Ned Deily added the comment: Where do we stand on this issue? At the moment, 3.6.0 is going to be released without these fixes. -- ___ Python tracker

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

2016-11-28 Thread Ned Deily
Ned Deily added the comment: Where do we stand on this issue? At the moment, 3.6.0 is on track to be released as is. -- nosy: +ned.deily ___ Python tracker

[issue28797] Modifying class __dict__ inside __set_name__

2016-11-28 Thread Nick Coghlan
Nick Coghlan added the comment: Rather than taking a snapshot of the whole class namespace, I think it will make more sense to make a new empty dictionary of descriptors to notify, and then split the current loop into two loops: - the first loop adds descriptors with __set_name__ attributes

[issue28773] typing.FrozenSet missing in documentation.

2016-11-28 Thread Ned Deily
Ned Deily added the comment: > Is that the right procedure still? Yes, thanks! -- stage: commit review -> resolved ___ Python tracker ___

[issue28790] Error when using Generic and __slots__

2016-11-28 Thread Ned Deily
Ned Deily added the comment: I don't have a good sense of the severity of this issue but it doesn't seem like it qualifies as release critical. On the other hand, the changes are isolated to typing and typing is more fluid than older, more established modules. If you think it should go in

Re: Asyncio -- delayed calculation

2016-11-28 Thread Zachary Ware
On Mon, Nov 28, 2016 at 6:48 AM, Steve D'Aprano wrote: > What am I doing wrong? Give yourself a bit more to debug with, since you're going to want to do something with the result your expensive calculation anyway: import asyncio class Counter: def __init__(self,

Re: Asyncio -- delayed calculation

2016-11-28 Thread Chris Angelico
On Tue, Nov 29, 2016 at 1:23 PM, Steve D'Aprano wrote: > This is confusing: why is this awaiting something inside an async function? > Doesn't that mean that the await asyncio.gather(...) call is turned > blocking? "await" means "don't continue this function until

[issue28797] Modifying class __dict__ inside __set_name__

2016-11-28 Thread Ned Deily
Ned Deily added the comment: Nick, as the original shepherd of PEP 487 (Issue27366), can you review Serhiy's proposed patch for 3.6.0rc1? Thanks! -- nosy: +ncoghlan ___ Python tracker

[issue28822] Fix indices handling in PyUnicode_FindChar

2016-11-28 Thread Xiang Zhang
Xiang Zhang added the comment: Other APIs like PyUnicode_Find and PyUnicode_Count support it. Their docs are almost the same so I think PyUnicode_FindChar does not need to be the special one. After change, its behaviour and implementation are more consistent with other APIs. --

[issue28828] Connection reset by peer error when installing python packages

2016-11-28 Thread Emanuel Barry
Emanuel Barry added the comment: Decorater: For very large projects, the switch from Python 2 to 3 is a non-trivial task that can take up years of work, and there are many reasons why one cannot switch. On the issue, however, for all PyPi-related issues, please go to the PyPa GitHub:

[issue15533] subprocess.Popen(cwd) documentation

2016-11-28 Thread Ned Deily
Changes by Ned Deily : -- nosy: +paul.moore, steve.dower, tim.golden, zach.ware versions: -Python 3.4 ___ Python tracker ___

[issue28782] SEGFAULT when running a given coroutine

2016-11-28 Thread Ned Deily
Ned Deily added the comment: (Victor also merged this into default branch for 3.7.0 in 6453ff3328b8) -- priority: release blocker -> stage: commit review -> resolved ___ Python tracker

[issue28828] Connection reset by peer error when installing python packages

2016-11-28 Thread Decorater
Decorater added the comment: Also why python 2.7? Python 2.7 does not include asyncio which is absolutely awesome to use. It can allow doing multiple different things at the same time. So, it is and will be a good thing to upgrade. Note: a lot of things since 2.7 and 3.x was removed (some

[issue28808] Make PyUnicode_CompareWithASCIIString() never failing

2016-11-28 Thread Ned Deily
Ned Deily added the comment: I'd like @haypo to review and approve this change as well since he was involved in the predecessor (Issue28701). Victor? -- ___ Python tracker

[issue28808] Make PyUnicode_CompareWithASCIIString() never failing

2016-11-28 Thread Ned Deily
Changes by Ned Deily : -- nosy: +larry priority: normal -> release blocker ___ Python tracker ___

[issue28828] Connection reset by peer error when installing python packages

2016-11-28 Thread Decorater
Decorater added the comment: Try using the new pypi instead: https://pypi.org/ locate the package then override pip to look for that package with the direct link to find the package with a command line arg of : -f ex: pip3 install -f [direct url to pypi page to package in question here]

Re: Asyncio -- delayed calculation

2016-11-28 Thread Zentrader
Take a look at Doug Hellmann's example using multiprocessing at https://pymotw.com/2/multiprocessing/basics.html You should be able to substitute the count down example directly into the first example. -- https://mail.python.org/mailman/listinfo/python-list

Re: Asyncio -- delayed calculation

2016-11-28 Thread Steve D'Aprano
On Tue, 29 Nov 2016 12:03 am, Chris Angelico wrote: > On Mon, Nov 28, 2016 at 11:48 PM, Steve D'Aprano > wrote: >> When I try running that, I get no output. No error, no exception, the >> run_until_complete simply returns instantly. > > When I do, I get this warning:

[issue28828] Connection reset by peer error when installing python packages

2016-11-28 Thread Rohit Khairnar
New submission from Rohit Khairnar: We are seeing intermittent "connection reset by peer" connecting to pypi.python.org. Pip install "connection reset by peer" I am a Network Engineer at Hulu and our Devs are seeing error 104 connection resets by peer errors. We thought it was a firewall

[issue14845] list() != []

2016-11-28 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: rhettinger -> ___ Python tracker ___

[issue17038] multiprocessing only use one core when C module are imported

2016-11-28 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Ended up here by accident. For whoever bumps into this same issue, psutil allows to get an set CPU affinity, so you can avoid using taskset. >>> import psutil >>> psutil.cpu_count() 4 >>> p = psutil.Process() >>> p.cpu_affinity() # get [0, 1, 2, 3] >>>

[issue28827] f-strings: format spec should not accept unicode escapes

2016-11-28 Thread Eric V. Smith
Eric V. Smith added the comment: Specifically, see: https://www.python.org/dev/peps/pep-0498/#format-specifiers str.format() also works this way: >>> '{0:02{1}}'.format(10, an_x) '0A' -- ___ Python tracker

[issue28827] f-strings: format spec should not accept unicode escapes

2016-11-28 Thread Decorater
Decorater added the comment: there is also the most common. '{10:02{0}}'.format(an_x) -- nosy: +Decorater ___ Python tracker ___

[issue28827] f-strings: format spec should not accept unicode escapes

2016-11-28 Thread Eric V. Smith
Eric V. Smith added the comment: I think this is documented. This is a result of supported nested expressions in the format_spec: >>> an_x = "X" >>> f'{10:02{an_x}}' '0A' -- ___ Python tracker

[issue28827] f-strings: format spec should not accept unicode escapes

2016-11-28 Thread Martin Panter
Martin Panter added the comment: I don’t have Py 3.6 to test on, but won’t that make it unnecessarily inconvenient to use certain format codes? I.e. codes that involve non-ASCII characters, control codes, quote signs, or backslashes. Slightly silly use case: >>> "The time is {:%I\N{DEGREE

Re: Asyncio -- delayed calculation

2016-11-28 Thread Chris Angelico
On Tue, Nov 29, 2016 at 11:20 AM, Steve D'Aprano wrote: > On Tue, 29 Nov 2016 02:53 am, Ian Kelly wrote: > >> In order for the coroutines to actually do anything, you need to >> schedule them in some way with the event loop. That could take the >> form of awaiting them

[issue28754] Argument Clinic for bisect.bisect_left

2016-11-28 Thread Martin Panter
Martin Panter added the comment: Regarding the problem with the default value, can we use “unspecified”, as documented at , or is that an old relic that no longer exists (hinted at the end of Issue 20293)? Failing

Re: The Case Against Python 3

2016-11-28 Thread Chris Angelico
On Tue, Nov 29, 2016 at 10:54 AM, Steve D'Aprano wrote: > Now you're just being silly, this isn't "anything", it is a specific design > decision: something which looks like, and is treated by the tokeniser, as a > string but is actually a hidden call to eval. > This,

[issue28827] f-strings: format spec should not accept unicode escapes

2016-11-28 Thread Yury Selivanov
Yury Selivanov added the comment: Also this inconsistency: we already don't accept escaped letters after `!`: >>> f'{min!\N{LATIN SMALL LETTER R}}' File "", line 1 SyntaxError: f-string: invalid conversion character: expected 's', 'r', or 'a' --

[issue28816] Document if zipimport can respect import hooks to load custom files from zip.

2016-11-28 Thread Decorater
Changes by Decorater : -- nosy: +brett.cannon, eric.snow, ncoghlan ___ Python tracker ___

[issue28827] f-strings: format spec should not accept unicode escapes

2016-11-28 Thread Yury Selivanov
New submission from Yury Selivanov: Right now, Python 3.6b4 happily accepts the following: >>> f'{10:02\N{LATIN CAPITAL LETTER X}}' '0A' >>> f'{10:02X}' '0A' I think that the first line should not be accepted (as we now don't accept escaped open curly brace). At least this

[issue27632] build on AIX fails when builddir != srcdir, more than bad path to ld_so_aix

2016-11-28 Thread Eric N. Vander Weele
Changes by Eric N. Vander Weele : -- nosy: +ericvw ___ Python tracker ___ ___

Re: Asyncio -- delayed calculation

2016-11-28 Thread Steve D'Aprano
On Tue, 29 Nov 2016 02:53 am, Ian Kelly wrote: > In order for the coroutines to actually do anything, you need to > schedule them in some way with the event loop. That could take the > form of awaiting them from some other coroutine, or passing them > directly to loop.run_until_complete or

[issue18235] _sysconfigdata.py wrong on AIX installations

2016-11-28 Thread Eric N. Vander Weele
Changes by Eric N. Vander Weele : -- nosy: +ericvw ___ Python tracker ___ ___

Re: The Case Against Python 3

2016-11-28 Thread Steve D'Aprano
On Tue, 29 Nov 2016 09:35 am, Gregory Ewing wrote: > Steve D'Aprano wrote: >> I daresay you are right that a sufficiently clever adversary may have >> found an exploit. But there's no sign that anyone actually did find an >> exploit, until f-strings made exploiting this trivial. > > The person

[issue19159] 2to3 incorrectly converts two parameter unicode() constructor to str()

2016-11-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- status: open -> pending ___ Python tracker ___

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

2016-11-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- status: open -> pending ___ Python tracker ___

[issue28820] Typo in section 6 of the Python 3.4 documentation

2016-11-28 Thread Martin Panter
Martin Panter added the comment: Thanks, this looks good to me, although let’s not touch the blank line at the end of the file. -- nosy: +martin.panter stage: -> commit review versions: +Python 2.7, Python 3.5, Python 3.6, Python 3.7 -Python 3.4

Re: The Case Against Python 3

2016-11-28 Thread Paul Rubin
Gregory Ewing writes: > I agree that f-strings are not to blame here. If we really want to > avoid breaking anyone's ill-conceived attempts at sandboxing eval, > we'd better not add anything more to the language, ever, because > nobody can foresee all the possible

[issue28826] Programming with Python 3.6

2016-11-28 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Maybe you can post your code snippet and the error? -- nosy: +Mariatta ___ Python tracker ___

Re: The Case Against Python 3

2016-11-28 Thread Gregory Ewing
Steve D'Aprano wrote: I daresay you are right that a sufficiently clever adversary may have found an exploit. But there's no sign that anyone actually did find an exploit, until f-strings made exploiting this trivial. The person who wrote the bug report found at least one way of exploiting it

[issue28826] Programming with Python 3.6

2016-11-28 Thread Allen David Frankel
New submission from Allen David Frankel: On the Python Tutorial for beginners, the Python 3.6 gives me a syntax error with strings and does not respond to print and/or nothing comes up. -- components: Demos and Tools messages: 281921 nosy: ADFGUR priority: normal severity: normal

[issue28791] update sqlite to 3.15.2

2016-11-28 Thread Big Stone
Big Stone added the comment: too late for sqlite-0.15.2 in Python-3.6.0rc ? -- ___ Python tracker ___ ___

[issue14845] list() != []

2016-11-28 Thread Wolfgang Maier
Wolfgang Maier added the comment: Isn't the difference between generator expressions and comprehensions what's dealt with by PEP479? So it seems this issue is outdated enough to deserve being closed? -- nosy: +wolma ___ Python tracker

[issue28818] simplify lookdict functions

2016-11-28 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker ___ ___

[issue28824] os.environ should preserve the case of the OS keys ?

2016-11-28 Thread Steve Dower
Steve Dower added the comment: Ah, I see what you mean. In this case, we could change how the case-insensitivity is handled here, but it would only be applicable to 3.7. I'm not opposed to changing the default behavior here, but it does kind of bring up the mapping dict discussion again. If

[issue28816] Document if zipimport can respect import hooks to load custom files from zip.

2016-11-28 Thread Decorater
Changes by Decorater : -- nosy: +twouters ___ Python tracker ___ ___ Python-bugs-list

[issue28816] Document if zipimport can respect import hooks to load custom files from zip.

2016-11-28 Thread Decorater
Changes by Decorater : -- nosy: -brett.cannon, eric.snow, ncoghlan, paul.moore, tim.golden, twouters, zach.ware ___ Python tracker

[issue24469] Py2.x int free list can grow without bounds

2016-11-28 Thread Guido van Rossum
Guido van Rossum added the comment: OK, SGTM. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue24469] Py2.x int free list can grow without bounds

2016-11-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It seems to me, that all builtin and extension types set tp_free to PyObject_Del, PyObject_GC_Del, or 0. The int class is the only exception. int_free() was introduced in 200559fcc664: > Make sure that tp_free frees the int the same way as tp_dealloc would.

[issue28824] os.environ should preserve the case of the OS keys ?

2016-11-28 Thread tzickel
tzickel added the comment: Steve, I've checked in Python 3.5.2, and os.environ.keys() still uppercases everything when scanning (for my use case). Has it changed since then ? -- ___ Python tracker

[issue28824] os.environ should preserve the case of the OS keys ?

2016-11-28 Thread Eryk Sun
Eryk Sun added the comment: I've come across a few problems when passing a modified os.environ.copy() to a child process via subprocess.Popen. Ideally it shouldn't be an issue, as long as the OS or C runtime functions are used, but some troublesome programs do their own case-sensitive search

Re: ANN: JavaScrypthon 0.5, now with embedded evaluation of transpiled code

2016-11-28 Thread Eric S. Johansson
On 11/28/2016 2:02 PM, Amirouche Boubekki wrote: > Also, FWIW users are looking for a Javascript replacement that is real > Python, not another coffeescript. does this count? http://brython.info/ -- https://mail.python.org/mailman/listinfo/python-list

[issue28825] socket.SO_KEEPALIVE does not work on FreeBSD

2016-11-28 Thread Victor Porton
Victor Porton added the comment: Weird, after I minimized the PHP example, it also has the same bug as the Python one. (The real long code in PHP was working without this bug.) I attach the PHP code for your reference. Maybe it is a FreeBSD bug? Please write to por...@narod.ru with advice

[issue28824] os.environ should preserve the case of the OS keys ?

2016-11-28 Thread tzickel
tzickel added the comment: My issue is that somebody wants to pass a few dict like environment variables as some prefix_key=value but he wants to preserve the case of the key for usage in python so the .keys() space needs to be enumerated. A workaround for this issue can be importing nt and

[issue28825] socket.SO_KEEPALIVE does not work on FreeBSD

2016-11-28 Thread Victor Porton
New submission from Victor Porton: When I connect telnet XXX 9000 to the server in attached file, the connection breaks after 5 min (and a few seconds), as if SO_KEEPALIVE were not specified. I run my server on FreeBSD 9.2-RELEASE-p15 (GENERIC) So SO_KEEPALIVE does not work in Python 2.7

[issue28824] os.environ should preserve the case of the OS keys ?

2016-11-28 Thread Steve Dower
Steve Dower added the comment: This works fine in Python 3, and also Python 2.7 *unless* you call .keys(). PS D:\> py -2.7 Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>>

[issue28824] os.environ should preserve the case of the OS keys ?

2016-11-28 Thread R. David Murray
R. David Murray added the comment: That unfortunately would probably break existing code. It does seem reasonable that case should be ignored on get, though, if the OS does so. So making your 'in' statement work might be acceptable, backward compatibility wise. Probably only in 3.7,

Re: ANN: JavaScrypthon 0.5, now with embedded evaluation of transpiled code

2016-11-28 Thread Amirouche Boubekki
On Sat, Nov 26, 2016 at 7:21 PM Alberto Berti < azazel+python-annou...@arstecnica.it> wrote: > Hi all, > Héllo! > i'm pleased to announce that JavaScripthon 0.5 has been released to > PyPI. JavaScrypthon can translate a subset of Python 3.5 code to ES6 > JavaScript producing beautiful and

[issue28823] Simplify compiling to BUILD_MAP_UNPACK

2016-11-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Yury. Simplifying the code was the main purpose. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue28823] Simplify compiling to BUILD_MAP_UNPACK

2016-11-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9ded2433dc2c by Serhiy Storchaka in branch 'default': Issue #28823: Simplified compiling with opcode BUILD_MAP_UNPACK. https://hg.python.org/cpython/rev/9ded2433dc2c -- nosy: +python-dev ___ Python

[issue28824] os.environ should preserve the case of the OS keys ?

2016-11-28 Thread tzickel
New submission from tzickel: In Windows, python's os.environ currently handles the case sensitivity different that the OS. While it's true that the OS is case insensitive, it does preserve the case that you first set it as. For example: C:\Users\user>set aSD=Blah C:\Users\user>set asd

[issue28288] Expose environment variable for Py_Py3kWarningFlag

2016-11-28 Thread Berker Peksag
Berker Peksag added the comment: I can commit the patch this week if there are no objections to the name of the variable. I like Brett's PY3KWARNINGS suggestion, but I'm fine with either of the suggested names. -- ___ Python tracker

[issue28288] Expose environment variable for Py_Py3kWarningFlag

2016-11-28 Thread Brett Cannon
Brett Cannon added the comment: Benjamin just announced 2.7.13rc1 is going to be Dec 3, so this patch needs to land before then if it's going to make it in the next release. -- ___ Python tracker

correct way to catch exception with Python 'with' statement

2016-11-28 Thread g thakuri
Dear Python friends, Any suggestion on how to add exception and make the below program look better , I am using Python 2.7 and Linux def create_files_append(): """ """ try:

[issue28288] Expose environment variable for Py_Py3kWarningFlag

2016-11-28 Thread Brett Cannon
Brett Cannon added the comment: I agree with Roy: while PYTHON_OPT might be nice long-term, I think that scopes it beyond a py3k change in Python 2.7 and into new feature territory. As for a better name, PY3KWARNINGS is also possible and minimizes typo issues if that's what people are worried

[issue28781] On Installation of 3.5 Python get error message

2016-11-28 Thread Steve Dower
Steve Dower added the comment: Looking at those logs, it seems like we think the per-user packages are already installed. When you go to do an all-users install, it "removes" the per-user packages, but passes in the same options as it does for the all user packages. Under the hood, these

Re: correct way to catch exception with Python 'with' statement

2016-11-28 Thread Thomas 'PointedEars' Lahn
Ganesh Pal wrote: > I am using Python 2.7 and Linux As a rule of thumb¹, use at least Python 3.3 for new programs. > What will be the best way to catch the exception in the above program ? > Can we replace both the with statement in the above program with > something like below > > try: >

[issue28754] Argument Clinic for bisect.bisect_left

2016-11-28 Thread STINNER Victor
STINNER Victor added the comment: Ah right, _bisect.bisect_right() support keywords. I expected that it doesn't support keywords yet ;-) -- ___ Python tracker

[issue28288] Expose environment variable for Py_Py3kWarningFlag

2016-11-28 Thread Roy Williams
Roy Williams added the comment: > What about PYTHON_OPT and allowing to pass any options via an environment > > > variable? There is a number of precedences (gzip, less, etc). > >export PYTHON_OPT="-t -b -3" I'd be open to this, but it seems like a much wider change than something that

[issue28799] Drop CALL_PROFILE special build?

2016-11-28 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue28754] Argument Clinic for bisect.bisect_left

2016-11-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Sorry, I didn't follow the discussion, but why not using "/" magic separator > in Argument Clinic to mark arguments as optional but don't document their > default value? '/' marks positional-only arguments, not optional arguments. --

[issue28288] Expose environment variable for Py_Py3kWarningFlag

2016-11-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What about PYTHON_OPT and allowing to pass any options via an environment variable? There is a number of precedences (gzip, less, etc). export PYTHON_OPT="-t -b -3" Or PYTHON3COMP[ATIBILITY]? -- ___ Python

  1   2   >