[issue41135] Suggested change to http.server.HTTPServer to prevent socket reuse in Windows

2020-06-26 Thread Michael Rich
New submission from Michael Rich : Hi, a web server can be incorrectly bound to an already in-use socket when binding a HTTPServer on windows. The issue is discussed here:

[issue41131] Augment random.choices() with the alias method

2020-06-26 Thread Raymond Hettinger
Change by Raymond Hettinger : Added file: https://bugs.python.org/file49268/choices_binomial.py ___ Python tracker ___ ___ Python-bugs-list

[issue36656] Add race-free os.link and os.symlink wrapper / helper

2020-06-26 Thread Tom Hale
Tom Hale added the comment: Related: bpo-41134 distutils.dir_util.copy_tree FileExistsError when updating symlinks WIP update: I am just about to ask for feedback on my proposed solution at core-mentors...@python.org -- title: Please add race-free os.link and os.symlink wrapper /

[issue41134] distutils.dir_util.copy_tree FileExistsError when updating symlinks

2020-06-26 Thread Tom Hale
New submission from Tom Hale : Here is a minimal test case: == #!/bin/bash cd /tmp || exit 1 dir=test-copy_tree src=$dir/src dst=$dir/dst mkdir -p "$src" touch "$src"/file ln -s file "$src/symlink" python -c "from distutils.dir_util

[issue41132] F-String parser uses raw allocator

2020-06-26 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > Why would pymalloc be preferred? For such small and temporary string is normally faster because it will likely have pools of that size readily available and it will also benefit further allocation of the same pool size. --

[issue41132] F-String parser uses raw allocator

2020-06-26 Thread Eric V. Smith
Eric V. Smith added the comment: I don't think I put any thought into it. It was probably just in an example I was copying from. I'm not familiar with the difference between those allocators. Why would pymalloc be preferred? -- ___ Python

[issue41119] Wrong error message for list/tuple followed by a colon

2020-06-26 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset d01a3e76ee0519cba3ccdb5de47b25ec2ed7bee4 by Lysandros Nikolaou in branch '3.9': [3.9] bpo-41119: Output correct error message for list/tuple followed by colon (GH-21160) (GH-21172)

[issue41133] Insufficient description of cyclic garbage collector for C API

2020-06-26 Thread Daniel Barkalow
New submission from Daniel Barkalow : Nothing in the documentation gives you enough information to find what you're doing wrong if you have the following bug for an object tracked by the GC: (a) you store a borrowed reference to an object whose lifetime is always longer that the buggy object

[issue35823] Use vfork() in subprocess on Linux

2020-06-26 Thread Gregory P. Smith
Gregory P. Smith added the comment: No objections, it would be great to see this finished up and land. I've encountered a minority of users who are using a wrapped vfork-based C/C++ library for process spawning as fork+exec isn't fast enough for them. --

[issue39883] Use BSD0 license for code in docs

2020-06-26 Thread bbayles
Change by bbayles : -- nosy: +bbayles ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41131] Augment random.choices() with the alias method

2020-06-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: I also looked at another method using binomial variates but couldn't get it to run faster than the alias method: def choices(population, weights, *, k=1): r = 1.0 n = k selections = [] for elem, p in zip(population,

[issue41132] F-String parser uses raw allocator

2020-06-26 Thread Lysandros Nikolaou
New submission from Lysandros Nikolaou : The f-string parser uses the raw allocator in various places. We had a very very brief discussion about this with Pablo and he suggested to change the new parser and the hand-written f-string parser to use the pymalloc allocator. Eric, is there a

[issue41119] Wrong error message for list/tuple followed by a colon

2020-06-26 Thread Lysandros Nikolaou
Change by Lysandros Nikolaou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue41084] Signify that a SyntaxError comes from an fstring in the error message

2020-06-26 Thread Lysandros Nikolaou
Change by Lysandros Nikolaou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue41131] Augment random.choices() with the alias method

2020-06-26 Thread Raymond Hettinger
New submission from Raymond Hettinger : For n unequal weights and k selections, sample selection with the inverse-cdf method is O(k log₂ n). Using the alias method, it improves to O(k). The proportionally constants also favor the alias method so that if the set up times were the same, the

[issue41119] Wrong error message for list/tuple followed by a colon

2020-06-26 Thread Lysandros Nikolaou
Change by Lysandros Nikolaou : -- pull_requests: +20330 pull_request: https://github.com/python/cpython/pull/21172 ___ Python tracker ___

[issue41093] TCPServer's server_forever() shutdown immediately when calling shutdown()

2020-06-26 Thread Tony
Tony added the comment: poke -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41130] Improve/fix FreeBSD Bluetooth socket support

2020-06-26 Thread myfreeweb
New submission from myfreeweb : 1) BTPROTO_HCI addresses only expect string identifiers on NetBSD and DragonFly: https://github.com/python/cpython/blob/2e0a920e9eb540654c0bb2298143b00637dc5961/Modules/socketmodule.c#L1931 But of course this is true on FreeBSD too. (DragonFly inherited the BT

[issue41128] Signal handlers should not hang during blocked main thread

2020-06-26 Thread Josef Havránek
Change by Josef Havránek : -- type: enhancement -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41129] Python extension modules fail to build on Mac 10.15.1 (Catalina)

2020-06-26 Thread Andrew
New submission from Andrew : Quick repoduction steps: 1) Log into a mac with macOS version 10.15.1 (10.15.x may work) 2) For build tools, use Xcode11. A minimal xcode command-tools installation also reproduced for me. 3) Download and decompress the latest python 3.8.2 source 4) run

[issue41022] AST sum types is unidentifiable after ast.Constant became a base class

2020-06-26 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: > Where they were identifable in such way? It is incorrect way, because user > can create a subclass of every AST class. You are right, I didn't consider that while I was opening the issue. Also from 3.9>= can be searched "|" in the ASDL signature to

[issue37369] Issue with pip in venv on Powershell in Windows

2020-06-26 Thread Miika Mäkelä
Miika Mäkelä added the comment: I tried to reproduce the issue on a another windows installation (Windows build 10.0.18363.0), but was however unable to do it following the same steps. I fear that my original python/pip installation is just corrupted somehow due to having many python

[issue41128] Signal handlers should not hang during blocked main thread

2020-06-26 Thread Josef Havránek
New submission from Josef Havránek : python3 When handling signals (via signal module) have delayed execution when main thread is blocked/waiting for event That is sub-optimal(signal "could get lost"). Signals shoud be handled asap... Think about scenario when os may be asking python nicely

[issue41106] os.scandir() Windows bug dir_entry.stat() not works on file during writing.

2020-06-26 Thread Steve Dower
Steve Dower added the comment: Those are all good ideas, but using os.stat(d) instead of d.stat() is shorter, more reliable, more compatible, and already works. There's no middle ground where DirEntry can be faster, because it's already using that middle ground. All the discussion between

[issue41115] Codecs should raise precise UnicodeDecodeError or UnicodeEncodeError

2020-06-26 Thread utkarsh
utkarsh added the comment: @thatiparthy These were the most logical changes, standard error messages, which were already there in the existing code, I just edited them as mentioned here. What part of your "work" do you think i copied? Sent this PR to get familiar to the process mostly, i

[issue38879] Reordered error checking in PyArena_New().

2020-06-26 Thread Zoltán Szatmáry
Change by Zoltán Szatmáry : -- hgrepos: -386 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41106] os.scandir() Windows bug dir_entry.stat() not works on file during writing.

2020-06-26 Thread Cezary Wagner
Cezary Wagner added the comment: I think we can assume that NTFS is priority since that is the most used option. I can not discuss what with FAT32 or FAT since I am not the best in this domain (in NTFS I am not the best too now). Whatever I think that system must do allocation for open

[issue41115] Codecs should raise precise UnicodeDecodeError or UnicodeEncodeError

2020-06-26 Thread శ్రీనివాస్ రెడ్డి తాటిపర్తి
Srinivas Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) added the comment: @utk You could have taken some other easy issue from

[issue41106] os.scandir() Windows bug dir_entry.stat() not works on file during writing.

2020-06-26 Thread Steve Dower
Steve Dower added the comment: > We're faced with the choice between either always calling the real lstat, or > just documenting that files with hard links will have stale information if > the file was updated using another link. That's an easy choice: we document it. The os module comes

[issue41115] Codecs should raise precise UnicodeDecodeError or UnicodeEncodeError

2020-06-26 Thread utkarsh
Change by utkarsh : -- nosy: +utk nosy_count: 8.0 -> 9.0 pull_requests: +20329 pull_request: https://github.com/python/cpython/pull/21170 ___ Python tracker ___

