[issue36439] Inconsistencies with datetime.fromtimestamp(t) when t < 0

2020-06-10 Thread Paul Anton Letnes
Paul Anton Letnes added the comment: I've encountered an issue on anaconda python on windows 10 v1909 which I suspect is related. It looks like no dates in 1970 can be converted to datetime.timestamp(): Python 3.8.2 (default, Apr 14 2020, 19:01:40) [MSC v.1916 64 bit (AMD64)] Type

[issue40933] zoneinfo may give incorrect dst() in Europe/Minsk in 1942

2020-06-09 Thread Paul Ganssle
New submission from Paul Ganssle : Related to bpo-40930 and bpo-40931, it *seems* that in 1942 only, `zoneinfo.ZoneInfo` returns -01:00 for DST in Europe/Minsk: >>> from datetime import datetime, timedelta >>> from backports.zoneinfo import ZoneInfo >>>

[issue40931] zoneinfo gives incorrect dst() in Europe/Madrid in 1938

2020-06-09 Thread Paul Ganssle
New submission from Paul Ganssle : Apparently in 1938, Madrid had a "double daylight saving time", where they transitioned from WET (+0) → WEST (+1) → WEMT (+2) → WEST (+1) → WET (+0): $ zdump -V -c 1938,1940 'Europe/Madrid' Europe/Madrid Sat Apr 2 22:59:59 1938 UT = Sat Apr 2 22:

[issue40930] zoneinfo gives incorrect dst() in Pacific/Rarotonga between 1978 and 1991

2020-06-09 Thread Paul Ganssle
New submission from Paul Ganssle : While developing a shim for deprecating pytz, I discovered this issue with the Pacific/Rarotonga zone: >>> from datetime import datetime, timedelta >>> from backports.zoneinfo import ZoneInfo >&

[issue40908] datetime strftime with %Y and 2 digit years

2020-06-08 Thread Paul Ganssle
Paul Ganssle added the comment: This is a duplicate of bpo-13305 and is due to platform-specific implementations of %Y. On Linux, `strftime()` does not zero-pad to 4, and if you need to represent years <1000, you should use "%4Y" to zero-pad the output. I think the ideal res

[issue40615] unstable behaviour for options in argparse

2020-06-07 Thread paul j3
Change by paul j3 : -- nosy: +paul.j3 ___ Python tracker <https://bugs.python.org/issue40615> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40862] argparse.BooleanOptionalAction accept and silently discard its the const argument

2020-06-07 Thread paul j3
Change by paul j3 : -- nosy: +paul.j3 ___ Python tracker <https://bugs.python.org/issue40862> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40863] bytes.decode changes/destroys line endings on windows

2020-06-04 Thread Paul Moore
Paul Moore added the comment: Because if you open a file in text mode (without "b" in the mode), Python writes \n (newline) characters as \r\n (carriage return, line feed) which are the Windows textfile representation of "Newline". >From the documentation of the b

[issue40686] Compiler warnings in _zoneinfo.c on Windows build in 64-bit

2020-06-04 Thread Paul Ganssle
Change by Paul Ganssle : -- pull_requests: +19849 pull_request: https://github.com/python/cpython/pull/20624 ___ Python tracker <https://bugs.python.org/issue40

[issue40777] _datetimemodule.c:3328:16: error: initializer element is not constant

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

[issue40799] Create Lib/_pydatetime.py file to optimize "import datetime" when _datetime is available

2020-05-28 Thread Paul Ganssle
Paul Ganssle added the comment: I basically agree with this — this is one of the reasons I structured the zoneinfo module the way I did rather than mimicking the pattern in datetime. I believe that there are other modules that have similar situations like heapq, but datetime is probably

[issue40734] /usr/bin surprisingly in sys.path under IDLE

2020-05-26 Thread paul rubin
paul rubin added the comment: Yes as mentioned I'm running Debian GNU/Linux, not Windows. By "idle is installed in /usr/bin" I mean that it is an executable shell script stored at /usr/bin/idle . Yes, shell prompt is the $ prompt to bash. When I run "python3 -m idlelib&

[issue40734] /usr/bin surprisingly in sys.path under IDLE

