Antoine Pitrou
715a63b783
Issue #14579 : Fix error handling bug in the utf-16 decoder.
Patch by Serhiy Storchaka.
14 years ago
Raymond Hettinger
aad5b02e62
Improve tooltips for splitlines() by showing that the default for keepends is False.
14 years ago
Benjamin Peterson
f51c384a0a
fix build without Py_DEBUG and DNDEBUG ( closes #14509 )
14 years ago
Benjamin Peterson
e8ecc73844
kill this terribly outdated comment
14 years ago
Benjamin Peterson
26da920001
ensure no one tries to hash things before the random seed is found
14 years ago
Barry Warsaw
1e13eb084f
- Issue #13703 : oCERT-2011-003: add -R command-line option and PYTHONHASHSEED
environment variable, to provide an opt-in way to protect against denial of
service attacks due to hash collisions within the dict and set types. Patch
by David Malcolm, based on work by Victor Stinner.
14 years ago
Éric Araujo
a4c81b07f8
Fix typo
14 years ago
Victor Stinner
975134e2a2
Issue #13093 : Fix error handling on PyUnicode_EncodeDecimal()
Add tests for PyUnicode_EncodeDecimal()
14 years ago
Antoine Pitrou
30402549de
Issue #13333 : The UTF-7 decoder now accepts lone surrogates
(the encoder already accepts them).
14 years ago
Ezio Melotti
15d6b65ead
#12266 : Fix str.capitalize() to correctly uppercase/lowercase titlecased and cased non-letter characters.
15 years ago
Senthil Kumaran
5e3a19d806
merge from 3.2 - Fix closes Issue12621 - Fix docstrings of find and rfind methods of bytes/bytearry/unicodeobject.
15 years ago
Ezio Melotti
e3685f6b1b
#6780 : fix starts/endswith error message to mention that tuples are accepted too.
15 years ago
Jesus Cea
44e81687a2
startswith and endswith don't accept None as slice index. Patch by Torsten Becker. ( closes #11828 )
15 years ago
Victor Stinner
2b574a2332
Merged revisions 88697 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r88697 | victor.stinner | 2011-03-01 23:46:52 +0100 (mar., 01 mars 2011) | 4 lines
Issue #11246 : Fix PyUnicode_FromFormat("%V")
Decode the byte string from UTF-8 (with replace error handler) instead of
ISO-8859-1 (in strict mode). Patch written by Ray Allen.
........
15 years ago
Victor Stinner
659eb84457
Merged revisions 88481 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r88481 | victor.stinner | 2011-02-21 22:13:44 +0100 (lun., 21 févr. 2011) | 4 lines
Fix PyUnicode_FromFormatV("%c") for non-BMP char
Issue #10830 : Fix PyUnicode_FromFormatV("%c") for non-BMP characters on
narrow build.
........
15 years ago
Alexander Belopolsky
b9cc00caab
Removed unneeded #include
15 years ago
Benjamin Peterson
28a4dce6a8
remove (un)transform methods
15 years ago
Alexander Belopolsky
942af5a9a4
Issue #10557 : Fixed error messages from float() and other numeric
types. Added a new API function, PyUnicode_TransformDecimalToASCII(),
which transforms non-ASCII decimal digits in a Unicode string to their
ASCII equivalents.
15 years ago
Martin v. Löwis
4d0d471a80
Merge branches/pep-0384.
15 years ago
Georg Brandl
3b9406b08a
Remove redundant check for PyBytes in unicode_encode.
15 years ago
Georg Brandl
02524629f3
#7475 : add (un)transform method to bytes/bytearray and str, add back codecs that can be used with them from Python 2.
15 years ago
Georg Brandl
e5b99f0fb3
Remove redundant includes of headers that are already included by Python.h.
15 years ago
Victor Stinner
d5af0a5df0
PyUnicode_DecodeFSDefaultAndSize() raises MemoryError if _Py_char2wchar() fails
15 years ago
Victor Stinner
2f02a51135
PyUnicode_EncodeFS() raises an exception if _Py_wchar2char() fails
* Add error_pos optional argument to _Py_wchar2char()
* PyUnicode_EncodeFS() raises a UnicodeEncodeError or MemoryError if
_Py_wchar2char() fails
15 years ago
Victor Stinner
c911bbfd5d
str, bytes, bytearray docstring: remove unnecessary [...]
15 years ago
Victor Stinner
e14e212221
Fix encode/decode method doc of str, bytes, bytearray types
* Specify the default encoding: write 'utf-8' instead of
sys.getdefaultencoding(), because the default encoding is now constant
* Specify the default errors value
15 years ago
Eric Smith
6c84085cfb
Improved docstrings for str and unicode methods format and __format__.
15 years ago
Eric Smith
16562f41b0
Merged revisions 86277 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r86277 | eric.smith | 2010-11-06 15:27:37 -0400 (Sat, 06 Nov 2010) | 1 line
Added more to docstrings for str.format, format_map, and __format__.
........
15 years ago
Eric Smith
51d2fd983b
Added more to docstrings for str.format, format_map, and __format__.
15 years ago
David Malcolm
9696088b6d
Issue #10288 : The deprecated family of "char"-handling macros
(ISLOWER()/ISUPPER()/etc) have now been removed: use Py_ISLOWER() etc
instead.
16 years ago
Eric Smith
27bbca6f79
Issue #6081 : Add str.format_map. str.format_map(mapping) is similar to str.format(**mapping), except mapping does not get converted to a dict.
16 years ago
Victor Stinner
ad15872854
Simplify PyUnicode_Encode/DecodeFSDefault on Windows/Mac OS X
* Windows always uses mbcs
* Mac OS X always uses utf-8
16 years ago
Victor Stinner
f933e1ab6f
Issue #4388 : On Mac OS X, decode command line arguments from UTF-8, instead of
the locale encoding. If the LANG (and LC_ALL and LC_CTYPE) environment variable
is not set, the locale encoding is ISO-8859-1, whereas most programs (including
Python) expect UTF-8. Python already uses UTF-8 for the filesystem encoding and
to encode command line arguments on this OS.
16 years ago
Victor Stinner
9a90900da5
PyUnicode_FromFormatV(): Fix %A format
It was not completly implemented. Add a test.
16 years ago
Benjamin Peterson
8f67d0893f
make hashes always the size of pointers; introduce Py_hash_t #9778
16 years ago
Georg Brandl
ded5acf34a
Merged revisions 81936 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k
........
r81936 | mark.dickinson | 2010-06-12 11:10:14 +0200 (Sa, 12 Jun 2010) | 2 lines
Silence 'unused variable' gcc warning. Patch by Éric Araujo.
........
16 years ago
Victor Stinner
168e117e0a
Add an optional size argument to _Py_char2wchar()
_Py_char2wchar() callers usually need the result size in characters. Since it's
trivial to compute it in _Py_char2wchar() (O(1) whereas wcslen() is O(n)), add
an option to get it.
16 years ago
Victor Stinner
f3170ccef8
Use locale encoding if Py_FileSystemDefaultEncoding is not set
* PyUnicode_EncodeFSDefault(), PyUnicode_DecodeFSDefaultAndSize() and
PyUnicode_DecodeFSDefault() use the locale encoding instead of UTF-8 if
Py_FileSystemDefaultEncoding is NULL
* redecode_filenames() functions and _Py_code_object_list (issue #9630 )
are no more needed: remove them
16 years ago
Georg Brandl
66c221e993
#9418 : first step of moving private string methods to _string module.
16 years ago
Victor Stinner
beb4135b8c
PyUnicode_AsWideCharString() takes a PyObject*, not a PyUnicodeObject*
All unicode functions uses PyObject* except PyUnicode_AsWideChar(). Fix the
prototype for the new function PyUnicode_AsWideCharString().
16 years ago
Victor Stinner
5593d8aeb4
Issue #8670 : PyUnicode_AsWideChar() and PyUnicode_AsWideCharString() replace
UTF-16 surrogate pairs by single non-BMP characters for 16 bits Py_UNICODE
and 32 bits wchar_t (eg. Linux in narrow build).
16 years ago
Victor Stinner
1c24bd0252
Issue #8870 : PyUnicode_AsWideCharString() doesn't count the trailing nul character
And write unit tests for PyUnicode_AsWideChar() and PyUnicode_AsWideCharString().
16 years ago
Victor Stinner
71e91a358b
Fix PyUnicode_AsWideCharString(): set *size if size is not NULL
16 years ago
Victor Stinner
c39211f51e
Issue #9630 : Redecode filenames when setting the filesystem encoding
Redecode the filenames of:
- all modules: __file__ and __path__ attributes
- all code objects: co_filename attribute
- sys.path
- sys.meta_path
- sys.executable
- sys.path_importer_cache (keys)
Keep weak references to all code objects until initfsencoding() is called, to
be able to redecode co_filename attribute of all code objects.
16 years ago
Victor Stinner
137c34c027
Issue #9979 : Create function PyUnicode_AsWideCharString().
16 years ago
Benjamin Peterson
d4ac96a336
use return NULL; it's just as correct
16 years ago
Victor Stinner
4c7db315df
Issue #9738 , #9836 : Fix refleak introduced by r84704
16 years ago
Benjamin Peterson
9be0b2e312
detect non-ascii characters much earlier (plugs ref leak)
16 years ago
Victor Stinner
1205f2774e
Issue #9738 : PyUnicode_FromFormat() and PyErr_Format() raise an error on
a non-ASCII byte in the format string.
Document also the encoding.
16 years ago
Victor Stinner
46408606d8
Rename PyUnicode_strdup() to PyUnicode_AsUnicodeCopy()
16 years ago