[issue34383] asyncio passes SSL certificate error to loop.call_exception_handler()

2018-08-11 Thread Andrei
New submission from Andrei : I'm using 3.7, but it's an issue that I've found in the old github repo for 3.6. When using asyncio, SSL certificate errors don't get suppressed. I've tried: - with contextlib.suppress(Exception) - except & pass Original ticket: http

[issue44289] tarfile.is_tarfile() and tarfile.open() when used with file object may cause tarfile operations to fail

2021-12-10 Thread Andrei Kulakov
Change by Andrei Kulakov : -- nosy: +lars.gustaebel ___ Python tracker <https://bugs.python.org/issue44289> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45977] Unexpected effect of sys.pycache_prefix = ""

2021-12-11 Thread Andrei Kulakov
Andrei Kulakov added the comment: Thanks, I've misunderstood how it works. It makes sense now. Closing as not a bug. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.pyth

[issue46068] Change use of warnings.warn to logging.warning in a few places

2021-12-13 Thread Andrei Kulakov
New submission from Andrei Kulakov : In discussion on https://github.com/python/cpython/pull/29910 related to whether to use warnings.warn or logging.warning, I found two places in the library where it might make sense to change to logging.warning. There's probably other instances wher

[issue44413] OverflowError: mktime argument out of range after 2019

2021-12-15 Thread Andrei Kulakov
Change by Andrei Kulakov : -- pull_requests: +28343 pull_request: https://github.com/python/cpython/pull/30124 ___ Python tracker <https://bugs.python.org/issue44

[issue44413] OverflowError: mktime argument out of range after 2019

2021-12-15 Thread Andrei Kulakov
Andrei Kulakov added the comment: Confirmed on Ubuntu buildbot: https://github.com/python/cpython/runs/4537544103?check_suite_focus=true -- ___ Python tracker <https://bugs.python.org/issue44

[issue44413] OverflowError: mktime argument out of range after 2019

2021-12-15 Thread Andrei Kulakov
Change by Andrei Kulakov : -- resolution: works for me -> stage: resolved -> needs patch status: closed -> open versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.or

[issue46068] Change use of warnings.warn to logging.warning in a few places

2021-12-15 Thread Andrei Kulakov
Andrei Kulakov added the comment: Raymond: Makes sense; I didn't know there was disagreement about this. I will keep this issue open for a week and then close. -- ___ Python tracker <https://bugs.python.org/is

[issue37578] Change Glob: Allow Recursion for Hidden Files

2021-12-16 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch nosy: +andrei.avk nosy_count: 5.0 -> 6.0 pull_requests: +28372 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30153 ___ Python tracker <https://bugs.python.org/i

[issue37578] Change Glob: Allow Recursion for Hidden Files

2021-12-16 Thread Andrei Kulakov
Andrei Kulakov added the comment: Zsh allows use of *, ? and ** to match hidden files and directories. Bash allows the same for * and ? with `dotglob` option. There is also a `globstar` but my version of bash (on macos) is too old to have it. By the way setting options in bash is done with

[issue37578] Change Glob: Allow Recursion for Hidden Files

2021-12-16 Thread Andrei Kulakov
Andrei Kulakov added the comment: Isaac: my PR does allow [.] to match. But I probably need to update the docs to note that. -- ___ Python tracker <https://bugs.python.org/issue37

[issue37578] Change Glob: Allow Recursion for Hidden Files

2021-12-16 Thread Andrei Kulakov
Andrei Kulakov added the comment: I want to clarify my first comment: my PR is similar to Zsh behaviour as described above; as I'm not 100% sure how bash behaves with `**` with globstar option, I can say that bash is the same as Zsh with ? and * magic characters (with dotglob option)

[issue46068] Change use of warnings.warn to logging.warning in a few places

2021-12-18 Thread Andrei Kulakov
Andrei Kulakov added the comment: https://discuss.python.org/t/logging-warning-vs-warnings-warn/12625/2 -- ___ Python tracker <https://bugs.python.org/issue46

[issue42673] Optimize round_size for rehashing

