48 Commits

Author SHA1 Message Date
Martin Panter
6a8163a928 Correct “an” → “a” with “Unicode”, “user”, “UTF”, etc
This affects documentation and code comments.
2016-04-15 02:14:19 +00:00
Serhiy Storchaka
c7797dc748 Issue #19543: Emit deprecation warning for known non-text encodings.
Backported issues #19619: encode() and decode() methods and constructors
of str, unicode and bytearray classes now emit deprecation warning for known
non-text encodings when Python is ran with the -3 option.

Backported issues #20404: io.TextIOWrapper (and hence io.open()) now uses the
internal codec marking system added to emit deprecation warning for known non-text
encodings at stream construction time when Python is ran with the -3 option.
2015-05-31 20:21:00 +03:00
Serhiy Storchaka
14e10a19f7 Issue #24102: Fixed exception type checking in standard error handlers. 2015-05-18 16:08:38 +03:00
Serhiy Storchaka
fb7c38040e Fixed compilation error introduced in 3f7519f633ed (issue #22518). 2014-10-04 14:51:44 +03:00
Serhiy Storchaka
d524922bdc Issue #22518: Fixed integer overflow issues in "backslashreplace" and
"xmlcharrefreplace" error handlers.
2014-10-04 14:14:41 +03:00
Serhiy Storchaka
7d96a09aca Fixed reference leak in the "backslashreplace" error handler. 2014-09-23 19:58:57 +03:00
Serhiy Storchaka
a9885e93ee Issue #13461: Fix a crash in the TextIOWrapper.tell method and in the "replace"
error handler on 64-bit platforms.  Patch by Yogesh Chaudhari.
2013-08-20 20:08:53 +03:00
Serhiy Storchaka
e822b034e7 Issue #15866: The xmlcharrefreplace error handler no more produces two XML
entities for a non-BMP character on narrow build.
2013-08-06 16:56:26 +03:00
Antoine Pitrou
4cfae027b3 Issue #1813: Fix codec lookup and setting/getting locales under Turkish locales. 2011-07-24 02:51:01 +02:00
Antoine Pitrou
c83ea137d7 Untabify C files. Will watch buildbots. 2010-05-09 14:46:46 +00:00
Georg Brandl
f4ffae2b2a #7035: improve docs of the various <method>_errors() functions, and give them docstrings. 2009-10-22 15:42:32 +00:00
Gregory P. Smith
dd96db63f6 This reverts r63675 based on the discussion in this thread:
http://mail.python.org/pipermail/python-dev/2008-June/079988.html

Python 2.6 should stick with PyString_* in its codebase.  The PyBytes_* names
in the spirit of 3.0 are available via a #define only.  See the email thread.
2008-06-09 04:58:54 +00:00
Christian Heimes
593daf545b Renamed PyString to PyBytes 2008-05-26 12:51:38 +00:00
Hye-Shik Chang
e6a1cb9700 Bug #1511381: codec_getstreamcodec() in codec.c is corrected to
omit a default "error" argument for NULL pointer.  This allows
the parser to take a codec from cjkcodecs again.
(Reported by Taewook Kang and reviewed by Walter Doerwald)
2006-06-23 21:16:18 +00:00
Neal Norwitz
237bf40746 Fix a warning on alpha 2006-04-28 05:28:30 +00:00
Martin v. Löwis
6685128b97 Fix more ssize_t issues. 2006-04-22 11:40:03 +00:00
Martin v. Löwis
b1ed7fac12 Replace INT_MAX with PY_SSIZE_T_MAX. 2006-04-13 07:52:27 +00:00
Walter Dörwald
ba8e180f3b Release codecs variable earlier. 2006-03-18 14:05:43 +00:00
Walter Dörwald
d53850a2be Fix wrong argument format in PyCodec_IncrementalEncoder() and
PyCodec_IncrementalDecoder().

Factor out common code from PyCodec_Encoder()/PyCodec_Decoder(),
PyCodec_IncrementalEncoder()/PyCodec_IncrementalDecoder() and
PyCodec_StreamReader()/PyCodec_StreamWriter().
2006-03-16 21:46:40 +00:00
Walter Dörwald
abb02e5994 Patch #1436130: codecs.lookup() now returns a CodecInfo object (a subclass
of tuple) that provides incremental decoders and encoders (a way to use
stateful codecs without the stream API). Functions
codecs.getincrementaldecoder() and codecs.getincrementalencoder() have
been added.
2006-03-15 11:35:15 +00:00
Brett Cannon
bf36409e2a PEP 352 implementation. Creates a new base class, BaseException, which has an
added message attribute compared to the previous version of Exception.  It is
also a new-style class, making all exceptions now new-style.  KeyboardInterrupt
and SystemExit inherit from BaseException directly.  String exceptions now
raise DeprecationWarning.

Applies patch 1104669, and closes bugs 1012952 and 518846.
2006-03-01 04:25:17 +00:00
Thomas Wouters
f7f438ba3b SF patch #1438387, PEP 328: relative and absolute imports.
- IMPORT_NAME takes an extra argument from the stack: the relativeness of
   the import. Only passed to __import__ when it's not -1.

 - __import__() takes an optional 5th argument for the same thing; it
   __defaults to -1 (old semantics: try relative, then absolute)

 - 'from . import name' imports name (be it module or regular attribute)
   from the current module's *package*. Likewise, 'from .module import name'
   will import name from a sibling to the current module.

 - Importing from outside a package is not allowed; 'from . import sys' in a
   toplevel module will not work, nor will 'from .. import sys' in a
   (single-level) package.

 - 'from __future__ import absolute_import' will turn on the new semantics
   for import and from-import: imports will be absolute, except for
   from-import with dots.

Includes tests for regular imports and importhooks, parser changes and a
NEWS item, but no compiler-package changes or documentation changes.
2006-02-28 16:09:29 +00:00
Martin v. Löwis
18e165558b Merge ssize_t branch. 2006-02-15 17:27:45 +00:00
Neal Norwitz
3715c3e576 Fix a few more ref leaks. Backport candidate 2005-11-24 22:09:18 +00:00
Neal Norwitz
739a8f86d6 Fix a couple of signed/unsigned comparison warnings 2004-07-08 01:55:58 +00:00