| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Don't truncate path if it is too long anymore, and allocate fewer memory (but
allocate it on the heap, not on the stack).
|
|
|
|
|
|
| |
people towards importlib.import_module().
Closes issue #7397.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
threads are still running. Instead, reinitialize the GIL on a second
call to Py_Initialize().
|
|
|
|
| |
PyThread_create_key now has a failure mode that the applicatino can detect.
|
|
|
|
|
|
|
| |
fromlist to get __import__ to return the module desired. Now it uses the proper
approach of fetching the module from sys.modules.
Closes issue #9252. Thanks to Alexander Belopolsky for the bug report.
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
(Patch by Jon Anglin)
|
|
|
|
|
|
| |
a single `\UXXXXXXXX`, regardless of whether the character is printable
or not. Also, the "backslashreplace" error handler now joins surrogate
pairs into a single character on UCS-2 builds.
|
|
|
|
| |
to load the one without the SOABI in the name.
|
|
|
|
| |
thread-local storage key.
|
|
|
|
|
| |
by the new (and simpler) DUP_TOP_TWO. Performance isn't changed, but
our bytecode is a bit simplified. Patch by Demur Rumed.
|
|
|
|
|
|
|
|
|
|
|
| |
'once_registry'. This is bad as the warnings module had variables named
'defaultaction' and 'onceregistry' which are what people should be looking at
(technically those variables shouldn't be mucked with as they are undocumented,
but we all know better than to believe that isn't happening). So the variables
from _warnings have been renamed to come off as private and to avoid confusion
over what variable should be used.
Closes issue #9766. Thanks to Antoine Pitrou for the discovery.
|
|
|
|
| |
http://mail.python.org/pipermail/python-dev/2010-September/103408.html
|
|
|
|
|
| |
are now removed, since their effect was inexistent in 3.x (the default
encoding is hardcoded to utf-8 and cannot be changed).
|
| |
|
| |
|
|
|
|
| |
Also remove one tab, and move a check closer to the possible failure.
|
|
|
|
|
|
| |
Failure to do it may result in strange error messages or even crashes,
in admittedly convoluted cases that are normally syntax errors, like:
def f(*xx, __debug__): pass
|
|
|
|
|
|
| |
filesystem encoding.
initfsencoding() displays also a better error message if get_codeset() failed.
|
| |
|
| |
|
|
|
|
| |
module to execute. Also updates all the cmd_line_script tests to validate the setting of sys.path[0] and the current working directory
|
|
|
|
| |
_PyUnicode_AsString() raises an exception on unencodable filename.
|
|
|
|
|
| |
Write a message formatted by PyUnicode_FromFormatV() to sys.stdout and
sys.stderr.
|
|
|
|
|
|
| |
Call _wfopen() on Windows, or fopen() otherwise. Return the new file object on
success, or NULL if the file cannot be open or (if PyErr_Occurred()) on unicode
error.
|
| |
|
|
|
|
| |
Use stat() or _wstat() depending on the OS.
|
|
|
|
|
| |
compilers (which are detected by the configure script). They can still
be disable selectively by specifying --without-computed-gotos.
|
|
|
|
|
|
|
| |
Similar to PyErr_WarnEx() but use PyUnicode_FromFormatV() to format the warning
message.
Strip also some trailing spaces.
|
|
|
|
|
|
| |
* On non-Windows OSes: the constructor accepts bytes filenames
and use surrogateescape for unicode filenames
* On Windows: use GetFileAttributesW() instead of GetFileAttributesA()
|
|
|
|
|
| |
va_copy, but available on all python platforms. Untabified a few
unrelated files.
|
|
|
|
|
| |
by Kristján. Unfortunately the 3.x Windows buildbots are in a wreck, so we'll
have to watch them when they become fit again.
|
|
|
|
| |
Just move the code and some variables.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
setup_context() replaces .pyc or .pyo filename suffix by .py, but it
didn't work if the filename contains a non-ascii character because the
function used the wrong unit for the length (number of characters
instead of the number of bytes).
With this patch, it uses unicode filenames instead of bytes filenames,
to fix the bug and to be fully unicode compliant.
|
|
|
|
| |
shutdown.
|