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:


[EMAIL PROTECTED]:~> hostname
mailman2
[EMAIL PROTECTED]:~> 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'
>>> import os
>>> os.getpid()
17830
>>> import sys
>>> sys.exit()
[EMAIL PROTECTED]:~>


-- John


This message was sent to: [EMAIL PROTECTED]
Unsubscribe or change your options at
http://mail.python.org/mailman/options/mailman-users/ r.barrett%40openinfo.co.uk




------------------------------------------------------
Mailman-Users mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/

This message was sent to: [EMAIL PROTECTED]
Unsubscribe or change your options at
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Reply via email to