summaryrefslogtreecommitdiff
path: root/Python/codecs.c
AgeCommit message (Collapse)AuthorLines
2016-04-15Correct “an” → “a” with “Unicode”, “user”, “UTF”, etcMartin Panter-2/+2
This affects documentation and code comments.
2015-05-31Issue #19543: Emit deprecation warning for known non-text encodings.Serhiy Storchaka-27/+182
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-18Issue #24102: Fixed exception type checking in standard error handlers.Serhiy Storchaka-8/+9
2014-10-04Fixed compilation error introduced in 3f7519f633ed (issue #22518).Serhiy Storchaka-2/+1
2014-10-04Issue #22518: Fixed integer overflow issues in "backslashreplace" andSerhiy Storchaka-2/+12
"xmlcharrefreplace" error handlers.
2014-09-23Fixed reference leak in the "backslashreplace" error handler.Serhiy Storchaka-1/+3
2013-08-20Issue #13461: Fix a crash in the TextIOWrapper.tell method and in the "replace"Serhiy Storchaka-1/+1
error handler on 64-bit platforms. Patch by Yogesh Chaudhari.
2013-08-06Issue #15866: The xmlcharrefreplace error handler no more produces two XMLSerhiy Storchaka-30/+36
entities for a non-BMP character on narrow build.
2011-07-24Issue #1813: Fix codec lookup and setting/getting locales under Turkish locales.Antoine Pitrou-1/+1
2010-05-09Untabify C files. Will watch buildbots.Antoine Pitrou-401/+401
2009-10-22#7035: improve docs of the various <method>_errors() functions, and give ↵Georg Brandl-5/+17
them docstrings.
2008-06-09This reverts r63675 based on the discussion in this thread:Gregory P. Smith-5/+5
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-05-26Renamed PyString to PyBytesChristian Heimes-5/+5
2006-06-23Bug #1511381: codec_getstreamcodec() in codec.c is corrected toHye-Shik Chang-3/+6
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-04-28Fix a warning on alphaNeal Norwitz-1/+1
2006-04-22Fix more ssize_t issues.Martin v. Löwis-1/+1
2006-04-13Replace INT_MAX with PY_SSIZE_T_MAX.Martin v. Löwis-5/+5
2006-03-18Release codecs variable earlier.Walter Dörwald-4/+2
2006-03-16Fix wrong argument format in PyCodec_IncrementalEncoder() andWalter Dörwald-96/+57
PyCodec_IncrementalDecoder(). Factor out common code from PyCodec_Encoder()/PyCodec_Decoder(), PyCodec_IncrementalEncoder()/PyCodec_IncrementalDecoder() and PyCodec_StreamReader()/PyCodec_StreamWriter().
2006-03-15Patch #1436130: codecs.lookup() now returns a CodecInfo object (a subclassWalter Dörwald-0/+50
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-01PEP 352 implementation. Creates a new base class, BaseException, which has anBrett Cannon-3/+2
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-02-28SF patch #1438387, PEP 328: relative and absolute imports.Thomas Wouters-1/+1
- 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-15Merge ssize_t branch.Martin v. Löwis-14/+14
2005-11-24Fix a few more ref leaks. Backport candidateNeal Norwitz-3/+3
2004-07-08Fix a couple of signed/unsigned comparison warningsNeal Norwitz-1/+1
2004-03-24Changed random calls to PyThreadState_Get() to use the macroNicholas Bastin-5/+5
2003-12-29Fix gcc 3.3 warnings related to Py_UNICODE_WIDE.Hye-Shik Chang-2/+20
2003-03-19Fixed SF bug #663074. The codec system was using global staticGustavo Niemeyer-83/+64
variables to store internal data. As a result, any atempts to use the unicode system with multiple active interpreters, or successive interpreter executions, would fail. Now that information is stored into members of the PyInterpreterState structure.
2003-02-14Patch for bug reported in patch #686627: import race condition inMarc-André Lemburg-1/+1
codecs registry startup.
2002-11-21Properly compute array size even for --disable-unicode.Martin v. Löwis-1/+1
2002-11-21Fix PEP 293 related problems with --disable-unicode buildsWalter Dörwald-0/+6
reported by Michael Hudson in http://mail.python.org/pipermail/python-dev/2002-November/030299.html
2002-09-26Add encoding name in LookupError. Fixes #615013. Will backport to 2.2.Martin v. Löwis-2/+2
2002-09-02Check string for NULL before using it to format the error message.Walter Dörwald-3/+6
(Spotted by Neal Norwitz)
2002-09-02PEP 293 implemention (from SF patch http://www.python.org/sf/432401)Walter Dörwald-0/+399
2002-07-18Fix bug [ 549731 ] Unicode encoders appears to leak references.Mark Hammond-4/+10
Python 2.2.1 bugfix candidate.
2000-09-26Rationalize use of limits.h, moving the inclusion to Python.h.Fred Drake-3/+0
Add definitions of INT_MAX and LONG_MAX to pyport.h. Remove includes of limits.h and conditional definitions of INT_MAX and LONG_MAX elsewhere. This closes SourceForge patch #101659 and bug #115323.
2000-08-03Changing the CNRI copyright notice according to CNRI's instructions.Guido van Rossum-1/+1
This is a notice without a date, which apparently is not a claim to copyright but only advice to the reader. IANAL. :-)
2000-07-22Mass ANSIfication of function definitions. Doesn't cover all 'extern'Thomas Wouters-3/+3
declarations yet, those come later.
2000-07-16Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in eitherThomas Wouters-2/+2
comments, docstrings or error messages. I fixed two minor things in test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't"). There is a minor style issue involved: Guido seems to have preferred English grammar (behaviour, honour) in a couple places. This patch changes that to American, which is the more prominent style in the source. I prefer English myself, so if English is preferred, I'd be happy to supply a patch myself ;)
2000-07-03Include limits.h if we have it.Jack Jansen-0/+3
2000-06-29Change the loop index in normalizestring() to size_t too, to avoid aGuido van Rossum-1/+1
warning on Windows.
2000-06-28Trent Mick's Win64 changes: size_t vs. int or long; also some overflowGuido van Rossum-2/+7
tests.
2000-05-09M.-A. Lemburg <mal@lemburg.com>:Fred Drake-9/+5
Moved some docs to the include file. Added a NULL check to _PyCodec_Lookup() to make it core dump safe.
2000-04-05Marc-Andre's third try at this bulk patch seems to work (except thatGuido van Rossum-5/+16
his copy of test_contains.py seems to be broken -- the lines he deleted were already absent). Checkin messages: New Unicode support for int(), float(), complex() and long(). - new APIs PyInt_FromUnicode() and PyLong_FromUnicode() - added support for Unicode to PyFloat_FromString() - new encoding API PyUnicode_EncodeDecimal() which converts Unicode to a decimal char* string (used in the above new APIs) - shortcuts for calls like int(<int object>) and float(<float obj>) - tests for all of the above Unicode compares and contains checks: - comparing Unicode and non-string types now works; TypeErrors are masked, all other errors such as ValueError during Unicode coercion are passed through (note that PyUnicode_Compare does not implement the masking -- PyObject_Compare does this) - contains now works for non-string types too; TypeErrors are masked and 0 returned; all other errors are passed through Better testing support for the standard codecs. Misc minor enhancements, such as an alias dbcs for the mbcs codec. Changes: - PyLong_FromString() now applies the same error checks as does PyInt_FromString(): trailing garbage is reported as error and not longer silently ignored. The only characters which may be trailing the digits are 'L' and 'l' -- these are still silently ignored. - string.ato?() now directly interface to int(), long() and float(). The error strings are now a little different, but the type still remains the same. These functions are now ready to get declared obsolete ;-) - PyNumber_Int() now also does a check for embedded NULL chars in the input string; PyNumber_Long() already did this (and still does) Followed by: Looks like I've gone a step too far there... (and test_contains.py seem to have a bug too). I've changed back to reporting all errors in PyUnicode_Contains() and added a few more test cases to test_contains.py (plus corrected the join() NameError).
2000-03-31Marc-Andre Lemburg: Error reporting in the codec registry and lookupGuido van Rossum-12/+46
mechanism is enhanced to be more informative.
2000-03-24Marc-Andre Lemburg:Guido van Rossum-8/+6
Andy Robinson noted a core dump in the codecs.c file. This was introduced by my latest patch which fixed a memory leak in codecs.c. The bug causes all successful codec lookups to fail.
2000-03-20On 17-Mar-2000, Marc-Andre Lemburg said:Barry Warsaw-2/+12
Attached you find an update of the Unicode implementation. The patch is against the current CVS version. I would appreciate if someone with CVS checkin permissions could check the changes in. The patch contains all bugs and patches sent this week and also fixes a leak in the codecs code and a bug in the free list code for Unicode objects (which only shows up when compiling Python with Py_DEBUG; thanks to MarkH for spotting this one).
2000-03-10Python Codec Registry and support functions, written by Marc-AndreGuido van Rossum-0/+382
Lemburg.