[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: output of sys.platform changed



Petr Salinger wrote:

> Hi.
> 
>> I have a python application which relies on the sys.platform output.
>>
>> I noticed that on GNU/kFreeBSD, the output of sys.paltform has changed from
>> gnukfreebsd5 to gnukfreebsd6.
>>
>> Is this intentional ?
>> How are the numbers calculated ?
> 
> It is derived from version number of FreeBSD kernel.
> It used to be 5.3, 5.4 ,6.0 ,6.1. Currently it is 6.2.
>

Yes, that is what came to my mind too. So, ideally for a FreeBSD 5.x kernel it
should show gnukfreebsd5 and for a FreeBSD 6.x kernel it should show
gnukfreebsd6.

But on my system, where uname -a reports 5.4-1-486, the output from sys.platform
is gnukfreebsd6.
Which means the sys.platform output is being taken from somewhere else.
 
> But I don't know why is part of version number included in sys.platform.
>
There might be a good reason behind that. Even for Linux systems the output of
sys.platform is linux2. I think sys.platform is caring only about the major
releases (though in linux major releases are 2.X)

And even if that's the (correct) case, sys.platform should output gnukfreebsd5
for a 5.x FreeBSD kernel installed.
 
>> Is there something else I should check for to find out if the platform is a
>> GNU/kFreeBSD box ?
> 
> The best would be to test whether sys.platform starts with "gnukfreebsd",
> as gnukfreebsd7 is not so far.
>

Yes, that'd be my last option. But for the point I mentioned above, I think
there is a bug somewhere. Not sure if it's in the python package or any of the
freebsd related packages. 

I also verified the installed FreeBSD kernel on my system and it says is
kfreebsd-image-5.4-1-486 5.4-21. I don't see any FreeBSD 6.x series kernel
image or utility installed on my box.


Ritesh
-- 
Ritesh Raj Sarraf
RESEARCHUT - http://www.researchut.com
"Necessity is the mother of invention."
"Stealing logic from one person is plagiarism, stealing from many is research."
"The great are those who achieve the impossible, the petty are those who
cannot - rrs"



Reply to: