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 2008年04月27日 02:59 by roysmith, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg65871 - (view) | Author: Roy Smith (roysmith) | Date: 2008年04月27日 02:59 | |
If you pass csv.reader() a filename as its first argument:
csv.reader('filename')
instead of a file object like you're supposed to, you don't get an error.
You instead get a reader object which returns the characters which make up
the filename.
Technically, this is not a bug, since the documentation says, "csvfile can
be any object which supports the iterator protocol and returns a string
each time its next method is called", and a string meets that definition.
Still, this is unexpected behavior, and is almost certainly not what the
user intended. It would be useful if a way could be devised to catch this
kind of mistake.
|
|||
| msg65884 - (view) | Author: Skip Montanaro (skip.montanaro) * (Python triager) | Date: 2008年04月27日 11:41 | |
It's not a mistake. In fact, the csv unit tests make use of being able to iterate over strings. I don't think this feature is going away. |
|||
| msg68502 - (view) | Author: Facundo Batista (facundobatista) * (Python committer) | Date: 2008年06月21日 15:48 | |
Skip is right, this is working ok. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:33 | admin | set | github: 46953 |
| 2008年06月21日 15:48:58 | facundobatista | set | status: open -> closed nosy: + facundobatista resolution: not a bug messages: + msg68502 |
| 2008年04月27日 11:41:51 | skip.montanaro | set | nosy:
+ skip.montanaro messages: + msg65884 |
| 2008年04月27日 02:59:50 | roysmith | create | |