[issue43179] Remove 32-bit s390 Linux support (s390-linux-gnu triplet)

2021-02-15 Thread John Paul Adrian Glaubitz
John Paul Adrian Glaubitz added the comment: s390 is a 31-bit platform, not a 32-bit platform. I also don't see what this change achieves other than making the use of Python 3.10 on s390 harder. It's not like the removal of support for non-threaded builds which actually saved quite some

[issue43179] Remove s390 support

2021-02-15 Thread John Paul Adrian Glaubitz
John Paul Adrian Glaubitz added the comment: > I opened this ticket after a user told me that they grepped the source code > of Python, found the string "s390", and concluded that s390 is still > supported by us. Because one user was surprised by a few lines in configure

[issue43179] Remove s390 support

2021-02-15 Thread John Paul Adrian Glaubitz
John Paul Adrian Glaubitz added the comment: That's an argument I have personally never heard before and I have been dealing with a lot of architecture support in many packages. FWIW, lots of upstream projects have targets which are officially supported and others which

[issue43179] Remove s390 support

2021-02-15 Thread John Paul Adrian Glaubitz
John Paul Adrian Glaubitz added the comment: And, FWIW, I generally don't quite understand what the problem with old triplet definitions in configure.ac are. I assume they don't hurt anyone, do they? You never know what usecases your users have and as long as a code snippet doesn't

[issue43179] Remove s390 support

2021-02-15 Thread John Paul Adrian Glaubitz
John Paul Adrian Glaubitz added the comment: I'm a Debian Developer and maintainer for multiple Debian Ports architectures. Please don't remove support for Alpha, HPPA, m68k, ia64, PowerPC, SuperH, SPARC as we're still maintaining these in Debian. Here are the latest build results

[issue43160] argparse: add extend_const action

2021-02-08 Thread paul j3
paul j3 added the comment: It's not clear what your patch does that the existing 'store_const' doesn't. Even 'append_const' does the same except for a extra level of list/tuple nesting. But I'll admit that I didn't much need for 'extend' addition, but others, including the original

[issue43143] Allow multiple assignment (i.e. tuple on LHS) in walrus operator

2021-02-07 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: Thanks. I would like to put this ticket in the context of other grammar-related tickets/elaboration for the assignment operator: https://bugs.python.org/issue42316 - allow foo[a:=1] instead of foo[(a:=1)] https://bugs.python.org/issue42374 - allow (c := i

[issue43143] Allow multiple assignment (i.e. tuple on LHS) in walrus operator

2021-02-07 Thread Paul Sokolovsky
Change by Paul Sokolovsky : -- nosy: +lys.nikolaou ___ Python tracker <https://bugs.python.org/issue43143> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42269] Add ability to set __slots__ in dataclasses

2021-02-07 Thread Paul Bryan
Change by Paul Bryan : -- nosy: +pbryan ___ Python tracker <https://bugs.python.org/issue42269> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43143] Allow multiple assignment (i.e. tuple on LHS) in walrus operator

2021-02-06 Thread Paul Sokolovsky
New submission from Paul Sokolovsky : Currently (CPython 3.10.0a4) having a tuple on left-hand side of assignment expression/operator (aka walrus operator) is not allowed: >>> ((a, b) := (1, 2)) File "", line 1 ((a, b) := (1, 2)) ^ SyntaxError: cannot use ass

[issue43132] Incorrect handling of PyObject_RichCompareBool() in the _zoneinfo module

2021-02-05 Thread Paul Ganssle
Paul Ganssle added the comment: Re-opening because this was merged without tests. @ZackerySpytz would you mind adding tests to hit these error cases? I've spent some time satisfying myself that it's indeed possible, and I've detailed a general outline here: https://github.com/python

[issue43131] MMAP duplicate reads and writes on ARM64 platform

