[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread anthony shaw
anthony shaw added the comment: The opcode would not solely apply to this specific use case. I could seek another way of implementing the same behaviour without an additional opcode? -- ___ Python tracker

[issue32534] Speed-up list.insert: use memmove()

2019-04-08 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> wont fix stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue26730] SpooledTemporaryFile doesn't correctly preserve data for text (non-binary) SpooledTemporaryFile objects when Unicode characters are written

2019-04-08 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- assignee: -> serhiy.storchaka versions: +Python 3.7, Python 3.8 -Python 3.5, Python 3.6 ___ Python tracker ___

[issue36552] Replace OverflowError with ValueError when calculating length of range objects > PY_SIZE_MAX

2019-04-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For large but smaller than the C limit ranges the list constructor raises a MemoryError. It should raise the same error for larger ranges. Raising an OverflowError in range.__len__ is legitimate. -- nosy: +serhiy.storchaka

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The benefit is too small to add a new opcode. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue33228] Use Random.choices in tempfile

2019-04-08 Thread Inada Naoki
Inada Naoki added the comment: I'm +0 too. Since there are no +1 from core dev for a long time, I close this issue for now. -- resolution: -> wont fix stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue36546] Add quantiles() to the statistics module

2019-04-08 Thread Mark Dickinson
Mark Dickinson added the comment: Related previous discussion on python-ideas: https://mail.python.org/pipermail/python-ideas/2018-March/049327.html -- nosy: +mark.dickinson ___ Python tracker

[issue36546] Add quantiles() to the statistics module

2019-04-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for taking a detailed look. I'll explore the links you provided shortly. The API is designed to be extendable so that we don't get trapped by the choice of computation method. If needed, any or all of the following extensions are possible without

[issue28190] Cross-build _curses failed if host ncurses headers and target ncurses headers have different layouts

2019-04-08 Thread Chih-Hsuan Yen
Chih-Hsuan Yen added the comment: I created https://github.com/python/cpython/pull/12587 as a preparation pull request to fix the __sgi issue mentioned in msg282782. -- ___ Python tracker

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

2019-04-08 Thread Inada Naoki
Inada Naoki added the comment: I concur with Raymond. If you really need this feature, please discuss on python-dev ML. -- nosy: +inada.naoki resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker

[issue35488] pathlib Path.match does not behave as described

2019-04-08 Thread anthony shaw
Change by anthony shaw : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue36553] inspect.is_decorator_call(frame)

2019-04-08 Thread Sylvain Marie
New submission from Sylvain Marie : Python decorators are frequently proposed by libraries as an easy way to add functionality to user-written functions: see `attrs`, `pytest`, `click`, `marshmallow`, etc. A common pattern in most such libraries, is that they do not want to provide users

[issue33461] json.loads(encoding=) does not emit deprecation warning.

2019-04-08 Thread Inada Naoki
Inada Naoki added the comment: Since we didn't raise DeprecationWarning, I think at least one version with DeprecationWarning is preferable. -- nosy: +inada.naoki versions: +Python 3.8 ___ Python tracker

[issue36553] inspect.is_decorator_call(frame)

2019-04-08 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +yselivanov versions: +Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread Inada Naoki
Inada Naoki added the comment: $ python3 -m timeit -s 'r=range(1000)' -- '[x for x in r]' 5000 loops, best of 5: 40 usec per loop $ python3 -m timeit -s 'r=range(1000)' -- '[*r]' 2 loops, best of 5: 17.3 usec per loop -- ___ Python tracker

[issue34488] improve performance of BytesIO.writelines() by avoiding creation of unused PyLongs

2019-04-08 Thread Inada Naoki
Inada Naoki added the comment: Hm, what happened if subclass of BytesIO overrides `write` but not `writelines`? -- nosy: +inada.naoki ___ Python tracker ___

[issue36053] pkgutil.walk_packages jumps out from given path if there is package with the same name in sys.path

2019-04-08 Thread Piotr Karkut
Piotr Karkut added the comment: Nick: From what I've checked, it jumps in case the module is already imported. The problem is that the original implementation is quite naive, and it's trying to import the module before looking for it in `sys.modules` - So if the module with a conflicting

[issue18372] _Pickler_New() doesn't call PyObject_GC_Track(self)

2019-04-08 Thread STINNER Victor
STINNER Victor added the comment: It has been decided to not fix the issue in Python 2.7: https://github.com/python/cpython/pull/8505#issuecomment-480771689 -- versions: -Python 3.6 ___ Python tracker

