[issue33372] Wrong calculation

2018-04-26 Thread Tim Peters
Tim Peters added the comment: Please find a minimal example that illustrates the problem you think you've found, and paste the plain text _into_ the bug report. In the meantime, I'm closing this as "not a bug". The division operator applied to integers in Python 2 defaults

[issue33372] Wrong calculation

2018-04-26 Thread an0n.r00t32
New submission from an0n.r00t32 : I found that python calculate this wrong. Other calculators gave me 9997809307 not 9997809507 (python), even python3 calculated it correctly. Here is the computation expression which Python 2.7 calculated wrong.

[issue33363] async for statement is not a syntax error in sync context

2018-04-26 Thread Zsolt Dollenstein
Change by Zsolt Dollenstein : -- keywords: +patch pull_requests: +6312 stage: -> patch review ___ Python tracker ___

[issue33369] Removing Popen log files in threads is racy on Windows

2018-04-26 Thread Zachary Ware
Zachary Ware added the comment: You will get no support for Python 2.7.3 out of us (that patch release is over 6 years old! At least try 2.7.14, or wait a week for 2.7.15) and most of us have lost interest in 2.7 altogether, particularly on Windows. However, this

[issue33371] Clarify the predicate parameter of inspect.getmembers

2018-04-26 Thread Brian Curtin
Change by Brian Curtin : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue33371] Clarify the predicate parameter of inspect.getmembers

2018-04-26 Thread Brian Curtin
Change by Brian Curtin : -- keywords: +patch pull_requests: +6311 stage: needs patch -> patch review ___ Python tracker ___

[issue33371] Clarify the predicate parameter of inspect.getmembers

2018-04-26 Thread Brian Curtin
New submission from Brian Curtin : It would be helpful to clarify what the *predicate* callable will be called with. I had to look into the source in order to figure out what it was going to receive. -- assignee: brian.curtin components: Documentation messages:

[issue33370] Addition of mypy cache to gitignore

2018-04-26 Thread Ekin Dursun
Change by Ekin Dursun : -- keywords: +patch pull_requests: +6310 stage: -> patch review ___ Python tracker ___

[issue33370] Addition of mypy cache to gitignore

2018-04-26 Thread Ekin Dursun
New submission from Ekin Dursun : Since Python developers started to use mypy, I need we should add .mypy_cache directories to .gitignore. -- messages: 315823 nosy: onlined priority: normal severity: normal status: open title: Addition of mypy cache to gitignore

[issue33369] Removing Popen log files in threads is racy on Windows

2018-04-26 Thread Peter Boström
New submission from Peter Boström : OS: Windows 10, version 1607 (OS Build 14393.2189) Python --version: Python 2.7.3 Removing logfiles files just after Popen().wait() outside an open() block is racy on Windows. This seems to require multiple parallel workers to pull

[issue33000] IDLE Doc: Text consumes unlimited RAM, consoles likely not

2018-04-26 Thread Big Stone
Big Stone added the comment: done, sorry for the (now) missleading icon name. -- ___ Python tracker ___

[issue33354] Python2: test_ssl fails on non-ASCII path

2018-04-26 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +6309 stage: -> patch review ___ Python tracker ___

[issue33358] [EASY] x86 Ubuntu Shared 3.x: test_embed.test_pre_initialization_sys_options() fails

2018-04-26 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +6308 stage: needs patch -> patch review ___ Python tracker

[issue33326] Convert collections (cmp_op, hasconst, hasname and others) in opcode module to more optimal type

2018-04-26 Thread Kirill Balunov
Kirill Balunov added the comment: I apologize for FutureWarning and __getattr__. I myself do not understand what I meant and how it will help in this situation :) -- ___ Python tracker

[issue33274] minidom removeAttributeNode returns None

2018-04-26 Thread R. David Murray
R. David Murray added the comment: The rule in Python is that when a function mutates its argument it does *not* return a pointer to the object it just mutated, and likewise a method does *not* return a pointer to the parent object. Usually this means a mutating

[issue33326] Convert collections (cmp_op, hasconst, hasname and others) in opcode module to more optimal type

2018-04-26 Thread Kirill Balunov
Kirill Balunov added the comment: Small risk of breaking is a fair point (maybe some FutureWarning with new __getattr__ PEP 562?). I've checked several packages: --- vstinner/bytecode:: uses: @staticmethod def _has_jump(opcode): return (opcode in

[issue33326] Convert collections (cmp_op, hasconst, hasname and others) in opcode module to more optimal type

2018-04-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This list are short. I don't think there is a large benefit of this change. But there is a small risk of breaking a third party code (for example hasjrel+hasjabs). -- ___ Python

[issue33368] Inaccuracy in https://docs.python.org/3/library/re.html#re.match.end

2018-04-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It returns not the index of the last character of the substring, but the index of the end of the substring, i.e. the position past the last character of the substring. Try s[:sre.end()] and s[sre.end():]. s[sre.begin()] gives

[issue33326] Convert collections (cmp_op, hasconst, hasname and others) in opcode module to more optimal type

2018-04-26 Thread Kirill Balunov
Change by Kirill Balunov : -- nosy: +larry, serhiy.storchaka ___ Python tracker ___

[issue21822] KeyboardInterrupt during Thread.join hangs that Thread

2018-04-26 Thread Eryk Sun
Eryk Sun added the comment: For POSIX systems, try the following test function several times. For the bug to manifest, Thread._wait_for_tstate_lock has to be interrupted in between acquiring and releasing the sentinel lock. Maybe it could use a reentrant lock in order to

[issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful

2018-04-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Kirill and was going to propose this change in a separate issue. -- ___ Python tracker

[issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful

2018-04-26 Thread Kirill Balunov
Kirill Balunov added the comment: Sorry if this doesn't fit this issue and needs a separate one. Since Python switched to 2 byte wordcode, all opcodes which do not imply an argument, technically have it - augmented with 0. So it is convenient to iterate over

[issue21822] KeyboardInterrupt during Thread.join hangs that Thread

2018-04-26 Thread Paul Goins
Paul Goins added the comment: Not sure if I'll do the full fix (need to check w/ my employer), but I'm doing some investigation. Here's what I know so far: At the Python level, the KeyboardInterrupt is being raised within _wait_for_tstate_lock, on "elif

[issue33368] Inaccuracy in https://docs.python.org/3/library/re.html#re.match.end

2018-04-26 Thread C. Y. Hollander
New submission from C. Y. Hollander : The documentation states that match.end([group]) returns "the ind[ex] of the... end of the substring matched by group". In fact, it returns [said index] + 1, as demonstrated by the example below: s = 'example' sre = re.search('le', s)

[issue33000] IDLE Doc: Text consumes unlimited RAM, consoles likely not

2018-04-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: Big Stone: thank you for the clarification that IDLEX, and its patching of idlelib, is not involved. WinPython is an independent augmented distribution. Your suggestion about its IDLEX icon should be sent to its authors. --

[issue33361] readline() + seek() on io.EncodedFile breaks next readline()

2018-04-26 Thread Diego Argueta
Diego Argueta added the comment: Update: If I run your exact code it still breaks for me: ``` Got header: 'abc\n' Skipping the header. 'def\n' Line 2: 'ghi\n' Line 3: 'abc\n' Line 4: 'def\n' Line 5: 'ghi\n' ``` I'm running Python 2.7.14 and 3.6.5 on OSX 10.13.4.

[issue33361] readline() + seek() on io.EncodedFile breaks next readline()

2018-04-26 Thread Diego Argueta
Diego Argueta added the comment: That's because the stream isn't transcoding, since UTF-8 is ASCII-compatible. Try using something not ASCII-compatible as the codec e.g. 'ibm500' and it'll give incorrect results. ``` b =

[issue33338] [lib2to3] Synchronize token.py and tokenize.py with the standard library

2018-04-26 Thread Łukasz Langa
Łukasz Langa added the comment: I agree with you Serhiy, there's a number things I want to make faster. But first I'd like to merge implementations so there is a clear one-way diff ("this is what we updated in lib2to3 to make it consistent it Lib/tokenize.py"). Then I want

[issue33000] IDLE Doc: Text consumes unlimited RAM, consoles likely not

2018-04-26 Thread Big Stone
Big Stone added the comment: WinPython-64bit-3.6.4.0Qt5b4 doesn't in fact includes IDLEX: IDLEX is not compatible with Python-3.6+ The "IDLEX" icon of WinPython switches back to "normal" IDLE, when IDLEX is not detected. As WinPython-3.5 is being deprecated, the icon

[issue33341] python3 fails to build if directory or sysroot contains "*icc*" string

2018-04-26 Thread Gianfranco
Gianfranco added the comment: I signed the contributor agreement, even if such patches shouldn't need any kind of license -- ___ Python tracker

[issue33367] Multiprocessing Pool workers initiated with maxtasksperchild do not execute when sharing logging

2018-04-26 Thread Soumyadipta Das
New submission from Soumyadipta Das : When Multiprocessing Pool is initiated with maxtasksperchild and is sharing logging with the root process some workers do not execute. This is only on Python 2.7 and not on Python 3. Also bug is present only on linux and not

[issue33366] `contextvars` documentation incorrectly refers to "non-local state".

2018-04-26 Thread Yury Selivanov
Yury Selivanov added the comment: I like what you propose. Can you submit a PR? :) -- ___ Python tracker ___

[issue33358] [EASY] x86 Ubuntu Shared 3.x: test_embed.test_pre_initialization_sys_options() fails

2018-04-26 Thread Cheryl Sabella
Change by Cheryl Sabella : -- assignee: -> csabella nosy: +csabella stage: -> needs patch ___ Python tracker ___

[issue33338] [lib2to3] Synchronize token.py and tokenize.py with the standard library

2018-04-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It seems to me that regular expressions used in the lib2to3 version are more efficient but more complex. $ ./python -m timeit -s 'import re; p = re.compile(r"0[bB](?:_?[01])+"); s = "0b"+"_0101"*16' 'p.match(s)' 10 loops,

[issue32797] Tracebacks from Cython modules no longer work

2018-04-26 Thread Erik Bray
Erik Bray added the comment: +1, that seems obvious to me like better behavior. -- ___ Python tracker ___

[issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst

2018-04-26 Thread Andrés Delfino
Andrés Delfino added the comment: There's still an open PR to backport this to 3.6: https://github.com/python/cpython/pull/6602 -- ___ Python tracker

[issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst

2018-04-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 4533494ac553273239c809053b54c0ab783a0c78 by Serhiy Storchaka (Andrés Delfino) in branch '3.6': [3.6] bpo-33280: Reorganize external Tcl/Tk references. (GH-6473). (#6602)

[issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst

2018-04-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue33358] [EASY] x86 Ubuntu Shared 3.x: test_embed.test_pre_initialization_sys_options() fails

2018-04-26 Thread STINNER Victor
STINNER Victor added the comment: To reproduce the bug: ./configure --with-pydebug --enabled-shared make clean make LD_LIBRARY_PATH=$PWD ./python -m test -v test_embed -- ___ Python tracker

[issue33358] [EASY] x86 Ubuntu Shared 3.x: test_embed.test_pre_initialization_sys_options() fails

2018-04-26 Thread STINNER Victor
STINNER Victor added the comment: It seems like the failure comes from "env = dict(PYTHONPATH=os.pathsep.join(sys.path))" of Lib/test/test_embed.py. The code from test_pre_initialization_api() works properly. The fix seems easy. -- keywords: +easy title: x86

[issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst

2018-04-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 1c6c8510f91fcd9d46a8ce9155d8c2689d7df92b by Serhiy Storchaka (Andrés Delfino) in branch '2.7': [2.7] bpo-33280: Reorganize external Tcl/Tk references. (GH-6473). (GH-6607)

[issue20104] expose posix_spawn(p)

2018-04-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What about posix_spawnp()? The title mentions both functions, but I don't see any mentions about posix_spawnp() in the discussion. Its omission looks unintentional to me. -- ___

[issue31141] Start should be a keyword argument of the built-in sum

2018-04-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In 2.6 it was "sequence". -- ___ Python tracker ___

[issue31141] Start should be a keyword argument of the built-in sum

2018-04-26 Thread STINNER Victor
STINNER Victor added the comment: > I don't think it is worth to allow passing the first argument as a keyword > argument. I concur. Would you mind to add a test to make sure that passing the first argument as the "iterable" keyword doesn't work? "iterable" name comes

[issue33366] `contextvars` documentation incorrectly refers to "non-local state".

2018-04-26 Thread Tom Christie
New submission from Tom Christie : The `contextvars` documentation, at https://docs.python.org/3.7/library/contextvars.html starts with the following: "This module provides APIs to manage, store, and access non-local state." I assume that must be a documentation bug,

[issue31141] Start should be a keyword argument of the built-in sum

2018-04-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: First than to allow this argument be passes by keyword, we mast choose its name. See the discussion "Start argument for itertools.accumulate()" on Python-ideas

[issue33365] http/client.py does not print correct headers in debug

2018-04-26 Thread Marco Strigl
Change by Marco Strigl : -- pull_requests: +6307 stage: -> patch review ___ Python tracker ___

[issue31155] Encode set, frozenset, bytearray, and iterators as json arrays

2018-04-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: There is some virtue to the current design. Having a user explicitly cast to a list will avoid unintentional conversions. -- nosy: +rhettinger ___ Python tracker

[issue31141] Start should be a keyword argument of the built-in sum

2018-04-26 Thread Cheryl Sabella
Cheryl Sabella added the comment: Hi Mark, Are you able to make the Argument Clinic change the Serhiy suggested to come up with new benchmarks? Thanks! -- nosy: +csabella ___ Python tracker

[issue33361] readline() + seek() on io.EncodedFile breaks next readline()

2018-04-26 Thread Elena Oat
Elena Oat added the comment: I cannot replicate this when the stream is: In: stream_ex = io.BytesIO(u"abc\ndef\nghi\n".encode("utf-8")) In: f = codecs.EncodedFile(stream_ex, 'utf-8') In: run(f) Out: Got header: b'abc\n' Skipping the header: b'abc\n' Line 2: b'def\n' Line

[issue33365] http/client.py does not print correct headers in debug

2018-04-26 Thread Marco Strigl
New submission from Marco Strigl : Consider the following script: try: from urllib import request except ImportError: import urllib2 as request handler = request.HTTPSHandler(debuglevel=1) opener = request.build_opener(handler) f =

[issue9625] argparse: Problem with defaults for variable nargs when using choices

2018-04-26 Thread Freek Dijkstra
Change by Freek Dijkstra : -- nosy: +macfreek ___ Python tracker ___ ___ Python-bugs-list

[issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful

2018-04-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.8 -Python 3.7 ___ Python tracker ___

[issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful

2018-04-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In 3.7 the stack effect is calculated more accurately by the compiler. PR 6610 exposes this feature to users. It add jump parameter to dis.stack_effect() and to PyCompile_OpcodeStackEffect(). By default the maximal value is

[issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful

2018-04-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +6306 stage: -> patch review ___ Python tracker ___

[issue32790] Keep trailing zeros in precision for string format option g

2018-04-26 Thread Cheryl Sabella
Change by Cheryl Sabella : -- keywords: +easy stage: -> needs patch versions: +Python 3.8 ___ Python tracker ___

[issue22069] TextIOWrapper(newline="\n", line_buffering=True) mistakenly treat \r as a newline

2018-04-26 Thread Elena Oat
Change by Elena Oat : -- keywords: +patch pull_requests: +6305 stage: needs patch -> patch review ___ Python tracker ___

[issue22069] TextIOWrapper(newline="\n", line_buffering=True) mistakenly treat \r as a newline

2018-04-26 Thread Elena Oat
Elena Oat added the comment: Note that the correct link to the test case is: https://github.com/python/cpython/blob/master/Lib/test/test_io.py#L2565 -- nosy: +Elena.Oat ___ Python tracker

[issue33284] Increase test coverage for numbers.py

2018-04-26 Thread Barry Devlin
Barry Devlin added the comment: Hey, I updated my pull request based in your advice. Could you review it please? Best, Barry On Sat, 21 Apr 2018, 03:20 Terry J. Reedy, wrote: > > Terry J. Reedy added the comment: > >

[issue27227] argparse fails to parse [] when using choices and nargs='*'

2018-04-26 Thread Freek Dijkstra
Freek Dijkstra added the comment: I don't think that this issue27227 and issue9625 are the same (although they may have the same root cause, and I would be in favour of fixing both issues). At least, I think the unit test are distinct: This issue27227 is that argparse does

[issue31155] Encode set, frozenset, bytearray, and iterators as json arrays

2018-04-26 Thread Ori Avtalion
Ori Avtalion added the comment: If sets are to be supported, then so should dictionary views. Please also consider the range type. -- nosy: +salty-horse ___ Python tracker

[issue33364] Conditionals not evaluating propertly

2018-04-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In Python "True == False < 20" is evaluated as "True == False and False < 20". See https://docs.python.org/3/reference/expressions.html#comparisons -- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved

[issue33360] ALternative recipe for password using secrets

2018-04-26 Thread Juan Postlbauer
Juan Postlbauer added the comment: Just a clarification: by "infinite potential loop" I meant a loop that *theoretically* could last forever. Of course in practice it won't, but my experiments show that for the conditions in the example in average the current recipe

[issue33364] Conditionals not evaluating propertly

2018-04-26 Thread Juan Enrique Segebre Zaghmout
New submission from Juan Enrique Segebre Zaghmout : The following code generates False when it should generate true: True == False < 20 Either way the order of operation is taken should result in True but the answer still results in False. To further confirm this issue

[issue31455] ElementTree.XMLParser() mishandles exceptions

2018-04-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___