473,407 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

os.name under Win32

Hi!

We have an application using Python that is intended to work both under
Win32 and Linux.
Since some parts of the code need to be different depending whether we
are under Win32
or Linux, we use the traditional:

if os.name == "posix":
some Linux code
else:
some Win32 code

However, we have noticed that under some circumstances, in some cases,
in some
computers under Windows XP Family that the "posix" code was executed causing
of course a crash.

My question is whether that is supposed to be totally impossible.
Under Win32, we are indeed supposed to have os.name = "nt". Is that value
hardcoded in Win32 binaries distribution themself? Can it potentially
change?

The purpose of this thread would be to have confirmed that under Win32,
os.name cannot never, ever be equal to "posix", whatever happens and so,
that we must have done some other mistakes elsewhere.

Thanks for any enlighting,

Igor.

Sep 1 '06 #1
2 2803
Igor Kravtchenko schrieb:
My question is whether that is supposed to be totally impossible.
Under Win32, we are indeed supposed to have os.name = "nt". Is that value
hardcoded in Win32 binaries distribution themself? Can it potentially
change?
I can't test it right now, but I would expect that Cygwin Python
binaries on Win32 have os.name == "posix".

Regards,
Martin
Sep 9 '06 #2
Martin v. Löwis wrote:
Igor Kravtchenko schrieb:
>>My question is whether that is supposed to be totally impossible.
Under Win32, we are indeed supposed to have os.name = "nt". Is that value
hardcoded in Win32 binaries distribution themself? Can it potentially
change?


I can't test it right now, but I would expect that Cygwin Python
binaries on Win32 have os.name == "posix".
That's correct.

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden

Sep 9 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
by: jacob navia | last post by:
Recently there was a discussion in this group about how to retrieve the file name given a FILE *. The question raised my curiosity, and after some research I have come up with a good...
1
by: Anoop Nair | last post by:
Hi I am developing scripts in C# which can be used to test windows based applications. I use Win32 API's to perform click operations etc. To uniquely identify a control in a window rather than ...
5
by: =?Utf-8?B?Qkw=?= | last post by:
Hello friends In c# 2005 I have written a function to access "font file name" by "Font name" and it is working fine in all the windows version other than vista, in vista it is throughing an...
4
by: mcterborg | last post by:
Hello everyone, here is what I want to do. I have a ATI video card and it allows me to setup profiles for monitor configurations and so forth. The shortcut to activate one of these profiles looks...
2
by: Zytan | last post by:
I want to have a Win32 class (to dump my win32 dll imports in). I want this in it's own directory Win32 in the solution explorer (since I have other classes to put in this folder), which makes...
2
by: cnsabar | last post by:
Hi., I am using the following code to terminate the any process by giving the process name as input... use Win32::Process::List; use Win32::OLE; $Win32::OLE::Warn = 3; $P =...
0
by: mohanprasadgutta | last post by:
Hello, I am facing problem when trying to update a MS project task name cell color. here is my code. Win32::OLE->FreeUnusedLibraries ();...
185
by: jacob navia | last post by:
Hi We are rewriting the libc for the 64 bit version of lcc-win and we have added a new field in the FILE structure: char *FileName; fopen() will save the file name and an accessor function will...
5
by: Sin Jeong-hun | last post by:
Hello. Speical folders, like Desktop, usually have different display names. For example, in Japanese Windows, it's displayed as "$B%G%9%/%H%C%W(B". I want to get the this displayed name of a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.