-
-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix richInspectVariables #943
Fix richInspectVariables #943
Conversation
Does this mean the strip is related to the evaluate debug request? |
Maybe, I can't find where it is striped. It is received already striped from the |
I created a test which shows that the |
a2ac60e
to
16a603c
Compare
The issue was that SafeRepr is used to get a representation of an evaluation, which has some class attributes to strip the representation. Setting these values to a high number disables the stripping, although it is not very clean. |
To be more precise, we set maxstring_inner to |
Thanks @davidbrochart for digging that up. I think a cleaner solution is to set To avoid side-effect for other use cases, could we apply the change in a transient fashion during the evaluation request? |
Thanks for helping @fcollonval! |
@davidbrochart what's the use case here? Can you give me the bigger picture? I'm not that fond of raising the limits for all requests because it can slow down debugging on some cases (i.e.: if the user has a 1MB string having that serialized all the time isn't ideal). I saw you linked code using the |
Thanks @fabioz, we want to send an |
@davidbrochart well, I don't really know what's best for the use-case you have (it depends on how you're going to use it afterwards...). |
I'm not sure, I think we can get back bytes if the type is e.g. eval(repr(b"123"))
# b'123'
eval(repr("\n"))
# '\n' But if bytes are decoded using |
Anyways, I've tried it in JupyterLab with an image and it works fine with |
I tried kicking the two failing builds, but they still failed |
The last commit reverted the changes, we have the same failures so I guess it's not related. I'm going to re-apply them. |
I just kicked https://github.com/ipython/ipykernel/actions/runs/2412265322 and it passed |
Yeah, it seems to be a bit random, but 448e16b is identical to |
I re-launched the only failing build and it passed. |
Great, thanks! |
I can cut a release on Monday |
It seems that we can always use the interpreter to get the rich representation of the variable, whether we hit a breakpoint or not. The problem with the current situation where we hit a breakpoint and display an HTML representation of a variable is that the HTML is striped and we get something like
'text/html': '<div>\n<style scoped>...le>\n</div>'
instead of the full HTML. I can't find where it is striped, but if we don't need this branch anyway, can we just get rid of it?@JohanMabille what do you think?
Also, @fcollonval might have some feedback since he refactored that part.