[issue40288] [subinterpreters] atexit module should not be loaded more than once per interpreter

2020-09-09 Thread STINNER Victor
STINNER Victor added the comment: I would prefer a more generic solution, if possible: > bpo-40600: "Add an option to disallow creating more than one instance of a > module". -- ___ Python tracker

[issue41754] Webbrowser Module Cannot Find xdg-settings on OSX

2020-09-09 Thread Tony DiLoreto
New submission from Tony DiLoreto : The following code does not work on many OSX installations of Python via homebrew: >>> import webbrowser >>> webbrowser.open("http://www.google.com";) And throws the following error stack trace: File "/usr/local/opt/python@3.8/Frameworks/Python.framewor

[issue41672] imaplib: wrong return type documented

2020-09-09 Thread Dong-hee Na
Dong-hee Na added the comment: Please ping me when you submit the PR -- ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue40288] [subinterpreters] atexit module should not be loaded more than once per interpreter

2020-09-09 Thread Dong-hee Na
Dong-hee Na added the comment: @vstineer I'd like to update PR 19562 not to create more than one instance. if the PR is updated, would you like to review this PR? -- ___ Python tracker __

[issue29988] with statements are not ensuring that __exit__ is called if __enter__ succeeds

2020-09-09 Thread Gregory P. Smith
Change by Gregory P. Smith : -- versions: +Python 3.10 -Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch

2020-09-09 Thread Bug Reporter
Bug Reporter added the comment: I don't know if it matters, but I started having this problem when I switched from Ubuntu 18.04 (native python3.7) to 20.04 (native python3.8.2). I specify --prefix to a folder in my home directory, but while running make test Ubuntu gives a system error which

[issue40564] Using zipfile.Path with several files prematurely closes zip

2020-09-09 Thread Jason R. Coombs
Jason R. Coombs added the comment: In jaraco/zipp, I've implemented three of the options above: - https://github.com/jaraco/zipp/tree/bugfix/bpo-40564-option-1 - https://github.com/jaraco/zipp/tree/bugfix/bpo-40564-option-2 - https://github.com/jaraco/zipp/tree/bugfix/bpo-40564-option-5 -

[issue19438] Where is NoneType in Python 3?

2020-09-09 Thread Andrés Delfino
Andrés Delfino added the comment: ammar2 found this mail mentioning the changes in that commit https://mail.python.org/pipermail/python-dev/2007-November/075386.html "I've removed the 'new' module from py3k and also removed a lot of types from the 'types' module in py3k. It only contains types

[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2020-09-09 Thread Steve Dower
Steve Dower added the comment: The comment you quoted was referring to the NamedTemporaryFile(do_not_delete) flag. Yes, we'd have to reimplement the UCRT function using the system API. Ultimately, it's not a great compatibility layer if you want to match POSIX semantics and not just the C s

[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2020-09-09 Thread Eryk Sun
Eryk Sun added the comment: > Nothing preventing someone from contributing the flag on open as well. To be clear, supporting delete-access sharing would require re-implementing C _wopen in terms of CreateFileW, _open_osfhandle, etc. It could be implemented as _Py_wopen in Python/fileutils.c

[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2020-09-09 Thread Steve Dower
Steve Dower added the comment: Issue41490 can also be fixed by using FILE_SHARE_DELETE on all opened files (and that's a release blocker, so we need to fix it somehow), and if DeleteFile has been updated as you suggest then it might even help with the "pip replacing its own script executable

[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2020-09-09 Thread Eryk Sun
Eryk Sun added the comment: > Why do we need to use this O_TEMPORARY flag at all? Using the O_TEMPORARY flag isn't necessary, but it's usually preferred because it ensures the file gets deleted even if the process is terminated abruptly. However, it opens the file with delete access, and mos

[issue38572] Misleading AttributeError accessing fileno attribute in tarfile

2020-09-09 Thread Zackery Spytz
Change by Zackery Spytz : -- nosy: +ZackerySpytz nosy_count: 4.0 -> 5.0 pull_requests: +21244 pull_request: https://github.com/python/cpython/pull/22178 ___ Python tracker ___

[issue41428] PEP 604 -- Allow writing union types as X | Y

2020-09-09 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Now that PR 21515 is landed, we should consider what sections of the docs/spec needs to be updated. -- ___ Python tracker ___ ___

[issue35815] Able to instantiate a subclass with abstract methods from __init_subclass__ of the ABC

2020-09-09 Thread Thijs Damsma
Change by Thijs Damsma : -- nosy: +tda versions: +Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41428] PEP 604 -- Allow writing union types as X | Y

2020-09-09 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 1b4552c5e8e925f24c15f707050f22c977171125 by Maggie Moss in branch 'master': bpo-41428: Implementation for PEP 604 (GH-21515) https://github.com/python/cpython/commit/1b4552c5e8e925f24c15f707050f22c977171125 -- nosy: +pablogsal

[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2020-09-09 Thread Chary Chary
Chary Chary added the comment: I am not sure, this is the correct place to ask this "educational" question, but I will do this any way: where is this O_TEMPORARY flag defined? if I looks at [tempfile.py](https://github.com/python/cpython/blob/3ff6975e2c0af0399467f234b2e307cc76efcfa9/Lib/tem

[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2020-09-09 Thread Chary Chary
Chary Chary added the comment: Why do we need to use this O_TEMPORARY flag at all? I understand that we are using OS functionality, available on Windows, rather than implementing it in Python. But why doing this, if we already do this for none-nt systems in Python any way? Doesn't it just c

[issue41687] sendfile implementation is not compatible with Solaris

2020-09-09 Thread miss-islington
miss-islington added the comment: New changeset fa8c9e70104b0aef966a518eb3a80a4881906ae0 by Jakub Kulík in branch 'master': bpo-41687: Fix error handling in Solaris sendfile implementation (GH-22128) https://github.com/python/cpython/commit/fa8c9e70104b0aef966a518eb3a80a4881906ae0 --

[issue41753] subprocess.run on windows does not convert path to string

2020-09-09 Thread Eryk Sun
Eryk Sun added the comment: The underlying subprocess.Popen class was updated in 3.8 to support path-like objects in `args` (with shell=False) and `executable` on Windows [1]. This change was not backported to 3.6 and 3.7. --- [1] https://docs.python.org/3/library/subprocess.html#subprocess

[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2020-09-09 Thread Eryk Sun
Eryk Sun added the comment: > For this case, I think the best thing we can probably do is change the > default share mode for _all_ opens to include FILE_SHARE_DELETE. The C runtime doesn't provide a way to share delete access, except for the O_TEMPORARY flag, so Python would have to re-imp

[issue41688] Document how **= does not fall back on **

2020-09-09 Thread Brett Cannon
Change by Brett Cannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue41688] Document how **= does not fall back on **

2020-09-09 Thread miss-islington
miss-islington added the comment: New changeset 4c4c354de2c9a290afbd4e5fcba07e3696ca0396 by Miss Islington (bot) in branch '3.8': [3.8] [3.9] bpo-41688: Document bug in **= dispatching in the language data… (GH-22172) (GH-22175) https://github.com/python/cpython/commit/4c4c354de2c9a290afbd4e5

[issue41753] subprocess.run on windows does not convert path to string

2020-09-09 Thread Kaushik G
Kaushik G added the comment: Thank you for your response. There are two concerns I have here. 1. Python's promise of being straightforward. In MOST cases pathlib.Path objects do the right thing, casting to a string such that pathlib.Path is a drop in replacement. This exception is unexpecte

[issue41753] subprocess.run on windows does not convert path to string

2020-09-09 Thread Eric V. Smith
Eric V. Smith added the comment: Among others, see: issue 41649 issue 31961 In general, I think the consensus is that the caller should convert each argument to a string. It's not subprocess's job to convert each parameter to a string. -- nosy: +eric.smith _

[issue41688] Document how **= does not fall back on **

2020-09-09 Thread miss-islington
Change by miss-islington : -- pull_requests: +21243 pull_request: https://github.com/python/cpython/pull/22175 ___ Python tracker ___ __

[issue41688] Document how **= does not fall back on **

2020-09-09 Thread miss-islington
miss-islington added the comment: New changeset 46bc21e1780016aaacd34e472f838dc792fb674c by Ammar Askar in branch '3.9': [3.9] bpo-41688: Document bug in **= dispatching in the language data… (GH-22172) https://github.com/python/cpython/commit/46bc21e1780016aaacd34e472f838dc792fb674c --

[issue41753] subprocess.run on windows does not convert path to string

2020-09-09 Thread Kaushik G
New submission from Kaushik G : a call of the form `subprocess.run([x, y, z])` where one of the elements is a `pathlib.Pat`h fails on windows because the path is not converted to a string as it should. This works fine (as expected) on macOS and Linux. A typical error message is: `TypeError:

[issue41751] Error copying an instance of a subclass of OrderedDict

2020-09-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I do not think there is a bug. If we ever decide to change the behavior, the changes can only go in future Python version. And if we decide to make changes, I think that it would be better to make the pure Python implementation using __new__() instead of _

[issue41751] Error copying an instance of a subclass of OrderedDict

2020-09-09 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2020-09-09 Thread Chary Chary
Chary Chary added the comment: Steve Dower, thanks for looking at this. After reading the thread from my amature point of view I kind of liked suggestion of Daniel Lenski to replace the binary delete argument of the current NamedTemporaryFile implementation with finer-grained options https:

[issue41751] Error copying an instance of a subclass of OrderedDict

2020-09-09 Thread Erez Zinman
Erez Zinman added the comment: Just to be clear, what I did is (works with both "copy" and "pickle"): ``` def _new_and_init(cls): inst = cls.__new__(cls) OrderedDict.__init__(inst) return inst class A(OrderedDict): def __reduce__(self): # This fixes a bug in Python

[issue41751] Error copying an instance of a subclass of OrderedDict

2020-09-09 Thread Erez Zinman
Erez Zinman added the comment: The first argument can be remedied by creating a new method that deals with that (something like `def _new_init(cls)`, and passing the `cls` as argument). The third argument is not really an argument - there is a bug that needs a precedent to be solved. Concer

[issue41703] Most bytecode changes are absent from Python 3.9 What's new

2020-09-09 Thread Mark Shannon
Mark Shannon added the comment: Thanks for the reminder. Tis' done. -- stage: patch review -> ___ Python tracker ___ ___ Python-bu

[issue41703] Most bytecode changes are absent from Python 3.9 What's new

2020-09-09 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +21242 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22174 ___ Python tracker _

[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2020-09-09 Thread Steve Dower
Steve Dower added the comment: In general, if a bug here appears to be inactive, it's probably waiting on someone to volunteer to move it forward. Often merely posting to a thread is enough. For this case, I think the best thing we can probably do is change the default share mode for _all_

[issue41751] Error copying an instance of a subclass of OrderedDict

2020-09-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: First, closures cannot be pickled. You have to pass self.__class__ as an argument. Second, it will break compatibility with older Python versions. Pickles created in new Python could not be unpickled in older Pythons. Third, it is the behavior which does

[issue40124] Clearer assertion error

2020-09-09 Thread Udi
Udi added the comment: I don't see anything in the documentation of drain() that states that it cannot be called from multiple tasks. I'm also not sure why this assertion is necessary. If self._drain_waiter is already set, could the other task just await on it? -- nosy: +udifuchs _

[issue41748] HTMLParser: parsing error

2020-09-09 Thread Ezio Melotti
Ezio Melotti added the comment: The html.parser follows the HTML 5 specs as closely as possible. There are a few corner cases where it behaves slightly differently but it's only while dealing with invalid markup, and the differences should be trivial and generally not worth the extra comple

[issue41688] Document how **= does not fall back on **

2020-09-09 Thread Ammar Askar
Change by Ammar Askar : -- keywords: +patch nosy: +ammar2 nosy_count: 2.0 -> 3.0 pull_requests: +21241 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22172 ___ Python tracker ___

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2020-09-09 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue41748] HTMLParser: parsing error

2020-09-09 Thread STINNER Victor
STINNER Victor added the comment: Also, there is no warning about security in the html.parser documentation? Is this module mature and maintained enough to be considered as reliable? Or should we warn users about possible issues on corner cases, and point to BeautilfulSoup for a more mature

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2020-09-09 Thread pmp-p
pmp-p added the comment: all PyRun_InteractiveOne* functions are also affected it is really annoying when implementing repl behaviour when embedding( use cases : pyodide, android, wasi ) But I think the correct patch is : -char *newtok = PyOS_Readline(stdin, stdout, tok->prompt)

[issue41748] HTMLParser: parsing error

2020-09-09 Thread STINNER Victor
STINNER Victor added the comment: HTMLParser.check_for_whole_start_tag() uses locatestarttagend_tolerant regular expression to find the end of the start tag. This regex cuts the string at the first comma (","), but not if the comma is the first character of an attribute name * '' => '' => '

[issue41748] HTMLParser: parsing error

2020-09-09 Thread Ademar Nowasky Junior
Ademar Nowasky Junior added the comment: Yes, I understand that in the same way. Both are valid attr names. Maybe it's worth noting that Javascript has no problem handling this. -- ___ Python tracker _

[issue41751] Error copying an instance of a subclass of OrderedDict

2020-09-09 Thread Erez Zinman
Erez Zinman added the comment: small correction: meant `self.__class__` in the above function. Also, it is based on https://github.com/python/cpython/blob/76553e5d2eae3e8a47406a6de4f354fe33ff370b/Lib/collections/__init__.py#L302 -- ___ Python trac

[issue41751] Error copying an instance of a subclass of OrderedDict

2020-09-09 Thread Erez Zinman
Erez Zinman added the comment: Looking at the implementation of `__init__` (https://github.com/python/cpython/blob/76553e5d2eae3e8a47406a6de4f354fe33ff370b/Lib/collections/__init__.py#L109), it seems that you can fix this bug while retaining backward compatibility if you would use `__new__`

[issue41748] HTMLParser: parsing error

2020-09-09 Thread STINNER Victor
STINNER Victor added the comment: HTML 5.2 specification says https://www.w3.org/TR/html52/syntax.html#elements-attributes "Attribute names must consist of one or more characters other than the space characters, U+ NULL, U+0022 QUOTATION MARK ("), U+0027 APOSTROPHE ('), U+003E GREATER-TH

[issue41571] Implement thread-related commands in pdb

2020-09-09 Thread Irit Katriel
Change by Irit Katriel : -- nosy: +iritkatriel ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue41752] Wave shouldn't try to close an open file at all costs

2020-09-09 Thread Karel
New submission from Karel : The standard `wave` library tries to close a file unconditionally. I believe this is wrong. >From the docs: Wave_write.close(): Make sure nframes is correct, and close the file if it was opened by wave. *This method is called upon object collection.* [...] This le

[issue41571] Implement thread-related commands in pdb

2020-09-09 Thread Dong-hee Na
Dong-hee Na added the comment: I am +1 on this project :) -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41571] Implement thread-related commands in pdb

2020-09-09 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue41749] Little improve on imghdr library

2020-09-09 Thread Dong-hee Na
Dong-hee Na added the comment: IMHO, those use cases are already intended. We can read such use case on test code but also documentation. It will break legacy usage. I am -1 on change the API signature. We should think deeply before changing this. -- nosy: +corona10 _

[issue41748] HTMLParser: parsing error

2020-09-09 Thread Ademar Nowasky Junior
Change by Ademar Nowasky Junior : -- type: security -> crash ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28850] Regression in Python 3: Subclassing PrettyPrinter.format doesn't work anymore

2020-09-09 Thread Georg Brandl
Change by Georg Brandl : -- nosy: -georg.brandl ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue41751] Error copying an instance of a subclass of OrderedDict

2020-09-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: So we are restricted by backward compatibility with the original pure Python implementation. Sometimes it is feasible to break backward compatibility, but there should be very good reasons for it. -- ___ Python

[issue41751] Error copying an instance of a subclass of OrderedDict

2020-09-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It would break the code which expect that __init__() be called (I do not know if there are much such code, but still). It also would not work with the original pure Python implementation of OrderedDict, which initializes the OrderedDict object in __init__(

[issue28850] Regression in Python 3: Subclassing PrettyPrinter.format doesn't work anymore

2020-09-09 Thread Irit Katriel
Change by Irit Katriel : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue41750] unpractical printing of datetimes by the interpreter

2020-09-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The UTC timezone implementation in the stdlib works well: >>> import datetime >>> datetime.datetime(2020, 9, 9, 8, 0, tzinfo=datetime.timezone.utc) datetime.datetime(2020, 9, 9, 8, 0, tzinfo=datetime.timezone.utc) I guess you use a third-part implementation

[issue41751] Error copying an instance of a subclass of OrderedDict

2020-09-09 Thread Erez Zinman
Erez Zinman added the comment: Proposed solution - change OrderedDict's `__reduce_ex__ ` function. The code below works like expected if I override `__reduce_ex__` like so: ``` def __reduce_ex__(self, protocol): ret = list(super().__reduce_ex__(protocol)) ret[0] = type(se

[issue41751] Error copying an instance of a subclass of OrderedDict

2020-09-09 Thread Erez Zinman
New submission from Erez Zinman : This bug occurs when copying/pickling an ordered-dict subtype that has default items. The initialization function that's returned is **not** `object.__new__` so the default items are set when the copied/pickled item is created. The problem I encountered is th

[issue41750] unpractical printing of datetimes by the interpreter

2020-09-09 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +belopolsky, p-ganssle ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue41750] unpractical printing of datetimes by the interpreter

2020-09-09 Thread J Rt
New submission from J Rt : I think the way datetimes get printed by the interpreter is a bit unpractical. For example: datetime.datetime(2020, 9, 9, 8, 0, tzinfo=) The reason for the inpracticality is that this cannot be put right into python back: >>>datetime.datetime(2020, 9, 9, 8, 0, tz

[issue41726] Update refcounts info of PyType_FromModuleAndSpec in refcounts.dat

2020-09-09 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 1e2f051a6127904cfee5f9e4021dd6e4a4d51c0f by Hai Shi in branch 'master': bpo-41726: Update the refcounts info of PyType_FromModuleAndSpec in refcounts.dat (GH-22112) https://github.com/python/cpython/commit/1e2f051a6127904cfee5f9e4021dd6e4a4d51c0

[issue41703] Most bytecode changes are absent from Python 3.9 What's new

2020-09-09 Thread Ned Deily
Ned Deily added the comment: Mark, PR 22151 needs to be merged to the 3.9 branch as well. You can add the "Needs backport to 3.9" label to the original PR. -- nosy: +ned.deily ___ Python tracker __

[issue20468] resource module documentation is incorrect

2020-09-09 Thread Greg Lindahl
Greg Lindahl added the comment: I just tripped on the bug that the maxrss field is kilobytes on Linux and bytes on Darwin. I don't think referring to the C manpages is sufficient to prevent confusion. I don't actually use my package on a Mac, I just use Travis-CI to test it. -- nosy

[issue35328] Set a environment variable for venv prompt

2020-09-09 Thread Vinay Sajip
Change by Vinay Sajip : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue40300] logging.Formatter crashes when default_msec_format is None.

2020-09-09 Thread Vinay Sajip
Change by Vinay Sajip : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue38762] Logging displays wrong "processName" if "sys.modules" is cleared in child process

2020-09-09 Thread Vinay Sajip
Change by Vinay Sajip : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue38447] test_multiprocessing_spawn: Dangling processes: {} on AMD64 RHEL7 Refleaks 3.7

2020-09-09 Thread STINNER Victor
STINNER Victor added the comment: Issue seen on x86 Windows7 3.8: https://buildbot.python.org/all/#/builders/270/builds/30 0:52:12 load avg: 6.48 [367/423/1] test_multiprocessing_spawn failed (env changed) (12 min 32 sec) Warning -- Dangling processes: {} I keep the issue closed since I spen

[issue41525] Python '--help' has corrupted text.

2020-09-09 Thread STINNER Victor
STINNER Victor added the comment: xtreak: "serhiy , I can similar quotes present in Lib/pydoc_data/topics.py too which is autogenerated. Could this cause issues with pydoc too while reading topics?" If you consider that it is an issue, please open a new issue. -- __

[issue19438] Where is NoneType in Python 3?

2020-09-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the link. It looks like NoneType got inadvertently caught up in the sweep of names that had direct synonyms. -- ___ Python tracker __