question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Variable Explorer throws an error instead of displaying contents when attempting to inspect any loaded modules

See original GitHub issue

Description

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?

  1. Import a module (example: import os)
  2. Initialize a dict in a variable (example: d=dict())
  3. Assign the module to the dict (example: d['os']=os)
  4. Double-click the cyan entry of your variable on variable explorer
  5. Double-click the white entry which corresponds to your module
  6. 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

screenshot_2017-12-28_16-23-15

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:closed
  • Created 6 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
ccordoba12commented, Dec 28, 2017

@CAM-Gerlach, it should be enough with catching the TypeError generated by this and then pass if that happens.

0reactions
CAM-Gerlachcommented, Dec 28, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found