[issue30671] dict: improve lookup function

2017-06-18 Thread Tim Peters
Tim Peters added the comment: Dmitry, I suggest you spend more of the time you give to thinking to writing code instead ;-) But, really, that's the easiest & surest way to discover for yourself where your analysis is going off in the weeds. For example, issue 28201 was both simpler and worse

[issue29304] dict: simplify lookup functions

2017-06-18 Thread INADA Naoki
INADA Naoki added the comment: pr-2237 only changes lookdict_index() function. The function is used from only dict_popitem(). So it's not performance critical part. And microbench doesn't show significant performance changes: $ ./python.default -m perf timeit -q -l 2000 -s

[issue29304] dict: simplify lookup function

2017-06-18 Thread INADA Naoki
Changes by INADA Naoki : -- pull_requests: +2323 ___ Python tracker ___ ___

[issue30700] fileinput inplace clobbers file without leaving backup on decode errors

2017-06-18 Thread switchnode
New submission from switchnode: Consider the script: $ cat nop.py #!/usr/bin/env python import fileinput srt = fileinput.input(inplace=True) print(srt.readline(), end='') for line in srt: print(line, end='') Called on text files, it will do nothing. $ ls -alh test.* -rw-r--r-- 1 501

[issue29887] test_normalization doesn't work

2017-06-18 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +2321 ___ Python tracker ___ ___

[issue29887] test_normalization doesn't work

2017-06-18 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +2322 ___ Python tracker ___ ___

[issue13601] sys.stderr should be line-buffered when stderr is not a TTY

2017-06-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue28647 and issue30404. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue30671] dict: improve lookup function

2017-06-18 Thread Dmitry Rubanovich
Dmitry Rubanovich added the comment: A few notes on my motivation and other comments I made(not necessarily in the order of significance): 1. I started looking at this because of the fix in Issue28201. It effectively improves on the difference between

[issue30604] co_extra_freefuncs is stored thread locally and can lead to crashes

2017-06-18 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: I'm setting the stage to 'backport needed', but it really is a 'porting needed' stage :) The two PRs merged PRs here were made against 3.6. -- nosy: +Mariatta stage: patch review -> backport needed ___ Python

[issue29366] os.listdir has inconsistent behavior when run on a non-directory

2017-06-18 Thread Eryk Sun
Eryk Sun added the comment: Yes, I think this issue should be closed. But for the record I'd like to note a not uncommon case in which listdir() raise FileNotFoundError on Windows. According to MS-FSA [1], if a request to open a directory resolves to a file, the operation should fail with

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-18 Thread STINNER Victor
STINNER Victor added the comment: Nice. Do you know my https://pypi.python.org/pypi/pyfailmalloc project? It helped me to identify and fix dozens of code which didn't handle properly memory allocation failures. Seach for "pyfailmalloc" in the bug tracker (closed issues) ;-) --

[issue29970] Severe open file leakage running asyncio SSL server

2017-06-18 Thread Nikolay Kim
Nikolay Kim added the comment: I see. this is server specific problem. as a temp solution I'd use proxy for ssl termination. -- ___ Python tracker ___

[issue29970] Severe open file leakage running asyncio SSL server

2017-06-18 Thread kyuupichan
kyuupichan added the comment: @Nikolay Kim As I note in the original submission, 480 was tested and does NOT solve this issue. Thanks. -- ___ Python tracker

[issue30699] Misleading class names in datetime.tzinfo usage examples

2017-06-18 Thread Robert Tasarz
New submission from Robert Tasarz: https://docs.python.org/3/library/datetime.html#datetime-objects gives in an example two classes named GMT1 and GMT2 subclassing tzinfo, defined with dst(…) methods returning one hour timedelta for summer periods. This is in conflict with naming, as GMT

[issue30698] asyncio sslproto do not shutdown ssl layer cleanly

2017-06-18 Thread Grzegorz Grzywacz
Changes by Grzegorz Grzywacz : -- pull_requests: +2320 ___ Python tracker ___ ___

[issue24465] Make shutil.make_archive have deterministic sorting

