Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
for lin in openfile:
#6
i did the command py3 seeintent.py fd12.py which was printing lots of ASCII stuff for debugging then printed the file it read in and it ended with:

Output:
Traceback (most recent call last): File "seeintent.py", line 54, in <module> print(line) UnicodeEncodeError: 'ascii' codec can't encode character '\xa9' in position 10: ordinal not in range(128) lt1/pdh /home/pdh 73> lines 53 56 seeintent.py for line in a: print(line) stdout.flush() lt1/pdh /home/pdh 74> lines 15 18 fd12.py __license__ = """ Copyright © 2016, by Phil D. Howard - all other rights reserved lt1/pdh /home/pdh 75>
the character at issue is '©' (code point U+00A9) which should be handled OK if stdout was open()'d with encoding='utf-8'. but it wasn't. and i couldn't
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
for lin in openfile: - by Skaperen - Jun-27-2018, 03:41 AM
RE: for lin in openfile: - by buran - Jun-27-2018, 06:50 AM
RE: for lin in openfile: - by snippsat - Jun-27-2018, 09:14 AM
RE: for lin in openfile: - by Skaperen - Jun-27-2018, 10:02 PM
RE: for lin in openfile: - by snippsat - Jun-27-2018, 10:48 PM
RE: for lin in openfile: - by Skaperen - Jun-28-2018, 02:01 AM
RE: for lin in openfile: - by snippsat - Jun-28-2018, 12:47 PM
RE: for lin in openfile: - by DeaD_EyE - Jun-28-2018, 02:19 PM
RE: for lin in openfile: - by Skaperen - Jun-28-2018, 08:53 PM
RE: for lin in openfile: - by snippsat - Jun-28-2018, 09:42 PM
RE: for lin in openfile: - by Skaperen - Jun-28-2018, 11:36 PM
RE: for lin in openfile: - by snippsat - Jun-29-2018, 07:52 AM
RE: for lin in openfile: - by Skaperen - Jun-29-2018, 09:59 PM
RE: for lin in openfile: - by snippsat - Jun-30-2018, 12:07 PM
RE: for lin in openfile: - by Skaperen - Jun-30-2018, 05:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  combobox_callback(choice choice part of openfile name (kind of dependency) janeik 9 1,580 Sep-10-2023, 10:27 PM
Last Post: janeik

Forum Jump:

User Panel Messages

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