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.

Author jvanpraag
Recipients ezio.melotti, jvanpraag
Date 2010-07-01.13:54:20
SpamBayes Score 4.4744706e-05
Marked as misclassified No
Message-id <1277992458.12398.1382824513@webmail.messagingengine.com>
In-reply-to <1277936955.22.0.824130437647.issue9126@psf.upfronthosting.co.za>
Content
According to the documentation of the open function:

errors is an optional string that specifies how encoding and decoding
errors are to be handled–this cannot be used in binary mode. Pass
'strict' to raise a ValueError exception if there is an encoding error
(the default of None has the same effect), or pass 'ignore' to ignore
errors. (Note that ignoring encoding errors can lead to data loss.)
'replace' causes a replacement marker (such as '?') to be inserted where
there is malformed data. 

If a replacement marker such as '?' were replacing the bad characters,
the print function would not have a problem. The open function is not
working as described in the documentation.

On Wed, 30 Jun 2010 22:29 +0000, "Ezio Melotti" <report@bugs.python.org>
wrote:
> 
> Ezio Melotti <ezio.melotti@gmail.com> added the comment:
> 
> The problem is not in the reading part, but in the print().
> Since the default encoding of your terminal is cp437 and cp437 is not
> able to encode the "bad character" (U+2019 RIGHT SINGLE QUOTATION MARK),
> an error is raised.
> 
> ----------
> nosy: +ezio.melotti
> resolution:  -> invalid
> stage:  -> committed/rejected
> status: open -> closed
> type:  -> behavior
> 
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue9126>
> _______________________________________
>
History
Date User Action Args
2010-07-01 13:54:22jvanpraagsetrecipients: + jvanpraag, ezio.melotti
2010-07-01 13:54:21jvanpraaglinkissue9126 messages
2010-07-01 13:54:20jvanpraagcreate