[issue36554] unittest.TestCase: "subTest" cannot be used together with "debug"

2019-04-08 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Can you please provide an example script to reproduce this? There is similar None check fixed with issue34900 -- nosy: +xtreak ___ Python tracker

[issue36555] PEP484 @overload vs. str/bytes

2019-04-08 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +gvanrossum, levkivskyi ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue36554] unittest.TestCase: "subTest" cannot be used together with "debug"

2019-04-08 Thread Dieter Maurer
New submission from Dieter Maurer : "subTest" accesses "self._outcome" which is "None" when the test is performed via "debug". -- components: Library (Lib) messages: 339607 nosy: dmaurer priority: normal severity: normal status: open title: unittest.TestCase: "subTest" cannot be used

[issue36478] backport of pickle fixes to Python 3.5.7 uses C99 for loops

2019-04-08 Thread STINNER Victor
STINNER Victor added the comment: > ../Modules/_pickle.c:677:5: error: 'for' loop initial declarations are only > allowed in C99 mode Why do you get an error? Which compiler do you use to build deadsnakes? -- ___ Python tracker

[issue36478] backport of pickle fixes to Python 3.5.7 uses C99 for loops

2019-04-08 Thread STINNER Victor
STINNER Victor added the comment: > Which compiler do you use to build deadsnakes? Sorry, which compiler *flags*. -- ___ Python tracker ___

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread Inada Naoki
Inada Naoki added the comment: I agree with Serhiy. Benefit seems too small to add new opcode. > I could seek another way of implementing the same behaviour without an > additional opcode? How about converting `[x for x in it]` to `[*it]` in AST? --

[issue35983] tp_dealloc trashcan shouldn't be called for subclasses

2019-04-08 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: In Python 3, the resurrection issue probably appears too. But it's not so much a problem since __del__ (mapped to tp_finalize) is only called once anyway. So there are no bad consequences if the object is resurrected incorrectly. --

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +inada.naoki ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36555] PEP484 @overload vs. str/bytes

2019-04-08 Thread Crusader Ky
New submission from Crusader Ky : An exceedingly common pattern in many Python libraries is for a function to accept either a string or a list of strings, and change the function output accordingly. This however does not play nice with @typing.overload, as a str variable is also an

[issue36556] Trashcan causing duplicated __del__ calls

2019-04-08 Thread Jeroen Demeyer
New submission from Jeroen Demeyer : NOTE: because of PEP 442, this issue is specific to Python 2. This bug was discovered while adding testcases for bpo-35983 to the Python 2.7 backport. There is a nasty interaction between the trashcan and __del__: if you're very close to the trashcan

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread Ronald Oussoren
Ronald Oussoren added the comment: This might cause a MemoryError when the __length_hint__ of the source returns a too large value, even when the actual size of the comprehension is smaller, e.g.: [x**2 for x in range(LARGE_VALUE) if is_prime(x)] See also issue28940 -- nosy:

[issue36555] PEP484 @overload vs. str/bytes

2019-04-08 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Mypy already takes first overload for ambiguous arguments. This example is however genuinely unsafe from the static typing point of view. Please read the docs https://mypy.readthedocs.io/en/latest/more_types.html#type-checking-the-variants --

[issue33632] undefined behaviour: signed integer overflow in threadmodule.c

2019-04-08 Thread Paul Ganssle
Change by Paul Ganssle : -- nosy: +p-ganssle ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36561] Python argparse doesn't work in the presence of my custom module

2019-04-08 Thread JP Zhang
JP Zhang added the comment: >>>python test.py --num_epochs 200 usage: test.py [-h] [--data_type DATA_TYPE] test.py: error: unrecognized arguments: --num_epochs 200 I have a created a colab share link. You can check: https://colab.research.google.com/drive/1TUvt4CCv2d43GD1ccmuRNBJlkbUPXN8Z

[issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential)

2019-04-08 Thread cagney
cagney added the comment: I think the only pragmatic solution here is to add an optional parameter to logging.basicConfig() that specifies that the logger should use a single global lock; and then start documenting that thread locks and fork() don't work well together. And note that this

[issue36560] test_functools leaks randomly 1 memory block

2019-04-08 Thread STINNER Victor
STINNER Victor added the comment: Current bisection progress: I'm able to reproduce a failure with attached test_functools.py (211 lines) using: ./python -m test -F -j5 -R 3:3 test_functools It takes between 4 and 200 runs to reproduce the failure, I don't understand what triggers the