2021-12-23 Thread Andrei Kulakov
Andrei Kulakov added the comment: Closing as it sounds like OP agreed to it in the last msg; and no benchmarking was provided. -- nosy: +andrei.avk resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Pytho

[issue42259] pprint: infinite recursion for saferepr() when using nested objects, but str() works

2021-12-25 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch nosy: +andrei.avk nosy_count: 2.0 -> 3.0 pull_requests: +28477 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30256 ___ Python tracker <https://bugs.python.org/i

[issue42259] pprint: infinite recursion for saferepr() when using nested objects, but str() works

2021-12-25 Thread Andrei Kulakov
Andrei Kulakov added the comment: The recursion protection in `saferepr` applies when two conditions are met: - the structure is subclassed from list, tuple or dict - __repr__ is not overriden In this case neither condition is met. However, the recursion is caused by the `__repr__` so when

[issue42079] Why does tarfile.next swallow InvalidHeaderError

2021-12-26 Thread Andrei Kulakov
Change by Andrei Kulakov : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> tarfile module next() method hides exceptions ___ Python tracker <https://bugs.python

[issue26214] textwrap should minimize number of breaks in extra long words

2021-12-27 Thread Andrei Kulakov
Andrei Kulakov added the comment: It may be worth fixing wrap() to do the nicer style of wrapping for long words. If we decide to do that, it should be done via a new parameter because the same logic (TextWrapper class) is used for `shorten` and in that case it may be preferable to have the

[issue31369] re.RegexFlag is not included in __all__, makes type inference less useful

2021-12-27 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch nosy: +andrei.avk nosy_count: 10.0 -> 11.0 pull_requests: +28495 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30279 ___ Python tracker <https://bugs.p

[issue21987] TarFile.getmember on directory requires trailing slash iff over 100 chars

2021-12-28 Thread Andrei Kulakov
Change by Andrei Kulakov : -- nosy: +andrei.avk nosy_count: 8.0 -> 9.0 pull_requests: +28497 pull_request: https://github.com/python/cpython/pull/30283 ___ Python tracker <https://bugs.python.org/issu

[issue21987] TarFile.getmember on directory requires trailing slash iff over 100 chars

2021-12-28 Thread Andrei Kulakov
Andrei Kulakov added the comment: The original issue was twofold: 1. below 100 char not working with trailing slash 2. over 100 char not working WITHOUT trailing slash The second part is no longer an issue -- tested in 3.9 and 3.11 on MacOS. Currently the issue is that a trailing slash now

[issue41585] policy.max_line_length is incorrectly assumed to never be None

2021-12-28 Thread Andrei Kulakov
Andrei Kulakov added the comment: Seems to be a duplicate of #34800 -- nosy: +andrei.avk ___ Python tracker <https://bugs.python.org/issue41585> ___ ___ Pytho

[issue41593] pathlib PermissionError problem

2021-12-29 Thread Andrei Kulakov
Andrei Kulakov added the comment: Cannot reproduce on 3.9 and 3.11; the quoted fragment of code is no longer in pathlib. Closing as fixed as it seems that it was fixed in 3.9 or earlier. Please comment if you think it should be reopened. -- nosy: +andrei.avk, kj resolution

[issue45853] Misspelled _IGNORED_ERROS in Lib/pathlib.py

2021-12-29 Thread Andrei Kulakov
Change by Andrei Kulakov : -- pull_requests: +28506 pull_request: https://github.com/python/cpython/pull/30292 ___ Python tracker <https://bugs.python.org/issue45

[issue41569] json.JSONEncoder.default should be called for dict keys as well

2021-12-29 Thread Andrei Kulakov
Change by Andrei Kulakov : -- nosy: +kj resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> json.dump() ignores its 'default' option when serializing dictionary keys ___ Python tracker &l

[issue40236] datetime.datetime.strptime get day error

2021-12-31 Thread Andrei Kulakov
Andrei Kulakov added the comment: > I am open to discussion about trying to rationalize this behavior - it would > be a bit tricky but if we moved to our own implementation of the algorithm to > calculate %W we could detect this situation and throw an exception. Paul: I'm

