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
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
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
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 tr
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
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 (and then
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
Change by Ulrich Petri :
--
nosy: +ulope
___
Python tracker
<https://bugs.python.org/issue27362>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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")
--
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
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
mes
Ulrich Petri added the comment:
Just as another datapoint: This also breaks installing a2 with pythonz.
--
nosy: +ulope
___
Python tracker
<http://bugs.python.org/issue27
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
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
16 matches
Mail list logo