summaryrefslogtreecommitdiffstats
path: root/Python/codecs.c
Commit message (Collapse)AuthorAgeFilesLines
* Bug #1511381: codec_getstreamcodec() in codec.c is corrected toHye-Shik Chang2006-06-231-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)
* Fix a warning on alphaNeal Norwitz2006-04-281-1/+1
|
* Fix more ssize_t issues.Martin v. Löwis2006-04-221-1/+1
|
* Replace INT_MAX with PY_SSIZE_T_MAX.Martin v. Löwis2006-04-131-5/+5
|
* Release codecs variable earlier.Walter Dörwald2006-03-181-4/+2
|
* Fix wrong argument format in PyCodec_IncrementalEncoder() andWalter Dörwald2006-03-161-96/+57
| | | | | | | | PyCodec_IncrementalDecoder(). Factor out common code from PyCodec_Encoder()/PyCodec_Decoder(), PyCodec_IncrementalEncoder()/PyCodec_IncrementalDecoder() and PyCodec_StreamReader()/PyCodec_StreamWriter().
* Patch #1436130: codecs.lookup() now returns a CodecInfo object (a subclassWalter Dörwald2006-03-151-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.
* PEP 352 implementation. Creates a new base class, BaseException, which has anBrett Cannon2006-03-011-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.
* SF patch #1438387, PEP 328: relative and absolute imports.Thomas Wouters2006-02-281-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.
* Merge ssize_t branch.Martin v. Löwis2006-02-151-14/+14
|
* Fix a few more ref leaks. Backport candidateNeal Norwitz2005-11-241-3/+3
|
* Fix a couple of signed/unsigned comparison warningsNeal Norwitz2004-07-081-1/+1
|
* Changed random calls to PyThreadState_Get() to use the macroNicholas Bastin2004-03-241-5/+5
|
* Fix gcc 3.3 warnings related to Py_UNICODE_WIDE.Hye-Shik Chang2003-12-291-2/+20
|
* Fixed SF bug #663074. The codec system was using global staticGustavo Niemeyer2003-03-191-84/+65
| | | | | | | | | 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.
* Patch for bug reported in patch #686627: import race condition inMarc-André Lemburg2003-02-141-1/+1
| | | | codecs registry startup.
* Properly compute array size even for --disable-unicode.Martin v. Löwis2002-11-211-1/+1
|
* Fix PEP 293 related problems with --disable-unicode buildsWalter Dörwald2002-11-211-0/+6
| | | | | reported by Michael Hudson in http://mail.python.org/pipermail/python-dev/2002-November/030299.html
* Add encoding name in LookupError. Fixes #615013. Will backport to 2.2.Martin v. Löwis2002-09-261-2/+2
|
* Check string for NULL before using it to format the error message.Walter Dörwald2002-09-021-3/+6
| | | | (Spotted by Neal Norwitz)
* PEP 293 implemention (from SF patch http://www.python.org/sf/432401)Walter Dörwald2002-09-021-0/+399
|
* Fix bug [ 549731 ] Unicode encoders appears to leak references.Mark Hammond2002-07-181-4/+10
| | | | Python 2.2.1 bugfix candidate.
* Rationalize use of limits.h, moving the inclusion to Python.h.Fred Drake2000-09-261-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.
* Changing the CNRI copyright notice according to CNRI's instructions.Guido van Rossum2000-08-031-1/+1
| | | | | This is a notice without a date, which apparently is not a claim to copyright but only advice to the reader. IANAL. :-)
* Mass ANSIfication of function definitions. Doesn't cover all 'extern'Thomas Wouters2000-07-221-3/+3
| | | | declarations yet, those come later.
* Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in eitherThomas Wouters2000-07-161-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 ;)
* Include limits.h if we have it.Jack Jansen2000-07-031-0/+3
|
* Change the loop index in normalizestring() to size_t too, to avoid aGuido van Rossum2000-06-291-1/+1
| | | | warning on Windows.
* Trent Mick's Win64 changes: size_t vs. int or long; also some overflowGuido van Rossum2000-06-281-2/+7
| | | | tests.
* M.-A. Lemburg <mal@lemburg.com>:Fred Drake2000-05-091-9/+5
| | | | | | | Moved some docs to the include file. Added a NULL check to _PyCodec_Lookup() to make it core dump safe.
* Marc-Andre's third try at this bulk patch seems to work (except thatGuido van Rossum2000-04-051-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).
* Marc-Andre Lemburg: Error reporting in the codec registry and lookupGuido van Rossum2000-03-311-12/+46
| | | | mechanism is enhanced to be more informative.
* Marc-Andre Lemburg:Guido van Rossum2000-03-241-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.
* On 17-Mar-2000, Marc-Andre Lemburg said:Barry Warsaw2000-03-201-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).
* Python Codec Registry and support functions, written by Marc-AndreGuido van Rossum2000-03-101-0/+382
Lemburg.