2017-06-18 Thread Martin Panter
Changes by Martin Panter : -- dependencies: +tarfile add uses random order title: Make tarfile have deterministic sorting -> Make shutil.make_archive have deterministic sorting ___ Python tracker

[issue30698] asyncio sslproto do not shutdown ssl layer cleanly

2017-06-18 Thread Grzegorz Grzywacz
New submission from Grzegorz Grzywacz: Asyncio on shutdown do not send shutdown confirmation to the other side. _SSLPipe after doing unwrap is calling shutdown callback where transportis closed and quit ssldata wont be sent. -- components: asyncio messages: 296295 nosy:

[issue29970] Severe open file leakage running asyncio SSL server

2017-06-18 Thread Nikolay Kim
Nikolay Kim added the comment: question is, should asyncio handle timeouts or leave it to caller? https://github.com/python/cpython/pull/480 fixes leak during handshake. -- nosy: +fafhrd91 ___ Python tracker

[issue29406] asyncio SSL contexts leak sockets after calling close with certain Apache servers

2017-06-18 Thread Nikolay Kim
Changes by Nikolay Kim : -- pull_requests: +2319 ___ Python tracker ___ ___

[issue30609] Python 3.6.1 fails to generate 256 colors on Cygwin based 64-bit Windows 10

2017-06-18 Thread Richard S. Gordon
Richard S. Gordon added the comment: FYI: Here is an update to my subsequent bug report to the Cygwin project team. You might find my answers to their questions useful in the future. > Begin forwarded message: > > From: "Richard S. Gordon" > >

[issue27321] Email parser creates a message object that can't be flattened

2017-06-18 Thread Johannes Löthberg
Johannes Löthberg added the comment: Ping? -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue22028] Python 3.4.1 Installer ended prematurely (Windows msi)

2017-06-18 Thread Tim Golden
Tim Golden added the comment: [Housekeeping] Closing this as fixed. The mimetypes fix is in; the 3.4 installer is well out of support. If any other issues arise on current installers they should be raised as new issues. -- resolution: -> fixed stage: -> resolved status: open ->

[issue8631] subprocess.Popen.communicate(...) hangs on Windows

2017-06-18 Thread Tim Golden
Tim Golden added the comment: I can't reproduce either on 2.7 or on 3.5 with any of the examples shown. Closing again as not-a-bug. -- resolution: -> not a bug status: open -> closed versions: -Python 2.7, Python 3.4 ___ Python tracker

[issue29739] zipfile raises wrong exception for some incorrect passwords

2017-06-18 Thread Jack Cushman
Jack Cushman added the comment: Agreed that no one should be using zip encryption. :) I hit this issue working on an academic exercise. I'm fine with closing this. (I do think the exception types in zipfile set up a trap for the programmer here: Python throws a different exception type 1/256

[issue30671] dict: improve lookup function

2017-06-18 Thread Tim Peters
Tim Peters added the comment: I don't see a reason to keep this open, but I haven't been able to follow the OP's line of argument. My best _guess_ is that they're chasing illusions based on not understanding (or grossly undervaluing) that the primary point of the perturb logic is to

[issue29430] zipfile: invalid link

2017-06-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The link already is fixed. -- resolution: -> out of date stage: needs patch -> resolved status: open -> closed ___ Python tracker

[issue30360] getpass.getpass() does not accept stdin from an Expect script

2017-06-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: As suggested, and with no further response, closing. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue29366] os.listdir has inconsistent behavior when run on a non-directory

2017-06-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: Eryk, does your last comment suggest that we close this? -- ___ Python tracker ___

[issue25918] AssertionError in lib2to3 on 2.7.11 Windows

2017-06-18 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- resolution: -> not a bug stage: -> resolved ___ Python tracker ___

[issue25303] Add option to py_compile to compile for syntax checking without writing bytecode

2017-06-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: Closing, as suggested above. -- resolution: -> out of date stage: needs patch -> resolved status: open -> closed ___ Python tracker

[issue20663] Introduce exception argument to iter

2017-06-18 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- resolution: -> rejected stage: needs patch -> resolved status: open -> closed ___ Python tracker ___

