Python Forum
i don't understand this exception
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i don't understand this exception
#4
the thing i am trying to understand is what wants bytes from read. this file is not compressed so zopen should be doing a plain open(). and it should be doing this in text mode which would, presumably, be having read() return strings.

the only cases i know where opening the file needs binary is if one or more compression layers will be added or the caller requests binary mode. i got errors like this early on when a coding error opened the file in text mode when compression was added on top of it. that resulted in the compression layer reading the other file layer assuming binary and getting str.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
i don't understand this exception - by Skaperen - Aug-24-2021, 01:09 AM
RE: i don't understand this exception - by Skaperen - Aug-24-2021, 02:23 AM
RE: i don't understand this exception - by Skaperen - Aug-24-2021, 04:33 AM
RE: i don't understand this exception - by Skaperen - Aug-24-2021, 07:13 AM
RE: i don't understand this exception - by Skaperen - Sep-02-2021, 05:44 AM
RE: i don't understand this exception - by ndc85430 - Sep-03-2021, 06:54 PM
RE: i don't understand this exception - by buran - Sep-02-2021, 07:41 AM
RE: i don't understand this exception - by Skaperen - Sep-05-2021, 12:39 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  During handling of the above exception, another exception occurred Skaperen 7 27,242 Dec-21-2018, 10:58 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

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