This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Larry.Pete
Recipients Larry.Pete, alexandre.vassalotti, pitrou
Date 2013-09-25.14:11:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1380118274.37.0.850286724138.issue19088@psf.upfronthosting.co.za>
In-reply-to
Content
Hexchat (fork of XChat IRC Client) switched with version 2.9.6 to Python 3.3 for their Python plugins.
Hexchat loads plugins in a similar fashion like the attached C file (not entirely sure I used the C-API right though). For every plugin a new interpreter is started and Py_EndInterpreter is used to unload the plugin.
When using pickle in such a python plugin, it raises the Exception (in the attached example):

Traceback (most recent call last):
  File "<string>", line 7, in <module>
TypeError: attribute of type 'NoneType' is not callable

when trying to pickle an object (using pickle.dump or pickle.dumps).
The Exception happens on the line where pickle.dumps is called, though pickle.dumps is not None.

It happens:
- with python3.3.2 (I also tested it with python3.4.0a2 since I happened to have it installed, same issue). No issue with python2.7. I did not test it with 3.x versions prior to 3.3.2
- when trying to pickle a user defined class. Python objects like dictionaries and lists work fine.
- only with the second (and any additional) interpreter.
- when destroying the interpreter and starting a new one, in that order. When two interpreters are started and execute the code before any of them is destroyed, it works fine.

The full output of the attached file when executed is btw:

First output:
Pickle dumps:
b'\x80\x03c__main__\nSomeClass\nq\x00)\x81q\x01}q\x02X\x08\x00\x00\x00some_varq\x03K{sb.'

Second output:
Pickle dumps:
Traceback (most recent call last):
  File "<string>", line 7, in <module>
TypeError: attribute of type 'NoneType' is not callable
History
Date User Action Args
2013-09-25 14:11:14Larry.Petesetrecipients: + Larry.Pete, pitrou, alexandre.vassalotti
2013-09-25 14:11:14Larry.Petesetmessageid: <1380118274.37.0.850286724138.issue19088@psf.upfronthosting.co.za>
2013-09-25 14:11:14Larry.Petelinkissue19088 messages
2013-09-25 14:11:13Larry.Petecreate