[issue19956] inspect.getsource(obj.foo) fails when foo is an injected method constructed from another method

2017-06-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: Any review of the revised patch? -- ___ Python tracker ___ ___

[issue18967] Find a less conflict prone approach to Misc/NEWS

2017-06-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: Has this been superseded by core_workflow issues? -- ___ Python tracker ___

[issue17773] test_pydoc fails with the installed testsuite (2.7)

2017-06-18 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- resolution: -> out of date stage: needs patch -> resolved status: open -> closed ___ Python tracker ___

[issue13601] sys.stderr should be line-buffered when stderr is not a TTY

2017-06-18 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: -terry.reedy ___ Python tracker ___ ___

[issue12420] distutils tests fail if PATH is not defined

2017-06-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: test_distutils now passes on 3.6, so this is out-of-date for 3.x. On installed 2.7.13 (released Dec 2016) ERROR: test_get_outputs (distutils.tests.test_build_ext.BuildExtTestCase) FAIL: test_customize_compiler_before_get_config_vars

[issue6171] IDLE - TreeWidget draw and double-click (Ubuntu)

2017-06-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: (In 3.6, TreeWidget.py became tree.py.) Even though IDLE trees now appear to work correctly, including on Ubuntu, I am concerned about possible memory leaks, which are usually detected by repeatedly running a module's test file. Test_tree does not leak now,

[issue30693] tarfile add uses random order

2017-06-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The patch for similar issue with the glob module was rejected recently since it is easy to sort the result of glob.glob() (see issue30461). This issue looks similar, but there are differences. On one side, the command line tar utility doesn't have the

[issue30645] imp.py: load_package() appends to its own loop variable

2017-06-18 Thread Alexandru Ardelean
Alexandru Ardelean added the comment: Admittedly, that PR refers to `imp.load_module()` But, `imp.load_modules()` also calls `imp.load_package()` -- ___ Python tracker

[issue30645] imp.py: load_package() appends to its own loop variable

2017-06-18 Thread Alexandru Ardelean
Alexandru Ardelean added the comment: FWIW, I took a look over the virtualenv repo. There's an issue raised there https://github.com/pypa/virtualenv/issues/955 And a PR to address it https://github.com/pypa/virtualenv/pull/947 Though, it seems like they still want to keep `imp.load_package()`

[issue29616] input() after restarting causes bug

2017-06-18 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- resolution: -> works for me stage: -> resolved status: pending -> closed ___ Python tracker ___

[issue30645] imp.py: load_package() appends to its own loop variable

2017-06-18 Thread Alexandru Ardelean
Changes by Alexandru Ardelean : -- pull_requests: +2318 ___ Python tracker ___ ___

[issue30657] Unsafe arithmetic in PyString_DecodeEscape

2017-06-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue30657] Unsafe arithmetic in PyString_DecodeEscape

2017-06-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset c3c9db89273fabc62ea1b48389d9a3000c1c03ae by Serhiy Storchaka (Jay Bosamiya) in branch '2.7': [2.7] bpo-30657: Check & prevent integer overflow in PyString_DecodeEscape (#2174)

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think the allocators must just return NULL, without setting the error. -- nosy: +serhiy.storchaka ___ Python tracker

[issue29755] python3 gettext.lgettext sometimes returns bytes, not string

2017-06-18 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I agree with everything @serhiy.storchaka said, including the questionable utility of the l* methods in Python 3. ;) Thanks also for updating the documentation. Reading the existing docs over now, it's shocking how imprecise "the translation is returned in

[issue30697] segfault in PyErr_NormalizeException() after memory exhaustion

2017-06-18 Thread Xavier de Gaye
Xavier de Gaye added the comment: Problem b) is IMO a clear demonstration that using tstate->recursion_depth and the PyExc_RecursionErrorInst singleton is not the correct way to control the recursive calls to PyErr_NormalizeException() since the problem here is memory exhaustion, not

[issue29657] os.symlink: FileExistsError shows wrong message

2017-06-18 Thread Larry Hastings
Larry Hastings added the comment: "Special cases aren't special enough to break the rules." I want the error message to mirror the API, which it currently does. If we swapped them, the error message would now contradict the API. So no, I don't support swapping "src" and "dst" in the error