[issue40236] datetime.datetime.strptime get day error

2021-12-31 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch pull_requests: +28534 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30318 ___ Python tracker <https://bugs.python.org/issu

[issue40236] datetime.datetime.strptime get day error

2022-01-01 Thread Andrei Kulakov
Andrei Kulakov added the comment: I didn't realize that time.strptime is just using python module _strptime. -- ___ Python tracker <https://bugs.python.org/is

[issue41403] Uncaught AttributeError in unittest.mock._get_target

2022-01-01 Thread Andrei Kulakov
Andrei Kulakov added the comment: More generally, split()/rsplit() are probably the most common operations done on expected string at the start of a function, i.e. most likely to be triggered on the wrong type passed in. At the same time to many new users split()/rsplit() does not imply

[issue41011] [venv] record which executable and command were used to create a virtual environment

2022-01-03 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch nosy: +andrei.avk nosy_count: 2.0 -> 3.0 pull_requests: +28592 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30382 ___ Python tracker <https://bugs.python.org/i

[issue46300] zlib.compress level and wbits args are shown as keyword-only in the documentation

2022-01-07 Thread Andrei Kulakov
New submission from Andrei Kulakov : zlib.compress level and wbits args are shown as keyword-only in the documentation, however they are accepted as positional without error. Should the docs or the code be fixed? -- messages: 410051 nosy: andrei.avk priority: low severity: normal

[issue46300] zlib.compress level and wbits args are shown as keyword-only in the documentation

2022-01-07 Thread Andrei Kulakov
Change by Andrei Kulakov : -- components: +Library (Lib) ___ Python tracker <https://bugs.python.org/issue46300> ___ ___ Python-bugs-list mailing list Unsub

[issue46300] zlib.compress level and wbits args are shown as keyword-only in the documentation

2022-01-07 Thread Andrei Kulakov
Andrei Kulakov added the comment: I forgot that '/' marks end of positional-only args, not keyword-only. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs

[issue45572] urllib.request:AttributeError: 'dict' object has no attribute 'get_all' in http_error_auth_reqed function

2022-01-22 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch pull_requests: +29001 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30814 ___ Python tracker <https://bugs.python.org/issu

[issue45572] urllib.request:AttributeError: 'dict' object has no attribute 'get_all' in http_error_auth_reqed function

2022-01-22 Thread Andrei Kulakov
Andrei Kulakov added the comment: I was wrong that the method is undocumented, it is documented but it doesn't explain the type of *headers* param. The headers can also be more easily created using `email.message.Message()`. I've added the PR documenting

[issue45606] pathlib.Path.glob() does not list dangling symlink when pattern is the exact filename

2022-01-22 Thread Andrei Kulakov
Change by Andrei Kulakov : -- title: pathlib.Path.glob() does not list dangling symlink when pattern is the exact filenane -> pathlib.Path.glob() does not list dangling symlink when pattern is the exact filename versions: +Python 3.11 -Python

[issue39100] email.policy.SMTP throws AttributeError on invalid header

2022-01-30 Thread Andrei Kulakov
Andrei Kulakov added the comment: I confirmed I get the same error as Anton on 3.9 and 3.11 . -- ___ Python tracker <https://bugs.python.org/issue39100> ___ ___

[issue45326] Unexpected TypeError with type alias+issubclass+ABC

2022-02-27 Thread Andrei Kulakov
Andrei Kulakov added the comment: This error was added in https://bugs.python.org/issue33018 . See some discussion on that issue. Note that first arg needs to be a type (i.e. instance of `type`) to avoid this error: [ins] In [41]: class C(ABC):0 [ins] In [42]: issubclass(dict, C) Out[42

[issue45326] Unexpected TypeError with type alias+issubclass+ABC

2022-02-27 Thread Andrei Kulakov
Change by Andrei Kulakov : -- nosy: +kj type: -> behavior ___ Python tracker <https://bugs.python.org/issue45326> ___ ___ Python-bugs-list mailing list Un

