[issue43629] fix _PyRun_SimpleFileObject create __main__ module and cache. Call this function multiple times, the attributes stored in the module dict will affect eachother.

2021-03-25 Thread junyixie
Change by junyixie : -- resolution: -> wont fix ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue43620] os.path.join does not use os.sep as documentation claims

2021-03-25 Thread Fred Drake
Fred Drake added the comment: Just reviewed the documentation for both os.sep and os.path.join(). The os.sep docs do not suggest it can be set, and the reference in the os.path.join() description is silent regarding that, so can be read as Jared did. I don't recall this coming up before, bu

[issue40066] Enum: modify __repr__, __str__; update docs

2021-03-25 Thread Ethan Furman
Change by Ethan Furman : -- components: +Library (Lib) title: Enum._convert should change __repr__ and/or __str__ to use module name instead of class name -> Enum: modify __repr__, __str__; update docs ___ Python tracker

[issue43629] fix _PyRun_SimpleFileObject create __main__ module and cache. Call this function multiple times, the attributes stored in the module dict will affect eachother.

2021-03-25 Thread junyixie
Change by junyixie : -- keywords: +patch pull_requests: +23773 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25023 ___ Python tracker ___ ___

[issue43629] fix _PyRun_SimpleFileObject create __main__ module and cache. Call this function multiple times, the attributes stored in the module dict will affect eachother.

2021-03-25 Thread junyixie
New submission from junyixie : fix _PyRun_SimpleFileObject create __main__ module and cache. Call this function multiple times, the attributes stored in the module dict will affect eachother. create __main__ module, and cache it. for example. if we run fileA, call _PyRun_SimpleFileObject wi

[issue40758] For 7.2.7. Code Examples, distinguish between the Tutorial and other documentation

2021-03-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: I would think this would go without saying. The word "tutorial" means example driven instruction. Previous to now, no one has ever reported confusion about this. -- nosy: +rhettinger ___ Python tracker

[issue43628] Incorrect argument errors for random.getstate()

2021-03-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: Here's how to use getstate() and setstate(): >>> import random >>> state = random.getstate() >>> random.choices('ABCDE', k=8) ['E', 'A', 'B', 'B', 'A', 'A', 'E', 'D'] >>> # restore the previous state >>> random.setstate(state) >>> # now, replay the random se

[issue43628] Incorrect argument errors for random.getstate()

2021-03-25 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +mark.dickinson, rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue43628] Incorrect argument errors for random.getstate()

2021-03-25 Thread Yang Feng
New submission from Yang Feng : In documentation of random.getstate(), it says: “random.getstate() Return an object capturing the current internal state of the generator. This object can be passed to setstate() to restore the state.” random.getstate() takes 0 argument and return the current set

[issue43624] Add underscore as a decimal separator for string formatting

2021-03-25 Thread Eric V. Smith
Eric V. Smith added the comment: If we do anything for float, we should do the same for decimal.Decimal. -- ___ Python tracker ___

[issue43624] Add underscore as a decimal separator for string formatting

2021-03-25 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue39418] str.strip() should have a means of adding to the default behaviour

2021-03-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: Marking this as closed because the issue doesn't seem to have gathered much interest. If someone wants to move this forward, I recommend discussing it on python-ideas. -- resolution: -> rejected stage: -> resolved status: open -> closed __

[issue43620] os.path.join does not use os.sep as documentation claims

2021-03-25 Thread Jared Sutton
Jared Sutton added the comment: > Perhaps Jared was expecting that modifying os.sep would affect the functions > in os.path? This is precisely what I thought, because the documentation makes it sound like that variable named os.sep is read and used as the path delimiter when constructing so

[issue40758] For 7.2.7. Code Examples, distinguish between the Tutorial and other documentation

2021-03-25 Thread Irit Katriel
Change by Irit Katriel : -- assignee: -> docs@python components: +Documentation nosy: +docs@python versions: -Python 3.5, Python 3.6, Python 3.7 ___ Python tracker ___ __

