Variable Explorer throws an error instead of displaying contents when attempting to inspect any loaded modules
See original GitHub issueDescription
I double-clicked a module which was the value of a dict
in variable explorer and got an error.
What steps will reproduce the problem?
- Import a module (example:
import os
) - Initialize a
dict
in a variable (example:d=dict()
) - Assign the module to the dict (example:
d['os']=os
) - Double-click the cyan entry of your variable on variable explorer
- Double-click the white entry which corresponds to your module
- You see the error reporting window.
What is the expected output? What do you see instead?
I expected seeing the global variables defined in the module, but I got an error reporting window.
Please provide any additional information below
Stack trace
File "/usr/local/lib/python3.6/dist-packages/spyder/widgets/variableexplorer/collectionseditor.py", line 513, in createEditor
readonly=readonly)
File "/usr/local/lib/python3.6/dist-packages/spyder/widgets/variableexplorer/collectionseditor.py", line 1315, in setup
self.data_copy = copy.deepcopy(data)
File "/usr/lib/python3.6/copy.py", line 169, in deepcopy
rv = reductor(4)
TypeError: can't pickle module objects
Screenshot
Version and main components
- Ubuntu Studio 17.10
- Spyder Version: 3.2.5
- Python Version: 3.6.3
- Qt Versions: 5.9.3, PyQt5 5.9.2 on Linux
Dependencies
pyflakes >=0.6.0 : 1.6.0 (OK)
pycodestyle >=2.3: 2.3.1 (OK)
pygments >=2.0 : 2.2.0 (OK)
pandas >=0.13.1 : 0.21.1 (OK)
numpy >=1.7 : 1.12.1 (OK)
sphinx >=0.6.6 : 1.6.5 (OK)
rope >=0.9.4 : 0.10.7 (OK)
jedi >=0.9.0 : 0.11.1 (OK)
psutil >=0.3 : 5.4.2 (OK)
nbconvert >=4.0 : 5.3.1 (OK)
sympy >=0.7.3 : 1.1.1 (OK)
cython >=0.21 : 0.27.3 (OK)
qtconsole >=4.2.0: 4.3.1 (OK)
IPython >=4.0 : 6.2.1 (OK)
pylint >=0.25 : 1.8.1 (OK)
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Can't inspect objects in Spyder created using imported modules
I have a python script that uses a class definition from a module in a subdirectory of my project. My main module code...
Read more >Debugging methods and error types - HubSpot Developers
Understanding how to debug and look into errors when developing websites on the HubSpot CMS.
Read more >Python import: Advanced Techniques and Tips
In this tutorial, you'll learn how to: Use modules, packages, and namespace packages; Handle resources and data files inside your packages; Import modules...
Read more >Requiring modules in Node.js: Everything you need to know
We require a module by loading the content of a file into memory. ... in any of these paths, it will throw a...
Read more >JavaScript "use strict" - W3Schools
In strict mode, this will throw an error, making it impossible to accidentally create a global variable. In normal JavaScript, a developer will...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@CAM-Gerlach, it should be enough with catching the
TypeError
generated by this and thenpass
if that happens.Yeah, I think that was the change that I mentioned vaguely remembering above since it was potentially related to another issue I was having. In any case, this should simplify the test since it only needs to deal with the general case.