[Pythonmac-SIG] error on 'import NumTut' with 2.0b1 & Numeric

David Goodger dgoodger@bigfoot.com
Thu, 21 Sep 2000 23:44:37 -0400


I'm trying out Numeric and its tutorial (NumTut), which I've put on Python's
path.

When I try running a script containing:

    from NumTut import *

I get a TypeError exception in pickle.py:

Traceback (most recent call last):
  File "Cerebrum:Projects:Python-Local:Testing:numtuttest.py", line 5, in ?
    from NumTut import *
  File "Cerebrum:DevTools:Python
2.0b1:Extensions:Numerical:Lib:NumTut:__init__.py", line 14, in ?
    greece = pickle.load(open(os.path.join(_dir, 'greece.pik'), 'rb')) /
256.0
  File "Cerebrum:DevTools:Python 2.0b1:Lib:pickle.py", line 856, in load
    return Unpickler(file).load()
  File "Cerebrum:DevTools:Python 2.0b1:Lib:pickle.py", line 516, in load
    dispatch[key](self)
  File "Cerebrum:DevTools:Python 2.0b1:Lib:pickle.py", line 689, in
load_global
    klass = self.find_class(module, name)
  File "Cerebrum:DevTools:Python 2.0b1:Lib:pickle.py", line 695, in
find_class
    __import__(module)
TypeError: __import__, argument 1: expected string without null bytes,
string found

Upon inspection, I found that 'module' contained a long string starting with
'Numeric\015' and also containing \000 null bytes. Obviously not a module
name.

I first tried running it from the PythonInterpreter interactively, and from
Python IDE. After the error, I couldn't copy text to the clipboard, and
neither File->Quit nor cmd-Q would allow me to exit. Control-D let me exit
the interpreter, but I had to do a force quit (opt-cmd-esc) to exit from the
IDE. And then I got bombs in other apps (don't know if related), and had to
reboot.

Later I remembered that Tkinter (used by NumTut) and interactive mode don't
work well together, so I dragged the script onto the PythonInterpreter icon.
But I got the same error, and the same unresponsive interpreter (redirected
sys.stdout & sys.stderr to capture the traceback above).

I'm running Python 2.0b1 with 36 MB allocated, under MacOS 8.6.

Any ideas? Known problem? Can anybody else reproduce this?

Thanks in advance.

-- 
David Goodger    dgoodger@bigfoot.com    Open-source projects:
 - The Go Tools Project: http://gotools.sourceforge.net
 (more to come!)