[issue36559] "import random" should import hashlib on demand (nor load OpenSSL)

2019-04-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: Why do we care about this particular import? It doesn't see slow in any way. In general, we don't do deferred imports unless there is a compelling reason (i.e. it is very slow or it is sometimes unavailable). Otherwise, it is a false optimization.

[issue36562] Can't call a method from a module built in Python C API

2019-04-08 Thread Joao Paulo
New submission from Joao Paulo : I'm trying to build a python module in C++ using the Python C API and the code is attached. The problem is when I run my_module.runTester() in PyRun_SimpleString. I get the following error message: SystemError: Bad call flags in PyCFunction_Call.

[issue36561] Python argparse doesn't work in the presence of my custom module

2019-04-08 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: test.py shown in msg339649 accepts only --data_type DATA_TYPE. Running test.py without import and the non-existent flag would show all the options present like the below I am using from the repo you have shared. You might ./python.exe

[issue36561] Python argparse doesn't work in the presence of my custom module

2019-04-08 Thread Peter Otten
Peter Otten <__pete...@web.de> added the comment: That's a bug in your code. You create another ArgumentParser in the toplevel code of preprocess.py. When this module is imported directly or indirectly your script will us this parser to parse the command line first. Minimal example: $ cat

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread Inada Naoki
Inada Naoki added the comment: > > This might cause a MemoryError when the __length_hint__ of the source > > returns a too large value, even when the actual size of the comprehension > > is smaller, e.g.: > > The current implementation of list comprehensions raise neither a memoryerror > or

[issue35210] Use bytes + memoryview + resize instead of bytesarray + array in io.RawIOBase.read

2019-04-08 Thread Inada Naoki
Inada Naoki added the comment: Maybe, we need C version of memoryview.release() to invalidate pointer in memoryview object. -- nosy: +inada.naoki ___ Python tracker ___

[issue15994] memoryview to freed memory can cause segfault

2019-04-08 Thread Inada Naoki
Change by Inada Naoki : -- nosy: +inada.naoki ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > That is a one-off cost for the __length_hint__ of the range object > specifically. Objects with a known length (lists, sets, tuples) would not have that overhead. That seems incorrect. This is not unique of range objects as it affects also objects

[issue15903] Make rawiobase_read() read directly to bytes object

2019-04-08 Thread Mark Lawrence
Change by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35416] Fix potential resource warnings in distutils

2019-04-08 Thread Inada Naoki
Inada Naoki added the comment: New changeset 58721a903074d28151d008d8990c98fc31d1e798 by Inada Naoki (Mickaël Schoentgen) in branch 'master': bpo-35416: fix potential resource warnings in distutils (GH-10918) https://github.com/python/cpython/commit/58721a903074d28151d008d8990c98fc31d1e798

[issue36559] "import random" should import hashlib on demand (nor load OpenSSL)

2019-04-08 Thread STINNER Victor
New submission from STINNER Victor : Currently, when the random module is imported, the hashlib module is always imported which loads the OpenSSL library, whereas hashlib is only needed when a Random() instance is created with a string seed. For example, "rnd = random.Random()" and "rnd =

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread anthony shaw
anthony shaw added the comment: > How about converting `[x for x in it]` to `[*it]` in AST? I should have been more explicit, this patch improves the performance of all list comprehensions that don’t have an if clause. Not just [x for x in y] but: d = {} # some sort of dictionary [f”{k} —

[issue35459] Use PyDict_GetItemWithError() instead of PyDict_GetItem()

