On Sun, 2002-11-17 at 22:16, Jason R. Mastaler wrote:
> David Guerizec <[EMAIL PROTECTED]> writes:
>
> > Is there a reason why /usr/lib/python2.x/site-packages/TMDA/pythonlib
> > isn't prepended to sys.path in TMDA/Utils.py ?
>
> Because I'm doing this from the bin/tmda-* programs. So, by the time
> Utils is imported, pythonlib is already on sys.path.
ok, I see it's in bin/paths.py
> > I had a problem with the line 'from email import Header' in the
> > function decode_header(str).
>
> Where did you have this problem?
Here is the debug traceback log:
Uncaught Python 2.2.1 Exception (Sun Nov 17 22:18:18 2002):
-----------------------------------------------------------
Traceback (most recent call last):
File "/usr/bin/tmda-filter", line 53, in ?
execfile(os.path.join(execdir, 'tmda-rfilter'))
File "/usr/bin/tmda-rfilter", line 155, in ?
orig_msgin_headers_as_string = Util.headers_as_string(msgin)
File "/usr/lib/python2.2/site-packages/TMDA/Util.py", line 471, in
headers_as_string
(k, decode_header(v)) for k, v in msg.items()])
File "/usr/lib/python2.2/site-packages/TMDA/Util.py", line 453, in
decode_header
from email import Header
ImportError: cannot import name Header
And after changing the 'from email import Header' line (from Util.py)
to:
try:
from email import Header
except ImportError:
raise ImportError, repr(sys.path)
I've got:
Uncaught Python 2.2.1 Exception (Sun Nov 17 23:51:49 2002):
-----------------------------------------------------------
Traceback (most recent call last):
File "/usr/bin/tmda-filter", line 53, in ?
execfile(os.path.join(execdir, 'tmda-rfilter'))
File "/usr/bin/tmda-rfilter", line 155, in ?
orig_msgin_headers_as_string = Util.headers_as_string(msgin)
File "/usr/lib/python2.2/site-packages/TMDA/Util.py", line 474, in
headers_as_string
(k, decode_header(v)) for k, v in msg.items()])
File "/usr/lib/python2.2/site-packages/TMDA/Util.py", line 456, in
decode_header
raise ImportError, repr(sys.path)
ImportError: ['/usr/TMDA/pythonlib', '/usr', '/usr/bin',
'/usr/lib/python2.2', '/usr/lib/python2.2/plat-linux-i386',
'/usr/lib/python2.2/lib-dynload', '/usr/lib/python2.2/site-packages',
'/usr/lib/python2.2/site-packages/Numeric']
Although sys.path[0] should obviously be
'/usr/lib/python2.2/site-packages/TMDA/pythonlib'
paths.py is in /usr/bin, along with the other tmda-* files, is this
correct ? If no, where should it be put ?
I'm running Mandrake 9.0, using my own tmda-0.65 rpm (based on the 0.61
mdk rpm).
David
_________________________________________________
tmda-workers mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-workers