CDDB.py module bug on win32
Brought to you by:
che_fox
Hello
I am using win200 python 2.2.1
and whe I try to load import CDDB.py module I get error
import CDDB
Traceback (most recent call last):
File "<pyshell#0>", line 1, in ?
import CDDB
File "C:\Python\lib\CDDB.py", line 19, in ?
default_user = os.geteuid() or os.environ['USER']
or 'user'
AttributeError: 'module' object has no attribute 'geteuid'
geteuid() is only for UNIX
Logged In: YES
user_id=24723
Here's a patch:
--- CDDB.py.old Sat Mar 10 22:34:04 2001
+++ CDDB.py Fri May 16 09:44:58 2003
@@ -16,7 +16,9 @@
if os.environ.has_key('EMAIL'):
(default_user, hostname) =
string.split(os.environ['EMAIL'], '@')
else:
- default_user = os.geteuid() or os.environ['USER'] or 'user'
+ default_user = os.environ.get('USER') or
os.environ.get('USERNAME') or 'user'
+ if hasattr(os,'geteuid'):
+ default_user = os.geteuid() or default_user
hostname = socket.gethostname() or 'host'
proto = 4