2019-04-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 7a0630c530121725136526a88c49589b54da6492 by Serhiy Storchaka in branch 'master': Add a What's New entry for bpo-35459. (GH-12706) https://github.com/python/cpython/commit/7a0630c530121725136526a88c49589b54da6492 --

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: This patch makes it slow for small iterators: Perf program: import perf runner = perf.Runner() runner.timeit("list_comp", stmt="[x for x in range(10)]", setup="") Current master: ❯ ./python.exe ../check.py

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread Inada Naoki
Inada Naoki added the comment: > I should have been more explicit, this patch improves the performance of all > list comprehensions that don’t have an if clause. But in these cases, overhead of reallocation will be smaller than simple case. -- ___

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: More benchmarks for slow iterators: import perf runner = perf.Runner() runner.timeit("list_comp", stmt="[x**2 for x in k]", setup="k=iter(list(range(10)))") Current master: ❯ ./python.exe ../check.py

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread anthony shaw
anthony shaw added the comment: > This patch makes it slow for small iterators That is a one-off cost for the __length_hint__ of the range object specifically. Objects with a known length (lists, sets, tuples) would not have that overhead. I can run a more useful set of benchmarks against

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread Inada Naoki
Inada Naoki added the comment: > Try > > [x for x in range(2**1000)] > > in a REPL. It doesn’t raise anything, it tries to create a list that will > eventually exceed PY_SIZE_MAX, but it only crashes once it reaches that > iteration. It is expected behavior. > This raises an OverflowError

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread anthony shaw
anthony shaw added the comment: > If your patch uses __length_hint__, it is bug. iterator will return 2**1000 for __length_hint__, but produce no item on iteration. It raises an OverflowError because of the goto

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread anthony shaw
anthony shaw added the comment: > If your patch uses __length_hint__, it is bug. I’m not sure I understand this comment, PEP424 says “This is useful for presizing containers when building from an iterable.“ This patch uses __length_hint__ to presize the list container for a list

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread Inada Naoki
Inada Naoki added the comment: I'm sorry. list_extend raises OverflowError too. -- ___ Python tracker ___ ___ Python-bugs-list

[issue36557] Python (Launcher)3.7.3 CMDLine install/uninstall

2019-04-08 Thread SilentGhost
Change by SilentGhost : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker ___ ___

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > That is a one-off cost for the __length_hint__ of the range object > specifically. Objects with a known length (lists, sets, tuples) would not have that overhead. That seems incorrect. This is not unique of range objects as it affects also objects

[issue36559] "import random" should import hashlib on demand (nor load OpenSSL)

2019-04-08 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +12651 stage: -> patch review ___ Python tracker ___ ___

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread anthony shaw
anthony shaw added the comment: > This might cause a MemoryError when the __length_hint__ of the source returns > a too large value, even when the actual size of the comprehension is smaller, > e.g.: The current implementation of list comprehensions raise neither a memoryerror or overflow

[issue13475] Add '--mainpath'/'--nomainpath' command line options to override sys.path[0] initialisation

2019-04-08 Thread Nick Coghlan
Nick Coghlan added the comment: Retitled the issue using the `--mainpath` spelling, as I wanted to link to it from the PEP 582 discussion, and that's my current favourite from the various ideas I've had since first filing the issue. (I decided I didn't like `--basepath` because we already

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread anthony shaw
anthony shaw added the comment: > In such case, current behavior works. And your patch will raise > OverflowError. Try [x for x in range(2**1000)] in a REPL. It doesn’t raise anything, it tries to create a list that will eventually exceed PY_SIZE_MAX, but it only crashes once it reaches

[issue36557] Python (Launcher)3.7.3 CMDLine install/uninstall

2019-04-08 Thread mattcher_h
New submission from mattcher_h : Hi, I´m trying to generate an automated install and uninstall from Python. For this I normally use cmdlines, but I got some issues. If I try to uninstall by my automated version I got the problem that it doesn´t finish. When I do this at the PC himself it

[issue36556] Trashcan causing duplicated __del__ calls

2019-04-08 Thread Jeroen Demeyer
Change by Jeroen Demeyer : -- keywords: +patch pull_requests: +12648 stage: -> patch review ___ Python tracker ___ ___

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread Inada Naoki
Inada Naoki added the comment: "useful" doesn't mean "use it as-is". It is just a hint. It will be wrong. See here for list example: https://github.com/python/cpython/blob/7a0630c530121725136526a88c49589b54da6492/Objects/listobject.c#L929-L940 --

[issue34373] test_time errors on AIX

2019-04-08 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +12649 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36558] Change time.mktime() return type from float to int?

2019-04-08 Thread STINNER Victor
New submission from STINNER Victor : time.mktime() returns a floating point number: >>> type(time.mktime(time.localtime())) The documentation says: "It returns a floating point number, for compatibility with :func:`.time`." time.time() returns a float because it has sub-second resolution,

[issue15903] Make rawiobase_read() read directly to bytes object

2019-04-08 Thread Inada Naoki
Change by Inada Naoki : -- nosy: +inada.naoki ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36558] Change time.mktime() return type from float to int?

2019-04-08 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +12650 stage: -> patch review ___ Python tracker ___ ___

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- Removed message: https://bugs.python.org/msg339634 ___ Python tracker ___ ___ Python-bugs-list

[issue36559] "import random" should import hashlib on demand (nor load OpenSSL)

2019-04-08 Thread STINNER Victor
STINNER Victor added the comment: In the past, some developers complained when an import has been removed in a stdlib module. I vaguely recall code using "import os" to get the "errno" module from "os.errno". That's "What's New in Python 3.7" contains: "Several undocumented internal imports

[issue33632] undefined behaviour: signed integer overflow in threadmodule.c

2019-04-08 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch pull_requests: +12652 stage: -> patch review ___ Python tracker ___ ___

[issue33632] undefined behaviour: signed integer overflow in threadmodule.c

2019-04-08 Thread Zackery Spytz
Zackery Spytz added the comment: I've created a PR based on Martin Panter's patch. -- components: +Extension Modules -Library (Lib) nosy: +ZackerySpytz versions: -Python 3.6 ___ Python tracker

[issue36557] Python (Launcher)3.7.3 CMDLine install/uninstall

2019-04-08 Thread Steve Dower
Steve Dower added the comment: Pass /passive to have it automatically close at the end, or /quiet to avoid popping up a window at all. Can you clarify what you mean by launcher? There are a couple different things you could be talking about and I don't want to give you the wrong answer.

[issue35983] tp_dealloc trashcan shouldn't be called for subclasses

2019-04-08 Thread Jeroen Demeyer
Change by Jeroen Demeyer : -- pull_requests: +12653 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36561] Python argparse doesn't work in the presence of my custom module

2019-04-08 Thread JP Zhang
New submission from JP Zhang : Github repo for reproducing: https://github.com/zjplab/gc-mc-pytorch/tree/bug, test.py. In the presence of my custom data_loader, it will error as unrecognized argument. But without importing it(comment it out) everything is just fine. -- components:

[issue36561] Python argparse doesn't work in the presence of my custom module

2019-04-08 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Can you please post the traceback you are getting and how you are running the script from command line? The custom module has third party dependencies like numpy so it will be helpful if you can attach a reproducer without dependencies to see if

[issue36558] Change time.mktime() return type from float to int?

2019-04-08 Thread Paul Ganssle
Paul Ganssle added the comment: I would say that the natural output of mktime is indeed an integer, but I can't say off the top of my head what "compatibility" refers to here, so per the principle of Chesterton's fence, without more research or historical context I'd say the default should

[issue36414] Multiple test failures in GCC and Clang optional builds on Travis CI

2019-04-08 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: https://github.com/python/cpython/pull/12708 that seems to fix similar issue (issue36544) for Ubuntu that helps in making Mac OS build green again. Successful build : https://travis-ci.org/python/cpython/jobs/516821454 -- nosy: +xdegaye

[issue36560] test_functools leaks randomly 1 memory block

2019-04-08 Thread STINNER Victor
New submission from STINNER Victor : Sometimes, each run of test_functools leaks exactly 1 memory block, even when the whole test is "re-run in verbose mode". Sometimes, it doesn't leak. https://buildbot.python.org/all/#/builders/80/builds/550 test_functools leaked [1, 1, 1] memory blocks,

[issue35416] Fix potential resource warnings in distutils

2019-04-08 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue36478] backport of pickle fixes to Python 3.5.7 uses C99 for loops

2019-04-08 Thread Anthony Sottile
Anthony Sottile added the comment: It's a rather oldish gcc in this case. (4.8.4 + whatever ubuntu patches). Here's a full (successful) build log (including the combinations of flags) after patching:

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread Nick Coghlan
Nick Coghlan added the comment: I was going to note that the algorithm Anthony has pursued here is the same one we already use for the list constructor and list.extend(), but Inada-san already pointed that out :) While length_hint is allowed to be somewhat inaccurate, we do expect it to be

[issue18372] _Pickler_New() doesn't call PyObject_GC_Track(self)

2019-04-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Tracking objects that do not need this will just add work to the garbage collector. Not all instances of trackable types should be tracked, for example the empty tuple and some dicts are not tracked. >>> gc.is_tracked(()) False >>> gc.is_tracked((1, 2))

[issue35422] misleading error message from ssl.get_server_certificate() when bad port

2019-04-08 Thread Ruluk
Ruluk added the comment: I would still validate the error somewhere, maybe before reaching the OpenSSL library, because that same error is also shown for other cases. E.g: http_connection = HTTPSConnection("localhost") http_connection.request("POST", my_url, my_body, my_headers) The use of

