New submission from Larry Pete:

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

----------
components: Extension Modules
files: fail.c
messages: 198386
nosy: Larry.Pete, alexandre.vassalotti, pitrou
priority: normal
severity: normal
status: open
title: TypeError with pickle in embedded python3.3 when starting multiple 
Interpreters.
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file31867/fail.c

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19088>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to