[issue35823] Use vfork() in subprocess on Linux

2020-06-26 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: I'd really like to get this merged eventually because vfork()-based solution is fundamentally more generic than posix_spawn(). Apart from having no issue with close_fds=True, it will also continue to allow subprocess to add any process context tweaks

[issue41127] Executing code in thread or process pools: run_in_executor example

2020-06-26 Thread Austin Raney
New submission from Austin Raney : I found an issue with the concurrent.futures.ProcessPoolExecuter() example (#3) in the asyncio event loops documentation. The call to asyncio.run(main()) should be guarded by `__name__=="__main__":`, as it sits now a RuntimeError is thrown.

[issue40275] test.support has way too many imports

2020-06-26 Thread hai shi
Change by hai shi : -- pull_requests: +20328 pull_request: https://github.com/python/cpython/pull/21169 ___ Python tracker ___ ___

[issue40725] Documentation: Benchmark table in "What's new in Python 3.9" has weird values

2020-06-26 Thread hai shi
Change by hai shi : -- nosy: +shihai1991 nosy_count: 5.0 -> 6.0 pull_requests: +20327 pull_request: https://github.com/python/cpython/pull/21169 ___ Python tracker ___

[issue40799] Create Lib/_pydatetime.py file to optimize "import datetime" when _datetime is available

2020-06-26 Thread Paul Ganssle
Paul Ganssle added the comment: As for deciding between moving to `datetime/` and moving to `_pydatetime`, I think we should send an e-mail to Python-Dev about it to get a wider perspective, because the import machinery is a lot of black magic, and I know that there are large proprietary

[issue35823] Use vfork() in subprocess on Linux

2020-06-26 Thread Yonatan Goldschmidt
Yonatan Goldschmidt added the comment: With issue35537 merged, do we have any intention to get on with this? From what I can tell, it provides roughly the same performance benefit - but works also with close_fds=True, which is the default of Popen, so IMO it's a worthy addition. I tested a

[issue40799] Create Lib/_pydatetime.py file to optimize "import datetime" when _datetime is available

2020-06-26 Thread Paul Ganssle
Paul Ganssle added the comment: > bout _strptime, I see that the time.strptime() imports internally the > _strptime module. Ah, sorry, my remark about including `_strptime` was off the cuff — I thought it was only used in `datetime`, which is why I said "possibly _strptime". If it's used

[issue41126] Running test suite gives me - python.exe(14198, 0x114352dc0) malloc: can't allocate region

2020-06-26 Thread శ్రీనివాస్ రెడ్డి తాటిపర్తి
Srinivas Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) added the comment: It was a success. And yes, this is a duplicate of issue 40928. -- ___ Python tracker ___

[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-06-26 Thread Dong-hee Na
Change by Dong-hee Na : -- pull_requests: +20326 pull_request: https://github.com/python/cpython/pull/21168 ___ Python tracker ___

[issue41126] Running test suite gives me - python.exe(14198, 0x114352dc0) malloc: can't allocate region

2020-06-26 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: This is probably related to issue 40928. Does the test succeed or fail when you do this? -- nosy: +remi.lapeyre ___ Python tracker ___

[issue41126] Running test suite gives me - python.exe(14198, 0x114352dc0) malloc: can't allocate region

2020-06-26 Thread Eric V. Smith
Change by Eric V. Smith : -- components: +macOS nosy: +ned.deily, ronaldoussoren ___ Python tracker ___ ___ Python-bugs-list

[issue40893] tkinter: integrate TkDND support

2020-06-26 Thread E. Paine
E. Paine added the comment: I have now marked the PR ready for review. Terry: Could you please take a quick look to double-check that the changes proposed are fully backwards-compatible? I have run the IDLE tests and have tried to pay particular attention to this problem when developing,

[issue41084] Signify that a SyntaxError comes from an fstring in the error message

2020-06-26 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 2e0a920e9eb540654c0bb2298143b00637dc5961 by Lysandros Nikolaou in branch 'master': bpo-41084: Adjust message when an f-string expression causes a SyntaxError (GH-21084)

[issue41126] Running test suite gives me - python.exe(14198, 0x114352dc0) malloc: can't allocate region

2020-06-26 Thread శ్రీనివాస్ రెడ్డి తాటిపర్తి
Change by Srinivas Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) : -- components: +Build versions: +Python 3.10 ___ Python tracker ___

