Larry Hastings
3a9079742f
Issue #19722 : Added opcode.stack_effect(), which accurately
computes the stack effect of bytecode instructions.
12 years ago
Antoine Pitrou
8933521b3d
Fix refleak introduced by 4f730c045f5f (issue #18408 ) and unveiled by 95eea8624d05 (issue #16596 ).
12 years ago
Victor Stinner
ed3b0bca3e
Issue #18874 : Implement the PEP 454 (tracemalloc)
12 years ago
Brett Cannon
224b261258
User the repr for a module name in more places
12 years ago
Brett Cannon
175e7257b1
Remove a commented-out line
12 years ago
Brett Cannon
fddc311fe8
Don't assume trying to find a builtin will succeed (e.g. posix isn't on Windows)
12 years ago
Eric Snow
b523f8433a
Implement PEP 451 (ModuleSpec).
12 years ago
Nick Coghlan
c72e4e6dcc
Issue #19619 : Blacklist non-text codecs in method API
str.encode, bytes.decode and bytearray.decode now use an
internal API to throw LookupError for known non-text encodings,
rather than attempting the encoding or decoding operation and
then throwing a TypeError for an unexpected output type.
The latter mechanism remains in place for third party non-text
encodings.
12 years ago
Guido van Rossum
8820c239f7
Better behavior when stepping over yield[from]. Fixes issue 16596. By Xavier de Gaye.
12 years ago
Christian Heimes
a5bcd7c0ee
Issue #19183 : too many tests depend on the sort order of repr().
The bitshift and xor op for 32bit builds has changed the order of hash values.
12 years ago
Christian Heimes
985ecdcfc2
ssue #19183 : Implement PEP 456 'secure and interchangeable hash algorithm'.
Python now uses SipHash24 on all major platforms.
12 years ago
Victor Stinner
f8e3221fa5
Issue #9566 , #19617 : Fix more compiler warnings in compile.c on Windows 64-bit
12 years ago
Victor Stinner
85fe8a645e
Issue #9566 , #19617 : New try to fix compilation on Windows
Some compilers (ex: Visual Studio) decode -2147483648 as a unsigned integer
instead of an signed integer.
12 years ago
Victor Stinner
b679a2eb78
Issue #9566 , #19617 : Fix compilation on Windows
INT32_MIN and INT32_MAX constants are unknown on Windows.
12 years ago
Victor Stinner
ad9a066050
Issue #9566 : compile.c uses Py_ssize_t instead of int to store sizes to fix
compiler warnings on Windows 64-bit. Use Py_SAFE_DOWNCAST() where the final
downcast is needed.
The bytecode doesn't support integer parameters larger than 32-bit yet.
12 years ago
Victor Stinner
4a58707a34
Add _PyUnicodeWriter_WriteASCIIString() function
12 years ago
Serhiy Storchaka
58cf607d13
Issue #12892 : The utf-16* and utf-32* codecs now reject (lone) surrogates.
The utf-16* and utf-32* encoders no longer allow surrogate code points
(U+D800-U+DFFF) to be encoded.
The utf-32* decoders no longer decode byte sequences that correspond to
surrogate code points.
The surrogatepass error handler now works with the utf-16* and utf-32* codecs.
Based on patches by Victor Stinner and Kang-Hao (Kenny) Lu.
12 years ago
Victor Stinner
cb29ec5f74
PY_FORMAT_SIZE_T should not be used with PyErr_Format(), PyErr_Format("%zd") is
portable
12 years ago
Victor Stinner
74387f5cac
Use Py_ssize_t type for sizes in getargs.c
Fix compiler warnings on Windows 64-bit
12 years ago
Victor Stinner
b11d6cb711
fileutils.c: use MAXPATHLEN instead of PATH_MAX
PATH_MAX is not declared on IRIX nor Windows.
12 years ago
Victor Stinner
2384714819
sysmodule.c: fix sys_update_path(), use Py_ARRAY_LENGTH() to get the size of
the fullpath buffer, not PATH_MAX. fullpath is declared using MAXPATHLEN or
MAX_PATH depending on the OS, and PATH_MAX is not declared on IRIX.
12 years ago
Victor Stinner
2f5bbc6a12
pythonrun.c: fix Py_GetPythonHome(), use Py_ARRAY_LENGTH() to get the size of
the env_home buffer, not PATH_MAX+1. env_home is declared using MAXPATHLEN+1,
and PATH_MAX is not declared on IRIX.
12 years ago
Victor Stinner
da062558db
Fix compiler warning (on Windows 64-bit): explicit cast Py_ssize_t to unsigned
char, n is in range [0; 255] (a tuple cannot have a negative length)
12 years ago
Victor Stinner
0c083461a5
Fix compiler warning in win32_urandom(): explicit cast to DWORD in
CryptGenRandom()
12 years ago
Nick Coghlan
c4c2580d43
Close 19609: narrow scope of codec exc chaining
12 years ago
Victor Stinner
5eb4f59cd9
Issue #19437 : Fix init_builtin(), handle _PyImport_FindExtensionObject()
failure
12 years ago
Stefan Krah
49d0479357
Add unused third arg for the benefit of Valgrind.
12 years ago
Victor Stinner
c82729e44f
Issue #19437 : Fix fold_unaryops_on_constants() of the peephole optimizer, clear
the exception when PyList_Append() fails
12 years ago
Nick Coghlan
8b097b4ed7
Close #17828 : better handling of codec errors
- output type errors now redirect users to the type-neutral
convenience functions in the codecs module
- stateless errors that occur during encoding and decoding
will now be automatically wrapped in exceptions that give
the name of the codec involved
12 years ago
Victor Stinner
22af2599a9
Issue #19437 : Fix PyImport_ImportModuleLevelObject(), handle
PyUnicode_Substring() failure (ex: MemoryError)
12 years ago
Victor Stinner
3f36a5736b
Issue #19515 : Remove identifiers duplicated in the same file.
Patch written by Andrei Dorian Duma.
12 years ago
Victor Stinner
dcf17f8a55
Issue #19466 : Fix typo. Patch written by Vajrasky Kok.
12 years ago
Victor Stinner
45956b9a33
Close #19466 : Clear the frames of daemon threads earlier during the Python
shutdown to call objects destructors. So "unclosed file" resource warnings are
now corretly emitted for daemon threads.
12 years ago
Victor Stinner
bd303c165b
Issue #19512 , #19515 : remove shared identifiers, move identifiers where they
are used.
Move also _Py_IDENTIFIER() defintions to the top in modified files to remove
identifiers duplicated in the same file.
12 years ago
Victor Stinner
efa7a0e155
print_error_text() doesn't encode the filename anymore
Use aslo PyUnicode_FromFormat() to format the line so only one call to
PyFile_WriteObject() is needed. tb_displayline() of Python/traceback.c has
similar implementation.
12 years ago
Victor Stinner
79ed4c744a
remove an outdated comment
The comment is meaningless since changeset 4e985a96a612.
12 years ago
Victor Stinner
53e9ec48e5
Issue #19512 : Use the new _PyId_builtins identifier
12 years ago
Victor Stinner
ad14ccd047
Issue #19512 : add _PyUnicode_CompareWithId() function
_PyUnicode_CompareWithId() is faster than PyUnicode_CompareWithASCIIString()
when both strings are equal and interned.
Add also _PyId_builtins identifier for "builtins" common string.
12 years ago
Victor Stinner
937114f704
print_exception(): don't encode the module name to UTF-8
Replace _PyUnicode_AsString()+strcmp() with PyUnicode_CompareWithASCIIString().
12 years ago
Victor Stinner
eaa2883d15
Issue #19512 : builtin print() function uses an identifier instead of literal
string "flush" to call the flush method
12 years ago
Victor Stinner
ae9f161b43
Issue #19512 : __build_class() builtin now uses an identifier for the "metaclass" string
12 years ago
Victor Stinner
090543736f
Issue #19512 : add some common identifiers to only create common strings once,
instead of creating temporary Unicode string objects
Add also more identifiers in pythonrun.c to avoid temporary Unicode string
objets for the interactive interpreter.
12 years ago
Victor Stinner
cab75e3e1e
Issue #19512 : PRINT_EXPR bytecode now uses an identifier to get sys.displayhook
to only create the "displayhook" string once
12 years ago
Victor Stinner
d67bd45537
Issue #19512 : Add _PySys_GetObjectId() and _PySys_SetObjectId() functions
12 years ago
Victor Stinner
b44562b6b9
Issue #19512 : eval() and exec() now use an identifier for "__builtins__" string
12 years ago
Victor Stinner
95701bdf40
Issue #19512 : Add PyRun_InteractiveOneObject() function
Only decode the filename once. PyRun_InteractiveOneObject() uses an identifier
for "<string>" string, so the byte string is only decoded once.
12 years ago
Victor Stinner
4ee41c5839
Issue #19512 : _print_total_refs() now uses an identifier to get "showrefcount"
key from sys._xoptions
12 years ago
Victor Stinner
d02fbb8f71
Issue #19512 : sys_displayhook() now uses an identifier for "builtins"
dictionary key and only decodes "\n" string once to write a newline.
So "builtins" and "\n" are only decoded once from UTF-8, at the first call.
12 years ago
Victor Stinner
98e818b8e3
Issue #19437 : Fix compiler_class(), handle compiler_lookup_arg() failure
12 years ago
Brett Cannon
2b8fc303ad
Abstract out stat calls in importlib for easier experimentation.
12 years ago