This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2010年06月18日 19:43 by jvanpraag, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg108130 - (view) | Author: John Van Praag (jvanpraag) | Date: 2010年06月18日 19:43 | |
Platforms: Windows Vista Ultimate 64 bit Python v3.1.2 Goal is to read a tab-separated CSV file. Some records have garbage characters in them. The following code fragment works when the program is run in IDLE, but fails when run from the Windows command line. ... fh_read = open(company_info, encoding='utf_8', errors='replace') fh_write = open(quotes_file, 'w') count = 0 try: rdr = csv.reader(fh_read, delimiter='\t') wrt = csv.writer(fh_write, delimiter='\t', quotechar='"', lineterminator='\n') for row in rdr: ... Within IDLE the code works with or without the encoding='utf_8' declaration; and it fails with or without the declaration when run from the Windows command line. The error message from the Windows command line is as follows: 'charmap' codec can't encode character '\u2019' in position 207: character maps to <undefined> |
|||
| msg108176 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2010年06月19日 12:48 | |
What you show is not a complete program, nor do you provide the complete traceback or the data causing the problem. The most helpful thing would be a complete small program and data file demonstrating the problem. That said, I'm wondering if your problem is the encoding of the terminal window. |
|||
| msg108989 - (view) | Author: John Van Praag (jvanpraag) | Date: 2010年06月30日 15:28 | |
I just now resubmitted, with a text file and program demonstrating the problem: Issue9126. I am new to submitting Python bug reports and I would like to do it right. I found I could only attach 1 file to the bug report. However, I had two files: The text file to read, and the program doing the reading. Is there some way to attach multiple files to a bug report? If not, what is the customary way to handle submissions where there is a file to be processed, and a program doing the processing? And perhaps other files exhibiting output(s)? Thanks, John On 2010年6月19日 12:48 +0000, "R. David Murray" <report@bugs.python.org> wrote: > > R. David Murray <rdmurray@bitdance.com> added the comment: > > What you show is not a complete program, nor do you provide the complete > traceback or the data causing the problem. The most helpful thing would > be a complete small program and data file demonstrating the problem. > That said, I'm wondering if your problem is the encoding of the terminal > window. > > ---------- > nosy: +r.david.murray > > _______________________________________ > Python tracker <report@bugs.python.org> > <http://bugs.python.org/issue9029> > _______________________________________ > |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:02 | admin | set | github: 53275 |
| 2010年06月30日 16:51:42 | benjamin.peterson | set | status: open -> closed resolution: duplicate superseder: errors='replace' does not work at Windows command line |
| 2010年06月30日 15:28:56 | jvanpraag | set | messages: + msg108989 |
| 2010年06月19日 12:48:00 | r.david.murray | set | nosy:
+ r.david.murray messages: + msg108176 |
| 2010年06月18日 19:43:48 | jvanpraag | create | |