[issue39105] Spam

2019-12-19 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- components: -asyncio nosy: -asvetlov, yselivanov stage: -> resolved status: open -> closed title: Printer offline -> Spam ___ Python tracker

[issue39105] Printer offline

2019-12-19 Thread Printer offline
New submission from Printer offline : This blog has increased the level of information sharing. I just simply loved this blog. It has helped me a lot. A great and learning blog. I am very satisfied after reading this. https://www.printer-offline.com/ -- components: asyncio files:

[issue39104] ProcessPoolExecutor hangs on shutdown nowait with pickling failure

2019-12-19 Thread Thomas Moreau
Change by Thomas Moreau : -- keywords: +patch pull_requests: +17134 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17670 ___ Python tracker ___

[issue39104] ProcessPoolExecutor hangs on shutdown nowait with pickling failure

2019-12-19 Thread Thomas Moreau
New submission from Thomas Moreau : The attached scripts hangs on python3.7+. This is due to the fact that the main process closes the communication channels directly while the queue_management_thread might still use them. To prevent that, all the closing should be handled by the

[issue39103] [linux] strftime renders %Y with only 3 characters

2019-12-19 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +belopolsky, p-ganssle ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39102] Increase Enum performance

2019-12-19 Thread Ethan Furman
Change by Ethan Furman : -- assignee: -> ethan.furman ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39094] Add a default to statistics.mean and related functions

2019-12-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thought experiment: Suppose someone proposed, "math.log(x) should take an optional default argument because it is inconvenient to a catch a ValueError if the input is non-positive". Or more generally, what if someone proposed, "every function in Python

[issue39103] [linux] strftime renders %Y with only 3 characters

2019-12-19 Thread Jason R. Coombs
New submission from Jason R. Coombs : On Python 3.8, there's a difference between how datetime.datetime.strftime renders %Y for years < 1000 between Linux and other platforms. # Linux $ docker run -it python python -c 'import datetime; print(datetime.date(900,1,1).strftime("%Y"))'

[issue39102] Increase Enum performance

2019-12-19 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +barry, eli.bendersky, ethan.furman ___ Python tracker ___ ___ Python-bugs-list

[issue39102] Increase Enum performance

2019-12-19 Thread Arseny Boykov
Change by Arseny Boykov : -- keywords: +patch pull_requests: +17133 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17669 ___ Python tracker ___

[issue39102] Increase Enum performance

2019-12-19 Thread Arseny Boykov
New submission from Arseny Boykov : Now enum has very poor speed on trying values and attributes access (especially when it comes to accessing members name/value attrs) There are two major reasons why attrs access is slow: - All values/names access going through DynamicClassAttribute (x10

[issue38815] test_ssl: test_min_max_version() fails on FreeBSD and Fedora

2019-12-19 Thread Kubilay Kocak
Kubilay Kocak added the comment: @Christian As current assignee, are you able to produce a test that fixes the remaining issue (per msg357792)? I can rebuild OpenSSL on the worker at your direction at any time to make the test fail again or provide you with an SSH account to assist

[issue39099] scandir.dirfd() method

2019-12-19 Thread Eryk Sun
Eryk Sun added the comment: > I am not sure if it's possible to also support Windows. For reference, FindFirstFileW doesn't support handle-relative names, and neither does CreateFileW. At a lower level in Windows NT, NtCreateFile has always supported handle-relative names, but CPython

[issue38971] codecs.open leaks file descriptor when invalid encoding is passed

2019-12-19 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +17132 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/17666 ___ Python tracker

[issue39070] Uninstalling 3.8.0 fails but it says it succeeds..

2019-12-19 Thread Steve Dower
Steve Dower added the comment: The only issue I see in that log is an apparent failure communicating between the unelevated and the elevated components of the uninstaller. But that doesn't seem to have interfered with the rest of the process, so I'm at a bit of a loss. Possibly it has

[issue39101] IsolatedAsyncioTestCase freezes when exception is raised

2019-12-19 Thread Fabio Pugliese Ornellas
Change by Fabio Pugliese Ornellas : -- type: -> crash ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39101] IsolatedAsyncioTestCase freezes when exception is raised

2019-12-19 Thread Fabio Pugliese Ornellas
New submission from Fabio Pugliese Ornellas : IsolatedAsyncioTestCase freezes whenever an exception that inherits from BaseException is raised: import unittest class TestHangsForever(unittest.IsolatedAsyncioTestCase): async def test_hangs_forever(self): raise BaseException("Hangs

[issue39100] email.policy.SMTP throws AttributeError on invalid header

2019-12-19 Thread Anton Khirnov
New submission from Anton Khirnov : When parsing a (broken) mail from linux-me...@vger.kernel.org (message-id 20190212181908.horde.peighvv2khy9ekuy8ta8...@webmail.your-server.de, headers attached) with email.policy.SMTP, I get an AttributeError on trying to read the 'to' header:

[issue39099] scandir.dirfd() method

2019-12-19 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Good point, I didn't consider that. I suppose you're right. =) Closing. -- stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue39099] scandir.dirfd() method

