New issue 10 by rich...@bucker.net: Value error while parsing a bitmap with
\x20
http://code.google.com/p/iso8583py/issues/detail?id=10
Here is the 0820 message that I generated. Notice that I omitted the length
and that the first 4 bytes are the MTI. (this string wear produced with
pprint().
'0820\x82
\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x10\x00\x00\x0002171704580315633010825000344'
It's not interesting to note that the 6th-byte of the message or the
2nd-byte of the bitmap field resolved to a \x20 or a space.
when __getBitmapFromStr() attempted to parse the first byte in this code:
if (int(bitmap[0:2],16) & self._BIT_POSITION_1) .....
I receive a value error because int() does not like the space in the
string. For example try these:
int("\x82\x20")
int("\x82 ")
They are the same value and they both generate the error. I think you
should consider using the struct.unpack() instead of int().
btw: don't panic but the message will not parse completely in ISO8583. The
message spec is 8583-like but that's it.
Hi, Did you generate this ISO8583 whith the ISO8583py library?
Or are trying to parse a 8583-like with the library?
Seems that this project expects the bitmap in binary coded hexidecimal?
The spec I'm coding to is strict binary.
/r
Comment #4 on issue 10 by igo...@gmail.com: Value error while parsing a
bitmap with \x20
http://code.google.com/p/iso8583py/issues/detail?id=10
Thank for the information.
This library expects 100% ASCII values, So you cannot parse this kind of
ISO8583-like package without change the source code.
Work with Binary Data (Bitmap and bits) are in the TODO list.
I'll close this issue because isn't a Bug, but a request for feature.
Best regards,