Inconsistencies with tab/space indentation between Cygwin/Win32?

Christian Gelinek cgelinek at radlogic.com.au
Thu Aug 4 06:25:37 CEST 2011


Hi all,

I have a problem running some python program using version 2.6.4 (or version
2.7.2, I tried both) from the Win7 command line - it never finishes due to
an infinite loop. The thing is, when I run the same program through Cygwin
which uses Python version 2.6.5, it exits the loop at some point.

I came to try this after I realised that in some of the sources (it is a
rather big program using many source files, most of them being created by
others from a Linux environment), the indentation is mixed tabs/spaces where
the assumed tab size is 8 spaces.

Reading on the Python website, a tab size of 8 is default anyway, so I would
have assumed it should work... does that mean that one tab equals 2
indents?!? I myself never use tabs to indent Python code but let my editor
do a tab-to-4-spaces conversion when I press <TAB>.

I find it at least confusing to read that Python expects a tab size of 8 but
at the same time uses 4 spaces for one indent level. Or maybe I am
completely on the wron track here?

Any ideas on how to get the thing to run under (real) Windows, hopefully
without having to edit existing sources of people who left our company ages
ago?





More information about the Python-list mailing list