[issue46823] Add LOAD_FAST__LOAD_ATTR_INSTANCE_VALUE combined opcode

2022-03-02 Thread Andrei Kulakov
Change by Andrei Kulakov : -- title: Add LOAD_FAST__LOAD_ATTR_INSTACE_VALUE combined opcode -> Add LOAD_FAST__LOAD_ATTR_INSTANCE_VALUE combined opcode ___ Python tracker <https://bugs.python.org/issu

[issue8427] toplevel jumps to another location on the screen

2010-04-16 Thread Andrei Paraschivescu
New submission from Andrei Paraschivescu : The effect is the window just jumps to another location, matching left corners with another window in the same Python application. Its size doesn't change. The effect is somewhat erratic, the best I've been able to create is a situatio

[issue8427] toplevel jumps to another location on the screen

2010-05-02 Thread Andrei Paraschivescu
Changes by Andrei Paraschivescu : -- type: -> behavior ___ Python tracker <http://bugs.python.org/issue8427> ___ ___ Python-bugs-list mailing list Unsubscri

[issue45993] Main branch of CPython does not build anymore on macOS

2022-03-11 Thread Andrei Kulakov
Andrei Kulakov added the comment: I'm getting the same exact error but on `arm64`, and clearing the cache does not help. clang=13.0.0 MacOS=11.5.2 Should I open a new issue for this? 257 warnings generated. 257 warnings generated. Undefined symbols for architecture

[issue46975] clang: error: linker command failed with exit code 1 (use -v to see invocation) on m1 mac

2022-03-14 Thread Andrei Kulakov
Andrei Kulakov added the comment: I've had the same issue and fixed it with: brew remove --ignore-dependencies gettext @Ned thanks for help! -- nosy: +andrei.avk ___ Python tracker <https://bugs.python.org/is

[issue47026] BytesWarning in zipimport paths on sys.path

2022-03-20 Thread Andrei Kulakov
Andrei Kulakov added the comment: This warning can be fixed by changing the following line: https://github.com/python/cpython/blob/9d1c4d69dbc800ac344565119337fcf490cdc800/Lib/importlib/_bootstrap_external.py#L1419 to: if not path and str(path) == '': and running `

[issue47030] singledispatch does not work with positional arguments with default values.

2022-03-21 Thread Andrei Kulakov
Andrei Kulakov added the comment: This would be problematic for two reasons: - possible confusion between the default function that runs when an argument doesn't match any registered types, and another "default" which runs when argument is omitted. - to see which functio

[issue37865] tempfile.NamedTemporaryFile() raises exception on close() when file is absent

2019-08-15 Thread Andrei Pashkin
New submission from Andrei Pashkin : Here is an example: import tempfile import os with tempfile.NamedTemporaryFile() as temp: os.remove(temp.name) And here is an error it produces: Traceback (most recent call last): File "test.py", line 6, in os.remove(temp.name)

[issue38232] empty local-part in addr_spec displayed incorrectly

2019-09-20 Thread Andrei Troie
New submission from Andrei Troie : Given an (RFC-legal) email address with the local part consisting of a quoted empty string (e.g. 'Nobody <""@example.org>'), when I call the 'addr_spec' property, the result no longer includes the quoted empty string

[issue38232] empty local-part in addr_spec displayed incorrectly

2019-09-20 Thread Andrei Troie
Change by Andrei Troie : -- versions: +Python 3.9 ___ Python tracker <https://bugs.python.org/issue38232> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38232] empty local-part in addr_spec displayed incorrectly

2019-09-23 Thread Andrei Troie
Andrei Troie added the comment: As far as I understand it, this is due to the following code in email.headerregistry.Address.addr_spec (in 3.8 and below): if len(nameset) > len(nameset-parser.DOT_ATOM_ENDS): lp = parser.quote_string(self.username) or, in the current version on mas

[issue38332] invalid content-transfer-encoding in encoded-word causes KeyError

