[issue39812] Avoid daemon threads in concurrent.futures

2022-04-06 Thread Josh Rosenberg
Change by Josh Rosenberg : -- Removed message: https://bugs.python.org/msg416876 ___ Python tracker <https://bugs.python.org/issue39812> ___ ___ Python-bug

[issue39812] Avoid daemon threads in concurrent.futures

2022-04-06 Thread Josh Rosenberg
Josh Rosenberg added the comment: I think this is causing a regression for code that explicitly desires the ThreadPoolExecutor to go away abruptly when all other non-daemon threads complete (by choosing not to use a with statement, and if shutdown is called, calling it with wait=False, or

[issue46814] Documentation for constructin abstract base classes is misleading

2022-02-21 Thread Josh A. Mitchell
Change by Josh A. Mitchell : -- keywords: +patch pull_requests: +29592 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31463 ___ Python tracker <https://bugs.python.org/issu

[issue46814] Documentation for constructin abstract base classes is misleading

2022-02-21 Thread Josh A. Mitchell
New submission from Josh A. Mitchell : The docs for the abc[0] module states "With this class, an abstract base class can be created by simply deriving from ABC", and then gives an example of a class with no contents. This is not sufficient to construct an ABC; an ABC in Python ad

[issue46645] Portable python3 shebang for Windows, macOS, and Linux

2022-02-04 Thread Josh Triplett
Josh Triplett added the comment: Correction to the above evaluation of `#!/usr/bin/env python3`, based on some retesting on Windows systems: The failure case we encounter reasonably often involves the official Python installer for Windows, but applies specifically in the case of third-party

[issue46645] Portable python3 shebang for Windows, macOS, and Linux

2022-02-04 Thread Josh Triplett
New submission from Josh Triplett : I'm writing this issue on behalf of the Rust project. The build system for the Rust compiler is a Python 3 script `x.py`, which orchestrates the build process for a user even if they don't already have Rust installed. (For instance, `x.py bui

[issue46175] Zero argument super() does not function properly inside generator expressions

2021-12-27 Thread Josh Rosenberg
Josh Rosenberg added the comment: Carlos: This has nothing to do with reloading (as Alex's repro shows, no reload calls are made). super() *should* behave the same as super(CLASS_DEFINED_IN, self), and it looks like the outer function is doing half of what it must do to make no-arg

[issue46148] Optimize pathlib

2021-12-22 Thread Josh Rosenberg
Josh Rosenberg added the comment: Note: attrgetter could easily be made faster by migrating it to use vectorcall. -- nosy: +josh.r ___ Python tracker <https://bugs.python.org/issue46

[issue46082] type casting of bool

2021-12-15 Thread Josh Rosenberg
Josh Rosenberg added the comment: Agreed, this is not a bug. The behavior of the bool constructor is not a parser (unlike, say, int), it's a truthiness detector. Non-empty strings are always truthy, by design, so both "True" and "False" are truthy strings. There&

[issue45707] Variable reassginment triggers incorrect behaviors of locals()

2021-11-03 Thread Josh Rosenberg
Josh Rosenberg added the comment: This is a documented feature of locals() (it's definitionally impossible to auto-vivify *real* locals, because real locals are statically assigned to specific indices in a fixed size array at function compile time, and the locals() function is return

[issue45520] Frozen dataclass deep copy doesn't work with __slots__

2021-10-19 Thread Josh Rosenberg
Josh Rosenberg added the comment: You're right that in non-dataclass scenarios, you'd just use __slots__. The slots=True thing was necessary for any case where any of the dataclass's attributes have default values (my_int: int = 0), or are defined with fields (my_lis

[issue45520] Frozen dataclass deep copy doesn't work with __slots__

2021-10-18 Thread Josh Rosenberg
Josh Rosenberg added the comment: When I define this with the new-in-3.10 slots=True argument to dataclass rather than manually defining __slots__ it works just fine. Looks like the pickle format changes rather dramatically to accommodate it. >>> @dataclass(frozen=True, s

[issue45450] Improve syntax error for parenthesized arguments

2021-10-12 Thread Josh Rosenberg
Josh Rosenberg added the comment: Why not "lambda parameters cannot be parenthesized" (optionally "lambda function")? def-ed function parameters are parenthesized, so just saying "Function parameters cannot be parenthesized" seems very we

[issue45414] pathlib.Path.parents negative indexing is wrong for absolute paths

2021-10-08 Thread Josh Rosenberg
Josh Rosenberg added the comment: On the subject of sleep-deprived and/or sloppy, just realized: return self.__getitem__(len(self) + idx) should really just be: idx += len(self) no need to recurse. -- ___ Python tracker <ht

[issue45414] pathlib.Path.parents negative indexing is wrong for absolute paths

2021-10-08 Thread Josh Rosenberg
Josh Rosenberg added the comment: "We'll definitely want to make sure that we're careful about bad indices ... since it would be easy to get weird behavior where too-large negative indexes start 'wrapping around'" When I noticed the problem, I originally thought

[issue45340] Lazily create dictionaries for plain Python objects

2021-10-08 Thread Josh Rosenberg
Josh Rosenberg added the comment: Hmm... And there's one other issue (that wouldn't affect people until they actually start worrying about memory overhead). Right now, if you want to determine the overhead of an instance, the options are: 1. Has __dict__: sys.getsizeof(obj) + sys

[issue45340] Lazily create dictionaries for plain Python objects

2021-10-08 Thread Josh Rosenberg
Josh Rosenberg added the comment: Hmm... Key-sharing dictionaries were accepted largely without question because they didn't harm code that broke them (said code gained nothing, but lost nothing either), and provided a significant benefit. Specifically: 1. They imposed no penalty on

[issue21041] pathlib.PurePath.parents rejects negative indexes

2021-10-08 Thread Josh Rosenberg
Josh Rosenberg added the comment: Negative indexing is broken for absolute paths, see #45414. -- nosy: +josh.r ___ Python tracker <https://bugs.python.org/issue21

[issue45414] pathlib.Path.parents negative indexing is wrong for absolute paths

2021-10-08 Thread Josh Rosenberg
New submission from Josh Rosenberg : At least on PosixPath (not currently able to try on Windows to check WindowsPath, but from a quick code check I think it'll behave the same way), the negative indexing added in #21041 is implemented incorrectly for absolute paths. Passing either -1

[issue17792] Unhelpful UnboundLocalError due to del'ing of exception target

2021-09-30 Thread Josh Rosenberg
Josh Rosenberg added the comment: Aaron: Your understanding of how LEGB works in Python is a little off. Locals are locals for the *entire* scope of the function, bound or unbound; deleting them means they hold nothing (they're unbound) but del can't actually stop them from be

[issue45333] += operator and accessors bug?

2021-09-30 Thread Josh Rosenberg
Josh Rosenberg added the comment: This has nothing to do with properties, it's 100% about using augmented assignment with numpy arrays and mixed types. An equivalent reproducer is: a = np.array([1,2,3]) # Implicitly of dtype np.int64 a += 0.5 # Throws the same error, no prope

[issue15870] PyType_FromSpec should take metaclass as an argument

2021-09-28 Thread Josh Haberman
Josh Haberman added the comment: > Everything is copied by `_FromSpec` after all. One thing I noticed isn't copied is the string pointed to by tp_name: https://github.com/python/cpython/blob/0c50b8c0b8274d54d6b71ed7bd21057d3642f138/Objects/typeobject.c#L3427 This isn't an iss

[issue15870] PyType_FromSpec should take metaclass as an argument

2021-09-27 Thread Josh Haberman
Josh Haberman added the comment: > Windows/MSVC defines DLLs as separate programs, with their own lifetime and > entry point (e.g. you can reload a DLL multiple times and it will be > reinitialised each time). All of this is true of so's in ELF also. It doesn&#

[issue45306] Docs are incorrect re: constant initialization in the C99 standard

2021-09-27 Thread Josh Haberman
New submission from Josh Haberman : I believe the following excerpt from the docs is incorrect (https://docs.python.org/3/c-api/typeobj.html#c.PyTypeObject.tp_base): > Slot initialization is subject to the rules of initializing > globals. C99 requires the initializers to be “a

[issue15870] PyType_FromSpec should take metaclass as an argument

2021-09-27 Thread Josh Haberman
Josh Haberman added the comment: This behavior is covered by the standard. The following C translation unit is valid according to C99: struct PyTypeObject; extern struct PyTypeObject Foo_Type; struct PyTypeObject *ptr = &Foo_Type; Specifically, &Foo_Type is an "address

[issue15870] PyType_FromSpec should take metaclass as an argument

2021-09-27 Thread Josh Haberman
Josh Haberman added the comment: > On ELF/Mach-O... nvm, I just realized that you were speaking about Windows specifically here. I believe you that on Windows "static" makes no difference in this case. The second point stands: if you consider LoadLibrary()/dlopen() to be

[issue15870] PyType_FromSpec should take metaclass as an argument

2021-09-27 Thread Josh Haberman
Josh Haberman added the comment: > "static" anything in C is completely irrelevant to how symbols are looked up > and resolved between modules That is not true. On ELF/Mach-O the "static" storage-class specifier in C will prevent a symbol from being added to the d

[issue15870] PyType_FromSpec should take metaclass as an argument

2021-09-27 Thread Josh Haberman
Josh Haberman added the comment: > I consider Py_tp_bases to be a mistake: it's an extra way of doing things > that doesn't add any extra functionality I think it does add one extra bit of functionality: Py_tp_bases allows the bases to be retrieved with PyType_GetSlot().

[issue15870] PyType_FromSpec should take metaclass as an argument

2021-09-23 Thread Josh Haberman
Josh Haberman added the comment: > It's better to pass the metaclass as a function argument, as with bases. I'd > prefer adding a new function that using a slot. Bases are available both as a slot (Py_tp_bases) and as an argument (PyType_FromSpecWithBases). I don't s

[issue15870] PyType_FromSpec should take metaclass as an argument

2021-09-23 Thread Josh Haberman
Josh Haberman added the comment: > Passing the metaclass as a slot seems like the right idea for this API, > though I recall there being some concern about the API (IIRC, mixing function > pointers and data pointers doesn't work on some platforms?) PyType_Slot is defined as

[issue15870] PyType_FromSpec should take metaclass as an argument

2021-09-14 Thread Josh Haberman
Josh Haberman added the comment: I found a way to use metaclasses with the limited API. I found that I can access PyType_Type.tp_new by creating a heap type derived from PyType_Type: static PyType_Slot dummy_slots[] = { {0, NULL} }; static PyType_Spec dummy_spec

[issue15870] PyType_FromSpec should take metaclass as an argument

2021-08-02 Thread Josh Haberman
Josh Haberman added the comment: > You can also call (PyObject_Call*) the metaclass with (name, bases, > namespace); But won't that just call my metaclass's tp_new? I'm trying to do this from my metaclass's tp_new, so I can customize the class creation process. Th

[issue15870] PyType_FromSpec should take metaclass as an argument

2021-07-28 Thread Josh Haberman
Josh Haberman added the comment: I know this is quite an old bug that was closed almost 10 years ago. But I am wishing this had been accepted; it would have been quite useful for my case. I'm working on a new iteration of the protobuf extension for Python. At runtime we create

[issue41255] Argparse.parse_args exits on unrecognized option with exit_on_error=False

2021-07-22 Thread Josh Meranda
Change by Josh Meranda : -- pull_requests: +25838 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27295 ___ Python tracker <https://bugs.python.org/issu

[issue41255] Argparse.parse_args exits on unrecognized option with exit_on_error=False

2021-07-21 Thread Josh Meranda
Josh Meranda added the comment: I agree with Bigbird and paul.j3. > But I think this is a real bug in argparse, not a documentation problem. > Off hand I can't think of clean way of refining the description without > getting overly technical about the error handling. I

[issue44547] fraction.Fraction does not implement __int__.

2021-07-01 Thread Josh Rosenberg
Josh Rosenberg added the comment: Seems like an equally reasonable solution would be to make class's with __trunc__ but not __int__ automatically generate a __int__ in terms of __trunc__ (similar to __str__ using __repr__ when the latter is defined but not the former). The inconsisten

[issue44140] WeakKeyDictionary should support lookup by id instead of hash

2021-06-23 Thread Josh Rosenberg
Josh Rosenberg added the comment: Andrei: If designed appropriately, a weakref callback attached to the actual object would delete the associated ID from the dictionary when the object was being deleted to avoid that problem. That's basically how WeakKeyDictionary works already; it do

[issue44470] 3.11 docs.python.org in Polish not English?

2021-06-23 Thread Josh Rosenberg
Josh Rosenberg added the comment: I just visited the link, and it's now *mostly* English, but with random bits of Korean in it (mostly in links and section headers). The first warning block for instance begins: 경고: The parser module is deprecated... Then a few paragraphs later I&#

[issue14995] PyLong_FromString documentation should state that the string must be null-terminated

2021-06-17 Thread Josh Rosenberg
Josh Rosenberg added the comment: The description is nonsensical as is; not sure the patch goes far enough. C-style strings are *defined* to end at the NUL terminator; if it really needs a NUL after the int, saying it "points to the first character which follows the representation o

[issue44318] Asyncio classes missing __slots__

2021-06-17 Thread Josh Rosenberg
Josh Rosenberg added the comment: Andrei: The size of an instance of Semaphore is 48 bytes + 104 more bytes for the __dict__ containing its three attributes (ignoring the cost of the attributes themselves). A slotted class with three attributes only needs 56 bytes of overhead per-instance

[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-16 Thread Josh Jiang
Change by Josh Jiang : -- nosy: +johnj nosy_count: 5.0 -> 6.0 pull_requests: +25339 pull_request: https://github.com/python/cpython/pull/26754 ___ Python tracker <https://bugs.python.org/issu

[issue44175] What do "cased" and "uncased" mean?

2021-05-19 Thread Josh Rosenberg
Josh Rosenberg added the comment: See the docs for the title method on what they mean by "titlecased"; "a" is self-evidently not titlecased. https://docs.python.org/3/library/stdtypes.html#str.title -- ___ Python tracker <

[issue44175] What do "cased" and "uncased" mean?

2021-05-18 Thread Josh Rosenberg
Josh Rosenberg added the comment: "Cased": Characters which are either lowercase or uppercase (they have some other equivalent form in a different case) "Uncased": Characters which are neither uppercase nor lowercase. Do you have a suggested alternate wording?

[issue37355] SSLSocket.read does a GIL round-trip for every 16KB TLS record

2021-04-19 Thread Josh Snyder
Change by Josh Snyder : -- keywords: +patch pull_requests: +24203 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25478 ___ Python tracker <https://bugs.python.org/issu

[issue43824] array.array.__deepcopy__() accepts a parameter of any type

2021-04-12 Thread Josh Rosenberg
Josh Rosenberg added the comment: __deepcopy__ is required to take a second argument by the rules of the copy module; the second argument is supposed to be a memo dictionary, but there's no reason to use it for array.array (it can't contain Python objects, and you only us

[issue43464] set intersections should short-circuit

2021-03-10 Thread Josh Rosenberg
New submission from Josh Rosenberg : At present, set_intersection (the C name for set.intersection) optimizes for pairs of sets by iterating the smallest set and only adding entries found in the larger, meaning work is proportionate to the smallest input. But when the other input isn't

[issue43363] memcpy writes to wrong destination

2021-03-02 Thread Josh Rosenberg
Josh Rosenberg added the comment: Agreed, stack is a PyObject**, so adding an integer (pto_nargs) to the pointer (stack) is implicitly by multiples of sizeof(PyObject*). This is how pointer arithmetic works in all versions of C I'm aware of. The code is correct. -- nosy: +j

[issue43297] bz2.open modes behaving differently than standard open() modes

2021-02-23 Thread Josh Rosenberg
Josh Rosenberg added the comment: All of the compression modules (gzip, lzma) have this behavior, not just bz2; it's consistent in that sense. Changing it now, after literally decades with the old behavior, would needlessly break existing programs. As you say, it's documented cl

[issue43209] system cannot find the file specified in subprocess.py

2021-02-23 Thread Josh Rosenberg
Change by Josh Rosenberg : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue43246] Dict copy optimization violates subclass invariant

2021-02-17 Thread Josh Rosenberg
Josh Rosenberg added the comment: The cause is in dict_merge (see here: https://github.com/python/cpython/blob/master/Objects/dictobject.c ); it has a fast path for when the object being merged in (which is what the dict constructor does; it makes an empty dict, then merges the provided

[issue43119] asyncio.Queue.put never yields if the queue is unbounded

2021-02-04 Thread Josh Rosenberg
Josh Rosenberg added the comment: Making literally every await equivalent to: await asyncio.sleep(0) followed by the actual await (which is effectively what you're proposing when you expect all await to be preemptible) means adding non-trivial overhead to all async operations (async

[issue42948] bytearray.copy is undocumented

2021-01-23 Thread Josh Rosenberg
Josh Rosenberg added the comment: Does this need specific documentation? bytearray itself is documented with: > As bytearray objects are mutable, they support the mutable sequence > operations in addition to the common bytes and bytearray operations described > in Bytes and

[issue42958] filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs

2021-01-19 Thread Josh Rosenberg
Josh Rosenberg added the comment: This is a problem with the docstring. The actual docs for it are a bit more clear, https://docs.python.org/3/library/filecmp.html#filecmp.cmp : "If shallow is true, files with identical os.stat() signatures are taken to be equal. Otherwise, the conten

[issue42899] Is it legal to eliminate tests of a value, when that test has no effect on control flow?

2021-01-12 Thread Josh Rosenberg
Josh Rosenberg added the comment: Gregory: Even in a low-level compiled language (say, C++), pretty sure the compiler can't automatically optimize out: if (x) { } unless it has sure knowledge of the implementation of operator bool; if operator bool's implementation isn'

[issue15373] copy.copy() does not properly copy os.environment

2021-01-12 Thread Josh Rosenberg
Josh Rosenberg added the comment: Would we remove the functionality of os.environ.copy()? It seems very odd for types to have a .copy() method that works, while not supporting copy.copy, especially when there is zero documentation, on the web or the docstring, to even hint at the difference

[issue42826] typing.Iterable does not need __getitem__() method

2021-01-04 Thread Josh Rosenberg
Josh Rosenberg added the comment: As Serhiy says, the glossary term for an iterable is not the same as the documentation for typing.Iterable (which at this point is largely defined in terms of collections.abc.Iterable). True, collections.abc.Iterable does not detect classes that iterate via

[issue42799] Please document fnmatch LRU cache size (256) and suggest alternatives

2020-12-31 Thread Josh Triplett
New submission from Josh Triplett : fnmatch translates shell patterns to regexes, using an LRU cache of 256 elements. The documentation doesn't mention the cache size, just "They cache the compiled regular expressions for speed.". Without this knowledge, it's possible t

[issue42699] Use `.join(k for k in g)` instead of `.join([k for k in g])`

2020-12-20 Thread Josh Rosenberg
Josh Rosenberg added the comment: This is a pessimization given the current implementation of str.join; it calls PySequence_Fast as the very first step, which is effectively free for a tuple or list input (just reference count manipulation), but must convert a generator expression to a list

[issue42689] Installation

2020-12-20 Thread Josh Rosenberg
Change by Josh Rosenberg : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42629] PyObject_Call not behaving as documented

2020-12-16 Thread Josh Rosenberg
Josh Rosenberg added the comment: Pingback from #42033. Proper fix for that issue likely involves moving the work for copying kwargs into PyObject_Call, which would fix this bug by side-effect. -- nosy: +josh.r ___ Python tracker <ht

[issue42033] Seemingly unnecessary complexification of foo(**kw)

2020-12-16 Thread Josh Rosenberg
Josh Rosenberg added the comment: Even if making a copy is necessary when the underlying function receives the dict "raw", preemptively performing the copy (before knowing if the function being called is a Vectorcall function) means that when it's a Vectorcall function

[issue42646] Add function that supports "applying" methods

2020-12-15 Thread Josh Rosenberg
Josh Rosenberg added the comment: If you're annoyed by having to use two lines, one to copy, one to call the mutating method, you can use the walrus operator: (y := x.copy()).some_method() or: (y := deepcopy(x)).some_method() Does that cover your use case? For the list case,

[issue42612] Software Designer

2020-12-12 Thread Josh Rosenberg
Josh Rosenberg added the comment: A rough description is not sufficient. If you have code that reproduces the problem, post the reproducer so we can check, but odds are you've got a bug in your code. -- nosy: +josh.r status: open ->

[issue39707] Abstract property setter/deleter implementation not enforced, but documented as such

2020-12-09 Thread Josh Rosenberg
Josh Rosenberg added the comment: If this is going to be closed as rejected, I think it still needs some improvement to the documentation. Right now, the docs for abstractproperty (deprecated in favor of combining property and abstractmethod) state: "If only some components are abs

[issue42565] Traceback (most recent call last): File "", line 1, in NameError: name 'python' is not defined

2020-12-03 Thread Josh Rosenberg
Josh Rosenberg added the comment: Looks like someone tried to run python inside an interactive Python shell, rather than the command line. I'm moving to pending and will eventually close unless they add a repro for some actual bug. -- nosy: +josh.r status: open ->

[issue42454] Move slice creation to the compiler for constants

2020-11-30 Thread Josh Rosenberg
Josh Rosenberg added the comment: Yep, Mark Shannon's solution of contextual hashing is what I was trying (without success) when my last computer died (without backing up work offsite, oops) and I gave up on this for a while. And Batuhan Taskaya's note about compiler dictionari

[issue41878] python3 fails to use custom mapping object as symbols in eval()

2020-11-24 Thread Josh Rosenberg
Change by Josh Rosenberg : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42454] Move slice creation to the compiler for constants

2020-11-24 Thread Josh Rosenberg
Josh Rosenberg added the comment: There is an open issue for this already, under #11107 (a reopen of the closed #2268, where the reopen was justified due to Python 3 making slice objects more common), just so you know. I made a stab at this a while ago and gave up due to the problems with

[issue26290] fileinput and 'for line in sys.stdin' do strange mockery of input buffering

2020-11-20 Thread Josh Rosenberg
Josh Rosenberg added the comment: For those who find this in the future, the simplest workaround for the: for line in sys.stdin: issue on Python 2 is to replace it with: for line in iter(sys.stdin.readline, ''): The problem is caused by the way file.__next__'s bufferi

[issue42269] Add ability to set __slots__ in dataclasses

2020-11-10 Thread Josh Rosenberg
Josh Rosenberg added the comment: Is the plan to allow an argument to auto-generate __slots__, or would this require repeating the names once in __slots__, and once for annotations and the like? -- ___ Python tracker <https://bugs.python.

[issue42269] Add ability to set __slots__ in dataclasses

2020-11-10 Thread Josh Rosenberg
Change by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker <https://bugs.python.org/issue42269> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39931] Global variables are not accessible from child processes (multiprocessing.Pool)

2020-11-10 Thread Josh Rosenberg
Change by Josh Rosenberg : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42033] Seemingly unnecessary complexification of foo(**kw)

2020-10-15 Thread Josh Rosenberg
Change by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker <https://bugs.python.org/issue42033> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16525] wave file module does not support 32bit float format

2020-10-15 Thread Josh Lee
Change by Josh Lee : -- nosy: +jleedev ___ Python tracker <https://bugs.python.org/issue16525> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-07 Thread Josh Rosenberg
Change by Josh Rosenberg : -- type: performance -> behavior ___ Python tracker <https://bugs.python.org/issue41972> ___ ___ Python-bugs-list mailing list Un

[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-07 Thread Josh Rosenberg
Josh Rosenberg added the comment: Can reproduce on Alpine Linux, with CPython 3.8.2 (running under WSLv2), so it's not just you. CPU usage is high; seems like it must be stuck in an infinite loop. -- nosy: +josh.r ___ Python tracker &

[issue32922] dbm.open() encodes filename with default encoding rather than the filesystem encoding

2020-10-04 Thread Josh Friend
Josh Friend added the comment: yes it should be closed, can i do that? (ill try...) -- stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/i

[issue41924] TextWrap's wrap method throws unhelpful error on bytes object

2020-10-03 Thread Josh Rosenberg
Josh Rosenberg added the comment: It's not textwrap that's doing it, which is why the error is so unhelpful; the input is assumed to be a str, and the translate method is called on it with a dict argument, which is valid for str.translate, but not for bytes.translate. You&#x

[issue41878] python3 fails to use custom mapping object as symbols in eval()

2020-09-29 Thread Josh Rosenberg
Josh Rosenberg added the comment: Yes, list comprehensions having their own local scope was a change from Py2 to Py3. Python 2 did not do this for list comps initially, and it was left that way during the 2.x timeframe due to back compat constraints, but 2.x did it from the start for

[issue41810] Consider reintroducing `types.EllipsisType` for the sake of typing

2020-09-18 Thread Josh Bode
Change by Josh Bode : -- nosy: +joshbode ___ Python tracker <https://bugs.python.org/issue41810> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41702] Inconsistent behaviour in strftime

2020-09-03 Thread Josh Rosenberg
Josh Rosenberg added the comment: 3.8.2 (on Alpine Linux under WSL) produces '0020-10-05', just like your 3.6 example. Not seeing anything obvious in commit history that would break it for 3.7. That said, 3.7 is in security fix only mode at this point (see https://devguide.

[issue41694] python3 futures.as_completed timeout broken if future contains undefined reference

2020-09-02 Thread Josh Rosenberg
Josh Rosenberg added the comment: The problem is a lot simpler than you're making it: 1. You submit a time.sleep(30) task. This begins running immediately 2. You try to submit another task, but a NameError is raised, bypassing the rest of the code (you never call as_completed, wi

[issue36172] csv module internal consistency

2020-08-28 Thread Josh Rosenberg
Change by Josh Rosenberg : -- resolution: -> not a bug stage: -> resolved status: pending -> closed ___ Python tracker <https://bugs.python.or

[issue41652] An Advice on Turning Ellipsis into Keyword

2020-08-28 Thread Josh Rosenberg
Josh Rosenberg added the comment: I'm closing this as not being worth the costs of adding new keywords. You're welcome to propose it on the python-ideas list (a more appropriate place to propose and suss out the details of significant language changes), but you'll need to f

[issue41652] An Advice on Turning Ellipsis into Keyword

2020-08-27 Thread Josh Rosenberg
Josh Rosenberg added the comment: You can do the same thing to replace int, float, dict, len, and all the other built-in classes and functions. Why is Ellipsis so special that it needs protection, especially when, as you note, ... is an available unoverrideable way to refer to it? Making

[issue36379] nb_inplace_pow is always called with an invalid argument

2020-08-23 Thread Josh Rosenberg
Josh Rosenberg added the comment: Zackery, should this be closed? Or is there something missing from the patch? -- ___ Python tracker <https://bugs.python.org/issue36

[issue36921] Deprecate yield from and @coroutine in asyncio

2020-06-23 Thread Josh Rosenberg
Josh Rosenberg added the comment: Was this supposed to deprecate using types.coroutine as a decorator as well? Because that's not clearly documented, which means people can still use it to make generator-based coroutines without async def. -- nosy: +j

[issue40269] Inconsistent complex behavior with (-1j)

2020-04-12 Thread Josh Rosenberg
Josh Rosenberg added the comment: The final entry is identical to the second to last, because ints have no concept of -0. If you used a float literal, it would match the first two: >>> -0.-1j (-0-1j) I suspect the behavior here is due to -1j not actually being a literal on its

[issue40201] Last digit count error

2020-04-05 Thread Josh Rosenberg
Josh Rosenberg added the comment: Your script is using "true" division with / , (that produces potentially inaccurate float results) not floor division with // , (which gets int results). When the inputs vastly exceed the integer representational capabilities of floats (52-53 bits

[issue36144] Dictionary union. (PEP 584)

2020-02-26 Thread Josh Rosenberg
Josh Rosenberg added the comment: Sorry, I think I need examples to grok this in the general case. ChainMap unioned with dict makes sense to me (it's equivalent to update or copy-and-update on the top level dict in the ChainMap). But ChainMap unioned with another ChainMap is less

[issue36144] Dictionary union. (PEP 584)

2020-02-26 Thread Josh Rosenberg
Josh Rosenberg added the comment: What is ChainMap going to do? Normally, the left-most argument to ChainMap is the "top level" dict, but in a regular union scenario, last value wins. Seems like layering the right hand side's dict on top of the left hand side's wo

[issue39693] tarfile's extractfile documentation is misleading

2020-02-19 Thread Josh Rosenberg
New submission from Josh Rosenberg : The documentation for extractfile ( https://docs.python.org/3/library/tarfile.html#tarfile.TarFile.extractfile ) says: "Extract a member from the archive as a file object. member may be a filename or a TarInfo object. If member is a regular file

[issue26495] super() does not work in nested functions, genexps, listcomps, and gives misleading exceptions

2020-01-09 Thread Josh Lee
Change by Josh Lee : -- nosy: +jleedev ___ Python tracker <https://bugs.python.org/issue26495> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34480] _markupbase.py fails with UnboundLocalError on invalid keyword in marked section

2020-01-04 Thread Josh Kamdjou
Josh Kamdjou added the comment: (Author of PR https://github.com/python/cpython/pull/17643) Since the behavior of self.error() is determined by the subclass implementation, an Exception is not guaranteed. How should this be handled? It seems the options are: - continue execution, in which

[issue34480] _markupbase.py fails with UnboundLocalError on invalid keyword in marked section

2020-01-04 Thread Josh Kamdjou
Change by Josh Kamdjou : -- keywords: +patch pull_requests: +17250 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/17643 ___ Python tracker <https://bugs.python.org/issu

[issue36051] Drop the GIL during large bytes.join operations?

2019-12-30 Thread Josh Rosenberg
Josh Rosenberg added the comment: This will introduce a risk of data races that didn't previously exist. If you do: ba1 = bytearray(b'\x00') * 5 ba2 = bytearray(b'\x00') * 5 ... pass references to thread that mutates them ... ba3 = b

[issue39167] argparse boolean type bug

2019-12-30 Thread Josh Rosenberg
Change by Josh Rosenberg : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> ArgumentParser should support bool type according to truth values ___ Python tracker <https://bugs.python

[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2019-12-27 Thread Josh Holland
Change by Josh Holland : -- nosy: +anowlcalledjosh ___ Python tracker <https://bugs.python.org/issue39090> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39115] Clarify Python MIME type

2019-12-23 Thread Josh de Kock
Josh de Kock added the comment: I just wanted the intended MIME type for sending python over various mediums to be written down somewhere other than the source code, but I'm not sure where it should go. Though if you don't think it is necessary then that is fine too, I mostly ju

[issue39115] Clarify Python MIME type

2019-12-23 Thread Josh de Kock
Josh de Kock added the comment: An IANA media type assignment would be even better than a '*/x-*' MIME, of course, but my original intention was just to clarify that the MIMEs in the cpython source can be used as documentation for 'which MIME should you use when sendin

  1   2   3   4   5   6   7   8   9   >