[issue19113] duplicate test names in Lib/ctypes/test/test_functions.py

2021-08-27 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch nosy: +andrei.avk nosy_count: 8.0 -> 9.0 pull_requests: +26450 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/28008 ___ Python tracker <https://bugs.p

[issue25597] unittest.mock does not wrap dunder methods (__getitem__ etc)

2021-08-27 Thread Andrei Kulakov
Andrei Kulakov added the comment: I went through dunder methods to check if any other operators or builtins work on objects without respective dunder methods: - del x works even though there is no object.__del__ - operator.length_hint() => 0 when there is no object.__length_hint__ So

[issue39817] CRITICAL: TypeError: cannot pickle 'generator'

2021-08-28 Thread Andrei Kulakov
Andrei Kulakov added the comment: This issue has been resolved and closed in Pelican tracker; so it can be closed here as well, as not a bug. -- nosy: +andrei.avk ___ Python tracker <https://bugs.python.org/issue39

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

2021-08-29 Thread Andrei Kulakov
Andrei Kulakov added the comment: Can be closed as fixed (or perhaps renamed and kept open to track eventual raising of error in the future?) -- nosy: +andrei.avk ___ Python tracker <https://bugs.python.org/issue33

[issue24444] In argparse empty choices cannot be printed in the help

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

[issue42414] unable to document fields of dataclass

2021-08-31 Thread Andrei Kulakov
Andrei Kulakov added the comment: Laurie: thanks for linking that, it seems like there isn't that much enthusiasm. -- ___ Python tracker <https://bugs.python.org/is

[issue44980] Clean up tests that return a value that isn't None

2021-09-02 Thread Andrei Kulakov
Change by Andrei Kulakov : -- nosy: +kj resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement ___ Python tracker <https://bugs.python

[issue41010] email.message.EmailMessage.get_body

2021-09-03 Thread Andrei Kulakov
Change by Andrei Kulakov : -- nosy: +kj resolution: -> fixed stage: -> resolved status: open -> closed type: crash -> behavior versions: +Python 3.11 -Python 3.8 ___ Python tracker <https://bugs.python

[issue41082] Error handling and documentation of Path.home()

2021-09-06 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch pull_requests: +26614 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28186 ___ Python tracker <https://bugs.python.org/issu

[issue41082] Error handling and documentation of Path.home()

2021-09-06 Thread Andrei Kulakov
Change by Andrei Kulakov : -- versions: +Python 3.9 ___ Python tracker <https://bugs.python.org/issue41082> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41082] Error handling and documentation of Path.home()

2021-09-06 Thread Andrei Kulakov
Andrei Kulakov added the comment: I looked a bit more into this, it's been fixed in 3.10, in this PR: https://github.com/python/cpython/pull/18841 It wasn't backported to 3.9. I'm not quite sure if it's best to backport to 3.9 or fix via docs for 3.9. Just in case I'

[issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()`

2021-09-06 Thread Andrei Kulakov
Andrei Kulakov added the comment: Note this change also fixes https://bugs.python.org/issue41082 . I'm guessing it's too much of an edge case to backport this fix to 3.9, so I've put up a possible fix via docs update on that issue. -- nosy:

[issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()`

2021-09-06 Thread Andrei Kulakov
Andrei Kulakov added the comment: To be more precise, this change fixes https://bugs.python.org/issue41082 by raising RuntimeError instead of KeyError and also by documenting it, which means matplotlib can fix it by either using os.path.expanduser or catching RuntimeError, whichever might

[issue25963] strptime not parsing some timezones

2021-09-07 Thread Andrei Kulakov
Andrei Kulakov added the comment: I'm closing this as fixed, the note in datetime docs is here: https://docs.python.org/3.9/library/datetime.html (search for 'only accepts', - note 6) -- nosy: +kj resolution: -> fixed stage: -> resolved status: open -> clos

[issue37529] Mimetype module duplicates

2021-09-08 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch pull_requests: +26662 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28243 ___ Python tracker <https://bugs.python.org/issu

[issue37529] Mimetype module duplicates

2021-09-08 Thread Andrei Kulakov
Change by Andrei Kulakov : -- pull_requests: +26663 pull_request: https://github.com/python/cpython/pull/28244 ___ Python tracker <https://bugs.python.org/issue37

[issue36424] Pickle fails on frozen dataclass that has slots

2021-09-09 Thread Andrei Kulakov
Andrei Kulakov added the comment: This actually can't be closed yet as the fix was not backported to 3.9 -- ___ Python tracker <https://bugs.python.org/is

[issue39447] imaplib documentation claims that commands return a string, but they return bytes

2021-09-09 Thread Andrei Kulakov
Andrei Kulakov added the comment: This issue was fixed in https://github.com/python/cpython/commit/c75330605d4 -- closing. -- nosy: +andrei.avk, kj resolution: -> fixed stage: -> resolved status: open -> closed versions: +Python 3.9 -Python 3.7, P

[issue42119] Error when debugging logging.FileHandler subclass __init__ method

2021-09-10 Thread Andrei Kulakov
Change by Andrei Kulakov : -- nosy: +kj resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42119] Error when debugging logging.FileHandler subclass __init__ method

2021-09-12 Thread Andrei Kulakov
Andrei Kulakov added the comment: Changing from not a bug to duplicate of #20853. -- resolution: not a bug -> duplicate superseder: -> pdb "args" crashes when an arg is not printable ___ Python tracker <https://bugs.py

[issue45215] Add docs for Mock name and parent args and deprecation warning when wrong args are passed

2021-09-15 Thread Andrei Kulakov
New submission from Andrei Kulakov : Currently using *name* and *parent* args in Mock and MagicMock is problematic in a few ways: *name* - any value can be passed silently but at a later time, any value except for an str will cause an exception when repr() or str() on the mock object is

[issue45215] Add docs for Mock name and parent args and deprecation warning when wrong args are passed

2021-09-15 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch pull_requests: +26793 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28378 ___ Python tracker <https://bugs.python.org/issu

[issue45215] Add docs for Mock name and parent args and deprecation warning when wrong args are passed

2021-09-16 Thread Andrei Kulakov
Andrei Kulakov added the comment: I forgot to include example of the breakage: >>> m=Mock(name=1) >>> m Traceback (most recent call last): File "", line 1, in File "/Users/ak/opensource/cpython2/Lib/unittest/mock.py", line 735, in __rep

[issue20853] pdb "args" crashes when an arg is not printable

2021-09-16 Thread Andrei Kulakov
Change by Andrei Kulakov : -- nosy: +andrei.avk nosy_count: 3.0 -> 4.0 pull_requests: +26814 pull_request: https://github.com/python/cpython/pull/28400 ___ Python tracker <https://bugs.python.org/issu

[issue20853] pdb "args" crashes when an arg is not printable

2021-09-16 Thread Andrei Kulakov
Andrei Kulakov added the comment: p/pp commands were fixed in this commit: https://github.com/python/cpython/commit/6544b2532df -- ___ Python tracker <https://bugs.python.org/issue20

[issue45234] copy_file raises FileNotFoundError when src is a directory

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

[issue45234] copy_file raises FileNotFoundError when src is a directory

2021-09-17 Thread Andrei Kulakov
Andrei Kulakov added the comment: Alex: thanks for the report! I've added a PR that should fix this. -- ___ Python tracker <https://bugs.python.org/is

[issue45240] Add +REPORT_NDIFF option to pdb tests that use doctest

2021-09-18 Thread Andrei Kulakov
New submission from Andrei Kulakov : It would be useful to have +REPORT_NDIFF option applied to pdb doctests because it makes it much more convenient to add / modify pdb tests, to fix pdb bugs, add pdb features. I've worked on two pdb issues in the last few months and I wasn'

[issue45240] Add +REPORT_NDIFF option to pdb tests that use doctest

