[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2021-09-16 Thread Ulrich Petri
Ulrich Petri added the comment: > If we copy all the params from TracebackException (and it will be all params, > why only this one?) Why expose the internal machinery at all? If all additional parameters (and unless I'm miscounting we're talking about 2) were exposed on the conve

[issue43176] Dataclasses derived from empty frozen bases skip immutability checks

2021-05-06 Thread Ulrich Petri
Ulrich Petri added the comment: @eric.smith Sure, here you go: dataclass_empty.py: ``` from dataclasses import dataclass @dataclass class A: pass @dataclass(frozen=True) class B(A): x: int print("42") ``` Running this on < 3.8.10: ``` $ ~/.pythonz/pythons/CPyt

[issue43176] Dataclasses derived from empty frozen bases skip immutability checks

2021-05-06 Thread Ulrich Petri
Ulrich Petri added the comment: Wether the original behaviour was intentional or not this change introduces backwards incompatibility (and in our case, breakage) between 3.8.10 and previous releases (I expect the same to be true for the equivalent 3.9 releases). -- nosy: +ulope

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2021-01-15 Thread Ulrich Petri
Ulrich Petri added the comment: That would make it slightly better, but I still think it's a pretty arcane incantation (esp. for newer people). What makes you hesitant to adding the parameter to the convenience functions? -- ___ Python tracker

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2021-01-13 Thread Ulrich Petri
Ulrich Petri added the comment: Functionally equivalent code would be: print("".join(TracebackException.from_exception(ex, capture_locals=True).format())) vs. (hypothetically) print_exc(capture_locals=True) Which is quite a significant diff

[issue35046] logging.StreamHandler performs two syscalls when one would do

2019-02-06 Thread Ulrich Petri
Ulrich Petri added the comment: This change breaks (probably unsupported) uses of the logging module (esp. in combination with structlog) where non-string objects are passed through the .format() and .emit() calls. Previously it was possible to set the terminator attribute to None

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2018-06-08 Thread Ulrich Petri
New submission from Ulrich Petri : Since 3.5 the internal machinery of the `traceback` module has gained the very useful ability to capture locals. It would be useful to also expose that ability through the various convenience functions. -- components: Library (Lib) messages: 319079

[issue27362] json.dumps to check for obj.__json__ before raising TypeError

2018-02-01 Thread Ulrich Petri
Change by Ulrich Petri <pyt...@ulo.pe>: -- nosy: +ulope ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue27362> ___ ___ Python

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2017-05-14 Thread Ulrich Petri
Ulrich Petri added the comment: So this would basically be: with ExitStack() as stack: cm1 = stack.enter_context(a_long_name.with_a_long_method()) cm2 = stack.enter_context(another_long_variable.with_a_long_method()) Seems like a very non-obvious and inelegant solution

[issue29787] Internal importlib frames visible when module imported by import_module throws exception

2017-03-14 Thread Ulrich Petri
Ulrich Petri added the comment: Thanks for the fast response. However I disagree with the assertion that this is "working as expected". IMO the same arguments apply as in the original ticket (esp. Georg Brandls) http://bugs.python.org/issue15110#msg163258. It is unexpected, conf

[issue29787] Internal importlib frames visible when module imported by import_module throws exception

2017-03-10 Thread Ulrich Petri
New submission from Ulrich Petri: Importing a module that raises an exception on import trough `importlib.import_module()` causes importlib to not strip it's internal frames from the traceback. Minimal example: --a.py-- import importlib importlib.import_module("b") --a.py-

[issue21978] Support index access on OrderedDict views (e.g. o.keys()[7])

2016-12-07 Thread Ulrich Petri
Ulrich Petri added the comment: Should this maybe reconsidered now that dicts are ordered by default? Having to explain why list is needed in list(some_ordered_dict.values())[0] is a constant thorn in my side when dealing with people new to Python. -- nosy: +ulope

[issue28697] asyncio.Lock, Condition, Semaphore docs don't mention `async with` syntax

2016-11-15 Thread Ulrich Petri
New submission from Ulrich Petri: The docs for asyncio's Lock, Condition and Semaphore should use the new clean `async with lock:` syntax instead of the older (and IMO rather ugly) `with (yield from lock):` version. -- assignee: docs@python components: Documentation, asyncio messages

[issue27337] 3.6.0a2 tarball has weird paths

2016-06-28 Thread Ulrich Petri
Ulrich Petri added the comment: Just as another datapoint: This also breaks installing a2 with pythonz. -- nosy: +ulope ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue24120] pathlib.(r)glob stops on PermissionDenied exception

2015-07-02 Thread Ulrich Petri
Ulrich Petri added the comment: Antoine, thanks for the review. I didn't realise that `tree` outputs non-ASCII by default. I've updated the patch with a pure ASCII file tree. Unfortunately I don't have a Windows dev environment available at the moment, so I can't easily test

[issue24120] pathlib.(r)glob stops on PermissionDenied exception

2015-06-05 Thread Ulrich Petri
Ulrich Petri added the comment: The attached patch adds an unaccessible directory to the pathlib tests to provoke the problem and also fixes the cause in pathlib. It applies to at least 3.4 - 3.6 -- keywords: +patch nosy: +ulope Added file: http://bugs.python.org/file39634/issue24120