Comments (7)
Might be an endless loop while formatting. I'm going to be pretty busy the next few weeks but will try to take a look for you.
Thank you for the repro case, that's super helpful :)
from better-exceptions.
So, better_exceptions
is hanging here.
Prepend the format_value
function with:
if getattr(v, '__name__', None) == '_get':
help(v)
print("The program will crash...")
print("v =", v)
Strangely, it is not possible to display the method.
My traceback is slightly different from yours.
The first line is result[0] = yield gen.maybe_future(func(*args, **kwargs))
.
It appears that this func
function is actually the _get
method which cannot be displayed.
This is why it prevents better_exceptions
to format the traceback.
The function make_coro
of your traceback appears with v1.16.2 and uses func
too.
There is no error with TBVaccine because it does not introspect this traceback.
I then tried to study the code of distributed
but wow... It is a little bit too complex for me.
It is perhaps related to this __str__
function.
In the end, it looks like the bug came from distributed
and not better_exceptions
.
The bug stopped occurring with v1.17.0 when they removed the _get
function.
However, I am not sure that the bug has completely disappeared.
Maybe it has just been moved, and that the snippet here does not show it anymore.
from better-exceptions.
@Qix- Any ideas? I have just noticed TBVaccine project and its hook works well with Dask Distributed...
@skorokithakis Thank you for mentioning TBVaccine! It works great for me where better-exceptions just breaks things.
from better-exceptions.
@frol Hi!
I wanted to work on this issue but unfortunately I can not reproduce the error.
Are you still able to reproduce it?
If so, some information about your configuration may be usefull: distribution, libraries versions (run pip freeze
), python version (run python --version
).
I have studied the source code a bit and I do not see where there could be an infinite loop.
Sometimes your snippet takes a long time to run but the error always appears in the end (although I do not see any logging messages), with or without better_exceptions
imported.
from better-exceptions.
@Delgan Either dask
or distributed
has changed something so it works fine now with the latest versions of those. Downgrading pip install dask==0.14.3 distributed==1.16.1
makes the issue reproducible.
from better-exceptions.
@frol Indeed, I can reproduce the error now, thank you!
from better-exceptions.
I hold pretty firm with the idea that performing any I/O in __str__
or __repr__
is an anti-pattern and definitely not a use-case we should bend over backwards for.
Sounds like it got resolved in a successive release - going to close. Let me know if this is still a problem for anyone.
Keep in mind, tbvaccine doesn't do all of the stuff we do. It's not that tbvaccine is any better or worse than better-exceptions, it's just that we hit more codepaths than they do, increasing surface area for bugs like this to manifest.
from better-exceptions.
Related Issues (20)
- activate extension only when BETTER_EXCEPTIONS has true-like value: '1', 'on' or 'yes' HOT 2
- FileNotFoundError on PyPy HOT 4
- TERM setting of tmux-256color vs screen… HOT 3
- Not working with ~/.python_history
- threading.excepthook new in python 3.8
- Include Django middleware in better-exceptions HOT 3
- ModuleNotFoundError: No module named 'better_exceptions.integrations' HOT 3
- weird escape chars instead of lines HOT 5
- why "export BETTER_EXCEPTIONS=1" works? HOT 1
- terminfo (tmux-256color, xterm-256color) not considered to be valid HOT 6
- Don't print stack frames from certain libraries HOT 5
- How to hide sensibles data like passwords, tokens, ... HOT 1
- 0.3.3: pytest is failing HOT 3
- Installing from pip triggers a "WARNING: There was an error checking the latest version of pip." HOT 1
- f_lineno not an attribute on traceback
- Define license on pypi HOT 2
- Add environment variable support for MAX_LENGTH initialization
- How to use better-exceptions in pytest?
- Can't work in child process HOT 3
- Code difference
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from better-exceptions.