Wireshark-dev: Re: [Wireshark-dev] Follow up to making register.c - python problem - patch

From: Neil Piercy <Neil.Piercy@xxxxxxxxxxxx>
Date: Fri, 27 Oct 2006 10:27:19 +0100
Hi,

Ulf Lamping wrote:
Yes, the current cygwin python binding has some problems, I've installed it and compile without your changes! I just don't really understand why???

No, I am totally confused as to what triggers the issue: I had a working build environment on one PC with Windows Python 2.3, and when I setup another PC from clean with Python 2.4 it had this issue. When I upgraded the first to Python 2.4 it also failed so I thought it was that change (but I did start a clean build tree at the same time), and others have reported the issue on Python 2.3 too, so I suspect the Python version is irrelevant really.

It looks like something changes in the environment which causes either the command line arguements to be parsed for options - "/" being a common Windows option separator - so the path gets broken up and not treated as the file, or has the path not properly converted to the Windows "\" separator in actual use - but that is mainly speculation (and I'm far from a Python expert ;-). I was wondering whether it was something in our Python scripts which was just not general enough to cope in how the arguements were parsed and passed under Windows, but again, my lack of Python expertise prevented much progress.

I've started to put the string name in brackets "../../xy.py" in one of the nmake files some days ago, instead of replacing the slashes by backslashes as you did - which seems to both be working with native python.

Yes - somebody else reported the quotations working and indeed they do for me too.

Do you know of any drawbacks of either solutions?

Actually I suspect the right way to go is to quote paths - and possibly for all paths if we wanted to be very strict (what if somebody used a path with a space in it ? Understandably hated under Unix, but rather common on Windows in some circles).

I still don't have a good idea what the right solution to this problem really is - and don't want to change a lot of places just to notice that this raises other problems :-)

I don't know of any problems with either solution - btw I produced the patch by running a script over the tree, so I guess it would be easy to do the same for a patch to add quotes if you want.

Regards,
Neil