2019-09-30 Thread Andrei Troie
New submission from Andrei Troie : The following will cause a KeyError on email.message.get() import email import email.policy text = "Subject: =?us-ascii?X?somevalue?=" eml = email.message_from_string(text, policy=email.policy.default) eml.get('Subject') This is caused

[issue38332] invalid content-transfer-encoding in encoded-word causes KeyError

2019-10-01 Thread Andrei Troie
Change by Andrei Troie : -- keywords: +patch pull_requests: +16094 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16503 ___ Python tracker <https://bugs.python.org/issu

[issue38332] invalid content-transfer-encoding in encoded-word causes KeyError

2019-10-01 Thread Andrei Troie
Andrei Troie added the comment: I agree with you that according to the RFC, the cte can of course only be "B" or "Q". My point is that, in my example, if you try to do that you get a KeyError propagating all the way down to email.message.get(), which I believe is inco

[issue42454] Move slice creation to the compiler for constants

2021-04-11 Thread Andrei Kulakov
Andrei Kulakov added the comment: One possibility for this being a breaking change is this scenario: some codebase may have logic that takes a list and uses a slice operation on it; in a rare circumstance the list is really a dict and a TypeError is caught upstream and dealt with; with this

[issue43832] asyncio + multiprocessing = core dump in sem_trywait

2021-04-13 Thread Andrei Pozolotin
New submission from Andrei Pozolotin : every attempt to touch multiprocessing.Event.is_set() from asyncio.run() results in reproducible core dump in sem_trywait system: Linux 5.11.8 Linux work3 5.11.8-arch1-1 #1 SMP PREEMPT Sun, 21 Mar 2021 01:55:51 + x86_64 GNU/Linux Python: 3.9.2

[issue43832] asyncio + multiprocessing = core dump in sem_trywait

2021-04-13 Thread Andrei Pozolotin
Change by Andrei Pozolotin : Added file: https://bugs.python.org/file49957/dump_core.txt ___ Python tracker <https://bugs.python.org/issue43832> ___ ___ Python-bug

[issue42037] Documentation confusion in CookieJar functions

2021-04-15 Thread Andrei Kulakov
Andrei Kulakov added the comment: I can confirm `unverifiable` is an attr: https://github.com/python/cpython/blob/master/Lib/urllib/request.py#L333 and so is incorrectly listed as a method in cookie jar docs. -- nosy: +andrei.avk ___ Python

[issue41350] Use of zipfile.Path causes attempt to write after ZipFile is closed

2021-04-24 Thread Andrei Kulakov
Andrei Kulakov added the comment: Looks like a duplicate of https://bugs.python.org/issue40564 , which was fixed and closed so this can also be closed. -- nosy: +andrei.avk ___ Python tracker <https://bugs.python.org/issue41

[issue22167] iglob() has misleading documentation (does indeed store names internally)

2021-04-30 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch nosy: +andrei.avk nosy_count: 8.0 -> 9.0 pull_requests: +24460 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25767 ___ Python tracker <https://bugs.python.org/i

[issue44045] canonicalize "upper-case" -> "uppercase"; "lower-case" -> "lowercase"

2021-05-08 Thread Andrei Kulakov
Andrei Kulakov added the comment: https://dictionary.cambridge.org/us/dictionary/english/lower-case lists lower-case as a valid variant for nouns as well as adjectives. -- nosy: +andrei.avk ___ Python tracker <https://bugs.python.org/issue44

[issue44078] Output relative path when using PurePath.relative_to

2021-05-08 Thread Andrei Kulakov
Andrei Kulakov added the comment: duplicate of https://bugs.python.org/issue40358 , which has an open patch. -- nosy: +andrei.avk ___ Python tracker <https://bugs.python.org/issue44

[issue44045] canonicalize "upper-case" -> "uppercase"; "lower-case" -> "lowercase"

2021-05-08 Thread Andrei Kulakov
Andrei Kulakov added the comment: On Sat, May 8, 2021 at 10:38 PM Eric V. Smith wrote: > > Eric V. Smith added the comment: > > The stdlib seems to have settled on lowercase for the noun version, > though. My two cents: no sense not being consist just because lower-case &g