2021-09-18 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch pull_requests: +26855 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28453 ___ Python tracker <https://bugs.python.org/issu

[issue45249] Fine grained error locations do not work in doctests

2021-09-20 Thread Andrei Kulakov
New submission from Andrei Kulakov : It seems like fine grained error locations do not work in failed doctest traceback output: version 3.11.0a0 file contents: -- def a(x): """ >>> 1 1 1 """ import doctest doctest.te

[issue45249] Fine grained error locations do not work in doctests

2021-09-20 Thread Andrei Kulakov
Andrei Kulakov added the comment: I've ran into this when looking at doctest docs, the issue is that they use the old example where a single column is highlighted, I want to update it to explain why doctest output differs from the one you get from REPL, but I probably need to understan

[issue45249] Fine grained error locations do not work in doctests

2021-09-20 Thread Andrei Kulakov
Andrei Kulakov added the comment: Sorry, I should have noted I’m referring to the line 1 1 Which is underlined by a single caret, but on the command line it has 3 carets as expected. -- ___ Python tracker <https://bugs.python.org/issue45

[issue45249] Fine grained error locations do not work in doctests

2021-09-20 Thread Andrei Kulakov
Andrei Kulakov added the comment: Pablo: that works fine, thanks! I will look into updating the doctest docs, and will close this issue later today ( or you can close it if you like). -- ___ Python tracker <https://bugs.python.org/issue45

[issue45234] copy_file raises FileNotFoundError when src is a directory

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

[issue45249] Syntax error location range indicator does not work in doctests

2021-09-20 Thread Andrei Kulakov
Andrei Kulakov added the comment: Thinking a bit more on this, I'm not sure this can be closed, as SyntaxError indicators seems not to be working. I'm not sure if this is limited to doctests or not. I've updated the title to narrow it down to SyntaxErrors. I can look mo

[issue45249] SyntaxError location range indicator does not work in doctests

2021-09-20 Thread Andrei Kulakov
Change by Andrei Kulakov : -- title: Syntax error location range indicator does not work in doctests -> SyntaxError location range indicator does not work in doctests ___ Python tracker <https://bugs.python.org/issu

[issue40951] csv skipinitialspace no longer working

2021-09-21 Thread Andrei Kulakov
Andrei Kulakov added the comment: Closing; if anyone finds a way to reproduce please add a comment or open a new issue. -- resolution: -> works for me stage: -> resolved status: open -> closed ___ Python tracker <https://bug

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

2021-09-21 Thread Andrei Kulakov
Andrei Kulakov added the comment: I think the advantage of asdict() method is it's more discoverable and it doesn't leave any uncertainty of whether returned value will update environment or not. If a user sees `dict(os.environ)` in code, they may wonder if it does or does not; a

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

2021-09-21 Thread Andrei Kulakov
Andrei Kulakov added the comment: I guess the easy way to test it would be to modify the copy and check os.environ, but still there would be some uncertainty if it's consistent across platforms and python versions, if it's expected to still work in future python versions, e

[issue45215] Add docs for Mock name and parent args and deprecation warning when wrong args are passed

2021-09-21 Thread Andrei Kulakov
Andrei Kulakov added the comment: Łukasz: For parent, there's this issue: #39222 (which is why I started looking into this). For name, I couldn't find anything here or on SO, but it's hard to search for this because keywords 'mock argument name' on SO finds over

[issue45249] Update doctect SyntaxErrors for location range

2021-09-25 Thread Andrei Kulakov
Andrei Kulakov added the comment: Terry: I got it mostly working using your 2nd suggestion, I will do some testing and should be able to put up a PR in the next couple of days. Thanks for looking at this and explaining! -- ___ Python tracker

[issue45249] Update doctect SyntaxErrors for location range

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

[issue45249] Update doctect SyntaxErrors for location range

2021-09-26 Thread Andrei Kulakov
Andrei Kulakov added the comment: Terry: please take a look - https://github.com/python/cpython/pull/28567/files . -- ___ Python tracker <https://bugs.python.org/issue45

