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
#7
it also fails when iterated like:
f = zopen(fname,'r')
a = []
for x in f:
    a.append(x.strip())
f.close()
and this happens even with non-compressed files where zopen just calls open and returns the file object. i can't perceive how doing that can make it be a different kind of object. but i am digging into zopen to be sure it isn't doing something to the object, especially something that could make the iterator think it is a binary file. there is logic in zopen to open in binary if it is going to stack a compression object on top (does decompression for read). but this appears to be working right as the read file object is returning str as it should.

if i exhaust this search my next task will be to build a minimal class that replicates the problem.
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