[Tutor] Improper import

Lloyd Kvam pythontutor at venix.com
Sat Sep 6 19:00:07 EDT 2003


The sys.path attribute controls the python search order for loading modules.
Python is of course case sensitive and will apply that case sensitivity to
import file names even on Windows.  I suspect that Samba is doing case
mapping so that Mailbox is getting transformed to mailbox.

Your sys.path list probably starts with '' which indicates the current
directory.  You could modify sys.path to put the current directory last.
This is an ugly approach, but would enable you to import the correct mailbox
and get around the case mapping problem.

If it were me, I'd be tempted to add postfix (or sendmail) to the local
machine and then use that machine for mailman email and avoid Samba.
(I've only used Samba to provide access from Windows to Linux and vice versa.
Linux to Linux I use NFS.)

Michael Montagne wrote:

> I think it is related to samba.  I used smbmount to mount /var/lib
> mailman from a different machine, the one that has postfix.  The local
> machine has the web server.  When I told smb.conf to be case sensitive
> then I couldn't ls the mailbox.py file in the Mailman directory but I
> still have the problem.  I've unmounted/remounted, restated samba,
> apache.  Still no joy.  
> 
> 
> 
> 
>>On 09/06/03, Lloyd Kvam busted out the keyboard and typed:
> 
> 
>>Actually that was not the correct linkage to suggest.  Could
>>Mailbox.py gotten linked to mailbox.py in the Mailman directory??
>>
>>Lloyd Kvam wrote:
>>
>>
>>>My mailman installation contains the files you describe, but without
>>>the confusion.  Could ln have been used to link mailbox.py into the
>>>Mailman directory??
>>>
>>>Michael Montagne wrote:
>>>
>>>
>>>>I'm having an issue with Mailman.  There is a file called Mailbox.py 
>>>>in the Mailman directory that calls "import mailbox".  It is supposed
>>>>to import /usr/lib/python2.2/mailbox.py.  Instead, it imports itself.
>>>>It appears to not be respecting the case-sensitivity.  I can run "vim
>>>>/var/lib/mailman/Mailman/mailbox.py" and edit the file that is called
>>>>"/var/lib/mailman/Mailman/Mailbox.py"
>>>>
>>>>What in the world can cause something like that?

-- 
Lloyd Kvam
Venix Corp.
1 Court Street, Suite 378
Lebanon, NH 03766-1358

voice:	603-443-6155
fax:	801-459-9582




More information about the Tutor mailing list