[issue45253] mimetypes cannot detect mime of mka files

2021-10-11 Thread Andrei Kulakov
Andrei Kulakov added the comment: mkv (matroska) is not registered with IANA here: http://www.iana.org/assignments/media-types/media-types.xhtml Therefore according to the comment in mimetypes.py, it should not be added. Also note that .mkv is also not in mimetypes.py, so it's being l

[issue45253] mimetypes cannot detect mime of mka files

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

[issue45253] mimetypes cannot detect mime of mka files

2021-10-11 Thread Andrei Kulakov
Change by Andrei Kulakov : -- status: open -> pending ___ Python tracker <https://bugs.python.org/issue45253> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue45192] The tempfile._infer_return_type function cannot infer the type of os.PathLike objects.

2021-10-17 Thread Andrei Kulakov
Andrei Kulakov added the comment: This is a duplicate of #29447, so if this is merged, the other issue should also be closed as fixed. -- nosy: +andrei.avk ___ Python tracker <https://bugs.python.org/issue45

[issue45221] Linker flags starting with -h breaks setup.py (regression)

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

[issue45221] Linker flags starting with -h breaks setup.py (regression)

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

[issue45221] Linker flags starting with -h breaks setup.py (regression)

2021-10-18 Thread Andrei Kulakov
Andrei Kulakov added the comment: Inada: adding you as you merged the patch that made the switch optparse->argparse. -- nosy: +methane ___ Python tracker <https://bugs.python.org/issu

[issue25066] Better repr for multiprocessing.synchronize objects

2021-10-18 Thread Andrei Kulakov
Andrei Kulakov added the comment: Nihir: in synchronize.py, only Barrier inherits from threading.Barrier, as far as I can see. Other classes inherit from `object`. -- nosy: +andrei.avk ___ Python tracker <https://bugs.python.org/issue25

[issue45221] Linker flags starting with -h breaks setup.py (regression)

2021-10-18 Thread Andrei Kulakov
Andrei Kulakov added the comment: I agree re: 3.9, thanks Ned! -- ___ Python tracker <https://bugs.python.org/issue45221> ___ ___ Python-bugs-list mailin

[issue45336] Issue with xml.tree.ElementTree.write