[issue39228] traceback.FrameSummary does not handle exceptions from `repr()`

2021-05-08 Thread Andrei Kulakov
Andrei Kulakov added the comment: This probably shouldn't be done, for all of the reasons above. For the sake of an argument, if we really wanted to do something like this (as it may be convenient in some cases), a better way might be to add a `__tb_repr__ = __repr__` which c

[issue43656] StackSummary.format fails if str(value) fails

2021-05-08 Thread Andrei Kulakov
Andrei Kulakov added the comment: @Martin it's more that logic in a function may raise exception and it will be handled somewhere upstream, but a repr should just give you a simple representation of an object, it would make no sense for upstream logic to be "object repr failed

[issue44076] issue with list in Python 3.8.5

2021-05-09 Thread Andrei Kulakov
Andrei Kulakov added the comment: Hi Mohamed, you can try changing the following line: itemXid = assetinfo_lst[xrec][1] to: print('xrec',xrec) itemXid = assetinfo_lst[xrec] itemXid = itemXid[1] This will show you if the index error is caused by xrec or by [1] lookup. If caus

[issue44076] issue with list in Python 3.8.5

2021-05-09 Thread Andrei Kulakov
Andrei Kulakov added the comment: Hi Mohamed, >From the output it looks like the app is trying to get item at index 28 from assetinfo_list, while that list is of only 17 length. So it seems likely that either app is not inserting enough items into assetinfo_list, or you are clicking

[issue43905] dataclasses.astuple does deepcopy on all fields

2021-05-15 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch nosy: +andrei.avk nosy_count: 3.0 -> 4.0 pull_requests: +24788 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26154 ___ Python tracker <https://bugs.python.org/i

[issue43858] Provide method to get list of logging level names

2021-05-17 Thread Andrei Kulakov
Andrei Kulakov added the comment: I can add getLevelNamesDict() which would return a copy of _nameToLevel, which is currently _nameToLevel = { 'CRITICAL': CRITICAL, 'FATAL': FATAL, 'ERROR': ERROR, 'WARN': WARNING, 'WARNING&#x

[issue42722] Add --debug command line option to unittest to enable post-mortem debugging

2021-05-19 Thread Andrei Kulakov
Andrei Kulakov added the comment: This is a duplicate of https://bugs.python.org/issue18765, which already has some discussion going for a few years, so please follow up there. -- nosy: +andrei.avk ___ Python tracker <https://bugs.python.

[issue43858] Provide method to get list of logging level names

2021-05-30 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch pull_requests: +25054 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26459 ___ Python tracker <https://bugs.python.org/issu

[issue44281] Links on top of collections doc not in the order of sections

2021-06-01 Thread Andrei Kulakov
New submission from Andrei Kulakov : https://docs.python.org/3.11/library/collections.html Links are not in the same order as the sections below. It creates some dissonance for the reader to first read the section names above and then continue reading expecting them to be in the same order

[issue28937] str.split(): allow removing empty strings (when sep is not None)

2021-06-02 Thread Andrei Kulakov
Andrei Kulakov added the comment: I'm not sure I understand why the discussion was focused on removing *all* empty values. Consider this in a context of a cvs-like string: 1. 'a,b,c' => [a,b,c]# of course 2. ',,'=> [''

[issue28937] str.split(): allow removing empty strings (when sep is not None)

2021-06-05 Thread Andrei Kulakov
Andrei Kulakov added the comment: Mark: With sep=None, I don't think there is an issue. My only concern is when sep is set to some other value. The original issue was that the single empty str result is removed when using sep=None and that it's kept when sep is some other val

[issue28937] str.split(): allow removing empty strings (when sep is not None)

2021-06-05 Thread Andrei Kulakov
Andrei Kulakov added the comment: To clarify with pseudocode, this is how it could work: '' => [] # sep=None, keep_single_empty=False '' => [''] # sep=None, keep_single_empty=True '' => [] # sep=','

[issue28937] str.split(): allow removing empty strings (when sep is not None)

2021-06-05 Thread Andrei Kulakov
Andrei Kulakov added the comment: > I imagine that the discussion focussed on this since this is precisely what > happens when sep=None. For example, 'a b c ​'.split() == ['a', 'b', > 'c']. I guess that the point was to provide users

[issue28937] str.split(): allow removing empty strings (when sep is not None)

2021-06-05 Thread Andrei Kulakov
Andrei Kulakov added the comment: > Of course, but the main thing is that you spotted this before the PR was > merged :) I know, better late then never but also better sooner than late :-) -- ___ Python tracker <https://bugs.p