[issue39418] str.strip() should have a means of adding to the default behaviour

2021-03-25 Thread Irit Katriel
Irit Katriel added the comment: In python 3.9 there is also str.removeprefix: https://docs.python.org/3/library/stdtypes.html#str.removeprefix which you can apply in a loop. -- components: +Library (Lib) nosy: +iritkatriel ___ Python tracker

[issue38241] doc: Pickle with protocol=0 in python 3 does not produce a 'human-readable' format

2021-03-25 Thread Irit Katriel
Change by Irit Katriel : -- assignee: -> docs@python components: +Documentation nosy: +docs@python title: Pickle with protocol=0 in python 3 does not produce a 'human-readable' format -> doc: Pickle with protocol=0 in python 3 does not produce a 'human-readable' format versions: +Pyt

[issue21297] csv.skipinitialspace only skips spaces, not "whitespace" in general

2021-03-25 Thread Irit Katriel
Change by Irit Katriel : -- versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.4, Python 3.5, Python 3.6 ___ Python tracker ___ _

[issue35816] csv.DictReader, skipinitialspace does not ignore tabs

2021-03-25 Thread Irit Katriel
Change by Irit Katriel : -- components: +Library (Lib) versions: +Python 3.10 -Python 3.5 ___ Python tracker ___ ___ Python-bugs-lis

[issue43618] random.shuffle loses most of the elements

2021-03-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: As an immediate fix to your problem, replace this line: random.shuffle(questions_element) with: questions = list(questions_element) random.shuffle(questions) questions_element[:] = questions -- ___

[issue43624] Add underscore as a decimal separator for string formatting

2021-03-25 Thread Dominic Davis-Foster
Dominic Davis-Foster added the comment: ISO 8-1:2009 recommends groups of three digits either side of the decimal sign. -- nosy: +domdfcoding ___ Python tracker ___ _

[issue43627] What are the requirements for a test_sundry-testable script in Tools/scripts?

2021-03-25 Thread Skip Montanaro
Change by Skip Montanaro : -- title: What are the requirements for a test_sunry-testable script in Tools/scripts? -> What are the requirements for a test_sundry-testable script in Tools/scripts? ___ Python tracker

[issue43625] CSV has_headers heuristic could be improved

2021-03-25 Thread Skip Montanaro
Skip Montanaro added the comment: I assume the OP is referring to this sort of usage: >>> sniffer = csv.Sniffer() >>> raw = open("mixed.csv").read() >>> sniffer.has_header(raw) False *sigh* I really wish the Sniffer class had never been added to the CSV module. I can't recall who wrote it (

[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2021-03-25 Thread STINNER Victor
STINNER Victor added the comment: I reopen the issue to remind me that collections.deque() freelist is shared by all interpreters. -- resolution: fixed -> status: closed -> open ___ Python tracker

[issue43627] What are the requirements for a test_sunry-testable script in Tools/scripts?

2021-03-25 Thread Skip Montanaro
New submission from Skip Montanaro : In my fork of python/cpython I recently created a simple script to help me with my work (I am messing around in the internals and sometimes get blindsided by opcode changes). I stuck the script in Tools/script which caused test_tools.test_sundry to hang. (

[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2021-03-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 3bb19873abd572879cc9a8810b1db9db1f704070 by Raymond Hettinger in branch 'master': Revert "bpo-40521: Remove freelist from collections.deque() (GH-21073)" (GH-24944) https://github.com/python/cpython/commit/3bb19873abd572879cc9a8810b1db9db1f7

[issue43625] CSV has_headers heuristic could be improved

2021-03-25 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue43625] CSV has_headers heuristic could be improved

2021-03-25 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +skip.montanaro ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue43511] tkinter with Tk 8.6.11 is slow on macOS

2021-03-25 Thread Christopher A. Chavez
Change by Christopher A. Chavez : -- nosy: +chrstphrchvz ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue24605] segmentation fault at asciilib_split_char.lto_priv

2021-03-25 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Pyth

