Now it is getting wacky was( Re: A modest Error (I mean Proposal))

Arinte shouldbe at message.com
Thu Jan 20 15:22:45 EST 2000


I change my code to look like this

 def IOCTL(self, command, dargs):
  command1 = long(0)
  if type(command)==type(2):
   poss.write("IOCTL was int")
   command1 = long(command)
   poss.write("IOCTL Set to Long");
  else:
   if type(command) == type("  "):
    poss.write("IOCTL was a string")
    command1 = command
   else:
    if type(command)!=type(2L):
     poss.write("IOCTL fail")
     return -1
  self.dump();
  poss.IOCtl(self.devname,command1,dargs) #make this pass the ioctl command
as an PossArg with a special name
  print len("1234567")  #ADDED THIS LINE
  return 0

Just to test len.  And now my program works???? If I remove this line or
even just remove the print it doesn't work???
Now what ??? If anything.  Another not here that critical print statement
doesn't print the len of the string either...



"Mikael Olofsson" <mikael at isy.liu.se> wrote in message
news:XFMail.000120170754.mikael at isy.liu.se...

On 20-Jan-00 Arinte wrote:
 >
 >  "Mikael Olofsson" <mikael at isy.liu.se> wrote in message
 >  news:XFMail.000120142944.mikael at isy.liu.se...
 >
 >  On 20-Jan-00 Arinte wrote:
 >   >  I am getting this weird error???
 >   >  Traceback (innermost last):
 >   >    File "Beer", line 17, in ?
 >   >    File "D:\POSSApps\anotherposs app\PossDevice.py", line 37, in
IOCTL
 >   >      if type(command)==type(2):
 >   >  TypeError: len() of unsized object
 >
 >  Maybe you have accidentally redefined type to len...
 >
 >  I would entertain that thought, but this problem only occurs on the 2nd
 >  call to this function???

OK, so we've narrowed it down some. Maybe that's what happens between
those two calls.

/Mikael

-----------------------------------------------------------------------
E-Mail:  Mikael Olofsson <mikael at isy.liu.se>
WWW:     http://www.dtr.isy.liu.se/dtr/staff/mikael
Phone:   +46 - (0)13 - 28 1343
Telefax: +46 - (0)13 - 28 1339
Date:    20-Jan-00
Time:    17:03:57

This message was sent by XF-Mail.
-----------------------------------------------------------------------





More information about the Python-list mailing list