2021-10-18 Thread Andrei Kulakov
Andrei Kulakov added the comment: Ed: something looks a bit odd with the call to `write()` that you used: > rte_ecu_tree.write(rtexmlFile, encoding="UTF-8", xml_declaration="True", > default_namespace="None" method="xml",short_empt

[issue45336] Issue with xml.tree.ElementTree.write

2021-10-18 Thread Andrei Kulakov
Change by Andrei Kulakov : -- type: performance -> behavior ___ Python tracker <https://bugs.python.org/issue45336> ___ ___ Python-bugs-list mailing list Un

[issue45336] Issue with xml.tree.ElementTree.write

2021-10-19 Thread Andrei Kulakov
Andrei Kulakov added the comment: Ed: it seems ElementTree.write does not support `standalone` option, but both minidom (https://docs.python.org/3/library/xml.dom.minidom.html) and lxml (https://lxml.de/) support it. Are either of those suitable for your usecase

[issue45336] Issue with xml.tree.ElementTree.write

2021-10-19 Thread Andrei Kulakov
Change by Andrei Kulakov : -- components: +Library (Lib) -Documentation nosy: +kj ___ Python tracker <https://bugs.python.org/issue45336> ___ ___ Python-bug

[issue45336] xml.tree.ElementTree.write does not support `standalone` option

2021-10-19 Thread Andrei Kulakov
Change by Andrei Kulakov : -- title: Issue with xml.tree.ElementTree.write -> xml.tree.ElementTree.write does not support `standalone` option ___ Python tracker <https://bugs.python.org/issu

[issue45336] xml.etree.ElementTree.write does not support `standalone` option

2021-10-19 Thread Andrei Kulakov
Change by Andrei Kulakov : -- title: xml.tree.ElementTree.write does not support `standalone` option -> xml.etree.ElementTree.write does not support `standalone` option ___ Python tracker <https://bugs.python.org/issu

[issue45336] xml.etree.ElementTree.write does not support `standalone` option

2021-10-19 Thread Andrei Kulakov
Andrei Kulakov added the comment: Ed: I can look into adding it, but not sure when. If you can make the case that minidom and lxml are not suitable workarounds for this, it will be more likely that me or someone else will add this option; but note that as this is a new feature, it will only

[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-10-19 Thread Andrei Kulakov
Andrei Kulakov added the comment: related issue: https://bugs.python.org/issue20853 similarly to this, if args cmd is used in pdb in the TestClass __init__ method, `self` will be displayed, which means the TestClass.__str__ or __repr__ will run, lacking any required state set in the

[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-10-19 Thread Andrei Kulakov
Andrei Kulakov added the comment: Joe: I would argue that it should be expected that every object instantiated from a class should have a safe __repr__, because you will have logging and if a __repr__ is broken in some rare circumstances, it may bring down your production system in the

[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-10-20 Thread Andrei Kulakov
Andrei Kulakov added the comment: Joe: when I ran your code sample with modification I posted previously, I don't get any errors. Can you try running it? By the way my point was not that builtin __repr__ should be modified to never raise exceptions (which would not help in this case)

[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-10-20 Thread Andrei Kulakov
Andrei Kulakov added the comment: Joe: I've looked at https://bugs.python.org/issue39228 again and I see there was consensus to reject this idea, please take a look at the discussion there. -- ___ Python tracker <https://bugs.py

[issue45311] Threading Semaphore and BoundedSemaphore release method implementation improvement

2021-10-20 Thread Andrei Kulakov
Andrei Kulakov added the comment: Besart: with the current code, if there's a valueError when releasing a thread, it will be retried again n times, with your change, n waiting threads will be released, even if some of them fail with ValueError. I don't know enough about threading

[issue45311] Threading Semaphore and BoundedSemaphore release method implementation improvement

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

[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-10-20 Thread Andrei Kulakov
Andrei Kulakov added the comment: Joe: I understand your point but my concern is that this creates an impression for the users that Python is tolerant of failing __repr__'s, while that's not the case at all. I agree that if StackSummary was only used for interactive debugging, th

[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-10-21 Thread Andrei Kulakov
Andrei Kulakov added the comment: Martin: I was also thinking of adding a parameter to `extract()`. The issue I see is that it's still confusing and complicated for new students to understand the issue and find the parameter and understand why it's needed. Joe: one important thi

[issue45305] Incorrect record of call_args_list when using multiple side_effect in mock.patch

2021-10-22 Thread Andrei Kulakov
Andrei Kulakov added the comment: Dave: what seems to happen here is that mock correctly reporting to you that the object you passed to the mocked func is currently `{}`. What you probably expected it to be is to be equal to what it was at exact time when it was passed, i.e. before it was

[issue45305] Incorrect record of call_args_list when using multiple side_effect in mock.patch

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

[issue45305] Unexpected record of call_args_list when passing mutable object to mock.patch

2021-10-22 Thread Andrei Kulakov
Andrei Kulakov added the comment: This issue also came up with MagicMock on stackoverflow: https://stackoverflow.com/questions/23257227/python-mock-method-call-arguments-display-the-last-state-of-a-list/23264042 Dave: glad this helped to clear it up. For the record, the arguments in Python

[issue45275] Make argparse print description of subcommand when invoke help doc on subcommand

2021-10-23 Thread Andrei Kulakov
Andrei Kulakov added the comment: For me it works as well, tested on 3.7, 3.9 and 3.11 . -- nosy: +andrei.avk ___ Python tracker <https://bugs.python.org/issue45

[issue45600] First sentence in docs for os.environ

2021-10-24 Thread Andrei Kulakov
New submission from Andrei Kulakov : In os.eviron docs: https://docs.python.org/3.11/library/os.html#os.environ A mapping object representing the string environment. Should that be "... the process environment." ? -- assignee: docs@python components: Documentation messag

[issue45600] First sentence in docs for os.environ

2021-10-24 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch pull_requests: +27473 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29204 ___ Python tracker <https://bugs.python.org/issu

[issue45600] First sentence in docs for os.environ

2021-10-24 Thread Andrei Kulakov
Andrei Kulakov added the comment: Eryk: sounds much better and clearer I think, I've put up a PR (that also does the same update to os.environb). -- ___ Python tracker <https://bugs.python.org/is

[issue45600] First sentence in docs for os.environ

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

[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-10-25 Thread Andrei Kulakov
Andrei Kulakov added the comment: I've been thinking that perhaps it makes sense to special case printing of `self` argument in `__init__` methods. The same exact issue happens with PDB `args` command in `__init__` methods. My idea is that in the __init__, you generally don't wan

[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-10-26 Thread Andrei Kulakov
Andrei Kulakov added the comment: Martin: It's true that exceptions raised in other methods called from __init__ would still have this issue, but I feel like ~90% of it would be solved by the proposed fix. It does introduce an inconsistency but it does so because it reflect

[issue45356] Calling `help` executes @classmethod @property decorated methods

2021-10-27 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch nosy: +andrei.avk nosy_count: 8.0 -> 9.0 pull_requests: +27502 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/29239 ___ Python tracker <https://bugs.p

[issue45356] Calling `help` executes @classmethod @property decorated methods

2021-10-27 Thread Andrei Kulakov
Andrei Kulakov added the comment: I've put up a PR; I'm not sure it's the best way to fix it. I will look more into it and will try to post some details about the PR later today. -- ___ Python tracker <https://bugs.pyt

[issue45356] Calling `help` executes @classmethod @property decorated methods

2021-10-27 Thread Andrei Kulakov
Andrei Kulakov added the comment: I missed that this is assigned to Raymond, hope we didn't duplicate any effort (it only took me a short while to do the PR). Apologies.. -- ___ Python tracker <https://bugs.python.org/is

[issue45356] Calling `help` executes @classmethod @property decorated methods

2021-10-27 Thread Andrei Kulakov
Andrei Kulakov added the comment: I've looked more into it, the issue is that even before an object can be tested with `isinstance()`, both inspect.classify_class_attrs and in pydoc, classdoc local function `spill()` use a `getattr()` call, which triggers the property. So I think my

[issue45404] Undefined I_* macros of stropts.h when building Python 3.10 on Ubuntu: fail to build the fcntl module

2021-11-03 Thread Andrei Kulakov
Andrei Kulakov added the comment: Duplicate of #41105 , where two more people ran into this issue. -- nosy: +andrei.avk ___ Python tracker <https://bugs.python.org/issue45

[issue41105] Add some extra content check in configure process for some empty header file who has been deprecated by glibc

2021-11-03 Thread Andrei Kulakov
Andrei Kulakov added the comment: I think adding this code in the `configure` script may fix it: as_ac_Header=`$as_echo "ac_cv_header_stropts.h" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "stropts.h" "$as_ac_Header" "$ac_includes_default

[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-07 Thread Andrei Kulakov
Andrei Kulakov added the comment: Martin: I'm not sure what is the best way to fix this issue, so I hope someone else will look into this. -- ___ Python tracker <https://bugs.python.org/is

[issue45366] dataclass init=False field with default works but default_factory does not

2021-11-07 Thread Andrei Kulakov
Andrei Kulakov added the comment: I think a good possible solution is to raise an error if `default_factory` is provided on a `init=False` dataclass that doesn't have a `__init__()` defined. However, it will create a slight inconsistency because there will be an error when `__init__` i

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

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

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

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

[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

[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

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

[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

[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

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

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

[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

[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

[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('m

<    1   2   3   4   5   >