Python Forum
TypeError: a bytes-like object is required
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TypeError: a bytes-like object is required
#6
Yes, I believe the intended purpose of the script is to output in the YAML format so it is readable, but from your post I am guessing that even when it is working there will still be some bytes in the binary that will not be readable in an editor, even if the binary file structure is known?

The other posts did help get around my original problem, but now I get the following error:

Error:
InvalidPICFileError: Invalid magic number PRJX
I thought this error would only show if the magic number was not equal to "PRJX":

if magic != 'PRJX':
			raise InvalidPICFileError('Invalid magic number ' + magic.decode('utf-8'))
I think this might be a little bit above me, essentially what I was hoping to do was to get this working, then work on other files with known binary structures and create scripts to convert them into YAML too.
Reply


Messages In This Thread
RE: TypeError: a bytes-like object is required - by ZeroX - Jan-04-2023, 09:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  TypeError: cannot pickle ‘_asyncio.Future’ object Abdul_Rafey 1 520 Mar-07-2024, 03:40 PM
Last Post: deanhystad
  error in class: TypeError: 'str' object is not callable akbarza 2 606 Dec-30-2023, 04:35 PM
Last Post: deanhystad
Bug TypeError: 'NoneType' object is not subscriptable TheLummen 4 825 Nov-27-2023, 11:34 AM
Last Post: TheLummen
  TypeError: 'NoneType' object is not callable akbarza 4 1,144 Aug-24-2023, 05:14 PM
Last Post: snippsat
  [NEW CODER] TypeError: Object is not callable iwantyoursec 5 1,520 Aug-23-2023, 06:21 PM
Last Post: deanhystad
  TypeError: 'float' object is not callable #1 isdito2001 1 1,130 Jan-21-2023, 12:43 AM
Last Post: Yoriz
  TypeError: 'float' object is not callable TimofeyKolpakov 3 1,563 Dec-04-2022, 04:58 PM
Last Post: TimofeyKolpakov
  API Post issue "TypeError: 'str' object is not callable" makeeley 2 2,003 Oct-30-2022, 12:53 PM
Last Post: makeeley
  TypeError: 'NoneType' object is not subscriptable syafiq14 3 5,350 Sep-19-2022, 02:43 PM
Last Post: Larz60+
  TypeError: a bytes-like object is required, not 'str' - Help Please. IanJ 3 4,940 Aug-29-2022, 05:53 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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