[issue27901] DOC: inspect.ismethod returns different results on the same basic code between Python2.7 Python3.5

2021-06-07 Thread Andrei Kulakov
Andrei Kulakov added the comment: The data model docs still have 2 references to unbound methods: For callables, it may indicate that an instance of the given type (or a subclass) is expected or required as the first positional argument (for example, CPython sets this attribute for unbound

[issue31472] "Emulating callable objects" documentation misleading

2021-06-07 Thread Andrei Kulakov
Andrei Kulakov added the comment: I don't think the docs in current form imply keyword args are disallowed: "arguments" covers both positional and keyword args, and the call as given in example would work for both positional and keyword args (though not overriding the defa

[issue18767] csv documentation does not note default quote constant

2021-06-11 Thread Andrei Kulakov
Andrei Kulakov added the comment: The docs do say that now: .. attribute:: Dialect.quoting Controls when quotes should be generated by the writer and recognised by the reader. It can take on any of the :const:`QUOTE_\*` constants (see section :ref:`csv-contents`) and defaults to

[issue44365] Bad dataclass post-init example

2021-06-14 Thread Andrei Kulakov
Andrei Kulakov added the comment: How about this example: @dataclass class Rect: x: int y: int r=Rect(5,2) @dataclass class HyperRect(Rect): z: int def __post_init__(self): self.vol = self.x*self.y*self.z hr=HyperRect(5,2,3) print("hr.vol", hr.vol) Hyper

[issue44407] A "Coroutines and Tasks" code example needs "asyncio.run(main())"

2021-06-15 Thread Andrei Kulakov
Andrei Kulakov added the comment: I think it's clear that the modification of previous example is limited to `main()` because `say_after()` is also omitted. This is very common in Python code examples, - it seems to me this change is not needed. -- nosy: +andre

[issue28937] str.split(): allow removing empty strings (when sep is not None)

2021-06-16 Thread Andrei Kulakov
Andrei Kulakov added the comment: Just to sum up the current state the way I see it, as well as the history of the discussion, I think there were 2 initial requests based on experience and one additional, more theoretical "nice to have": A. ''.split() => [''

[issue44318] Asyncio classes missing __slots__

2021-06-16 Thread Andrei Kulakov
Andrei Kulakov added the comment: Bluenix, can you describe your use case in more detail? -- nosy: +andrei.avk ___ Python tracker <https://bugs.python.org/issue44

[issue44365] Bad dataclass post-init example

2021-06-17 Thread Andrei Kulakov
Andrei Kulakov added the comment: It's a good example, but some readers might only have a vague idea (if any) of what FTP is, so a self contained example might be easier to digest? -- ___ Python tracker <https://bugs.python.org/is

[issue44318] Asyncio classes missing __slots__

2021-06-17 Thread Andrei Kulakov
Andrei Kulakov added the comment: The size of an instance of Semaphore is 48, of an empty tuple is 40, of a small int is 28, of an instance of a normal class with a single slot in __slots__ is also 40, are you use 48 byte size will really be an issue for you

[issue44318] Asyncio classes missing __slots__

2021-06-17 Thread Andrei Kulakov
Andrei Kulakov added the comment: My mistake, I forgot the size of the dict itself is not included in getsizeof(). -- ___ Python tracker <https://bugs.python.org/issue44

[issue44465] html.escape can be used in a few places in the standard lib instead of similar existing code

2021-06-19 Thread Andrei Kulakov
New submission from Andrei Kulakov : There are a few places where old code does essentially the same thing as `html.escape()`, and can be replaced with html.escape(): - more readable - less error prone on refactorings - will benefit if html.escape() performance is improved in the future

[issue33213] crypt function not hashing properly on Mac (uses a specific salt)

2021-06-20 Thread Andrei Kulakov
Andrei Kulakov added the comment: How about adding a check to `crypt.mksalt()`: if method and method not in methods: raise ValueError(f'method {method} is not supported') If a method is supplied to `crypt.crypt()`, mksalt() is called with it as an arg, so adding this check

[issue33213] crypt function not hashing properly on Mac (uses a specific salt)

2021-06-20 Thread Andrei Kulakov
Andrei Kulakov added the comment: Actually it should be: if method is not None and method not in methods: ... -- ___ Python tracker <https://bugs.python.org/issue33

[issue43066] Zipfile with leading slashes

2021-06-20 Thread Andrei Kulakov
Andrei Kulakov added the comment: I propose fixing this in documentation. Raising an error is probably not warranted because zip files are often created on one system and used on another, so you can't raise an error based on current OS, and having a leading slash in the name is both u

[issue42588] Improvements to graphlib.TopologicalSorter.static_order() documentation

2021-06-21 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch nosy: +andrei.avk nosy_count: 5.0 -> 6.0 pull_requests: +25415 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26834 ___ Python tracker <https://bugs.python.org/i

[issue42588] Improvements to graphlib.TopologicalSorter.static_order() documentation

2021-06-21 Thread Andrei Kulakov
Andrei Kulakov added the comment: I'm not sure it's worth it to complicate the logic by raising the error before iteration since iteration is normally done soon after method call. I agree the doc change is helpful, since the ticket was dormant for a ~month, I've put up a PR w

[issue22167] iglob() has misleading documentation (does indeed store names internally)

2021-06-21 Thread Andrei Kulakov
Andrei Kulakov added the comment: I have put up a PR here: https://github.com/python/cpython/pull/25767 -- ___ Python tracker <https://bugs.python.org/issue22

[issue43905] dataclasses.astuple does deepcopy on all fields

2021-06-21 Thread Andrei Kulakov
Andrei Kulakov added the comment: I've added a PR here: https://github.com/python/cpython/pull/26154 -- ___ Python tracker <https://bugs.python.org/is

[issue44213] LIST_TO_TUPLE placed below the sentence "all of the following use their opcodes" in dis library documentaiton.

2021-06-22 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch nosy: +andrei.avk nosy_count: 2.0 -> 3.0 pull_requests: +25436 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26859 ___ Python tracker <https://bugs.python.org/i

[issue44213] LIST_TO_TUPLE placed below the sentence "all of the following use their opcodes" in dis library documentaiton.

2021-06-22 Thread Andrei Kulakov
Andrei Kulakov added the comment: I think the arg to dict_merge was just missing, I've put up a PR that adds it. -- ___ Python tracker <https://bugs.python.org/is

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

2021-06-22 Thread Andrei Kulakov
Andrei Kulakov added the comment: Maybe I am misunderstanding, but if an object is deleted, and another object created with the same ID, wouldn't WeakRefDict now be pointing to the wrong object? -- nosy: +andrei.avk ___ Python tracker &

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

2021-06-22 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch nosy: +andrei.avk nosy_count: 4.0 -> 5.0 pull_requests: +25440 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26865 ___ Python tracker <https://bugs.python.org/i

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

2021-06-22 Thread Andrei Kulakov
Andrei Kulakov added the comment: I've put up a PR that adds a footnote, clarifies 'uncased' meaning and also adds notes in regard to discrepancy between standard publishing definition of "title case" and what we use in the f

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

2021-06-23 Thread Andrei Kulakov
Andrei Kulakov added the comment: Josh: thanks for the explanation, this makes sense. -- ___ Python tracker <https://bugs.python.org/issue44140> ___ ___ Pytho

  1   2   3   4   5   6   >