[issue41126] Running test suite gives me - python.exe(14198, 0x114352dc0) malloc: can't allocate region

2020-06-26 Thread శ్రీనివాస్ రెడ్డి తాటిపర్తి
New submission from Srinivas Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) : While running tests with `./python.exe Lib/test`, I see the following text in the console. Is this a bug? `` python.exe(14198,0x114352dc0) malloc: can't allocate region :*** mach_vm_map(size=842105263157895168,

[issue26212] Python with ncurses6.0 will not load _curses module on Solaris 10

2020-06-26 Thread Zackery Spytz
Zackery Spytz added the comment: Python 2 is EOL, so I think this issue should be closed. -- nosy: +ZackerySpytz ___ Python tracker ___

[issue41116] build on macOS 11 (beta) does not find system-supplied third-party libraries

2020-06-26 Thread Ronald Oussoren
Ronald Oussoren added the comment: I see, and (as expected) get the same output when I build like that. I agree that we should teach _osx_support about this. I guess we should add a function that returns the SDK root, which can then be used in distutils (and setuptools, ...) instead of

[issue41120] Possible performance improvement for itertools.product example on Python Docs

2020-06-26 Thread Abbas Taher
Abbas Taher added the comment: Good morning Raymond,   Thank you for this quick response. You are absolutely right on all your points if you only consider that the example given in the documentation as purely a suggestion of "equivalent" version to the one implemented in the library. However,

[issue41116] build on macOS 11 (beta) does not find system-supplied third-party libraries

2020-06-26 Thread Ned Deily
Ned Deily added the comment: I should have specified that the failures I saw were just with the default intel-64 arch on the beta. After thinking about it a bit and reviewing the code, I think the best approach is to handle this in _osx_support.py as part of the compiler flags

[issue16623] argparse help formatter does not honor non-breaking space

2020-06-26 Thread Cheryl Sabella
Change by Cheryl Sabella : -- resolution: -> out of date stage: needs patch -> resolved status: open -> closed ___ Python tracker ___

[issue41116] build on macOS 11 (beta) does not find system-supplied third-party libraries

2020-06-26 Thread Ronald Oussoren
Ronald Oussoren added the comment: These build for me (master branch), because the support for .tbd files in the macOS SDK still works. The ones that don't build for me: - Bits not found: _gdbm, _hashlib, _ssl, ossaudiodev, spwd - Failed to build: _ctypes, _decimal, _lzma This was with a

[issue40058] Running test_datetime twice fails with: module 'datetime' has no attribute '_divide_and_round'

2020-06-26 Thread hai shi
hai shi added the comment: > My PR of bpo-40799 fix this issue. Thanks victor for your work, I closed my PR ;) -- ___ Python tracker ___

[issue16623] argparse help formatter does not honor non-breaking space

2020-06-26 Thread hai shi
hai shi added the comment: > Python 2 is EOL, so I think this issue should be closed. +1, if someone need create a PR, we can reopen it again. -- ___ Python tracker ___

[issue40275] test.support has way too many imports

2020-06-26 Thread hai shi
Change by hai shi : -- pull_requests: +20325 pull_request: https://github.com/python/cpython/pull/21167 ___ Python tracker ___ ___

[issue41125] Display exit-codes for abruptly terminated processes in concurrent.futures

2020-06-26 Thread Laurie Opperman
Change by Laurie Opperman : -- keywords: +patch pull_requests: +20324 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21166 ___ Python tracker ___

[issue41092] Report actual size from 'os.path.getsize'

2020-06-26 Thread Gareth Rees
Gareth Rees added the comment: The proposed change adds a Boolean flag to os.path.getsize() so that it returns: os.stat(filename).st_blocks * 512 (where the 512 is the file system block size on Linux; some work is needed to make this portable to other operating systems). The Boolean

[issue41111] Convert a few stdlib extensions to the limited C API

2020-06-26 Thread hai shi
Change by hai shi : -- nosy: +shihai1991 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41115] Codecs should raise precise UnicodeDecodeError or UnicodeEncodeError

2020-06-26 Thread శ్రీనివాస్ రెడ్డి తాటిపర్తి
Change by Srinivas Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) : -- keywords: +patch pull_requests: +20323 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/21165 ___ Python tracker