-
Notifications
You must be signed in to change notification settings - Fork 1.1k
ValueError: not enough values to unpack (expected 2, got 1) #1612
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
Comments
I'm getting the same kind of errors during tests after upgrading to 3.3.0, so the problem was likely introduced in this release. |
Indeed, I'm using django-debug-toolbar 3.3.0. |
Thanks for the report! I'm unable to reproduce this (I tried with Python 3.9 and 3.10 in Linux/WSL) Do you have a way to print the stack which fails, e.g. by printing the value of |
It's a little hard to reproduce on my end. It only happens during tests (that I've noticed so far, anyway) and only when running pytest with xdist - so the tests running in parallel - and you can't use --pdb when running in parallel. Maybe that information is useful somehow. |
The exception occurs every time I hit refresh after a status code 500. To reproduce:
|
|
@bblanchon could you get the other values for |
@matthiask I don't think we're going to figure out what path and file to show when abspath is set to I think a reasonable solution would be: if os.path.sep in abspath:
directory, filename = abspath.rsplit(os.path.sep, 1)
else:
directory = ""
filename = abspath I'm working on the PR to add the test to prevent regressions. |
@bblanchon @knyghty could one of you confirm that #1613 fixes the issue for you locally? |
@tim-schilling yes, my tests are passing now with that patch at least. |
code = ''
func = '_find_andload'
lineno = 1007
locals_ = None #1613 does fix the issue 👍 |
Occassionally we will get a stacktrace that's an importlib instance string representation. While we may be able to put the python path or something else it's likely easier (and more logical) to simply pass that onto the user. I was unable to reproduce the issue in our tests, so I've mocked the case in test_importlib_path_issue_1612. Fixes #1612
This fix was shipped in version 3.4 today. |
Hi,
Thank you very much for this essential library ❤️
I just upgraded my project to Django 4.0.4 and now I frequently get the following exception when refreshing the page:
The value of
abspath
is'<frozen importlib._bootstrap>'
.Let me know if you need further information.
Best regards,
Benoit
The text was updated successfully, but these errors were encountered: