Re: Re: problems with trackback

Eric Gaumer <gaumerel-rO34MGDSYikxZu/[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
Ted Leung wrote:
> ImportError means that Python could not import (load) the module.  The
> reason that it's giving for failure looks like it's related to
> UNIX/Linux magic numbers in the .pyc (byte code compiled) file.
> According to the message you got, I'd expect there to be a trackback.py
> and trackback.pyc file in
> /home/reagle/data/2web/pyblosxom-1.2/contrib.1.2/plugins/comments/
> plugins.  You should try removing that file and see if you still get
> the message.
>

The interpreter should be checking for updated versions of source code
before it uses old byte code files. You may have dropped a new trackback.py
file into the plugin directory that has an older time stamp and thus the
old byte code is being used because it looks up to date. Just 'touch' the
python source file.

Theoretically though, it shouldn't matter. If a .pyc file does exist then
you could actually delete the .py file and all should be well. I don't
understand why it would give you grief.

Have you upgraded python recently? Going from 2.3 to 2.4 (two different
major release numbers) changes the magic number. The first four bytes
tell the magic number in the file and imp.get_magic() will tell you
what it should be. If they are not the same then you have "bad" magic
number. As Ted stated... the easiest way is to just delete the .pyc and
have the interpreter generate a new one.

Still seems odd to me. That means if I have a bunch of python byte code
lying around and I upgrade the interpreter to a new major release, I would
have to manually remove all the .pyc files? In my limited experience with
python, I doubt that's the case. Anybody care to elaborate?

Joseph,
	If it's not too late (and you do actually find a .pyc file) could
you send it to me? I'd be very interested in seeing what the magic number
looks like on that file.

Anybody know where I could get a list of magic numbers for each python
release? I would assume it has to be in the python source code somewhere.

	-Eric

--
"Education is what remains after one has forgotten everything he learned in school."
	- Albert Einstein
signature.asc (application/pgp-signature, 256 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCWUeSZWL8hfFdQekRAoN9AKCVLNtjL+5o87Nmg7g7UNf0h3Md+wCfeHmR
LghgKwkwHOw4po5L9FnFvA0=
=lgci
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.