summaryrefslogtreecommitdiffstats
path: root/Lib/encodings/__init__.py
Commit message (Collapse)AuthorAgeFilesLines
* replace has_key with 'in' operatorBenjamin Peterson2009-10-091-1/+1
|
* replace callable()Benjamin Peterson2009-10-091-6/+6
|
* Fixed bug #1915: Python compiles with --enable-unicode=no again. However ↵Christian Heimes2008-01-231-1/+2
| | | | several extension methods and modules do not work without unicode support.
* Make the __import__ call in encodings.__init__ absolute with a level 0 call.Brett Cannon2007-02-161-4/+4
|
* Update the encoding package's search function to use absolute imports whenBrett Cannon2007-02-151-2/+4
| | | | | | | | | | | | calling __import__. This helps make the expected search locations for encoding modules be more explicit. One could use an explicit value for __path__ when making the call to __import__ to force the exact location searched for encodings. This would give the most strict search path possible if one is worried about malicious code being imported. The unfortunate side-effect of that is that if __path__ was modified on 'encodings' on purpose in a safe way it would not be picked up in future __import__ calls.
* Bug #1446043: correctly raise a LookupError if an encoding name givenGeorg Brandl2006-09-301-1/+1
| | | | to encodings.search_function() contains a dot.
* importing types is not necessary if we use isinstanceNeal Norwitz2006-08-251-2/+2
|
* Instead of relative imports, use (implicitly) absolute ones.Guido van Rossum2006-03-151-1/+1
|
* Whitespace normalization.Tim Peters2006-03-151-3/+3
|
* Patch #1436130: codecs.lookup() now returns a CodecInfo object (a subclassWalter Dörwald2006-03-151-12/+21
| | | | | | | 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.
* Use relative imports in a few places where I noticed the need.Guido van Rossum2006-03-151-1/+2
| | | | | (Ideally, all packages in Python 2.5 will use the relative import syntax for all their relative import needs.)
* Fix the encodings package codec search function to only searchMarc-André Lemburg2006-02-191-1/+1
| | | | | | inside its own package. Fixes problem reported in patch #1433198. Add codec search function for codec test codec.
* No need to import exceptions, they are builtinsNeal Norwitz2005-09-011-3/+2
|
* Let the default encodings search function lookup aliases before trying the ↵Marc-André Lemburg2004-01-201-18/+26
| | | | codec import. This allows applications to install codecs which override (non-special-cased) builtin codecs.
* Remove usage of re module from encodings package search function.Marc-André Lemburg2003-05-161-4/+19
|
* Whitespace normalization.Tim Peters2003-04-241-1/+0
|
* Revert Patch #670715: iconv support.Martin v. Löwis2003-04-031-5/+0
|
* Handle iconv initialization erorrsNeal Norwitz2003-02-281-1/+1
|
* Patch #670715: Universal Unicode Codec for POSIX iconv.Martin v. Löwis2003-01-261-0/+6
|
* Whitespace normalization.Tim Peters2002-12-241-1/+1
|
* When looking for an alias, first look for the normalized name (whichGuido van Rossum2002-10-041-1/+3
| | | | | still may contain dots), then if that doesn't exist look for the name with dots replaced by underscores. This is a little more forgiving.
* Extending the encoding name normalization to handle more non-alphanumericMarc-André Lemburg2002-10-041-8/+20
| | | | characters.
* Whitespace normalization.Tim Peters2002-08-081-3/+3
|
* Revert #571603 since it is ok to import codecs that are not subdirectoriesMartin v. Löwis2002-07-291-9/+12
| | | | of encodings. Skip modules that don't have a getregentry function.
* Patch #571603: Refer to encodings package explicitly.Martin v. Löwis2002-07-281-1/+1
|
* Corrected import behaviour for codecs which live outside the encodingsMarc-André Lemburg2002-02-111-12/+7
| | | | package.
* Add IANA character set aliases to the encodings alias dictionaryMarc-André Lemburg2002-02-101-7/+27
| | | | | | | and make alias lookup lazy. Note that only those IANA character set aliases were added for which we actually have codecs in the encodings package.
* Fixed search function error reporting in the encodings packageMarc-André Lemburg2001-09-191-7/+11
| | | | | | | | __init__.py module to raise errors which can be catched as LookupErrors as well as SystemErrors. Modified the error messages to include more information about the failing module.
* Changed .getaliases() support to register the new aliases in theMarc-André Lemburg2000-12-121-4/+12
| | | | | | | | | | | encodings package aliases mapping dictionary rather than in the internal cache used by the search function. This enables aliases to take advantage of the full normalization process applied to encoding names which was previously not available. The patch restricts alias registration to new aliases. Existing aliases cannot be overridden anymore.
* Marc-Andre Lemburg <mal@lemburg.com>:Marc-André Lemburg2000-06-131-2/+2
| | | | | Removed import of string module -- use string methods directly. Thanks to Finn Bock.
* Marc-Andre's third try at this bulk patch seems to work (except thatGuido van Rossum2000-04-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* On 17-Mar-2000, Marc-Andre Lemburg said:Barry Warsaw2000-03-201-3/+3
| | | | | | | | | | | | | 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).
* Marc-Andre Lemburg: Unicode encodings.Guido van Rossum2000-03-101-0/+78