New submission from Joseph C Wang <joequ...@gmail.com>:

When running cPickle in restricted mode, the module tries to import
copyreg which does not appear to exist anywhere.  The problem is in
cPickle.c 

 2980   if (PyEval_GetRestricted()) {
 2981           /* Restricted execution, get private tables */
 2982           PyObject *m = PyImport_Import(copyreg_str);
 2983 
 2984           if (m == NULL)
 2985                   goto err;
 2986           self->dispatch_table = PyObject_GetAttr(m, dispatch_table_str);
 2987           Py_DECREF(m);
 2988           if (self->dispatch_table == NULL)
 2989                   goto err;
 2990   }
 2991   else {
 2992           self->dispatch_table = dispatch_table;
 2993           Py_INCREF(dispatch_table);
 2994   }

copyreg_str should probably be copy_reg_str

----------
components: Interpreter Core
messages: 94004
nosy: joequant
severity: normal
status: open
title: cPickle looking for non-existent package copyreg
type: behavior
versions: Python 2.6

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

Reply via email to