Issue 10 in iso8583py: Value error while parsing a bitmap with \x20

18 views
Skip to first unread message

iso8...@googlecode.com

unread,
Feb 17, 2012, 6:04:19 PM2/17/12
to iso858...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

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().

iso8...@googlecode.com

unread,
Feb 17, 2012, 6:08:21 PM2/17/12
to iso858...@googlegroups.com

Comment #1 on issue 10 by rich...@bucker.net: Value error while parsing a

btw: don't panic but the message will not parse completely in ISO8583. The
message spec is 8583-like but that's it.

iso8...@googlecode.com

unread,
Feb 18, 2012, 2:01:14 PM2/18/12
to iso858...@googlegroups.com

Comment #2 on issue 10 by igo...@gmail.com: Value error while parsing a

Hi, Did you generate this ISO8583 whith the ISO8583py library?

Or are trying to parse a 8583-like with the library?

iso8...@googlecode.com

unread,
Feb 18, 2012, 4:40:52 PM2/18/12
to iso858...@googlegroups.com

Comment #3 on issue 10 by rich...@bucker.net: Value error while parsing a

Seems that this project expects the bitmap in binary coded hexidecimal?

The spec I'm coding to is strict binary.

/r

iso8...@googlecode.com

unread,
Feb 19, 2012, 5:03:57 AM2/19/12
to iso858...@googlegroups.com
Updates:
Status: Invalid
Labels: -Type-Defect Type-Enhancement

Comment #4 on issue 10 by igo...@gmail.com: Value error while parsing a

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,

Reply all
Reply to author
Forward
0 new messages