[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 function wil

[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 `make regen

[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/issue46

[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 arm64

[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

[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

[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

[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> ___ ___

[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

[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 this param

[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

[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.python.or

[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
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

[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

[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

[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/issue40

[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

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 gues

[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 <https://

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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: 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

[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

[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/issue46

[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

[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 : -- pull_requests: +28343 pull_request: https://github.com/python/cpython/pull/30124 ___ Python tracker <https://bugs.python.org/issue44

[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 where

[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.python.or

[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:

[issue44170] ShareableList cannot safely handle multibyte utf-8 characters

2021-12-08 Thread Andrei Kulakov
Andrei Kulakov added the comment: I've confirmed this issue is still present in 3.11. -- ___ Python tracker <https://bugs.python.org/issue44170> ___ ___ Pytho

[issue44170] ShareableList cannot safely handle multibyte utf-8 characters

2021-12-08 Thread Andrei Kulakov
Andrei Kulakov added the comment: We classify 'crash' type as seg faults etc, so changing this to 'behavior' type. -- nosy: +andrei.avk type: crash -> behavior ___ Python tracker <https://bugs.python.org/issu

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

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

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

2021-12-08 Thread Andrei Kulakov
Andrei Kulakov added the comment: This affects more use cases than just is_tarfile() and getmembers() results. is_tarfile() calls open() which is the root cause of the issue. Calling open() 2+ times will also cause the same issue. In addition to getmembers(), extracting the tar will also

[issue44377] Truncated error message of original function while multiprocessing or multithreading

2021-12-08 Thread Andrei Kulakov
Change by Andrei Kulakov : -- type: -> behavior versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7 ___ Python tracker <https://bugs.python.org/issu

[issue44377] Truncated error message of original function while multiprocessing or multithreading

2021-12-08 Thread Andrei Kulakov
Andrei Kulakov added the comment: Prasanth: can you provide a bit more details, are you saying that this line: https://github.com/python/cpython/blob/2109f7880b65755329a877da3a7f8a362de07350/Lib/multiprocessing/pool.py#L86 .. truncates the exception msg? What is the exact exception type

[issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior

2021-12-06 Thread Andrei Kulakov
Andrei Kulakov added the comment: It's a bit more readable to start by stating what a function does rather than what it doesn't do. I also wouldn't worry about possible future minor optimizations that might be added, because if that happens, a simple ".. aside from internal optimiza

[issue44077] IP_RECVTOS option is missing from socket module

2021-12-06 Thread Andrei Kulakov
Change by Andrei Kulakov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

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

2021-12-05 Thread Andrei Kulakov
Andrei Kulakov added the comment: Can this also create the risk of 'path too long' issues? -- ___ Python tracker <https://bugs.python.org/issue45977> ___ ___

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

2021-12-05 Thread Andrei Kulakov
Andrei Kulakov added the comment: If CWD=/a/b and pycache_prefix=c, the resulting dir is /a/b/c as I would expect. If CWD=/a/b and pycache_prefix='', I would expect resulting dir to be /a/b instead of /a/b/a/b . For example as the shell `cd` command accepts relative path as arg, I would

[issue36392] IPv4Interface Object has no attributte prefixlen

2021-12-04 Thread Andrei Kulakov
Andrei Kulakov added the comment: The docs for current bugfix releases (3.9+) have clear links from the Interface class attribute `network` to the Network class which lists the `prefixlen` attribute. I don't think it can be made clearer - there's two ways to find it - either searching

[issue44735] Failed venv Activation With "&" In Folder Name

2021-12-04 Thread Andrei Kulakov
Andrei Kulakov added the comment: Duplicate of https://bugs.python.org/issue44540 -- nosy: +andrei.avk superseder: -> venv: activate.bat fails for venv with special characters in PATH ___ Python tracker <https://bugs.python.org/issu

[issue43418] FTPLib error when server returns byte message instead of string

2021-12-04 Thread Andrei Kulakov
Andrei Kulakov added the comment: Closing as third party. Cowrie overrides ftplib.FTP class and implements __init__ in a way that doesn't work properly with some other methods of `FTP` class. -- resolution: -> third party stage: -> resolved status: open -&g

[issue43474] http.server.BaseHTTPRequestHandler end_header() fails

2021-12-04 Thread Andrei Kulakov
Andrei Kulakov added the comment: It seems like sending zero headers is not supported, because: - if using http/1.0 https://www.rfc-editor.org/rfc/rfc7230#section-6.1 -- Connection: close must be sent - if using http/1.1 -- https://docs.python.org/3.11/library/http.server.html

[issue44534] unittest.mock.Mock.unsafe doc is garbled

2021-12-04 Thread Andrei Kulakov
Change by Andrei Kulakov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11 -Python 3.9 ___ Python tracker <https://bugs.python.or

[issue43098] tarfile list() method does not show file type

2021-12-03 Thread Andrei Kulakov
Andrei Kulakov added the comment: Val: contributions are only now accepted in form of github PRs, not patches. -- ___ Python tracker <https://bugs.python.org/issue43

[issue37198] _parse_localename fail to parse 'en_IL'

2021-12-03 Thread Andrei Kulakov
Andrei Kulakov added the comment: I confirmed that it works on 3.9 so I think this can be closed as not a bug: [ins] In [4]: _parse_localename('en_IL') Out[4]: ('en_IL', 'UTF-8') -- ___ Python tracker <https://bugs.python.org/issue37

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

2021-12-03 Thread Andrei Kulakov
Andrei Kulakov added the comment: (I forgot to mention this happens on MacOS). -- ___ Python tracker <https://bugs.python.org/issue45977> ___ ___ Python-bug

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

2021-12-03 Thread Andrei Kulakov
New submission from Andrei Kulakov : Setting sys.pycache_prefix = "", re-creates CWD structure under current directory, e.g. if run from /Users/foo/test, will create /Users/foo/test/Users/foo/test/myfile.pyc . Is that intentional? It seems a little weird. At least it mig

[issue20907] behavioral differences between shutil.unpack_archive and ZipFile.extractall

2021-12-03 Thread Andrei Kulakov
Andrei Kulakov added the comment: I forgot to add this: - we may not want to follow the behavior of command line unzip - it's interactive so considerations are somewhat different. For example, it will warn if file is being overwritten and show a prompt on whether to skip, overwrite, abort

[issue20907] behavioral differences between shutil.unpack_archive and ZipFile.extractall

2021-12-03 Thread Andrei Kulakov
Andrei Kulakov added the comment: I think it may be good enough to add a warning on skipped files in _unpack_zipfile(). - this way we keep backwards compatibility (especially since behavior in both modules differed for such a long time.) - it's not clear that ZipFile behavior is superior

[issue20907] behavioral differences between shutil.unpack_archive and ZipFile.extractall

2021-12-03 Thread Andrei Kulakov
Change by Andrei Kulakov : -- nosy: +andrei.avk nosy_count: 6.0 -> 7.0 pull_requests: +28135 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/29910 ___ Python tracker <https://bugs.python.org/i

[issue43153] tempfile seems to treat a file as a directory when processing an exception in the onerror()

2021-11-30 Thread Andrei Kulakov
Andrei Kulakov added the comment: My last comment was wrong, the issue I linked is unrelated. I think the actual issue here is the code here: https://github.com/python/cpython/blob/4b97d974ecca9cce532be55410fe851eb9fdcf21/Lib/tempfile.py#L826 If `path` is a file that causes a permission

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

2021-11-29 Thread Andrei Kulakov
Change by Andrei Kulakov : -- nosy: +kj ___ Python tracker <https://bugs.python.org/issue44413> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2021-11-29 Thread Andrei Kulakov
Andrei Kulakov added the comment: Cannot reproduce with 3.8.6 on MacOS. The code runs without any errors. As OP hasn't responded in 4 months I think we should close as "works for me". -- nosy: +andrei.avk ___ Python track

[issue41102] ZipFile.namelist() does not match the actual files in .zip file

2021-11-29 Thread Andrei Kulakov
Andrei Kulakov added the comment: Closing by request of OP. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue43905] dataclasses.astuple (and .asdict) do deepcopy on all fields

2021-11-29 Thread Andrei Kulakov
Andrei Kulakov added the comment: Thank you for reviewing Eric! -- ___ Python tracker <https://bugs.python.org/issue43905> ___ ___ Python-bugs-list mailin

[issue44675] Cross-platform issues with private methods and multiprocessing

2021-11-29 Thread Andrei Kulakov
Andrei Kulakov added the comment: If we are not going to fix this issue in pickling at this time, I think it makes sense to raise an error with a good, clear explanation in multiprocessing.Process(target=self.__method), which is affected by this and caused some confusion in this issue

[issue44675] Cross-platform issues with private methods and multiprocessing

2021-11-28 Thread Andrei Kulakov
Andrei Kulakov added the comment: More details and a suggested fix here: #37852 . -- ___ Python tracker <https://bugs.python.org/issue44675> ___ ___ Python-bug

[issue44675] Cross-platform issues with private methods and multiprocessing

2021-11-28 Thread Andrei Kulakov
Andrei Kulakov added the comment: The issue seems to be that there was a change between 3.7.7 and 3.8.6, - multiprocessing started using pickle dump / load which cannot handle double underscore methods. See #33007 for a reproducer with pickle. I'm using MacOS and this multiprocessing

[issue43905] dataclasses.astuple (and .asdict) do deepcopy on all fields

2021-11-28 Thread Andrei Kulakov
Andrei Kulakov added the comment: Eric: I've closed a similar issue about asdict() and now updating the title to keep track of both in this issue. Let me know if you want to keep them separate instead. -- title: dataclasses.astuple does deepcopy on all fields -> dataclasses.astu

[issue44678] Seperate error message for discontinuous padding in binascii.a2b_base64 strict mode

2021-11-28 Thread Andrei Kulakov
Andrei Kulakov added the comment: Looks like it's fixed so closing it.. -- nosy: +andrei.avk, kj resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue44695] asdict use deep copy to dataclass instances

2021-11-28 Thread Andrei Kulakov
Andrei Kulakov added the comment: Duplicate of https://bugs.python.org/issue43905 -- nosy: +andrei.avk resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> dataclasses.astuple does deepcopy on all fields __

[issue45299] SMTP.send_message() does from mangling when it should not

2021-11-25 Thread Andrei Kulakov
Andrei Kulakov added the comment: Grant: sounds good! I can do the initial PR review. Note that the PR will need a test and a news entry. See the link below on authoring PRs: https://devguide.python.org/pullrequest/ -- ___ Python tracker <ht

[issue45299] SMTP.send_message() does from mangling when it should not

2021-11-25 Thread Andrei Kulakov
Andrei Kulakov added the comment: R. David: `mangle_from_` is the only exception; I agree it seems likely it was done this way for backwards compatibility. Grant: do you agree with the fix to logic? Also do you agree that mangle_from_ is the only setting that's not being applied to msg

[issue45299] SMTP.send_message() does from mangling when it should not

2021-11-23 Thread Andrei Kulakov
Andrei Kulakov added the comment: There are 3 policy settings that are also being passed as parameters to Generator/BytesGenerator: - mangle_from_ - linesep - maxheaderlen Both linesep and maxheaderlen are being inserted into policy after self.policy (if there is one) overrides message

[issue45299] SMTP.send_message() does from mangling when it should not

2021-11-23 Thread Andrei Kulakov
Andrei Kulakov added the comment: Seems like a reasonable request to me. I can make the PR+test. To minimize backwards-incompatible change, we can pass `_mangle_from=policy._mangle_from` argument instead of passing the entire policy. Is that a good idea or passing the policy argument

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

2021-11-22 Thread Andrei Kulakov
Andrei Kulakov added the comment: I'm not sure about the hang in 3.7 and CVE, but as far as `get_all()` error is concerned, it's due to passing the wrong kind of argument as `headers`. For this (undocumented) method, `headers` should be a Message object created in this way, e.g

[issue45555] Object stays alive for weak reference if an exception happens in constructor

2021-11-22 Thread Andrei Kulakov
Andrei Kulakov added the comment: Note also that in addition to not being related to weakref as Pablo said, it's also not related to the __init__() -- the exception can be moved to any method of the object with the same result. It may be good to update the title so that it's not misleading

[issue45853] Misspelled _IGNORED_ERROS in Lib/pathlib.py

2021-11-21 Thread Andrei Kulakov
Andrei Kulakov added the comment: Serhiy: I think you're right, it was likely meant to be _IGNORED_ERRNOS; for inlining it, it looks like it wasn't inlined to be more readable, but if we inline it, we should also inline _IGNORED_WINERRORS. I don't mind inlining both

[issue22276] pathlib glob ignores trailing slash in pattern

2021-11-20 Thread Andrei Kulakov
Andrei Kulakov added the comment: Generally if Path is created with a trailing separator, I think it should error out for all methods that apply to files, for example `.touch()`, `read*()`, `write*()`, others. This is consistent with shell commands: touch xyz

[issue22276] pathlib glob ignores trailing slash in pattern

2021-11-20 Thread Andrei Kulakov
Andrei Kulakov added the comment: I meant to say: path.glob('myfile/') => [PosixPath('myfile')] -- ___ Python tracker <https://bugs.python.org/issu

[issue22276] pathlib glob ignores trailing slash in pattern

2021-11-20 Thread Andrei Kulakov
Andrei Kulakov added the comment: I have also run into this when looking into path.glob('dangling_symlink') issue. I can add a few things (in the examples, *myfile* is a file, not a directory): This is probably more common / less obscure than '*/': path.glob('myfile/') => T

[issue45853] Misspelled _IGNORED_ERROS in Lib/pathlib.py

2021-11-20 Thread Andrei Kulakov
Change by Andrei Kulakov : -- components: +Library (Lib) priority: normal -> low stage: -> needs patch type: -> enhancement versions: +Python 3.11 ___ Python tracker <https://bugs.python.or

[issue45853] Misspelled _IGNORED_ERROS in Lib/pathlib.py

2021-11-20 Thread Andrei Kulakov
New submission from Andrei Kulakov : Should be _IGNORED_ERRORS This name was added 3 years ago: https://github.com/python/cpython/commit/216b745eafa7cd4a683a8405dcfbd7f5567f504c It's only used in a single place in the module. But I'm not sure if it's worth fixing. It is an internal

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

2021-11-19 Thread Andrei Kulakov
Andrei Kulakov added the comment: By the way note that path.glob('**/my_symlink') also does return the dangling symlink match. And glob.glob('my_symlink') also returns a dangling symlink. -- ___ Python tracker <https://bugs.python.org/issue45

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

2021-11-19 Thread Andrei Kulakov
Andrei Kulakov added the comment: Rasmus: thanks for the report, it does seem like a bug to me. -- ___ Python tracker <https://bugs.python.org/issue45

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

2021-11-19 Thread Andrei Kulakov
Andrei Kulakov added the comment: The issue is that _PreciseSelector follows the symlink when it checks if a path exists before yielding it as a result. I've put up a PR with a fix; I've also added a *follow_symlinks* arg to `exists()` method because it seems more logical to be able to test

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

2021-11-19 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch nosy: +andrei.avk nosy_count: 1.0 -> 2.0 pull_requests: +27897 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29655 ___ Python tracker <https://bugs.python.org/i

[issue44995] "Hide the prompts and output" works abnormal

2021-11-12 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +newcomer friendly ___ Python tracker <https://bugs.python.org/issue44995> ___ ___ Python-bugs-list mailing list Unsub

[issue44887] test_input_tty hangs when run multiple times in the same process on macOS 10.15

2021-11-12 Thread Andrei Kulakov
Andrei Kulakov added the comment: I've looked into this and the hang happens on this line: https://github.com/python/cpython/blob/de3db1448b1b983eeb9f4498d07e3d2f1fb6d29d/Lib/test/test_builtin.py#L2030 So the issue is that on the second run, there's nothing to read on that fd. I've tried

[issue45054] json module should issue warning about duplicate keys

2021-11-11 Thread Andrei Kulakov
Andrei Kulakov added the comment: Another good option would be to use typed dict like `mydict : dict[int,str] = {}`; and use typed values when populating the dict; this way a type checker will warn you of inconsistent key types. -- ___ Python

[issue45054] json module should issue warning about duplicate keys

2021-11-11 Thread Andrei Kulakov
Andrei Kulakov added the comment: In general this sounds reasonable; - but a couple of thoughts / comments: - If you have a dict with mixed numbers in str format and in number format (i.e. ints as numbers and ints as strings in your case), you are creating problems in many potential places

[issue45091] inspect.Parameter.__str__ does not include subscripted types in annotations

2021-11-10 Thread Andrei Kulakov
Andrei Kulakov added the comment: I have confirmed and tested -- this was fixed in https://github.com/python/cpython/pull/29212 and so I'm closing it as fixed. -- nosy: +andrei.avk, kj resolution: -> fixed stage: -> resolved status: open -&g

[issue45053] MD5SumTests.test_checksum_fodder fails on Windows

2021-11-10 Thread Andrei Kulakov
Andrei Kulakov added the comment: This was fixed in https://github.com/python/cpython/commit/dd7b816ac87, perhaps this should be closed as fixed? It sounds like the general solution is beyond the scope of this issue and doesn't need to be tracked here. -- nosy: +andrei.avk

[issue45171] stacklevel handling in logging module is inconsistent

2021-11-08 Thread Andrei Kulakov
Andrei Kulakov added the comment: The stacklevel arg was added 3+ years ago, wouldn't fixing this break a lot of code in a way that's hard to detect? That is to say, logs will look just fine, but when you try to debug an issue, you will realise it's pointing to an unhelpful location

[issue43656] TracebackException or StackSummary.extract with capture_locals=True fail to catch exceptions raised by repr() on value of frame local variable in FrameSummary.__init__.

2021-11-08 Thread Andrei Kulakov
Andrei Kulakov added the comment: Martin: I have a couple of concerns: - Generally (AFAIK) Python is very conservative about silencing arbitrary exceptions. There are a few functions with args like `ignore_errors`, but those are for errors in the logic of respective functions. I don't

  1   2   3   4   5   >