Message12762

Author wfouche2
Recipients wfouche2
Date 2019-11-06.07:19:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1573024783.94.0.320478427169.issue2826@roundup.psfhosted.org>
In-reply-to
Content
Jython 2.7.2b3 at change https://hg.python.org/jython/rev/159c277c4a80, fails to execute the following code:

import base64

JMSMessageID = u'38303762646637342d386137632d346637632d393364632d'
JMSMessageID_hex = JMSMessageID .decode("hex")
JMSMessageID_b64 = base64.b64encode(JMSMessageID_hex)

print JMSMessageID 
print JMSMessageID_hex
print JMSMessageID_b64

It fails with:

Traceback (most recent call last):
  File "test.py", line 4, in <module>
    JMSMessageID_hex = JMSMessageID .decode("hex")
  File "C:\jython27\jython-standalone.jar\Lib\encodings\hex_codec.py", line 42, in hex_decode
TypeError: a2b_hex() argument 1 must bytes or unicode, not unicode

Jython 2.5.4.rc1 and Python 2.7.16 produces the following output:

38303762646637342d386137632d346637632d393364632d
807bdf74-8a7c-4f7c-93dc-
ODA3YmRmNzQtOGE3Yy00ZjdjLTkzZGMt
History
Date User Action Args
2019-11-06 07:19:43wfouche2setrecipients: + wfouche2
2019-11-06 07:19:43wfouche2setmessageid: <1573024783.94.0.320478427169.issue2826@roundup.psfhosted.org>
2019-11-06 07:19:43wfouche2linkissue2826 messages
2019-11-06 07:19:43wfouche2create