2020-05-25 Thread paul rubin
paul rubin added the comment: I'm using Debian 10 MATE live install and have been running IDLE by clicking an icon on the top panel, but I just tried running IDLE from the shell prompt in a terminal window, and also see /usr/bin in the path. In both cases, the output of os.system('pwd

[issue40734] /usr/bin surprisingly in sys.path under IDLE

2020-05-25 Thread paul rubin
paul rubin added the comment: Matthias, I get the same result you do when I run python from the shell command line. I see /usr/bin in the path when I import sys and print sys.path from inside IDLE. In other words this is an IDLE configuration oddity. Again I don't know if it's a bug

[issue40764] Conflation of Counter with Multiset

2020-05-25 Thread Paul
New submission from Paul : The collections docs state: "Several mathematical operations are provided for combining Counter objects to produce multisets (counters that have counts greater than zero)." I am surprised at the clear level of decision into conflating counters with mult

[issue40733] Make IDLE doc more visible, mention in main python docs page

2020-05-23 Thread paul rubin
paul rubin added the comment: I think I used duckduckgo to find the docs. They don't change much between versions and I was trying to find how to do a specific thing. My installation has the docs included but it didn't explain how to do what I wanted, so I had hoped there was a more

[issue40733] mention IDLE in main python docs page

2020-05-22 Thread paul rubin
Change by paul rubin : -- title: mention IDLE in main python ocs page -> mention IDLE in main python docs page ___ Python tracker <https://bugs.python.org/issu

[issue40734] /usr/bin surprisingly in sys.path under IDLE

2020-05-22 Thread paul rubin
New submission from paul rubin : This is in the standard python 3.7.3 install under Debian 10. It's possible that this is on purpose, and it's (separately) possible that the Debian packagers did this for some reason. I'm not sure it's a bug but am reporting it as it's an oddity that might

[issue40733] mention IDLE in main python ocs page

2020-05-22 Thread paul rubin
New submission from paul rubin : The IDLE documentation is in https://docs.python.org/3/library/idle.html which is not where I'd have thought to look for it, since I think of IDLE as an application rather than a library. So I looked for it on the main docs page, docs.python.org, and didn't

[issue40705] use-after-free in _zoneinfo.c's module_free function

2020-05-22 Thread Paul Ganssle
Paul Ganssle added the comment: New changeset 06a1b8915d6674e40f0dccc422ca2c06212392d8 by Ammar Askar in branch 'master': bpo-40705: Fix use-after-free in _zoneinfo's module_free (GH-20280) https://github.com/python/cpython/commit/06a1b8915d6674e40f0dccc422ca2c06212392d8

[issue40713] _zoneinfo.c can use dst_offset without initialization in parse_tz_str()

2020-05-21 Thread Paul Ganssle
Paul Ganssle added the comment: This is a duplicate of bpo-40714. It's a bit of an overzealous compiler warning (as far as I can tell it's not true that the uninitialized value would ever be used), but we fixed it anyway in GH-20291. Thanks for the report! -- nosy: +p-ganssle

[issue40705] use-after-free in _zoneinfo.c's module_free function

2020-05-21 Thread Paul Ganssle
Change by Paul Ganssle : -- versions: +Python 3.9 ___ Python tracker <https://bugs.python.org/issue40705> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40448] ensurepip uses cache directory

2020-05-20 Thread Paul Moore
Paul Moore added the comment: PR looks good to me. There's a test failure that needs fixing and the PR needs a news entry, but otherwise looks fine. -- ___ Python tracker <https://bugs.python.org/issue40

[issue40683] Beta release does not distribute zoneinfo or test_zoneinfo

2020-05-19 Thread Paul Ganssle
Paul Ganssle added the comment: No worries Łukasz, I figured it would be worth bringing up because normally the releases aren't so broken that they aren't usable in the common case. That said, this won't break any *existing* code, it'll just prevent people on Linux machines from using

[issue40683] Beta release does not distribute zoneinfo or test_zoneinfo