2019-12-19 Thread Benjamin Peterson
Benjamin Peterson added the comment: Why not just os.open the directory yourself and pass it to os.scandir? -- nosy: +benjamin.peterson ___ Python tracker ___

[issue39099] scandir.dirfd() method

2019-12-19 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- keywords: +patch pull_requests: +17131 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17664 ___ Python tracker

[issue39099] scandir.dirfd() method

2019-12-19 Thread Giampaolo Rodola'
New submission from Giampaolo Rodola' : PR in attachment adds a new dirfd() method to the scandir() object (POSIX only). This can be be passed to os.* functions supporting the "dir_fd" parameter, and avoid opening a new fd as in: >>> dirfd = os.open("basename", os.O_RDONLY, dir_fd=topfd)

[issue39093] tkinter objects garbage collected from non-tkinter thread cause panic and core dump

2019-12-19 Thread obserience
obserience added the comment: My proposed fix isn't compatible with a lot of current Tkinter using code. It was a naive first attempt and breaks existing code and doesn't completely solve the problem. Variables currently retain a reference to the TCL interpreter self._tk and aren't linked

[issue32888] Improve exception message in ast.literal_eval

2019-12-19 Thread Batuhan
Change by Batuhan : -- pull_requests: +17130 pull_request: https://github.com/python/cpython/pull/17662 ___ Python tracker ___ ___

[issue38980] Compile libpython with -fno-semantic-interposition

2019-12-19 Thread STINNER Victor
STINNER Victor added the comment: Pablo: > I have seen people using LD_PRELOAD (...) to interpose faster versions of > some functions or to collect metrics (although there are better ways). IMHO if someone has to go so far into "hacking" Python, they should recompile Python with specific

[issue38316] docs: Code object's "co_stacksize" field is described with mistake

2019-12-19 Thread STINNER Victor
STINNER Victor added the comment: Thanks Paul Sokolovsky for the bug report and thanks Batuhan Taşkaya for the fix ;-) -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue38316] docs: Code object's "co_stacksize" field is described with mistake

2019-12-19 Thread miss-islington
miss-islington added the comment: New changeset eba61f33d60cc63e35d5f5fcada837a66c89774a by Miss Islington (bot) (Batuhan Taşkaya) in branch '3.8': [3.8] bpo-38316: Fix co_stacksize documentation (GH-16983) (GH-17661)

[issue38316] docs: Code object's "co_stacksize" field is described with mistake

2019-12-19 Thread miss-islington
miss-islington added the comment: New changeset 917419f58b2869d71691c5ba54a9e02e5dcf73b2 by Miss Islington (bot) (Batuhan Taşkaya) in branch '3.7': [3.7] bpo-38316: Fix co_stacksize documentation (GH-16983). (GH-17660)

[issue38316] docs: Code object's "co_stacksize" field is described with mistake

2019-12-19 Thread Batuhan
Change by Batuhan : -- pull_requests: +17128 pull_request: https://github.com/python/cpython/pull/17660 ___ Python tracker ___ ___

[issue38316] docs: Code object's "co_stacksize" field is described with mistake

2019-12-19 Thread Batuhan
Change by Batuhan : -- pull_requests: +17129 pull_request: https://github.com/python/cpython/pull/17661 ___ Python tracker ___ ___

[issue39096] Description of "Format Specification Mini-Language" not accurate for Decimal

2019-12-19 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith, mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue34850] Emit a syntax warning for "is" with a literal

2019-12-19 Thread thautwarm
thautwarm added the comment: Thanks. However, unfortunately, this warning seems impossible to suppress. Use following example: import warnings warnings.filterwarnings('ignore') warnings.warn(SyntaxWarning("test")) def f(x): return x is 5 print(f(5)) I succeeded in

[issue39098] OSError: handle is closed in ProcessPoolExecutor on shutdown(wait=False)

