| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
PY_ULLONG_MAX in pyport.h. Thanks Hallvard B Furuseth for the patch.
|
|
|
|
|
|
| |
zero-initialize all fields, fixing compiler warnings seen when building
extension modules with gcc with "-Wmissing-field-initializers" (implied
by "-W")
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* Add error_pos optional argument to _Py_wchar2char()
* PyUnicode_EncodeFS() raises a UnicodeEncodeError or MemoryError if
_Py_wchar2char() fails
|
|
|
|
|
| |
(ISLOWER()/ISUPPER()/etc) have now been removed: use Py_ISLOWER() etc
instead.
|
|
|
|
|
| |
unused undocumented value PyBUF_SHADOW, and strangely-looking code in
PyMemoryView_GetContiguous.
|
|
|
|
| |
data (including local variables caught in the stack trace) alive infinitely.
|
|
|
|
| |
narrow/wide unicode build.
|
|
|
|
|
|
|
|
| |
is silent by default,
except when configured --with-pydebug.
Emit this warning from the GC shutdown procedure, rather than just printing to stderr.
|
| |
|
|
|
|
| |
They can be retrieved through a new attribute `sys._xoptions`.
|
|
|
|
| |
Patch from ActiveState.
|
| |
|
|
|
|
|
|
|
| |
* Rename _PyImport_FindExtension() to _PyImport_FindExtensionUnicode():
the filename becomes a Unicode object instead of byte string
* Rename _PyImport_FixupExtension() to _PyImport_FixupExtensionUnicode():
the filename becomes a Unicode object instead of byte string
|
|
|
|
|
|
| |
_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.
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
| |
|
| |
|
|
|
|
| |
encodings
|
| |
|
|
|
|
|
| |
On Windows, Py_UNICODE is wchar_t, so we can avoid the expensive Py_UNICODE*
=> wchar_t* conversion.
|
|
|
|
|
|
| |
* Don't define _Py_wstat() on Windows, Windows has its own _wstat() function
with a different API (the stat buffer has another type)
* Include windows.h
|
|
|
|
|
|
|
| |
* _Py_fopen() and _Py_stat() come from Python/import.c
* (_Py)_wrealpath() comes from Python/sysmodule.c
* _Py_char2wchar(), _Py_wchar2char() and _Py_wfopen() come from Modules/main.c
* (_Py)_wstat(), (_Py)_wgetcwd(), _Py_wreadlink() come from Modules/getpath.c
|
|
|
|
|
| |
All unicode functions uses PyObject* except PyUnicode_AsWideChar(). Fix the
prototype for the new function PyUnicode_AsWideCharString().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
retry the select() loop instead of bailing out. This is because select()
can incorrectly report a socket as ready for reading (for example, if it
received some data with an invalid checksum).
|
|
|
|
| |
Add a Py_SetPath api to override magic path computations when starting up python.
|
| |
|
| |
|
|
|
|
| |
from the old FAQ into the docs
|
|
|
|
|
| |
re-created on a subsequent call to Py_Initialize(). The problem (a crash)
wouldn't appear in 3.1 or 2.7 where the GIL's structure is more trivial.
|
|
|
|
|
|
|
|
| |
The internal unicode database is now always used.
(after 5 years: see
http://mail.python.org/pipermail/python-dev/2004-December/050193.html
)
|
| |
|
|
|
|
|
|
| |
a non-ASCII byte in the format string.
Document also the encoding.
|
|
|
|
|
|
| |
environment variable to set the filesystem encoding at Python startup.
sys.setfilesystemencoding() creates inconsistencies because it is unable to
reencode all filenames in all objects.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
namespace if it occurs as a free variable in a nested block. This limitation
of the compiler has been lifted, and a new opcode introduced (DELETE_DEREF).
This sample was valid in 2.6, but fails to compile in 3.x without this change::
>>> def f():
... def print_error():
... print(e)
... try:
... something
... except Exception as e:
... print_error()
... # implicit "del e" here
This sample has always been invalid in Python, and now works::
>>> def outer(x):
... def inner():
... return x
... inner()
... del x
There is no need to bump the PYC magic number: the new opcode is used
for code that did not compile before.
|
| |
|
| |
|
|
|
|
|
| |
by the new (and simpler) DUP_TOP_TWO. Performance isn't changed, but
our bytecode is a bit simplified. Patch by Demur Rumed.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
are now removed, since their effect was inexistent in 3.x (the default
encoding is hardcoded to utf-8 and cannot be changed).
|
|
|
|
| |
_Py_add_one_to_C() and _Py_add_one_to_F(), respectively.
|
|
|
|
| |
other than MSC
|