[issue30697] segfault in PyErr_NormalizeException() after memory exhaustion

2017-06-18 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- versions: +Python 3.5, Python 3.6 ___ Python tracker ___

[issue30696] infinite loop in PyRun_InteractiveLoopFlags()

2017-06-18 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- versions: +Python 3.5, Python 3.6 ___ Python tracker ___

[issue30697] segfault in PyErr_NormalizeException() after memory exhaustion

2017-06-18 Thread Xavier de Gaye
New submission from Xavier de Gaye: Nosying reviewers of PR 1981 of issue 22898. The memerr.py script segfaults with the following gdb backtrace: #0 0x00550268 in PyErr_NormalizeException (exc=exc@entry=0x7fffdee8, val=val@entry=0x7fffdef0, tb=tb@entry=0x7fffdef8) at

[issue20823] Clarify copyreg.pickle() documentation

2017-06-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you update your patch Peter, and since CPython development is moved to GitHub, create a pull request? -- ___ Python tracker

[issue12680] cPickle.loads is not thread safe due to non-thread-safe imports

2017-06-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> not a bug status: open -> pending ___ Python tracker ___

[issue29616] input() after restarting causes bug

2017-06-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- status: open -> pending ___ Python tracker ___

[issue29657] os.symlink: FileExistsError shows wrong message

2017-06-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See issue20517 for the discussion about current implementation. Are there any ideas about clearer error messages? Added Larry as the author of the original idea and implementation. -- nosy: +larry ___ Python

[issue16055] incorrect error text for int(base=1000, x='1')

2017-06-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- keywords: +easy (C) stage: test needed -> needs patch type: behavior -> enhancement versions: +Python 3.7 -Python 2.7, Python 3.3, Python 3.4 ___ Python tracker

[issue29739] zipfile raises wrong exception for some incorrect passwords

2017-06-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Actually this feature helps to do the brute-force attack. 255 of 256 passwords can be rejected by testing only the header. Old ZIP files encryption is very weak, it isn't used in serious applications. -- nosy: +r.david.murray status: open -> pending

[issue29755] python3 gettext.lgettext sometimes returns bytes, not string

2017-06-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In Python 2 both gettext() and lgettext() are purposed to return 8-bit strings. The difference between them is only that gettext() encodes the translation back to the encoding of the translation file if the output encoding is not explicitly specified, while

[issue29755] python3 gettext.lgettext sometimes returns bytes, not string

2017-06-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +2317 ___ Python tracker ___ ___

[issue30696] infinite loop in PyRun_InteractiveLoopFlags()

2017-06-18 Thread Xavier de Gaye
New submission from Xavier de Gaye: To reproduce the problem, apply the nomemory_allocator.patch from issue 30695 and run the following two statements that must be interrupted with ^C: $ ./python -q >>> import _testcapi >>> _testcapi.set_nomemory_allocator() sys.excepthook is missing ^Cpython:

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-18 Thread Xavier de Gaye
New submission from Xavier de Gaye: Add the set_nomemory_allocator() function to _testcapi that sets a no memory allocator. -- components: Tests files: nomemory_allocator.patch keywords: patch messages: 296266 nosy: haypo, xdegaye priority: normal severity: normal status: open title:

[issue30671] dict: improve lookup function

2017-06-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: Can this be closed now? -- ___ Python tracker ___ ___ Python-bugs-list

[issue30691] WeakSet is not pickleable

2017-06-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: > If you pickle also hard refereces to the items, > a WeakSet can be pickled and unpickled as expected (after > fixing __reduce__). That seems contrary to the original intent of a WeakSet. I recommend not going down the path of adding pickle support. If

[issue29702] Error 0x80070003: Failed to launch elevated child process

2017-06-18 Thread Eryk Sun
Changes by Eryk Sun : -- resolution: out of date -> third party stage: -> resolved status: open -> closed ___ Python tracker ___

[issue30664] Change unittest's _SubTest to not sort its params when printing test failures

2017-06-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Note that the order of parameters of nested subtests is from inner to outer. -- ___ Python tracker ___