[ python-Bugs-1180267 ] expanding platform module and making it work as it should

2005-04-12 Thread SourceForge.net
Bugs item #1180267, was opened at 2005-04-10 19:44
Message generated for change (Comment added) made by nkour
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1180267&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nikos Kouremenos (nkour)
Assigned to: Nobody/Anonymous (nobody)
Summary: expanding platform module and making it work as it should

Initial Comment:
platform.release() (which is supposed to return the
Name of Windows) also does not work as it should in
some versions of windows I tried (xp pro sp1). Luckily
to print more than Windows (eg. print Windows XP or
Windows 2000 etc) you can have a look at this
http://www.brunningonline.net/simon/blog/archives/001168.html
of Simon Brunning

also  only debian, mdk and redhat is scanned for
GNU/Linux ?? why even bother then?

I think that PSL is good but this module is has hell of
limitations. At least dont' make anyone write this:

import os

distro_info = {
  'Arch Linux': '/etc/arch-release',  'Aurox Linux': '/etc/aurox-release',  
'Conectiva Linux': '/etc/conectiva-release',  'Debian GNU/Linux': 
'/etc/debian_release',  'Debian GNU/Linux': '/etc/debian_version',  'Fedora 
Linux': '/etc/fedora-release',  'Gentoo Linux': '/etc/gentoo-release',  
'Mandrake Linux': '/etc/mandrake-release',  'Slackware Linux': 
'/etc/slackware-release',  'Slackware Linux': '/etc/slackware-version',  
'Solaris/Sparc': '/etc/release',  'Sun JDS': '/etc/sun-release',  'Novell SUSE 
Linux': '/etc/SuSE-release',  'PLD Linux': '/etc/pld-release',  'SUSE Linux': 
'/etc/SuSE-release',  'Yellow Dog Linux': '/etc/yellowdog-release',  # many 
distros use the /etc/redhat-release for
compatibility
  # so Redhat is the last
  'Redhat Linux': '/etc/redhat-release'}

def get_os_info():
  if os.name =='nt':
win_version = {
(1, 4, 0): "95",(1, 4, 10): 
"98",   (1, 4, 90): "ME",   (2, 4, 0): 
"NT",(2, 5, 0): "2000",  (2, 5, 1): 
"XP"
}[os.sys.getwindowsversion()[3],
os.sys.getwindowsversion()[0],
os.sys.getwindowsversion()[1]]
return 'Windows' + ' ' + win_version
  elif os.name =='posix':
executable = 'lsb_release'
params = ' --id --codename --release --short'
for path in os.environ['PATH'].split(':'):
  full_path_to_executable = os.path.join(path,
executable)
  if os.path.exists(full_path_to_executable):
command = executable + params
child_stdin, child_stdout = os.popen2(command)
output = child_stdout.readline().strip()
child_stdout.close()
child_stdin.close()
return output
# lsb_release executable not available, so parse files
for distro in distro_info:
  path_to_file = distro_info[distro]
  if os.path.exists(path_to_file):
file = open(path_to_file)
text = file.read().strip()
file.close()
if path_to_file.endswith('version'):
  text = distro + ' ' + text
return text

print get_os_info()

Thank you

--

>Comment By: Nikos Kouremenos (nkour)
Date: 2005-04-12 13:56

Message:
Logged In: YES 
user_id=865368

ok I have it again in a friend of mine. he has win xp pro
sp1 French edition
and release() returns ""

the Simon's trick will return to him XP
which is correct!!

--

Comment By: Nikos Kouremenos (nkour)
Date: 2005-04-11 15:38

Message:
Logged In: YES 
user_id=865368

ok nevermind the platform.release() part for windows name.
it seems to work now.. :$

--

Comment By: Nikos Kouremenos (nkour)
Date: 2005-04-10 19:46

Message:
Logged In: YES 
user_id=865368

identation went to take a walk :(
I'm sorry
look here:
http://nkour.blogspot.com/2005/03/python-script-to-detect-gnulinux.html

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1180267&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1181619 ] Bad sys.executable value for bdist_wininst install script

2005-04-12 Thread SourceForge.net
Bugs item #1181619, was opened at 2005-04-12 16:49
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1181619&group_id=5470

Category: Distutils
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: follower (xfollower)
Assigned to: Nobody/Anonymous (nobody)
Summary: Bad sys.executable value for bdist_wininst install script

Initial Comment:
Description copied from:
 


>From the Python docs, sys.executable is:

executable
A string giving the name of the executable binary
for the Python interpreter, on systems where this makes
sense.

However, during the execution of a post-install script,
this string actually resolves to the name of the binary
installer!  This name should resolve, I think to the
name of the Python executable for which the installer
is running (a value selectable at the start of the
installation, if more than one Python is detected). 
Having this value available allows you to properly
generate shortcuts with the proper full path to the
python executable.

I resorted to using sys.prefix+r'\python.exe', which
will most likely work, but I'd rather see
sys.executable give me a more sensible answer.


--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1181619&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1078245 ] Python2.4: building '_socket' extension fails with `INET_ADD

2005-04-12 Thread SourceForge.net
Bugs item #1078245, was opened at 2004-12-03 05:16
Message generated for change (Comment added) made by ggarrett
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1078245&group_id=5470

Category: Extension Modules
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Michael Ströder (stroeder)
Assigned to: Nobody/Anonymous (nobody)
Summary: Python2.4: building '_socket' extension fails with `INET_ADD

Initial Comment:
HI!

