[Python.NET] Bug with System.Diagnostics.Process.ProcessName and tcl

Steffen Guhlemann Steffen.Guhlemann at mailbox.tu-dresden.de
Wed Mar 2 19:16:01 CET 2005


Hi,

I experienced some very strange bugs. Can someone help me?

The affected Programm is mainly written in Python with a Tcl-Gui. Some part of
the application logic lies in a c#-dll. Deep in this dll a function searches
for a certain Process by its id:

Process p=Process.GetProcessById(pid);

Afterwards the function checks the name of this Process:

string name=p.ProcessName;

This line makes Python go crazy. At least the Tcl-Gui and the float-Arithmetics
(i don't know which is a consequece of which) - we don't know what else is
affected. 

The Tcl-Windows appear with minimal size (0,0) instead of the size they where
meant to. Others with certain controls (e.g. a tree-Control) don't even appear.
Instead Python throws the following Exception:

Traceback (most recent call last):
  File "C:\tmp\testProcesses\bin\Release\test.py", line 577, in ?
    width=300)
  File "C:\tmp\testProcesses\bin\Release\test.py", line 388, in __init__
    self.move_cursor(self.root)
  File "C:\tmp\testProcesses\bin\Release\test.py", line 474, in move_cursor
    self.see(node.symbol, node.label)
  File "C:\tmp\testProcesses\bin\Release\test.py", line 446, in see
    while x2 > self.canvasx(0)+self.winfo_width():
  File "C:\Python23\lib\lib-tk\Tkinter.py", line 2028, in canvasx
    return getdouble(self.tk.call(
ValueError: invalid literal for float(): 6.0

The float arithmetic error, we found is not deterministic...if i edit and start
the script in IDLE, which also starts the Tree-Control mentioned above, then
somewhen it starts to go wrong with these lines:

val1=0.95
val2=1024
val3=int(val1*val2)
print val3

If beforehand of these lines no c#-function is called that uses some
ProcessName, the result is 972, otherwise the result could be 0. This is not
deterministic, the Tcl-Problem is deterministic.

Thanks 

Steffen


More information about the PythonDotNet mailing list