[issue24605] segmentation fault at asciilib_split_char.lto_priv

2021-03-25 Thread STINNER Victor
STINNER Victor added the comment: No activity for 6 years, the reporter didn't provide any way to reproduce the crash, I close the issue. Note: Python 3.10 now dumps the list of third party C extensions on a fatal error, or when faulthandler handlers a crash ;-) Just enabled the Python Deve

[issue43609] ast.unparse-ing a FunctionType gives ambiguous result

2021-03-25 Thread midori
midori added the comment: @BTaskaya I've seen this in third party ides and type checker. For example they are referring to "Union[Callable[[], Union[int, str]], None]" as "() -> (int | str) | None" where there are parentheses around the returns. -- __

[issue43624] Add underscore as a decimal separator for string formatting

2021-03-25 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue43626] SIGSEV in PyErr_SetObject

2021-03-25 Thread STINNER Victor
STINNER Victor added the comment: > What can be happening? How can I help to debug this? Try to run your application in the Python Debug Mode: https://docs.python.org/dev/library/devmode.html The best is if you can run your application with a Python built in debug mode. Usually, it's a bug

[issue43620] os.path.join does not use os.sep as documentation claims

2021-03-25 Thread Eryk Sun
Eryk Sun added the comment: Fred, do you think this needs to be reopened to clarify that os.sep and os.altsep are not parameters for the ntpath and posixpath modules? I would have thought that the note at the top (path name conventions, etc) would be sufficient to let someone know that os.p

[issue43626] SIGSEV in PyErr_SetObject

2021-03-25 Thread Abraham Macias
New submission from Abraham Macias : Hi, I'm dealing with random crashes when using pymongo in Python 3.7.3 in a Debian Buster. This is the python backtrace: (gdb) thread apply all py-bt Thread 2 (Thread 0x7f9817d95700 (LWP 221)): Traceback (most recent call first): File "/usr/local/lib/pyt

[issue43609] ast.unparse-ing a FunctionType gives ambiguous result

