Python Forum
base64 decoding issue or bug
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
base64 decoding issue or bug
#1
hi,

i am encoding data and sending the same through TCP/IP and then trying to decode the same with base64.b64decode() operations, but for some reason i am not able to decode the data when it contains padding as "==", but the same code works when it contains padding as one character "="

But same data when i try with Java decoders it decodes perfectly in both the cases.

Not able to find the issue exactly, getting exception and terminating my simulator

Is it bug in python ?

  File "C:\Python34\lib\base64.py", line 46, in _bytes_from_decode_data
    "string, not %r" % s.__class__.__name__) from None
TypeError: argument should be a bytes-like object or ASCII string, not 'dict' 

Thanks In advance.
Reply


Messages In This Thread
base64 decoding issue or bug - by rbrahmaa - Apr-24-2017, 04:33 PM
RE: base64 decoding issue or bug - by wavic - Apr-25-2017, 11:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Decoding lat/long in file name johnmcd 4 1,536 Mar-22-2024, 11:51 AM
Last Post: johnmcd
  Enigma Decoding Problem krisarmstrong 4 2,144 Dec-14-2023, 10:42 AM
Last Post: Larz60+
  json decoding error deneme2 10 8,125 Mar-22-2023, 10:44 PM
Last Post: deanhystad
  flask app decoding problem mesbah 0 3,208 Aug-01-2021, 08:32 PM
Last Post: mesbah
  Decoding a serial stream AKGentile1963 7 12,894 Mar-20-2021, 08:07 PM
Last Post: deanhystad
  xml decoding failure(bs4) roughstroke 1 3,011 May-09-2020, 04:37 PM
Last Post: snippsat
  download base64 email attachment cferguson 3 6,207 Feb-25-2020, 06:50 PM
Last Post: cferguson
  python3 decoding problem but python2 OK mesbah 0 2,305 Nov-30-2019, 04:42 PM
Last Post: mesbah
  utf-8 decoding failed every time i try adnanahsan 21 16,673 Aug-27-2019, 04:25 PM
Last Post: adnanahsan
  Base64 to retrieve message JonasH 0 2,098 Jul-22-2019, 04:00 PM
Last Post: JonasH

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020