I'm trying to build Python2.4 on a rather old Debian
machine. 
Building _socket fails (see below) although I tried to use

configure --disable-ipv6

I've added

#define INET_ADDRSTRLEN 16

to Modules/socketmodule.h which made it work. There
were no problems compiling Python2.2 on the very same
machine.

Ciao, Michael.

-- snip
--
building '_socket' extension
gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes
-fPIC -I. -I/tmp/Python-2.4/./Include
-I/user/W3311/local/include -I/usr/local/include
-I/tmp/Python-2.4/Include -I/tmp/Python-2.4 -c
/tmp/Python-2.4/Modules/socketmodule.c -o build/t
emp.linux-i686-2.4/socketmodule.o
/tmp/Python-2.4/Modules/socketmodule.c: In function
`socket_inet_ntop':
/tmp/Python-2.4/Modules/socketmodule.c:3350:
`INET_ADDRSTRLEN' undeclared (first use this function)
/tmp/Python-2.4/Modules/socketmodule.c:3350: (Each
undeclared identifier is reported only once
/tmp/Python-2.4/Modules/socketmodule.c:3350: for each
function it appears in.)
/tmp/Python-2.4/Modules/socketmodule.c:3350: size of
array `ip' has non-integer type 

--

Comment By: Garry J. Garrett (ggarrett)
Date: 2005-04-12 14:40

Message:
Logged In: YES 
user_id=377412

I'm a SysAdmin.  My users (programmers) who want this 
version of Python claim to have put this fix in place and it 
works (on a copy I'm sure is squirreled away in someone's 
home directory).  Perhaps the account I'm using doesn't have 
something it needs in LD_LIBRARY_PATH, etc.?

--

Comment By: Martin v. Löwis (loewis)
Date: 2005-04-11 16:23

Message:
Logged In: YES 
user_id=21627

Unfortunately, non of us has Solaris 7, so there is little
chance that we are able to develop a patch. Can you provide one?

--

Comment By: Garry J. Garrett (ggarrett)
Date: 2005-04-11 11:37

Message:
Logged In: YES 
user_id=377412

I got:

building '_socket' extension
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC
-fno-strict-aliasing -I. -I/opt/src/Python-2.4.1/./Include
-I/usr/local/include -I/opt/src/Python-2.4.1/Include
-I/opt/src/Python-2.4.1 -c
/opt/src/Python-2.4.1/Modules/socketmodule.c -o
build/temp.solaris-2.7-sun4u-2.4/socketmodule.o
In file included from
/opt/src/Python-2.4.1/Modules/socketmodule.c:315:
/opt/src/Python-2.4.1/Modules/getnameinfo.c: In function
`fake_getnameinfo':
/opt/src/Python-2.4.1/Modules/getnameinfo.c:173: warning:
implicit declaration of function `inet_ntop'
/opt/src/Python-2.4.1/Modules/getnameinfo.c:174: warning:
comparison between pointer and integer
/opt/src/Python-2.4.1/Modules/getnameinfo.c:206: warning:
comparison between pointer and integer
/opt/src/Python-2.4.1/Modules/socketmodule.c: In function
`socket_inet_ntop':
/opt/src/Python-2.4.1/Modules/socketmodule.c:3350: error:
`INET_ADDRSTRLEN' undeclared (first use in this function)
/opt/src/Python-2.4.1/Modules/socketmodule.c:3350: error:
(Each undeclared identifier is reported only once
/opt/src/Python-2.4.1/Modules/socketmodule.c:3350: error:
for each function it appears in.)
/opt/src/Python-2.4.1/Modules/socketmodule.c:3380: warning:
assignment makes pointer from integer without a cast
/opt/src/Python-2.4.1/Modules/socketmodule.c:3350: warning:
unused variable `ip'

My users then see...

# regtester.py ../ini/tester.ini main
Traceback (most recent call last):
  File "./regtester.py", line 24, in ?
import core_engine, core_event, core_action, logger
  File "/etsi/tst/regtester.1.0.0/scripts/core_engine.py",
line 19, in ?
import time, Queue, sched, copy, string, threading,
asyncore, socket
  File "/usr/local/lib/python2.4/asyncore.py", line 51, in ?
import socket
  File "/usr/local/lib/python2.4/socket.py", line 45, in ?
import _socket
ImportError: No module named _socket

I try your work-around.  Doesn't help.

--

Comment By: Garry J. Garrett (ggarrett)
Date: 2005-04-11 11:00

Message:
Logged In: YES 
user_id=377412

I have the same problem on Solaris 7.

--

Comment By: Martin v. Löwis (loewis)
Date: 2005-01-06 14:35

Message:
Logged In: YES 
user_id=21627

There are already a few attempts to define ADDRSTRLEN if it
is missing. Maybe we should just merge them into one, and
define it if it

[ python-Bugs-1181939 ] asyncore.loop() documentation

2005-04-12 Thread SourceForge.net
Bugs item #1181939, was opened at 2005-04-13 11:42
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1181939&group_id=5470

Category: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Graham (gumleef)
Assigned to: Nobody/Anonymous (nobody)
Summary: asyncore.loop() documentation

Initial Comment:
Document at http://docs.python.org/lib/module-asyncore.html
says that the map dictionary is updated in the asyncore
class's __init__() method (and to make sure you extend
this if you wish to retain this behaviour).

This is not the case. The map dictionary is updated by
asyncore.create_socket(). asyncore does not need to be
extended to retain the mapping behaviour the
documentation refers to.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1181939&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com