summaryrefslogtreecommitdiff
path: root/Modules/_codecsmodule.c
AgeCommit message (Collapse)AuthorLines
2017-03-12bpo-24037: Add Argument Clinic converter `bool(accept={int})`. (#485)Serhiy Storchaka-26/+26
2016-09-08Issue #27781: Change file system encoding on Windows to UTF-8 (PEP 529)Steve Dower-4/+4
2016-09-06Issue #27959: Adds oem encoding, alias ansi to mbcs, move aliasmbcs to codec ↵Steve Dower-0/+36
lookup
2016-07-07- Issue #27332: Fixed the type of the first argument of module-level functionsSerhiy Storchaka-92/+91
generated by Argument Clinic. Patch by Petr Viktorin.
2016-07-07Issue #27332: Fixed the type of the first argument of module-level functionsSerhiy Storchaka-92/+91
generated by Argument Clinic. Patch by Petr Viktorin.
2016-04-14Issues #26716, #26057: Regenerate Argument Clinic code.Serhiy Storchaka-15/+15
2016-04-13Issue #26057: Got rid of nonneeded use of PyUnicode_FromObject().Serhiy Storchaka-186/+45
2015-08-09Issue #24824: Signatures of codecs.encode() and codecs.decode() now areSerhiy Storchaka-6/+6
compatible with pydoc.
2015-05-12Fixed compilation on Windows for issue #20173.Serhiy Storchaka-1/+1
2015-05-12Issue #20173: Converted the _codecs module to Argument Clinic.Serhiy Storchaka-615/+629
2015-04-03Issue #23501: Argumen Clinic now generates code into separate files by default.Serhiy Storchaka-29/+2
2015-03-20Issue #23001: Few functions in modules mmap, ossaudiodev, socket, ssl, andSerhiy Storchaka-6/+9
codecs, that accepted only read-only bytes-like object now accept writable bytes-like object too.
2015-02-03Issue #22896: Avoid to use PyObject_AsCharBuffer(), PyObject_AsReadBuffer()Serhiy Storchaka-9/+15
and PyObject_AsWriteBuffer().
2015-02-03Issue #22896: Avoid to use PyObject_AsCharBuffer(), PyObject_AsReadBuffer()Serhiy Storchaka-9/+15
and PyObject_AsWriteBuffer().
2015-01-07Merge issue 19548 changes from 3.4Nick Coghlan-3/+3
2015-01-07Issue 19548: update codecs module documentationNick Coghlan-3/+3
- clarified the distinction between text encodings and other codecs - clarified relationship with builtin open and the io module - consolidated documentation of error handlers into one section - clarified type constraints of some behaviours - added tests for some of the new statements in the docs
2014-09-15Merge fix for issue #22166 from 3.4Nick Coghlan-0/+54
2014-09-15Issue #22166: clear codec caches in test_codecsNick Coghlan-0/+54
2014-08-17Issue #22207: Fix "comparison between signed and unsigned integers" warning inVictor Stinner-1/+1
test checking for integer overflow on Py_ssize_t type: cast explicitly to size_t.
2014-05-14Issue #21488: Add support of keyword arguments for codecs.encode and ↵Victor Stinner-6/+10
codecs.decode
2013-08-13Issue #18722: Remove uses of the "register" keyword in C code.Antoine Pitrou-3/+3
2012-10-06Issue #16096: Fix several occurrences of potential signed integer overflow. ↵Mark Dickinson-2/+2
Thanks Serhiy Storchaka.
2011-11-17#13406: fix more deprecation warnings and move the deprecation of ↵Ezio Melotti-5/+5
unicode-internal earlier in the code.
2011-11-16#13406: silence deprecation warnings in test_codecs.Ezio Melotti-1/+1
2011-11-12Plug some (unlikely) refleaks.Antoine Pitrou-15/+45
2011-11-10Fix and deprecated the unicode_internal codecVictor Stinner-4/+16
unicode_internal codec uses Py_UNICODE instead of the real internal representation (PEP 393: Py_UCS1, Py_UCS2 or Py_UCS4) for backward compatibility.
2011-11-10Fix build on WindowsVictor Stinner-0/+4
2011-11-10Port encoders from Py_UNICODE API to unicode object API.Martin v. Löwis-75/+45
2011-11-02Port UCS1 and charmap codecs to new API.Martin v. Löwis-5/+1
2011-10-18Issue #12281: Rewrite the MBCS codec to handle correctly replace and ignoreVictor Stinner-0/+50
error handlers on all Windows versions. The MBCS codec is now supporting all error handlers, instead of only replace to encode and ignore to decode.
2011-10-14Issue #13088: Add shared Py_hexdigits constant to format a number into base 16Victor Stinner-3/+2
2011-09-28Implement PEP 393.Martin v. Löwis-5/+3
2011-07-04Issue #9642: Uniformize the tests on the availability of the mbcs codecVictor Stinner-5/+5
Add a new HAVE_MBCS define.
2010-06-09Merged revisions 81860 via svnmerge fromAntoine Pitrou-96/+96
svn+ssh://pythondev@svn.python.org/python/trunk ........ r81860 | antoine.pitrou | 2010-06-09 18:24:00 +0200 (mer., 09 juin 2010) | 3 lines Issue #8930: fix some C code indentation ........
2010-06-08Issue #8838, #8339: Remove codecs.charbuffer_encode() and "t#" parsing formatVictor Stinner-16/+0
Remove last references to the "char buffer" of the buffer protocol from Python3.
2010-05-09Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou-373/+373
svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
2010-04-05Merged revisions 79779 via svnmerge fromPhilip Jenvey-1/+1
svn+ssh://pythondev@svn.python.org/python/trunk ........ r79779 | philip.jenvey | 2010-04-04 19:51:51 -0700 (Sun, 04 Apr 2010) | 2 lines fix escape_encode to return the correct consumed size ........
2009-05-06Merged revisions 72404-72406 via svnmerge fromWalter Dörwald-1/+2
svn+ssh://pythondev@svn.python.org/python/trunk ........ r72404 | walter.doerwald | 2009-05-06 16:28:24 +0200 (Mi, 06 Mai 2009) | 3 lines Issue 3739: The unicode-internal encoder now reports the number of *characters* consumed like any other encoder (instead of the number of bytes). ........ r72406 | walter.doerwald | 2009-05-06 16:32:35 +0200 (Mi, 06 Mai 2009) | 2 lines Add NEWS entry about issue #3739. ........
2009-03-21Merged revisions ↵Benjamin Peterson-1/+1
70342,70385-70387,70389-70390,70392-70393,70395,70400,70405-70406,70418,70438,70464,70468 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r70342 | georg.brandl | 2009-03-13 14:03:58 -0500 (Fri, 13 Mar 2009) | 1 line #5486: typos. ........ r70385 | benjamin.peterson | 2009-03-15 09:38:55 -0500 (Sun, 15 Mar 2009) | 1 line fix tuple.index() error message #5495 ........ r70386 | georg.brandl | 2009-03-15 16:32:06 -0500 (Sun, 15 Mar 2009) | 1 line #5496: fix docstring of lookup(). ........ r70387 | georg.brandl | 2009-03-15 16:37:16 -0500 (Sun, 15 Mar 2009) | 1 line #5493: clarify __nonzero__ docs. ........ r70389 | georg.brandl | 2009-03-15 16:43:38 -0500 (Sun, 15 Mar 2009) | 1 line Fix a small nit in the error message if bool() falls back on __len__ and it returns the wrong type: it would tell the user that __nonzero__ should return bool or int. ........ r70390 | georg.brandl | 2009-03-15 16:44:43 -0500 (Sun, 15 Mar 2009) | 1 line #5491: clarify nested() semantics. ........ r70392 | georg.brandl | 2009-03-15 16:46:00 -0500 (Sun, 15 Mar 2009) | 1 line #5488: add missing struct member. ........ r70393 | georg.brandl | 2009-03-15 16:47:42 -0500 (Sun, 15 Mar 2009) | 1 line #5478: fix copy-paste oversight in function signature. ........ r70395 | georg.brandl | 2009-03-15 16:51:48 -0500 (Sun, 15 Mar 2009) | 1 line #5276: document IDLESTARTUP and .Idle.py. ........ r70400 | georg.brandl | 2009-03-15 16:59:37 -0500 (Sun, 15 Mar 2009) | 3 lines Fix markup in re docs and give a mail address in regex howto, so that the recommendation to send suggestions to the author can be followed. ........ r70405 | georg.brandl | 2009-03-15 17:11:07 -0500 (Sun, 15 Mar 2009) | 7 lines Move the previously local import of threading to module level. This is cleaner and avoids lockups in obscure cases where a Queue is instantiated while the import lock is already held by another thread. OKed by Tim Peters. ........ r70406 | hirokazu.yamamoto | 2009-03-15 17:43:14 -0500 (Sun, 15 Mar 2009) | 1 line Added skip for old MSVC. ........ r70418 | georg.brandl | 2009-03-16 14:42:03 -0500 (Mon, 16 Mar 2009) | 1 line Add token markup. ........ r70438 | benjamin.peterson | 2009-03-17 15:29:51 -0500 (Tue, 17 Mar 2009) | 1 line I thought this was begging for an example ........ r70464 | benjamin.peterson | 2009-03-18 15:58:09 -0500 (Wed, 18 Mar 2009) | 1 line a much better example ........ r70468 | benjamin.peterson | 2009-03-18 22:04:31 -0500 (Wed, 18 Mar 2009) | 1 line close files after comparing them ........
2009-01-22Issue #4874: Most builtin decoders now reject unicode input.Antoine Pitrou-14/+14
2008-10-11merge from trunkBenjamin Peterson-1/+1
2008-08-13Merged revisions 65654 via svnmerge fromMartin v. Löwis-152/+127
svn+ssh://pythondev@svn.python.org/python/trunk ........ r65654 | martin.v.loewis | 2008-08-12 16:49:50 +0200 (Tue, 12 Aug 2008) | 6 lines Issue #3139: Make buffer-interface thread-safe wrt. PyArg_ParseTuple, by denying s# to parse objects that have a releasebuffer procedure, and introducing s*. More module might need to get converted to use s*. ........
2008-06-11Implement PEP 3121: new module initialization and finalization API.Martin v. Löwis-2/+14
2008-05-26Renamed PyString to PyBytesChristian Heimes-13/+13
2007-11-20Merged revisions 59056-59076 via svnmerge fromChristian Heimes-6/+13
svn+ssh://pythondev@svn.python.org/python/trunk ........ r59064 | christian.heimes | 2007-11-20 02:48:48 +0100 (Tue, 20 Nov 2007) | 1 line Fixed bug #1470 ........ r59066 | martin.v.loewis | 2007-11-20 03:46:02 +0100 (Tue, 20 Nov 2007) | 2 lines Patch #1468: Package Lib/test/*.pem. ........ r59068 | christian.heimes | 2007-11-20 04:21:02 +0100 (Tue, 20 Nov 2007) | 1 line Another fix for test_shutil. Martin pointed out that it breaks some build bots ........ r59073 | nick.coghlan | 2007-11-20 15:55:57 +0100 (Tue, 20 Nov 2007) | 1 line Backport some main.c cleanup from the py3k branch ........ r59076 | amaury.forgeotdarc | 2007-11-21 00:31:27 +0100 (Wed, 21 Nov 2007) | 6 lines The incremental decoder for utf-7 must preserve its state between calls. Solves issue1460. Might not be a backport candidate: a new API function was added, and some code may rely on details in utf-7.py. ........
2007-11-06Merging the py3k-pep3137 branch back into the py3k branch.Guido van Rossum-10/+9
No detailed change log; just check out the change log for the py3k-pep3137 branch. The most obvious changes: - str8 renamed to bytes (PyString at the C level); - bytes renamed to buffer (PyBytes at the C level); - PyString and PyUnicode are no longer compatible. I.e. we now have an immutable bytes type and a mutable bytes type. The behavior of PyString was modified quite a bit, to make it more bytes-like. Some changes are still on the to-do list.
2007-08-16Apply SF patch #1775604: This adds three new codecs (utf-32, utf-32-le andWalter Dörwald-0/+204
ut-32-be). On narrow builds the codecs combine surrogate pairs in the unicode object into one codepoint on encoding and create surrogate pairs for codepoints outside the BMP on decoding. Lone surrogates are passed through unchanged in all cases. Backport to the trunk will follow.
2007-07-20Merged revisions 56443-56466 via svnmerge fromGuido van Rossum-4/+5
svn+ssh://pythondev@svn.python.org/python/branches/p3yk ................ r56454 | kurt.kaiser | 2007-07-18 22:26:14 -0700 (Wed, 18 Jul 2007) | 2 lines Make relative imports explicit for py3k ................ r56455 | kurt.kaiser | 2007-07-18 23:12:15 -0700 (Wed, 18 Jul 2007) | 2 lines Was modifying dict during iteration. ................ r56457 | guido.van.rossum | 2007-07-19 07:33:19 -0700 (Thu, 19 Jul 2007) | 2 lines Fix failing test. ................ r56466 | guido.van.rossum | 2007-07-19 20:58:16 -0700 (Thu, 19 Jul 2007) | 35 lines Merged revisions 56413-56465 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r56439 | georg.brandl | 2007-07-17 23:37:55 -0700 (Tue, 17 Jul 2007) | 2 lines Use "Unix" as platform name, not "UNIX". ........ r56441 | guido.van.rossum | 2007-07-18 10:19:14 -0700 (Wed, 18 Jul 2007) | 3 lines SF patch# 1755885 by Kurt Kaiser: show location of Unicode escape errors. (Slightly tweaked for style and refcounts.) ........ r56444 | kurt.kaiser | 2007-07-18 12:58:42 -0700 (Wed, 18 Jul 2007) | 2 lines Fix failing unicode test caused by change to ast.c at r56441 ........ r56451 | georg.brandl | 2007-07-18 15:36:53 -0700 (Wed, 18 Jul 2007) | 2 lines Add description for wave.setcomptype() values ........ r56456 | walter.doerwald | 2007-07-19 06:04:38 -0700 (Thu, 19 Jul 2007) | 3 lines Document that codecs.lookup() returns a CodecInfo object. (fixes SF bug #1754453). ........ r56463 | facundo.batista | 2007-07-19 16:57:38 -0700 (Thu, 19 Jul 2007) | 6 lines Added a select.select call in the test server loop to make sure the socket is ready to be read from before attempting a read (this prevents an error 10035 on some Windows platforms). [GSoC - Alan McIntyre] ........ ................
2007-06-22Change readbuffer_encode() and charbuffer_encode() toWalter Dörwald-8/+4
return bytes objects.
2007-06-10Make identifiers str (not str8) objects throughout.Martin v. Löwis-1/+1
This affects the parser, various object implementations, and all places that put identifiers into C string literals. In testing, a number of crashes occurred as code would fail when the recursion limit was reached (such as the Unicode interning dictionary having key/value pairs where key is not value). To solve these, I added an overflowed flag, which allows for 50 more recursions after the limit was reached and the exception was raised, and a recursion_critical flag, which indicates that recursion absolutely must be allowed, i.e. that a certain call must not cause a stack overflow exception. There are still some places where both str and str8 are accepted as identifiers; these should eventually be removed.