2021-03-25 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: Hey @cleoold! Technically the second AST you gave is invalid (fun2), considering that the FunctionType is not an expression; mod = Module(stmt* body, type_ignore* type_ignores) | FunctionType(expr* argtypes, expr returns) expr = BoolOp(boolo

[issue43618] random.shuffle loses most of the elements

2021-03-25 Thread Stefan Behnel
Stefan Behnel added the comment: Yes, this is neither a bug in CPython (or its stdlib) nor in lxml. It's how things work. Don't use these two together. -- resolution: -> third party stage: -> resolved status: open -> closed ___ Python tracker

[issue43624] Add underscore as a decimal separator for string formatting

2021-03-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: Some brief research === """ in numbers four or more digits long, use commas to set off groups of three digits, counting leftward from the decimal point, in the standard American style. For long decimal numbers, do not use any digit-group se

[issue43616] random.shuffle() crashes with Unhandled exception

2021-03-25 Thread Stefan Behnel
Stefan Behnel added the comment: Almost certainly not a bug in CPython's stdlib. Possibly something worth investigating in lxml, although, as stated in issue 43618, random.shuffle() simply does not work on lxml.etree Elements. -- resolution: -> third party stage: -> resolved status

[issue43625] CSV has_headers heuristic could be improved

2021-03-25 Thread ejacq
New submission from ejacq <0pyth...@jesuislibre.net>: Here is an sample of CSV input: "time","forces" 0,0 0.5,0.9 when calling has_header() from csv.py on this sample, it returns false. Why? because 0 and 0.5 don't belong to the same type and thus the column is discarded by the heuristic. I

[issue43620] os.path.join does not use os.sep as documentation claims

2021-03-25 Thread Fred Drake
Fred Drake added the comment: Perhaps Jared was expecting that modifying os.sep would affect the functions in os.path? os.sep was never intended to be updated. Using the specific *path modules to work with "foreign" paths has long been advocated as the way to do this. It isn't a work-aroun

[issue37745] 3.8b3 - windows install gui/ inconsistent options

2021-03-25 Thread Dimitri Merejkowsky
Dimitri Merejkowsky added the comment: I know this is two years later so maybe this is not the best way to get answers, but Steve Dower said: > We don't add Python to PATH by default (because it's bad), and people > couldn't find the option Could someone clarify this for me? Because my expe

[issue43624] Add underscore as a decimal separator for string formatting

2021-03-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: IIRC there is ISO recommending that after the decimal point, digits be arranged in groups of five. I think is also how printed reference tables are typically formatted. -- nosy: +mark.dickinson, rhettinger, serhiy.storchaka _

[issue24605] segmentation fault at asciilib_split_char.lto_priv

2021-03-25 Thread Irit Katriel
Irit Katriel added the comment: Is there anything we can do about this or should it be closed? -- nosy: +iritkatriel status: open -> pending ___ Python tracker ___ ___

[issue43618] random.shuffle loses most of the elements

2021-03-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: Interestingly, this isn't an LXML bug. It is a documented difference from how the standard library works: https://lxml.de/tutorial.html#elements-are-lists So, if you want use random.shuffle(), you need the standard library ElementTree instead of lxm

[issue43616] random.shuffle() crashes with Unhandled exception

2021-03-25 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +scoder -skrah ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue43618] random.shuffle loses most of the elements

2021-03-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: The standard library isn't at fault here. Please file this an an LXML bug. Reproducer: from lxml.etree import Element root = Element('outer') root.append(Element('zero')) root.append(Element('one')) root.append(Element('two')) pri

[issue43624] Add underscore as a decimal separator for string formatting

2021-03-25 Thread Terry Davis
New submission from Terry Davis : Proposal: Enable this >>> format(12_34_56.12_34_56, '_._f') '123_456.123_456' Where now only this is possible >>> format(12_34_56.12_34_56, '_.f') '123_456.123456' Based on the discussion in the Ideas forum, three core devs support this addition. https://dis

[issue43416] Add README files in Include/cpython and Include/internal

2021-03-25 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue43416] Add README files in Include/cpython and Include/internal

2021-03-25 Thread STINNER Victor
STINNER Victor added the comment: New changeset 929c9039fe0468cb37e0811ddfb7b67c98353ea8 by Erlend Egeberg Aasland in branch 'master': bpo-43416: Add Include/README.rst (GH-24884) https://github.com/python/cpython/commit/929c9039fe0468cb37e0811ddfb7b67c98353ea8 -- _

[issue43582] SSLContext.sni_callback docs inaccurately describe available handshake info

2021-03-25 Thread Andrew Dailey
Andrew Dailey added the comment: Okay, that makes sense. I appreciate the overview! What do you feel is the best way to "solve" this issue, then? Should the docs be updated to reflect the fact that ALPN info isn't available in the sni_callback? Or should some code be modified to make the doc

[issue33164] Blake 2 module update

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

[issue42136] [importlib] deprecate module_repr() methods

2021-03-25 Thread Brett Cannon
Change by Brett Cannon : -- keywords: +patch pull_requests: +23772 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25022 ___ Python tracker ___ ___

[issue33164] Blake 2 module update

2021-03-25 Thread Christian Heimes
Change by Christian Heimes : -- resolution: fixed -> stage: resolved -> needs patch status: closed -> open type: -> behavior ___ Python tracker ___ __

[issue43620] os.path.join does not use os.sep as documentation claims

2021-03-25 Thread Eryk Sun
Eryk Sun added the comment: > certainly you can see this is a doc bug, since the doc clearly > states that os.sep is utilized to join the elements of the path, > when it clearly isn't; right? os.path is ntpath in Windows, which uses backslash as the path separator, which is the same as os.se

[issue33164] Blake 2 module update

2021-03-25 Thread STINNER Victor
STINNER Victor added the comment: > This reverted commit 5940c535b06805960d008bcafec7260dae74d9b9 Context of the memcpy/memove change: https://github.com/BLAKE2/BLAKE2/issues/32 -- nosy: +vstinner ___ Python tracker

[issue43623] nouveauté 2021

2021-03-25 Thread STINNER Victor
Change by STINNER Victor : -- Removed message: https://bugs.python.org/msg389503 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue43623] nouveauté 2021

2021-03-25 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python

[issue43623] nouveauté 2021

2021-03-25 Thread Emmanuel Miranda
New submission from Emmanuel Miranda : Avec un nouveau cycle de release annuel la communauté Python ne cesse d’aller de l’avant hâte de voir ce qu’ils nous réservent pour 2021 après la version 3.10 ! En espérant que les applicatifs suivent pour supporter https://webscre.com/ -- compon

[issue33164] Blake 2 module update

2021-03-25 Thread Petr Viktorin
Petr Viktorin added the comment: This reverted commit 5940c535b06805960d008bcafec7260dae74d9b9 -- nosy: +petr.viktorin ___ Python tracker ___ _

[issue43244] Move PyArena C API to the internal C API

2021-03-25 Thread STINNER Victor
STINNER Victor added the comment: In short, this issue is a follow-up of bpo-40939. These C API removal are related to the final step of the PEP 617 "New PEG parser for CPython": removal of the PyParser C API. * The PyParser C API produced "node*" objects, like PyParser_SimpleParseFile(FILE

[issue43620] os.path.join does not use os.sep as documentation claims

2021-03-25 Thread Jared Sutton
Jared Sutton added the comment: I can understand your suggestion to just utilize the posixpath library on Windows if needed. That's a reasonable work-around. But certainly you can see this is a doc bug, since the doc clearly states that os.sep is utilized to join the elements of the path, wh

[issue43622] TLS 1.3, client polling returns event without data

2021-03-25 Thread Christian Heimes
Christian Heimes added the comment: It looks like your code is treating a SSLSocket like an ordinary Kernel socket. SSLSocket are implemented in user space and behave differently. https://docs.python.org/3/library/ssl.html#ssl-nonblocking explains some of the aspects of non-blocking I/O for

[issue43622] TLS 1.3, client polling returns event without data

2021-03-25 Thread gchauvel
gchauvel added the comment: that's not the polling in itself, it's: polling returning event + setblocking(False) + recv() which blocks note: the behavior is present for python3.6 -- ___ Python tracker _

[issue43622] TLS 1.3, client polling returns event without data

2021-03-25 Thread Christian Heimes
Christian Heimes added the comment: Could you please explain why you consider this a bug? TLS 1.3 works differently than TLS 1.2. You must always assume that an application level read can result in a protocol level write operation and the other way around. This could happen with TLS 1.2, but

[issue43622] TLS 1.3, client polling returns event without data

2021-03-25 Thread gchauvel
New submission from gchauvel : A simple test in test_ssl.py [1][2] with following context: - client connects and listens to data without sending any first - traces to make sure no data is written at test level from server or client - TLSv1.3 is allowed or not using "context.options |= ssl.OP_NO_

[issue43613] gzip.compress and gzip.decompress are sub-optimally implemented.

2021-03-25 Thread Ruben Vorderman
Ruben Vorderman added the comment: I created bpo-43621 for the error issue. There should only be BadGzipFile. Once that is fixed, having only one error type will make it easier to implement some functions that are shared across the gzip.py codebase. -- __

[issue43621] gzip._GzipReader should only throw BadGzipFile errors

2021-03-25 Thread Ruben Vorderman
Change by Ruben Vorderman : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue43612] zlib.compress should have a wbits argument

2021-03-25 Thread Ruben Vorderman
Change by Ruben Vorderman : -- components: +Extension Modules -Library (Lib) ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue43621] gzip._GzipReader should only throw BadGzipFile errors

2021-03-25 Thread Ruben Vorderman
New submission from Ruben Vorderman : This is properly documented: https://docs.python.org/3/library/gzip.html#gzip.BadGzipFile . It now hrows EOFErrors when a stream is truncated. But this means that upstream both BadGzipFile and EOFError need to be catched in the exception handling when o