2020-05-19 Thread Paul Ganssle
Paul Ganssle added the comment: Victor has confirmed that this is working on Windows, so I think the current state of the 3.9 and master branches is now fixed. The last question remaining is whether this justifies a quick b2 release (or if there's another mechanism for a "fixup" re

[issue40683] Beta release does not distribute zoneinfo or test_zoneinfo

2020-05-19 Thread Paul Ganssle
Paul Ganssle added the comment: New changeset 2abededbc4165d2daa14ae9d74b1f33cce0593d7 by Paul Ganssle in branch 'master': bpo-40683: Add zoneinfo to LIBSUBDIRS (#20229) https://github.com/python/cpython/commit/2abededbc4165d2daa14ae9d74b1f33cce0593d7

[issue40683] Beta release does not distribute zoneinfo or test_zoneinfo

2020-05-19 Thread Paul Ganssle
Paul Ganssle added the comment: Victor: Might be worth updating your notes to indicate that any subdirectory (not just test subdirectories) need to go into LIBSUBDIRS. zoneinfo uses a subdirectory for both the tests and the zoneinfo module, and *neither* were included in the installation

[issue40683] Beta release does not distribute test_zoneinfo

2020-05-19 Thread Paul Ganssle
Change by Paul Ganssle : -- keywords: +patch pull_requests: +19520 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/20229 ___ Python tracker <https://bugs.python.org/issu

[issue40683] Beta release does not distribute zoneinfo

2020-05-19 Thread Paul Ganssle
Paul Ganssle added the comment: I think I found the problem: these directories are not included in the Makefile.pre.in LIBSUBDIRS variable: https://github.com/python/cpython/blob/a355a06fcc7ef2232736dceb012ae623335cd7ab/Makefile.pre.in#L1373 PR incoming

[issue40683] Beta release does not distribute zoneinfo

2020-05-19 Thread Paul Ganssle
New submission from Paul Ganssle : Apparently something is wrong with make install for beta 1 and the `zoneinfo` module is not installed with it (only _zoneinfo). When I run a local build `./python -c "import zoneinfo"` works, but when I do `make install` I get ImportError: $ b

[issue5537] LWPCookieJar cannot handle cookies with expirations of 2038 or greater on 32-bit platforms

2020-05-18 Thread Paul Ganssle
Paul Ganssle added the comment: > Should we fix utcfromtimestamp() internally to avoid the OverflowError, > rather than only fixing the http.cookiejar module? I'm not a big fan of utcfromtimestamp (as you can see here: https://blog.ganssle.io/articles/2019/11/utcnow.html ), but it se

[issue40536] Addition of a "list of available time zones" function to zoneinfo

2020-05-17 Thread Paul Ganssle
Paul Ganssle added the comment: I've merged the existing implementation, but I'm leaving this staged as "release blocker" so that Łukasz can have final say on whether this goes into 3.9. Thanks for the help everyone! -- ___ Python track

[issue40536] Addition of a "list of available time zones" function to zoneinfo

2020-05-17 Thread Paul Ganssle
Paul Ganssle added the comment: New changeset e527ec8abe0849e784ce100f53c2736986b670ae by Paul Ganssle in branch 'master': bpo-40536: Add zoneinfo.available_timezones (GH-20158) https://github.com/python/cpython/commit/e527ec8abe0849e784ce100f53c2736986b670ae

[issue40536] Addition of a "list of available time zones" function to zoneinfo

2020-05-17 Thread Paul Ganssle
Paul Ganssle added the comment: I've opened a PR adding this feature and tagged this as release blocker, since I'd like to make sure this is in the beta if Łukasz does not object. The concerns about the stability of the function I expressed earlier have not changed much, though we did get

[issue40536] Addition of a "list of available time zones" function to zoneinfo

2020-05-17 Thread Paul Ganssle
Change by Paul Ganssle : -- pull_requests: +19461 pull_request: https://github.com/python/cpython/pull/20158 ___ Python tracker <https://bugs.python.org/issue40

[issue40503] PEP 615: Add zoneinfo module

2020-05-16 Thread Paul Ganssle
Paul Ganssle added the comment: New changeset b17e49e0def23238b9e7f48c8a02e2d7bbf1f653 by Paul Ganssle in branch 'master': bpo-40503: Add documentation and what's new entry for zoneinfo (GH-20006) https://github.com/python/cpython/commit/b17e49e0def23238b9e7f48c8a02e2d7bbf1f653

[issue40643] Improve doc-strings for datetime.strftime & strptime

2020-05-16 Thread Paul Ganssle
Paul Ganssle added the comment: I agree, this can be improved (particularly the first one). I believe we'll need to change it in the C implementation as well as the pure python version. That said, the most useful thing for users would be a full formatting reference, which is too much to put

[issue24416] Have date.isocalendar() return a structseq instance

2020-05-16 Thread Paul Ganssle
Paul Ganssle added the comment: This is now merged, thanks for the debate and opinions offered everyone, and thanks to Dong-hee for the implementation! The way we did the implementation, a pickle/unpickle cycle on the result of .isocalendar() will return a plain tuple. Despite the fact

[issue24416] Have date.isocalendar() return a structseq instance

2020-05-16 Thread Paul Ganssle
Paul Ganssle added the comment: New changeset 1b97b9b0ad9a2ff8eb5c8f2e2e7c2aec1d13a330 by Paul Ganssle in branch 'master': bpo-24416: Return named tuple from date.isocalendar() (GH-20113) https://github.com/python/cpython/commit/1b97b9b0ad9a2ff8eb5c8f2e2e7c2aec1d13a330

[issue36264] os.path.expanduser should not use HOME on windows

2020-05-16 Thread Paul Moore
Paul Moore added the comment: > Perhaps the best approach for the sake of POSIX compatibility is to set HOME > on startup to the correct value? If Python starts setting `HOME`, that has the potential to affect programs called in a subprocess, possibly breaking them (making them no

[issue24416] Have date.isocalendar() return a structseq instance

2020-05-15 Thread Paul Ganssle
Change by Paul Ganssle : -- pull_requests: +19420 pull_request: https://github.com/python/cpython/pull/20113 ___ Python tracker <https://bugs.python.org/issue24

[issue40411] frozen collection.Counter

2020-05-14 Thread paul rubin
paul rubin added the comment: Note: PEP 603 may essentially take care of this, if it is accepted. -- ___ Python tracker <https://bugs.python.org/issue40

[issue40028] Math module method to find prime factors for non-negative int n

2020-05-14 Thread paul rubin
paul rubin added the comment: I don't think the interface needs much bikeshedding, as long as the implementer chooses something reasonable. E.g. factor(30) gives the list [2,3,5]. Implementation is harder if you want to handle numbers of non-trivial size. Neal Koblitz's book "A C

[issue40623] JSON streaming

2020-05-14 Thread paul rubin
paul rubin added the comment: Also I didn't know about ndjson (I just looked at it, ndjson.org) but its existence and formalization is even more evidence that this is useful. I'll check what the two different python modules linked from that site do that's different from your example

[issue40623] JSON streaming

2020-05-14 Thread paul rubin
paul rubin added the comment: It's coming back to me, I think I used the no-separator format because I made the multi-document input files by using json.dump after opening the file in append mode. That seems pretty natural. I figured the wikipedia article and the json.tool patch just

[issue40623] JSON streaming

2020-05-14 Thread paul rubin
paul rubin added the comment: Note: the function in my attached file wants no separation at all between the json docs (rather than a newline between them), but that was ok for the application I wrote it for some time back. I forgot about that when first writing this rfe so thought I better

[issue40623] JSON streaming

2020-05-14 Thread paul rubin
Change by paul rubin : Added file: https://bugs.python.org/file49154/jsonstream.py ___ Python tracker <https://bugs.python.org/issue40623> ___ ___ Python-bugs-list mailin

[issue40623] JSON streaming

2020-05-14 Thread paul rubin
New submission from paul rubin : This is a well-explored issue in other contexts: https://en.wikipedia.org/wiki/JSON_streaming There is also a patch for it in json.tool, for release in 3.9: https://bugs.python.org/issue31553 Basically it's often convenient to have a file containing a list

[issue36027] Support negative exponents in pow() where a modulus is specified.

2020-05-14 Thread paul rubin
paul rubin added the comment: https://bugs.python.org/issue457066 The old is new again ;-). -- nosy: +phr ___ Python tracker <https://bugs.python.org/issue36

[issue40028] Math module method to find prime factors for non-negative int n

2020-05-14 Thread paul rubin
paul rubin added the comment: I'm the one always asking for more stuff in the stdlib, but above some simplistic approaches this seems out of scope. Doing it usefully above say 2**32 requires fancy algorithms. Better to use some external package that implements that stuff. -- nosy

[issue40503] PEP 615: Add zoneinfo module

2020-05-13 Thread Paul Ganssle
Paul Ganssle added the comment: Talked to Steve Dower in a sidebar about the issue with compile-time configuration, he is convinced that compile-time configuration is not something that would be useful or worth doing on Windows. I am indifferent on the matter, so I am fine with calling

[issue40536] Addition of a "list of available time zones" function to zoneinfo

2020-05-13 Thread Paul Ganssle
Paul Ganssle added the comment: >From some discussion on the reference implementation PR, it seems that this >may be a more complicated feature than I had bargained for: >https://github.com/pganssle/zoneinfo/pull/60 The issue is that the current implementation picks up the posix/

[issue40503] PEP 615: Add zoneinfo module

2020-05-11 Thread Paul Ganssle
Paul Ganssle added the comment: Here are some benchmarks run using the latest implementation. The pure Python code is pretty optimized, but the C code is still ~4-5x faster. Running from_utc in zone Europe/Paris c_zoneinfo: mean: 494.82 ns ± 3.80 ns; min: 489.23 ns (k=5, N=50) py_zoneinfo

[issue40503] PEP 615: Add zoneinfo module

2020-05-11 Thread Paul Ganssle
Paul Ganssle added the comment: I mean, theoretically we don't "need" it, but it's much, much faster, and without it nearly every operation that needs time zone offsets will be slower than pytz (which has a mechanism for caching). Also, I've already written it, so I see no

[issue40536] Addition of a "list of available time zones" function to zoneinfo

2020-05-11 Thread Paul Ganssle
Change by Paul Ganssle : -- pull_requests: -19344 ___ Python tracker <https://bugs.python.org/issue40536> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40536] Addition of a "list of available time zones" function to zoneinfo

2020-05-11 Thread Paul Ganssle
Change by Paul Ganssle : -- keywords: +patch pull_requests: +19344 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19909 ___ Python tracker <https://bugs.python.org/issu

[issue40503] PEP 615: Add zoneinfo module

2020-05-11 Thread Paul Ganssle
Paul Ganssle added the comment: Thanks Thomas, that was super helpful. I've created GH-20034 to add in the compile-time arguments on POSIX systems at least, do you mind having a look? For the moment I have made it non-configurable on Windows, but I think the right thing to do is to add

[issue40503] PEP 615: Add zoneinfo module

2020-05-11 Thread Paul Ganssle
Change by Paul Ganssle : -- pull_requests: +19343 pull_request: https://github.com/python/cpython/pull/20034 ___ Python tracker <https://bugs.python.org/issue40

[issue40536] Addition of a "list of available time zones" function to zoneinfo

2020-05-09 Thread Paul Ganssle
Paul Ganssle added the comment: I have an initial implementation against the reference implementation here: https://github.com/pganssle/zoneinfo/pull/60 Once GH-19909 is merged, I will turn that into a PR against CPython. For the first pass I went with: 1. free-standing function 2

[issue40503] PEP 615: Add zoneinfo module

2020-05-08 Thread Paul Ganssle
Paul Ganssle added the comment: I've separated this into two separate PRs, one for docs and one for tests/implementation. I have not yet implemented the logic for the ability to configure the TZPATH at compile time because I'm not quite sure how to start on that. How are other compile-time

[issue40503] PEP 615: Add zoneinfo module

2020-05-08 Thread Paul Ganssle
Change by Paul Ganssle : -- pull_requests: +19318 pull_request: https://github.com/python/cpython/pull/20006 ___ Python tracker <https://bugs.python.org/issue40

[issue36944] Add support for ARM64 to libffi

2020-05-07 Thread Paul Monson
Paul Monson added the comment: Yes I think this can be closed. Thank you! -- status: pending -> open ___ Python tracker <https://bugs.python.org/issu

[issue40536] Addition of a "list of available time zones" function to zoneinfo

2020-05-06 Thread Paul Ganssle
New submission from Paul Ganssle : One thing that I sort of overlooked in PEP 615 that I think will be a common feature request for zoneinfo is the ability to get a list of time zones available on the current TZPATH. This is more complicated to implement than it sounds like, but luckily I

[issue40509] In argparse, allow REMAINDER(...) arguments in a mutually exclusive group

2020-05-06 Thread paul j3
paul j3 added the comment: A flagged argument with REMAINDER works just fine in a mutually exclusive group. group.add_argument('-g', nargs='...') positionals in such a group can only have ? or *. If you check the code, and past issues you'll see that those require some special handling

[issue40420] argparse choices formatter

2020-05-05 Thread paul j3
paul j3 added the comment: Related topic re. long usage with choices : https://bugs.python.org/issue16418 -- ___ Python tracker <https://bugs.python.org/issue40

[issue40509] In argparse, allow REMAINDER(...) arguments in a mutually exclusive group

2020-05-05 Thread paul j3
paul j3 added the comment: Handling the positional with '?' and '*' in a mutually_exclusive_group is tricky enough! I believe your user can use the '--' to get the same effect. -- ___ Python tracker <https://bugs.python.org/issue40

[issue40509] In argparse, allow REMAINDER(...) arguments in a mutually exclusive group

2020-05-05 Thread paul j3
Change by paul j3 : -- nosy: +paul.j3 ___ Python tracker <https://bugs.python.org/issue40509> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40503] PEP 615: Add zoneinfo module

2020-05-04 Thread Paul Ganssle
Change by Paul Ganssle : -- keywords: +patch pull_requests: +19224 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/19909 ___ Python tracker <https://bugs.python.org/issu

[issue40503] PEP 615: Add zoneinfo module

2020-05-04 Thread Paul Ganssle
New submission from Paul Ganssle : This is an issue to track the implementation of PEP 615: https://www.python.org/dev/peps/pep-0615/ It should mostly involve migrating from the reference implementation: https://github.com/pganssle/zoneinfo/ -- assignee: p-ganssle components

[issue40454] DEBUG kw to asyncio.run overrides DEBUG mode set elsewhere

2020-04-30 Thread Paul Martin
New submission from Paul Martin : According to the docs: " There are several ways to enable asyncio debug mode. Setting the PYTHONASYNCIODEBUG environment variable to 1. Using the -X dev Python command line option. Passing debug=True to asyncio.run(). Calling loop.set_debug().

[issue40420] argparse choices formatter

2020-04-28 Thread paul j3
paul j3 added the comment: The display of the choices has been discussed in previous issues. When the choices is long there isn't a clean way of handling the display. I'd suggest using a 'metavar' to show a short value, and then enumerate the choices in the help text. Use the 'Raw' help

[issue40411] frozen collection.Counter

2020-04-27 Thread paul rubin
paul rubin added the comment: Totally tangential: Veky, your ordinal example would work ok in Haskell and you'd have omega work the same way as epsilon0. Take a look at Herman Ruge Jervell's book "Proof Theory" for a really nice tree-based ordinal notation that goes much h

[issue40411] frozen collection.Counter

2020-04-27 Thread paul rubin
paul rubin added the comment: Yeah I think the basic answer to this ticket is "Python doesn't really have multisets and a proposal to add them should go somewhere else". Fair enough-- consider the request withdrawn from here. Regarding minimalism vs completeness, regarding some

[issue40411] frozen collection.Counter

2020-04-27 Thread paul rubin
paul rubin added the comment: Oops I meant "*without* 100s of third party modules" in the case of ruby gems or npm. There are just a few pip modules that I really use all the time, most notably bs4. I continue to use urllib/urllib2 instead of requests because I'm used to them a

[issue40411] frozen collection.Counter

2020-04-27 Thread paul rubin
paul rubin added the comment: Kyle, thanks, I saw your comment after posting my own, and I looked at Raymond's mailing list post that you linked. I do think that "completing the grid" is a good thing in the cases where it's obvious how to do it (if there's one and one o

[issue40411] frozen collection.Counter

2020-04-27 Thread paul rubin
paul rubin added the comment: Yes, the idea was for them to be hashable, to be used as dict keys. E.g. if you use frozensets to model graphs, you'd use frozen multisets for hypergraphs. My immediate use case involved word puzzles, e.g. treating words as bags of scrabble tiles with letters

[issue1726707] add itertools.ichain function and count.getvalue

2020-04-27 Thread paul rubin
paul rubin added the comment: Note, nowadays this is implement as itertools.chain.from_iterable . -- ___ Python tracker <https://bugs.python.org/issue1726

[issue40334] PEP 617: new PEG-based parser

2020-04-27 Thread paul rubin
Change by paul rubin : -- nosy: -phr ___ Python tracker <https://bugs.python.org/issue40334> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40411] frozen collection.Counter

2020-04-27 Thread paul rubin
New submission from paul rubin : It would be nice to have frozen Counters analogous to frozensets, so they are usable as dictionary keys. One can of course create frozenset(counter.items()) but that means the set items are tuples rather than the original set elements, so it's no longer

[issue40334] PEP 617: new PEG-based parser

2020-04-27 Thread paul rubin
paul rubin added the comment: I just saw this. Interesting. Sometimes I use ast.literal_eval to read big, deeply nested data objects. I can probably convert to JSON if necessary but it's another thing to watch out for. I might try to benchmark some of these. -- nosy: +phr

[issue40365] argparse: action "extend" with 1 parameter splits strings into characters

2020-04-22 Thread paul j3
paul j3 added the comment: This is a consequence of Python's own definition of append vs extend In [730]: alist = [] In [731]: alist.append('astring

[issue40362] AbstractBasicAuthHandler does not support the following scheme: 'Bearer'

2020-04-22 Thread Paul Stoner
Paul Stoner added the comment: --4/22/2020 09:36 I disconnected from my corporate vpn and ran the script over my private network with the same result -- ___ Python tracker <https://bugs.python.org/issue40

[issue40362] AbstractBasicAuthHandler does not support the following scheme: 'Bearer'

2020-04-22 Thread Paul Stoner
New submission from Paul Stoner : I found this issue when running an ansible playbook. In the playbook we go out to Azure Artifacts to download a customer jar to be deploy with a web application. After some digging, I found the error comes from the request class in the urllib library

[issue40236] datetime.datetime.strptime get day error

2020-04-16 Thread Paul Ganssle
Change by Paul Ganssle : -- stage: -> needs patch ___ Python tracker <https://bugs.python.org/issue40236> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue40303] argparse parse_args args parameter bug or intended

2020-04-16 Thread paul j3
paul j3 added the comment: 'type=bool' doesn't get any special treatment. 'bool' is a builtin Python function. test with def mybool(astr): print("mybool:", astr, len(astr), bool(astr)) return bool(astr) The trick to getting a False value is to pass a genui

[issue40236] datetime.datetime.strptime get day error

2020-04-09 Thread Paul Ganssle
Paul Ganssle added the comment: Likely relevant is bpo-23136, where they dealt with similar issues in the past. I don't see any explicit test for this behavior, but it seems that the solution is to try to be consistent and to not raise a ValueError. Looking at this issue, I think it's

[issue40236] datetime.datetime.strptime get day error

2020-04-09 Thread Paul Ganssle
Paul Ganssle added the comment: I can reproduce this on Linux with Python 3.8.2. I think this may be a bug, but it may also just be platform-specific weirdness. Either way it's very curious behavior: >>> datetime.strptime("2023-0-0", "%Y-%W-%w")

[issue40173] test.support.import_fresh_module fails to correctly block submodules when fresh is specified

2020-04-03 Thread Paul Ganssle
New submission from Paul Ganssle : It seems that test.support.import_fresh_module gets tripped up with its module blocking when you attempt to get a fresh copy of a submodule of a module where you are also importing the module that you are trying to block (bit of a doozy of a sentence

[issue40134] Inconsistent ANSI escape code handling on Windows 10

2020-04-01 Thread Paul Moore
Paul Moore added the comment: This works fine for me in Windows terminal, but I see the behaviour described when using the conventional "Command prompt" window. Enabling ANSI codes is handled via SetConsoleMode (see here: https://docs.microsoft.com/en-us/windows/console/setc

[issue40136] add warning to datetime.replace documentation to not use it for setting tzinfo unless UTC or None

2020-04-01 Thread Paul Ganssle
Paul Ganssle added the comment: That is a specific problem with the third-party library `pytz`, not a standard feature of the datetime module. Using `datetime.replace` is the intended way to set a time zone, see: https://blog.ganssle.io/articles/2018/03/pytz-fastest-footgun.html

[issue33262] Deprecate shlex.split(None) to read from stdin.

2020-04-01 Thread Paul Ganssle
Paul Ganssle added the comment: New changeset 975ac326ffe265e63a103014fd27e9d098fe7548 by Zackery Spytz in branch 'master': bpo-33262: Deprecate passing None for `s` to shlex.split() (GH-6514) https://github.com/python/cpython/commit/975ac326ffe265e63a103014fd27e9d098fe7548 -- nosy

[issue40076] isoformat function drops microseconds part if its value is 000000

2020-03-26 Thread Paul Ganssle
Paul Ganssle added the comment: > isoformat function does not conform to the ISO 8601 and drops microseconds > part if its value is 00. I'm not sure why you think that this does not conform to ISO 8601 - ISO 8601 is a sprawling beast of a spec and allows some crazy formats

[issue40058] Running test_datetime twice fails with: module 'datetime' has no attribute '_divide_and_round'

2020-03-25 Thread Paul Ganssle
Paul Ganssle added the comment: This isn't exactly "working as intended", but I believe it's a known problem with either `import_fresh_module` or `datetime`, as you can see from these comments: https://github.com/python/cpython/blob/302e5a8f79514fd84bafbc44b7c97ec63630232

[issue19462] Add remove_argument() method to argparse.ArgumentParser

2020-03-23 Thread paul j3
paul j3 added the comment: I think it can be closed. -- ___ Python tracker <https://bugs.python.org/issue19462> ___ ___ Python-bugs-list mailing list Unsub

[issue36078] argparse: positional with type=int, default=SUPPRESS raise ValueError

2020-03-16 Thread paul j3
paul j3 added the comment: You are right, this part of the same issue. _get_value() tests '==SUPPRESS==' both for type and choices. -- ___ Python tracker <https://bugs.python.org/issue36

[issue39970] Combined behavior of datetime.datetime.timestamp() and datetime.datetime.utcnow() on non-UTC timezoned machines

2020-03-16 Thread Paul Ganssle
Paul Ganssle added the comment: @Yi Luan I think you may misunderstand what the `.timestamp()` function does - it returns an epoch time, which is the amount of time (in seconds) elapsed since the Unix epoch: https://en.wikipedia.org/wiki/Unix_time The number is not different depending

[issue39970] Combined behavior of datetime.datetime.timestamp() and datetime.datetime.utcnow() on non-UTC timezoned machines

2020-03-15 Thread Paul Ganssle
Paul Ganssle added the comment: This is the intended behavior of these functions, and there is actually now a warning on both the utcnow and utcfromtimestamp functionsto reflect this: https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow I would say that the correct

[issue39955] argparse print_help breaks when help is blank space

2020-03-13 Thread paul j3
Change by paul j3 : -- nosy: +paul.j3 ___ Python tracker <https://bugs.python.org/issue39955> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39845] Argparse on Python 3.7.1 (Windows) appends double quotes to string if it ends with backward slash

2020-03-05 Thread paul j3
paul j3 added the comment: Then this isn't an argparse issue. Probably not even a Python one. The windows shell (which one? cmd.exe? power? some batch) is making the substitution. I see lots of discussion about Windows use of backslash, both as directory separator and escape. None

[issue39845] Argparse on Python 3.7.1 (Windows) appends double quotes to string if it ends with backward slash

2020-03-04 Thread paul j3
paul j3 added the comment: Could you show the sys.argv (for both the linux and windows cases)? print(args) (without your correction) might also help, just to see the 'raw' Namespace. (I'd have to restart my computer to explore the Windows behavior myself

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