2021-02-04 Thread Paul Swirhun
Paul Swirhun added the comment: A workaround is using memoryview (as reported here: https://stackoverflow.com/questions/53492716/python-writing-to-memory-in-a-single-operation). This results in only 1 transaction on the bus for some reason. import os, mmap fd = os.open("/dev/mem",

[issue43131] MMAP duplicate reads and writes on ARM64 platform

2021-02-04 Thread Paul Swirhun
New submission from Paul Swirhun : mmap (example, as used in python-periphery) duplicates writes, compared to devmem and a c-periphery on an ARM64 platform (Zynq/Petalinux/Yocto). There are various other reports of duplicated writes using mmap suggesting it is a bug. Example: fd = os.open

[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2021-02-02 Thread Paul Moore
Paul Moore added the comment: That's specifically the ensurepip PR, which is now outdated since pip 21.0.1 is in master. But for this bug report, Steve said "I still consider the changes a release blocking regression, but if it's not blocking ensurepip then I guess the updated package

[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2021-02-02 Thread Paul Moore
Paul Moore added the comment: It can be closed. -- ___ Python tracker <https://bugs.python.org/issue41490> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2021-02-01 Thread Paul Moore
Paul Moore added the comment: I'm not sure why, but the PR to update the bundled pip to 21.0.1 (and setuptools to 52.0.0) merged cleanly, so this may be obsolete now. -- ___ Python tracker <https://bugs.python.org/issue41

[issue43077] Update bundled pip to 21.0.1 and setuptools to 52.0.0

2021-01-30 Thread Paul Moore
Change by Paul Moore : -- pull_requests: +23203 pull_request: https://github.com/python/cpython/pull/24388 ___ Python tracker <https://bugs.python.org/issue43

[issue43077] Update bundled pip to 21.0.1 and setuptools to 52.0.0

2021-01-30 Thread Paul Moore
Change by Paul Moore : -- keywords: +patch pull_requests: +23202 pull_request: https://github.com/python/cpython/pull/24387 ___ Python tracker <https://bugs.python.org/issue43

[issue43077] Update bundled pip to 21.0.1 and setuptools to 52.0.0

2021-01-30 Thread Paul Moore
Paul Moore added the comment: New changeset 4d11ecbb5ed78e6259ee27289c7638aad795f473 by Paul Moore in branch 'master': bpo-43077: Update bundled pip to 21.0.1 and setuptools to 52.0.0 (GH-24386) https://github.com/python/cpython/commit/4d11ecbb5ed78e6259ee27289c7638aad795f473

[issue43077] Update bundled pip to 21.0.1 and setuptools to 52.0.0

2021-01-30 Thread Paul Moore
Change by Paul Moore : -- assignee: -> paul.moore nosy: +Marcus.Smith, dstufft, ncoghlan, pradyunsg stage: -> patch review ___ Python tracker <https://bugs.python.org/i

[issue43077] Update bundled pip to 21.0.1 and setuptools to 52.0.0

2021-01-30 Thread Paul Moore
New submission from Paul Moore : I've just released pip 21.0.1, so this updates the bundled copy (as well as updating setuptools). I assume this should be backported to 3.8 and 3.9. -- components: Library (Lib) messages: 385986 nosy: paul.moore priority: normal pull_requests: 23201

[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-27 Thread paul j3
paul j3 added the comment: Sometimes patches have unforeseen benefits. My earlier patch for this issue, parse_intermixed_args, has been useful beyond the OP's case. https://stackoverflow.com/questions/50916124/allow-positional-command-line-arguments-with-nargs-to-be-seperated-by-a-flag

[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-27 Thread paul j3
paul j3 added the comment: So in the big picture, the purpose of this change is to treat the inputs like a kind of state-machine. In the bigger example, the `**` positional values are processed one by one, using the interspersed optionals to set state parameters. `args.sources` then ends

[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-26 Thread paul j3
paul j3 added the comment: I haven't had a chance to study your longer posts, but it seems to me that the AddFruitAction example could just as well be implemented with parser.add_argument('--color', nargs='*', action='append') with post parsing processing to create the 'fruits' dicts

[issue43022] Unable to dynamically load functions from python3.dll

2021-01-25 Thread Paul Moore
Paul Moore added the comment: > PathAllocCombine() is Windows 8+, so sample code that uses it would only be > for Python 3.9+. Yeah, I'm probably going to remove that. I mainly used it because I'm *so* spoiled by Python, writing code in C where I have to actually implement stuff for

[issue43022] Unable to dynamically load functions from python3.dll

2021-01-25 Thread Paul Moore
Paul Moore added the comment: > I think here you're in a very small minority who could get away with this, > and so I'd hesitate to make it sound like the recommended approach. Well, the evidence here is that maybe even I shouldn't be doing this :-) > What I'd actually recommend (o

[issue33129] Add kwarg-only option to dataclass

2021-01-25 Thread Paul Bryan
Change by Paul Bryan : -- nosy: +pbryan ___ Python tracker <https://bugs.python.org/issue33129> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43022] Unable to dynamically load functions from python3.dll

2021-01-25 Thread Paul Moore
Paul Moore added the comment: Confirmed. The following code works as I want: Py_Main_t get_pymain(wchar_t *base_dir) { wchar_t *dll_path; HRESULT hr = PathAllocCombine( base_dir, L"python\\python3.dll", PATHCCH_ALLOW_LONG_PATHS, _path ); if (

[issue43022] Unable to dynamically load functions from python3.dll

2021-01-25 Thread Paul Moore
Paul Moore added the comment: Thanks, I'll give that a try. It sounds like I'm just using the APIs incorrectly, which would be good (in the sense that I can do what I wanted, I just didn't know how ;-)) I wonder whether it would be worth having a section in the docs somewhere explaining

[issue43022] Unable to dynamically load functions from python3.dll

2021-01-25 Thread Paul Moore
Paul Moore added the comment: Thinking about what you said, "the loader waits to load it until first accessed via GetProcAddress()" did you mean by that, that the following code should work: h = LoadLibraryW(L"some/path/to/python3.dll") py_main = GetPro

[issue43022] Unable to dynamically load functions from python3.dll

2021-01-25 Thread Paul Moore
Paul Moore added the comment: So I need to dynamically load *both* python3.dll and python39.dll, but if I do that I can get the functions from python3.dll? What's the point in doing that? Surely I might as well just load python39.dll and get the functions from there, in that case. I hoped

[issue43022] Unable to dynamically load functions from python3.dll

2021-01-25 Thread Paul Moore
New submission from Paul Moore : I am writing a small application using the embedded distribution to run a script supplied by the user. The requirements are very simple, so all I need to do is set up argv and call Py_Main. I'm trying to load the Py_Main function dynamically (for flexibility

[issue42966] argparse: customizable help formatter

2021-01-22 Thread paul j3
paul j3 added the comment: Years ago I proposed a `format_wrapper`, a Format class factory https://bugs.python.org/issue12806#msg218395 also https://bugs.python.org/issue39809 There I show that the formatter may be lambda formatter = lambda prog: argparse.HelpFormatter(prog, width=100

[issue42875] argparse incorrectly shows help string on a new line in case of long command string

2021-01-22 Thread paul j3
paul j3 added the comment: This issue is discussed in: https://bugs.python.org/issue34724 argparse subparser help indent too short and https://stackoverflow.com/questions/3215/max-help-position-is-not-works-in-python-argparse-library

[issue42980] argparse: GNU-style help formatter

2021-01-22 Thread paul j3
paul j3 added the comment: I was thinking of a refactoring that included the ', '.join(...) loop, but on further thought your refactoring might be enough for the case I raised. For example: def _format_option_with_args(self, option_string, args_string): if option_string.startswith

[issue42980] argparse: GNU-style help formatter

2021-01-21 Thread paul j3
paul j3 added the comment: The refactoring looks reasonable. But while we are tweaking: def _format_action_invocation(self, action): I wonder if we also give users more control over how multiple option strings are formatted. Currently if parser.add_argument('-f', '--foo', help

[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-20 Thread paul j3
paul j3 added the comment: Your patch is incomplete, without documentation or tests. Your example is incomplete. That is _CustomAction? What namespace does your patch produce. It's been a while since I worked on the intermixed patch, but as I recall the OP was happy with the fix. Also I

[issue42874] running configure on Solaris 10 gives grep "illegal option" errors

2021-01-12 Thread Paul Ganssle
Paul Ganssle added the comment: This particular grep statement is used to validate the `tzpath` variable. Apparently it is easy enough to achieve what I was going for using vanilla grep with no options, so I've created GH-24200 to fix the issue. I notice that there are other uses of `-q

[issue42874] running configure on Solaris 10 gives grep "illegal option" errors

2021-01-12 Thread Paul Ganssle
Change by Paul Ganssle : -- keywords: +patch pull_requests: +23025 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24200 ___ Python tracker <https://bugs.python.org/issu

[issue42902] a python embedded program may load "C:\Lib\os.py" on windows system

2021-01-12 Thread Paul Moore
Paul Moore added the comment: I thought that *all* versions of Python located the standard library by searching for os.py... -- ___ Python tracker <https://bugs.python.org/issue42

[issue42904] get_type_hints does not provide localns for classes

2021-01-11 Thread Paul Bryan
Change by Paul Bryan : -- nosy: +larry ___ Python tracker <https://bugs.python.org/issue42904> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42904] get_type_hints does not provide localns for classes

2021-01-11 Thread Paul Bryan
New submission from Paul Bryan : According to PEP 563: > The get_type_hints() function automatically resolves the correct value of > globalns for functions and classes. It also automatically provides the > correct localns for classes. This statement about providing correc

[issue42863] Python venv inconsistent folder structure on windows

2021-01-08 Thread Paul Moore
Paul Moore added the comment: Many tools hard code the "if windows then 'Scripts' else 'bin'" logic. They will simply fail to work with environments that don't have that layout. Yes, they probably should use sysconfig, but many don't (and sometimes for arguably good reasons, f

[issue9694] argparse required arguments displayed under "optional arguments"

2021-01-08 Thread paul j3
paul j3 added the comment: Since this issue is closed it might be a good idea to open a new one with this problem. And if possible identify the failed tests. We forgot to allow for the fact that working code/tests might be checking for specific help messages, checks the will fail when

[issue42855] pathlib.exists on Windows raises an exception on URL like/bad input

2021-01-07 Thread Paul Moore
Paul Moore added the comment: So I guess the key question then is whether Path.exists() should trap exceptions and interpret them as "does not exist" (on all platforms, although it looks like the null character case in Unix has now been fixed). Which doesn't seem unreasonabl

[issue42855] pathlib.exists on Windows raises an exception on URL like/bad input

2021-01-07 Thread Paul Moore
Paul Moore added the comment: "http:" isn't a valid drive letter, I'd imagine. -- ___ Python tracker <https://bugs.python.org/issue42855> ___ ___

[issue42855] pathlib.exists on Windows raises an exception on URL like/bad input

2021-01-07 Thread Paul Moore
Paul Moore added the comment: It's an invalid filename so it raises an exception. You can get the same on Unix by using an invalid filename (embedded null): >>> from pathlib import Path >>> Path("/usr/\0").exists() Traceback (most recent call last):   File "

[issue2142] difflib.unified_diff(...) produces invalid patches

2021-01-01 Thread Paul "TBBle" Hampson
Paul "TBBle" Hampson added the comment: I just bounced off this issue and proposed a work-around for it in Black (https://github.com/psf/black/pull/1897). Since it wasn't mentioned here earlier, the `\` marker _is_ documented in the GNU Diffutils documentation, under "I

[issue42798] pip search fails

2020-12-31 Thread Paul Watson
New submission from Paul Watson : Fresh install of 3.9.1 Created venv Activated venv (py3.9) 13:12:59.52 C:\venv\py3.9\Scripts C:>pip search astronomy ERROR: Exception: Traceback (most recent call last): File "c:\venv\py3.9\lib\site-packages\pip\_internal\cli\base_command.py&quo

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: > the idea was proposed purely to "close a gap" That pinpoints it well. I was just writing a tutorial on implementing custom import hooks, with the idea to show people how easy it to do it in Python. As first step, I explained that it's bad i

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: > There is a considerable tension on exposed parts of the compiler pipeline for > introspection and other capabilities and our ability to do optimizations. > Given how painful it has been in the past to deal with this, my view is to > av

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: > but the thing I don't quite get is the use case. And if that went unanswered: the usecase, how I'd formulate it, is to not expose CPython historical implementation detail of "tokenize" being disconnected from the rest of the langua

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: > What prevents you from using ast.parse(tokenize.untokenize(token_stream))? That's exactly the implementation in the patch now submitted against this issue. But that's the patch for CPython, the motive of the proposal here is to establish a standard

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Paul Sokolovsky
Change by Paul Sokolovsky : -- keywords: +patch pull_requests: +22773 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23922 ___ Python tracker <https://bugs.python.org/issu

[issue42729] tokenize, ast: No direct way to parse tokens into AST, a gap in the language processing pipiline

2020-12-24 Thread Paul Sokolovsky
New submission from Paul Sokolovsky : Currently, it's possible: * To get from stream-of-characters program representation to AST representation (AST.parse()). * To get from AST to code object (compile()). * To get from a code object to first-class function to the execute the program. Python

[issue42697] 3.8.7rc1 regression: 'free(): invalid pointer' after running backports-zoneinfo test suite

2020-12-21 Thread Paul Ganssle
Paul Ganssle added the comment: For future reference, this bug is triggered only when `.fromutc` is called on a subclass of `datetime` and the resulting date is the second ambiguous time (e.g. if there's a DST transition from 02:00 → 01:00, and the result of the `.fromutc` call

[issue42650] Can people use dest=argparse.SUPPRESS in custom Action classes?

2020-12-20 Thread paul j3
paul j3 added the comment: I'd have to study the code (and docs), but I'm not sure setting the `dest` to 'SUPPRESS' does anything meaningful. default=argparse.SUPPRESS is useful, keeping the default out of the namespace. That argument appears only if the user has used the option

[issue37717] argparse subcommand docs has non-existent parameter "action"

2020-12-19 Thread paul j3
paul j3 added the comment: I'm closing the is as a duplicate of https://bugs.python.org/issue23487, which is already closed. -- resolution: -> duplicate stage: -> resolved status: open -> closed ___ Python tracker <https://bug

[issue42683] asyncio should handle keyboard interrupt while the event loop is running

2020-12-19 Thread Paul Moore
Change by Paul Moore : -- nosy: +njs ___ Python tracker <https://bugs.python.org/issue42683> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue42683] asyncio should handle keyboard interrupt while the event loop is running

2020-12-19 Thread Paul Moore
New submission from Paul Moore : See the comment on Discourse here: https://discuss.python.org/t/feeding-data-generated-via-asyncio-into-a-synchronous-main-loop/5436/28 (and the thread leading up to this comment). In the thread, @njs states that if the user hits Ctrl-C while the asyncio

[issue42677] Support comments in argparse fromfile_prefix_chars files

2020-12-18 Thread paul j3
paul j3 added the comment: https://docs.python.org/3/library/argparse.html#customizing-file-parsing in the docs describes how to customize the @file reading. This particular extension handles several strings on a line, but that's not the limit of what you could do. You can also read

[issue42663] zoneinfo does not support full range of allowed transition hours in fallback string

2020-12-16 Thread Paul Ganssle
New submission from Paul Ganssle : TZif files consist of a list of transitions followed by a POSIX TZ var-style string of a form like "AAA3BBB,M3.2.0/01:30,M11.1.0/02:15:45", which decodes to "AAA (UTC-3) is the standard time and BBB (UTC-2) is the DST time, DST applies start

[issue42662] Propose: Data model explict about __annotations__ key ordering.

2020-12-16 Thread Paul Bryan
Paul Bryan added the comment: Retracting. -- resolution: -> not a bug stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42662] Propose: Data model explict about __annotations__ key ordering.

2020-12-16 Thread Paul Bryan
Change by Paul Bryan : -- keywords: +patch pull_requests: +22668 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23808 ___ Python tracker <https://bugs.python.org/issu

[issue42662] Propose: Data model explict about __annotations__ key ordering.

2020-12-16 Thread Paul Bryan
New submission from Paul Bryan : Currently the data model documentation does not specify the order of keys in __annotations__ dictionary. It is currently in the order that arguments or attributes are declared. I propose to make this explicit. Rationale: Having order explicitly specified

[issue42660] _zoneinfo.c incorrectly checks bounds of `day` variable in calenderrule_new

2020-12-16 Thread Paul Ganssle
Paul Ganssle added the comment: > Adding a static assertion about the signedness of uint8_t looks meaningless > to me. My proposal is to add a static assertion that `day` is an unsigned type. In the code it would look something like it does in the backports.zoneinfo code

[issue42660] _zoneinfo.c incorrectly checks bounds of `day` variable in calenderrule_new

2020-12-16 Thread Paul Ganssle
Paul Ganssle added the comment: There are at least two issues with this: 1. This is a constructor for a struct, and the struct would really unnecessarily balloon in size if we switched everything over to be 32-bit integers (which I think is your suggestion?). This is not a major concern

[issue42660] _zoneinfo.c incorrectly checks bounds of `day` variable in calenderrule_new

2020-12-16 Thread Paul Ganssle
Paul Ganssle added the comment: > Just my two cents, this isn't just "some compilers". Everything from gcc, > msvc, C# to the rust compiler complain about this sort of code. As they > should, this is effectively dead code. They complain because most of the time it's a si

[issue42660] _zoneinfo.c incorrectly checks bounds of `day` variable in calenderrule_new

2020-12-16 Thread Paul Ganssle
Paul Ganssle added the comment: As I mentioned, it's a style issue. Yes this did not introduce any user-observable bugs, nor should it have changed the machine code emitted by the assembly on any competent compiler. The issue is that I had deliberately chosen to do a "redundant&q

[issue42660] _zoneinfo.c incorrectly checks bounds of `day` variable in calenderrule_new

2020-12-16 Thread Paul Ganssle
New submission from Paul Ganssle : This is a code style issue — in https://github.com/python/cpython/pull/23614, a regression was deliberately introduced to satisfy an overzealous compiler. The `day` variable has logical bounds `0 <= day <= 6`. In the original code, both

[issue42622] Add support to add existing parser to ArgumentParser.subparsers

2020-12-11 Thread paul j3
paul j3 added the comment: An existing parser can be included in a new subparser via the 'parents' mechanism. With that the _actions and groups of the parent are copied (by reference) to the new subparser. There are some rough edges to the parents mechanism, but people have used it to add

[issue39106] Add suggestions to argparse error message output for unrecognized arguments

2020-12-11 Thread paul j3
paul j3 added the comment: In the subparser example, it's the `build` subparser that puts '--overwritte' in the unrecognized list. That is then passed back to the main parser, which then issues the 'unrecognized' error, along with its own usage. The subparser is called

[issue42572] Better path handling with argparse

2020-12-08 Thread paul j3
paul j3 added the comment: One caution - the type parameter is a callable (function) that takes one string as argument. I proposed `pathlib.Path` because it does that, returning a Path object. It's a class instance creator. I believe the module has other class initiators. bool() has

[issue42572] Better path handling with argparse

2020-12-08 Thread paul j3
paul j3 added the comment: The pathlib.Path is new since I paid much attention to os matters (I cut my teeth on py2.5). Off hand it looks like the user could import pathlib parser.add_argument('-p', type=pathlib.Path) to convert a string into a Path object. A custom type function

[issue42572] Better path handling with argparse

2020-12-07 Thread paul j3
paul j3 added the comment: What exactly do you do with a path argument? Admittedly I'm not expert with os and os.path modules, but isn't a path just a string passed to a function such as cwd(), or joined to another create a filename. I don't know what a 'path' type or action would do

[issue42592] TypedDict: total=False but still key required

2020-12-07 Thread Paul Bryan
Paul Bryan added the comment: Your patch LGTM, Brandt. -- ___ Python tracker <https://bugs.python.org/issue42592> ___ ___ Python-bugs-list mailing list Unsub

[issue42592] TypedDict: total=False but still key required

2020-12-07 Thread Paul Bryan
New submission from Paul Bryan : I believe "a" below should be an optional key, not a required one. Python 3.9.0 (default, Oct 7 2020, 23:09:01) [GCC 10.2.0] on linux Type "help", "copyright", "credits" or "license" for more informatio

[issue42559] random.getrandbits: Should it be explicit that it returns unsigned/non-negative integer?

2020-12-07 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: Raymond Hettinger: Thanks for acking it would be a useful change! ZackerySpytz: Thanks for making a patch! -- ___ Python tracker <https://bugs.python.org/issue42

[issue42559] random.getrandbits: Should it be explicit that it returns unsigned/non-negative integer?

2020-12-03 Thread Paul Sokolovsky
New submission from Paul Sokolovsky : Current docs for random.getrandbits() ( https://docs.python.org/3/library/random.html#random.getrandbits ) read (3.9.1rc1 at the top of the page): Returns a Python integer with k random bits. This method is supplied with the MersenneTwister generator

[issue42547] argparse: add_argument(... nargs='+', metavar=) does not work with positional arguments

2020-12-02 Thread paul j3
paul j3 added the comment: I'll reopen it - your patch, while not a complete resolution, does take care of the immediate error. -- resolution: duplicate -> status: closed -> open ___ Python tracker <https://bugs.python.org/i

[issue42547] argparse: add_argument(... nargs='+', metavar=) does not work with positional arguments

2020-12-02 Thread paul j3
paul j3 added the comment: Duplicate of https://bugs.python.org/issue14074 argparse allows nargs>1 for positional arguments but doesn't allow metavar to be a tuple -- resolution: -> duplicate stage: patch review -> resolved status: open

[issue42518] Error Message

2020-12-01 Thread Paul Moore
Paul Moore added the comment: You need to learn about chained comparisons in Python. This is not a bug. Please stop reopening it. -- status: open -> closed ___ Python tracker <https://bugs.python.org/issu

[issue42501] Improve error messages for argparse choices using enum

2020-11-29 Thread paul j3
paul j3 added the comment: choices is fine for a few strings, but quickly becomes awkward with other types and large numbers. The testing isn't an issue, since it just does a simple `in/contains` test. But display, whether in usage, help or error, is problematic if you try anything too

[issue35498] Parents objects in pathlib.Path don't support slices as __getitem__ arguments

2020-11-23 Thread Paul Ganssle
Paul Ganssle added the comment: New changeset 79d2e62c008446fbbc6f264bb8a30e2d38b6ff58 by Yaroslav Pankovych in branch 'master': Added support for negative indexes to PurePath.parents (GH-21799) https://github.com/python/cpython/commit/79d2e62c008446fbbc6f264bb8a30e2d38b6ff58

[issue21041] pathlib.PurePath.parents rejects negative indexes

2020-11-23 Thread Paul Ganssle
Paul Ganssle added the comment: New changeset 79d2e62c008446fbbc6f264bb8a30e2d38b6ff58 by Yaroslav Pankovych in branch 'master': Added support for negative indexes to PurePath.parents (GH-21799) https://github.com/python/cpython/commit/79d2e62c008446fbbc6f264bb8a30e2d38b6ff58

[issue42444] pathlib.PurePath properties annotated with .. data directive

2020-11-23 Thread Paul Ganssle
New submission from Paul Ganssle : Currently, it seems that the pathlib module uses `.. data::` to annotate the properties of the PurePath type (e.g. .parts, .drive, .root, etc). See: https://github.com/python/cpython/blob/ff420f0e08a2443339da0df7ace95e14177bac53/Doc/library/pathlib.rst

[issue21041] pathlib.PurePath.parents rejects negative indexes

2020-11-23 Thread Paul Ganssle
Paul Ganssle added the comment: I think you may have confused my thoughts as to why this might be considered ambiguous with an actual suggestion for what the semantics should be. I think that we should stick with `p.parents[x] == tuple(p.parents)[x]` for any valid value of `x`, which means

[issue35498] Parents objects in pathlib.Path don't support slices as __getitem__ arguments

2020-11-20 Thread Paul Ganssle
Change by Paul Ganssle : -- dependencies: -pathlib.PurePath.parents rejects negative indexes resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue35498] Parents objects in pathlib.Path don't support slices as __getitem__ arguments

2020-11-20 Thread Paul Ganssle
Paul Ganssle added the comment: New changeset 452058448335b39c784af9a047f9c4a1767c0b00 by Joshua Cannon in branch 'master': bpo-35498: Added slice support to PathLib parents attribute. (GH-11165) https://github.com/python/cpython/commit/452058448335b39c784af9a047f9c4a1767c0b00

[issue35498] Parents objects in pathlib.Path don't support slices as __getitem__ arguments

2020-11-19 Thread Paul Ganssle
Paul Ganssle added the comment: One question I would have about this is that `.parents` is a lazily-calculated sequence, not a list or a tuple, so it's not immediately obvious what the return type of a slice would be. I don't think it makes sense to return, e.g. a `_PathParents` object

[issue21041] pathlib.PurePath.parents rejects negative indexes

2020-11-19 Thread Paul Ganssle
Paul Ganssle added the comment: I am not seeing any compelling reasons to avoid supporting negative indexes *or* slices here. If I had to guess about the confusing semantics of negative indices, I would guess it's the fact that the index in the -1 position for a non-empty Path will always

[issue42390] Other Python implementations may not expose the module name in datetime type names

2020-11-17 Thread Paul Ganssle
Paul Ganssle added the comment: What is an example of another Python implementation that has this property? Is there a concrete issue open somewhere that this is solving? I am not unsympathetic to the idea of accommodating other implementations of Python, but this is very abstract and I

[issue42094] isoformat() / fromisoformat() for datetime.timedelta

2020-11-17 Thread Paul Ganssle
Paul Ganssle added the comment: This is probably more feasible than the proposal in bpo-41254 since it's a well-defined spec (mostly — it includes an optional alternative format and the number of digits allowed is defined "by agreement", thus defeating the purpose of us

[issue42094] isoformat() / fromisoformat() for datetime.timedelta

2020-11-17 Thread Paul Ganssle
Change by Paul Ganssle : -- nosy: +p-ganssle ___ Python tracker <https://bugs.python.org/issue42094> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42390] Other Python implementations may not expose the module name in datetime type names

2020-11-17 Thread Paul Ganssle
Paul Ganssle added the comment: Is this an actual problem for another implementation of Python? Is there some reason to think that we intended the repr of a `datetime` object to be implementation-defined? -- nosy: +p-ganssle ___ Python tracker

[issue42371] datetime.fromisoformat(): Omitted colon in timezone suffix raises ValueError

2020-11-16 Thread Paul Ganssle
Paul Ganssle added the comment: This is the expected behavior of `.fromisoformat()`. A similar issue is https://bugs.python.org/issue35829, which asks for the "Z" suffix to be supported. There is a note about this in the documentation: https://docs.python.org/3/library/dat

[issue42293] Installation of pyinstaller in Windows fails with utf8 error

2020-11-14 Thread Paul Moore
Paul Moore added the comment: I've raised https://github.com/pypa/pip/issues/9135 for this. -- ___ Python tracker <https://bugs.python.org/issue42293> ___ ___

[issue42293] Installation of pyinstaller in Windows fails with utf8 error

2020-11-14 Thread Paul Moore
Paul Moore added the comment: Erik is correct, this is a pip bug. Please raise an issue on the pip tracker linking to this issue and we can fix it. -- ___ Python tracker <https://bugs.python.org/issue42

[issue42297] [argparse] Bad error message formatting when using custom usage text

2020-11-10 Thread paul j3
paul j3 added the comment: We could look into using a different more compact 'prog' for these error messages. Currently the subparser 'prog' uses the main prog plus positionals plus the subparser name. The goal is to construct a subparser usage that reflects required input

[issue42297] [argparse] Bad error message formatting when using custom usage text

2020-11-09 Thread paul j3
paul j3 added the comment: It's the subparser that's producing this error, specifically its 'prog' attribute. If I use a custom usage with a simple parser: 1129:~/mypy$ python3 issue42297.py --foo=on usage: issue42297.py one two three issue42297.py: error: argument

<    1   2   3   4   5   6   7   8   9   10   >