[Mailman-Users] socket.gethostname()
John Poltorak
jp at warpix.org
Thu Nov 6 19:17:40 CET 2003
On Thu, Nov 06, 2003 at 04:57:12PM +0000, Richard Barrett wrote:
>
> On Thursday, November 6, 2003, at 05:43 pm, John Poltorak wrote:
>
> >
> >
> > I'm getting an error in LockFile.py at this point (line 180) :-
> >
> > self.__tmpfname = '%s.%s.%d' % (
> > lockfile, socket.gethostname(), os.getpid())
> >
> > It looks as though the function socket.gethostname() is causing this
> > error.
> >
> > How can I display the value returned by this funtion and where should
> > it
> > be retrieved from? ie should it be using $HOSTNAME ?
> >
>
> socket is a standard Python module. Its gethostname() function should
> return the same as the hostname shell command. From the command line
> you should be able to run python and get something like this:
Many thanks for this.
> mailman at mailman2:~> hostname
> mailman2
> mailman at mailman2:~> python
> Python 2.2.2 (#3, Feb 11 2003, 16:57:53)
> [GCC 2.95.3 20010315 (SuSE)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import socket
> >>> socket.gethostname()
> 'mailman2'
Where does value originate and should it match anything within Mailman's
configuration?
Is there any way to dump the value of self.__tmpfname to the logfile from
the lines above ?
This is what currently appears in the error log:-
admin(648): File "../Mailman/MailList.py", line 817, in __save
admin(648): fname_tmp = fname + '.tmp.%s.%d' % (socket.gethostname(), os.getpid())
admin(648): error: (14, 'Bad address')
I'm assuming that socket.gethostname() is the culprit.
--
John
More information about the Mailman-Users
mailing list