2019-12-19 Thread Patrick Buxton
New submission from Patrick Buxton : When shutting down a ProcessPoolExecutor with wait=False, an `OSError: handle is closed` is raised. The error can be replicated with a script as simple as: ``` from concurrent.futures import ProcessPoolExecutor e = ProcessPoolExecutor() e.submit(id)

[issue11245] Implementation of IMAP IDLE in imaplib?

2019-12-19 Thread Josh de Kock
Josh de Kock added the comment: Hi, I'm new to python but I had a go at implementing this for imaplib(1) using a different approach. It works but it has a couple issues (see patch), I would appreciate any thoughts/improvements. -- nosy: +jdek versions: +Python 3.9 -Python 3.6 Added

[issue39087] [C API] No efficient C API to get UTF-8 string from unicode object.

2019-12-19 Thread Inada Naoki
Change by Inada Naoki : -- keywords: +patch pull_requests: +17127 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17659 ___ Python tracker ___

[issue39097] The description of multiprocessing.cpu_count() is not accurate in the documentation

2019-12-19 Thread songyuc
songyuc <466309...@qq.com> added the comment: Hi, Andrew! Thanks for your explanation! I am sorry about my unfamiliarity about the shortcut, as a student from China whose mother tongue is not English. So I am not quite familiar with the English customs in Computer engineering. --

[issue39097] The description of multiprocessing.cpu_count() is not accurate in the documentation

2019-12-19 Thread Andrew Svetlov
Andrew Svetlov added the comment: While your suggestion is technically correct, CPU as a shortcut for "logical processor" is very common in software engineering. For me, "number of CPU threads" is more unclear than just "number of CPUs" -- nosy: +asvetlov

[issue39097] The description of multiprocessing.cpu_count() is not accurate in the documentation

2019-12-19 Thread songyuc
New submission from songyuc <466309...@qq.com>: In the documentation of Python 3.7, the description of multiprocessing.cpu_count() is "Return the number of CPUs in the system.", but, in fact, this function return the CPU threads number. -- assignee: docs@python components:

[issue39094] Add a default to statistics.mean and related functions

2019-12-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: TL;DR: I'm not likely to accept this feature request without at least one of (1) a practical use-case, (2) prior art in other statistics software, or (3) a strong mathematical justification for why this is meaningful and useful. I'm not categorically

[issue39087] [C API] No efficient C API to get UTF-8 string from unicode object.

2019-12-19 Thread Inada Naoki
Inada Naoki added the comment: > Don't you need to DECREF bytes somehow, at least, in case of failure? Thanks. I will create a pull request with suggested changes. -- ___ Python tracker

[issue39094] Add a default to statistics.mean and related functions

2019-12-19 Thread STINNER Victor
STINNER Victor added the comment: > I've tried think of other solutions, such as a generic wrapper for such > functions or a helper to check whether an iterable is empty, and they all > turn out to be very clunky to use and un-Pythonic. So the main use case would be to detect an empty

[issue39094] Add a default to statistics.mean and related functions

2019-12-19 Thread Mark Dickinson
Mark Dickinson added the comment: What would the proposal look like for `statistics.stdev`? There you need at least two data points to compute a result, and a user might want to do different things for an empty dataset versus a single data point. -- nosy: +mark.dickinson

[issue39087] [C API] No efficient C API to get UTF-8 string from unicode object.

2019-12-19 Thread STINNER Victor
STINNER Victor added the comment: return PyBytesType.tp_as_buffer(bytes, view, PyBUF_CONTIG_RO); Don't you need to DECREF bytes somehow, at least, in case of failure? -- ___ Python tracker

[issue39096] Description of "Format Specification Mini-Language" not accurate for Decimal

2019-12-19 Thread Michael Amrhein
Michael Amrhein added the comment: For a discussion of the different behaviour of float and Decimal see https://bugs.python.org/issue39077. -- ___ Python tracker ___

[issue39077] Numeric formatting inconsistent between int, float and Decimal

2019-12-19 Thread Michael Amrhein
Michael Amrhein added the comment: Created new issue for tracking the deficiencies in the documentation: https://bugs.python.org/issue39096. -- resolution: -> wont fix stage: -> resolved status: open -> closed ___ Python tracker

[issue39096] Description of "Format Specification Mini-Language" not accurate for Decimal

2019-12-19 Thread Michael Amrhein
New submission from Michael Amrhein : The description of the "Format Specification Mini-Language" states for float and Decimal regarding presentation type 'f': "The default precision is 6." Regarding presentation type None it reads: "Similar to 'g', except that fixed-point notation, when used,

[issue39087] [C API] No efficient C API to get UTF-8 string from unicode object.

2019-12-19 Thread Inada Naoki
Inada Naoki added the comment: s/return NULL/return -1/g -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39087] [C API] No efficient C API to get UTF-8 string from unicode object.

2019-12-19 Thread Inada Naoki
Inada Naoki added the comment: > Would it be possible to use a "container" object like a Py_buffer? Is there a > way to customize the code executed when a Py_buffer is "released"? It looks nice idea! Py_buffer.obj is decref-ed when releasing the buffer.

[issue39087] [C API] No efficient C API to get UTF-8 string from unicode object.

2019-12-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Would it be possible to use a "container" object like a Py_buffer? Looks like a good idea. int PyUnicode_GetUTF8Buffer(Py_buffer *view, const char *errors) -- nosy: +skrah ___ Python tracker

[issue39087] [C API] No efficient C API to get UTF-8 string from unicode object.

2019-12-19 Thread STINNER Victor
STINNER Victor added the comment: > The returned object is the owner of the *utf8*. You need to Py_DECREF() it > after > you finished to using the *utf8*. The owner may be not the unicode. Would it be possible to use a "container" object like a Py_buffer? Is there a way to customize the

[issue39087] [C API] No efficient C API to get UTF-8 string from unicode object.

2019-12-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Do you mean some concrete code? Several times I wished similar feature. To get a UTF-8 cache if it exists and encode to UTF-8 without creating a cache otherwise. The private _PyUnicode_UTF8() macro could help if ((s = _PyUnicode_UTF8(str))) { size =

[issue20443] __code__. co_filename should always be an absolute path

2019-12-19 Thread STINNER Victor
STINNER Victor added the comment: I reverted my change, so I remove "release blocker" priority. -- priority: release blocker -> ___ Python tracker ___