[issue36554] unittest.TestCase: "subTest" cannot be used together with "debug"

2019-04-08 Thread Dieter Maurer
Change by Dieter Maurer : Added file: https://bugs.python.org/file48248/utest.py ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue36563] pdbrc home twice

2019-04-08 Thread daniel hahler
Change by daniel hahler : -- nosy: blueyed priority: normal severity: normal status: open title: pdbrc home twice ___ Python tracker ___

[issue36563] pdbrc is read twice if current directory is the home directory

2019-04-08 Thread daniel hahler
New submission from daniel hahler : If $HOME is $PWD, .pdbrc is read twice. This confused me when seeing intentional errors from there twice during tests. It should be only read once. -- components: +Library (Lib) title: pdbrc home twice -> pdbrc is read twice if current directory is

[issue36554] unittest.TestCase: "subTest" cannot be used together with "debug"

2019-04-08 Thread Dieter Maurer
Dieter Maurer added the comment: This is a duplicate of issue34900 -- stage: -> resolved status: open -> closed Added file: https://bugs.python.org/file48249/utest.py ___ Python tracker

[issue36563] pdbrc is read twice if current directory is the home directory

2019-04-08 Thread daniel hahler
Change by daniel hahler : -- keywords: +patch pull_requests: +12654 stage: -> patch review ___ Python tracker ___ ___

[issue36554] unittest.TestCase: "subTest" cannot be used together with "debug"

2019-04-08 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks, just confirmed the commit fix with the given file. -- ___ Python tracker ___

[issue36554] unittest.TestCase: "subTest" cannot be used together with "debug"

2019-04-08 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- resolution: -> duplicate superseder: -> unittest subTests() fails when called from debug() ___ Python tracker ___

[issue36564] Infinite loop with short maximum line lengths in EmailPolicy

2019-04-08 Thread Paul Ganssle
New submission from Paul Ganssle : When reviewing PR 12020 fixing an infinite loop in the e-mail module, I noticed that a *different* infinite loop is documented with a "# XXX" comment on line 2724:

[issue36564] Infinite loop with short maximum line lengths in EmailPolicy

2019-04-08 Thread Paul Ganssle
Change by Paul Ganssle : -- keywords: +patch pull_requests: +12655 stage: -> patch review ___ Python tracker ___ ___

[issue36565] Reference hunting (python3 -m test -R 3:3) doesn't work if the _abc module is missing

2019-04-08 Thread STINNER Victor
New submission from STINNER Victor : Disable the compilation of the built-in _abc module. For example, on Python 3.7 apply the following patch: diff --git a/Modules/Setup.dist b/Modules/Setup.dist index 8cc6bf0540..4015527b32 100644 --- a/Modules/Setup.dist +++ b/Modules/Setup.dist @@ -114,7

[issue36565] Reference hunting (python3 -m test -R 3:3) doesn't work if the _abc module is missing

2019-04-08 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +12656 stage: -> patch review ___ Python tracker ___ ___

[issue36560] test_functools leaks randomly 1 memory block

2019-04-08 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36559] "import random" should import hashlib on demand (nor load OpenSSL)

2019-04-08 Thread Brett Cannon
Brett Cannon added the comment: Could you explain a bit more, Victor, about why you want to avoid importing hashlib and OpenSSL so much? -- nosy: +brett.cannon ___ Python tracker

[issue22377] %Z in strptime doesn't match EST and others

2019-04-08 Thread Alex LordThorsen
Alex LordThorsen added the comment: This behavior is currently unchanged and the docs still state that `EST` is an acceptable value. ``` >>> datetime.strptime("2019-01-28 18:54:45 EST", "%Y-%m-%d %H:%M:%S %Z") Traceback (most recent call last): File "", line 1, in File

[issue35907] Unnecessary URL scheme exists to allow file:// reading file in urllib

2019-04-08 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: This issue seems to have been assigned CVE-2019-9948 (https://nvd.nist.gov/vuln/detail/CVE-2019-9948) as noted in https://github.com/python/cpython/pull/11842#issuecomment-480930608 -- nosy: +xtreak ___

[issue36566] Support password masking in getpass.getpass()

2019-04-08 Thread Cheryl Sabella
Cheryl Sabella added the comment: Thank you for the suggestion. I believe this is a duplicate of issue 32884. -- nosy: +cheryl.sabella resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Adding the ability for getpass to print asterisks when passowrd

  1   2   >