[muscle] Small error in python Message.py

  • From: "David RENE" <david.rene@xxxxxxx>
  • To: <muscle@xxxxxxxxxxxxx>
  • Date: Fri, 12 Jan 2007 08:31:35 +0100

Hi, 

I'm working on port of the message interface to the Anubis Language
(www.anubis-language.com). For testing my work I used the python message.py
for generating message into file and test my implementation in Anubis. But
when I read the generated file I had some troubles for decoding the content
of that file. But when I receive the message from network, all is right.
I looked the python sources and I found that is due to opening and reading
mode of the file. With 'w' mode an extra CR is add when python see an LF
(10). That 10 are meeting when python save the "stringme!", which has a size
of 9 + 1 for null char.
The test was correct because extra add CR was remove during the reading, but
the file is not binary message.

outfile = open('test.msg', 'w')  instead of  outfile = open('test.msg',
'wr')

infile = open('test.msg', 'r')   instead of  infile = open('test.msg', 'rb')

If you can fix that small bug, it will be useful for everyone who wants to
use that file as basis of work.

Thank you very much

Regards.

David RENE




Other related posts: