Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | bpo-31492: Fix assertion failures in case of a module with a bad __name__ ↵ | Oren Milman | 2017-09-19 | 1 | -4/+1 |
| | | | | attribute. (#3620) | ||||
* | bpo-28411: Isolate PyInterpreterState.modules (#3575) | Eric Snow | 2017-09-14 | 1 | -3/+9 |
| | | | | | A bunch of code currently uses PyInterpreterState.modules directly instead of PyImport_GetModuleDict(). This complicates efforts to make changes relative to sys.modules. This patch switches to using PyImport_GetModuleDict() uniformly. Also, a number of related uses of sys.modules are updated for uniformity for the same reason. Note that this code was already reviewed and merged as part of #1638. I reverted that and am now splitting it up into more focused parts. | ||||
* | bpo-31404: Revert "remove modules from Py_InterpreterState (#1638)" (#3565) | Eric Snow | 2017-09-14 | 1 | -9/+3 |
| | | | PR #1638, for bpo-28411, causes problems in some (very) edge cases. Until that gets sorted out, we're reverting the merge. PR #3506, a fix on top of #1638, is also getting reverted. | ||||
* | bpo-30860: Consolidate stateful runtime globals. (#3397) | Eric Snow | 2017-09-08 | 1 | -0/+1 |
| | | | | | | | * group the (stateful) runtime globals into various topical structs * consolidate the topical structs under a single top-level _PyRuntimeState struct * add a check-c-globals.py script that helps identify runtime globals Other globals are excluded (see globals.txt and check-c-globals.py). | ||||
* | bpo-28411: Remove "modules" field from Py_InterpreterState. (#1638) | Eric Snow | 2017-09-04 | 1 | -3/+9 |
| | | | sys.modules is the one true source. | ||||
* | bpo-29793: Convert some builtin types constructors to Argument Clinic. (#615) | Serhiy Storchaka | 2017-03-19 | 1 | -17/+24 |
| | |||||
* | Issue #28748: Private variable _Py_PackageContext is now of type "const char *" | Serhiy Storchaka | 2016-11-21 | 1 | -1/+1 |
| | | | | rather of "char *". | ||||
* | Added the const qualifier to char* variables that refer to readonly internal | Serhiy Storchaka | 2016-11-20 | 1 | -2/+2 |
| | | | | UTF-8 represenatation of Unicode objects. | ||||
* | Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSize | Serhiy Storchaka | 2016-11-20 | 1 | -4/+4 |
| | | | | with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize. | ||||
* | Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵ | Serhiy Storchaka | 2016-11-16 | 1 | -1/+1 |
|\ | | | | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions. | ||||
| * | Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵ | Serhiy Storchaka | 2016-11-16 | 1 | -1/+1 |
| | | | | | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions. | ||||
* | | Issue #27914: Fixed a comment in PyModule_ExcDef. | Serhiy Storchaka | 2016-09-26 | 1 | -1/+1 |
| | | | | | | | | Patch by Xiang Zhang. | ||||
* | | Merge #27782 fix from 3.5 | Nick Coghlan | 2016-08-21 | 1 | -29/+35 |
|\ \ | |/ | |||||
| * | Issue #27782: Fix m_methods handling in multiphase init | Nick Coghlan | 2016-08-21 | 1 | -29/+35 |
| | | | | | | | | | | | | | | | | Multi-phase extension module import now correctly allows the ``m_methods`` field to be used to add module level functions to instances of non-module types returned from ``Py_create_mod``. Patch by Xiang Zhang. | ||||
* | | Issue #12946: Remove dead code in PyModule_GetDict | Berker Peksag | 2016-08-19 | 1 | -2/+1 |
|/ | | | | | | PyModule_NewObject already sets md_dict to PyDict_New(): m->md_dict = PyDict_New(); | ||||
* | Issue #22570: Renamed Py_SETREF to Py_XSETREF. | Serhiy Storchaka | 2016-04-06 | 1 | -1/+1 |
| | |||||
* | Issue #20440: Massive replacing unsafe attribute setting code with special | Serhiy Storchaka | 2015-12-24 | 1 | -2/+1 |
| | | | | macro Py_SETREF. | ||||
* | Issue #24268: Address some PEP 489 refleaks | Nick Coghlan | 2015-05-23 | 1 | -0/+1 |
| | | | | | | | | - missing DECREF in PyModule_FromDefAndSpec2 - missing DECREF in PyType_FromSpecAndBases2 - missing DECREF in _testmultiphase module Patch by Petr Viktorin | ||||
* | PEP 489: Multi-phase extension module initialization | Nick Coghlan | 2015-05-23 | 1 | -52/+283 |
| | | | | | | | | | | | | | | | | | | | | | | | Known limitations of the current implementation: - documentation changes are incomplete - there's a reference leak I haven't tracked down yet The leak is most visible by running: ./python -m test -R3:3 test_importlib However, you can also see it by running: ./python -X showrefcount Importing the array or _testmultiphase modules, and then deleting them from both sys.modules and the local namespace shows significant increases in the total number of active references each cycle. By contrast, with _testcapi (which continues to use single-phase initialisation) the global refcounts stabilise after a couple of cycles. | ||||
* | Removed unintentional trailing spaces in non-external and non-generated C files. | Serhiy Storchaka | 2015-03-18 | 1 | -1/+1 |
| | |||||
* | sprinkle some _PyId goodness around moduleobject.c | Benjamin Peterson | 2014-04-24 | 1 | -9/+19 |
| | |||||
* | do not override errors from descriptors on modules | Benjamin Peterson | 2014-04-24 | 1 | -10/+9 |
| | |||||
* | Issue8297: module attribute lookup failures now include module name in error ↵ | Ethan Furman | 2014-04-24 | 1 | -2/+26 |
| | | | | message. | ||||
* | Issue #19255: Clear error after failed PyDict_SetItem() on shutdown. | Serhiy Storchaka | 2014-02-12 | 1 | -2/+4 |
|\ | | | | | | | This silences a Coverity complain. | ||||
| * | Issue #19255: Clear error after failed PyDict_SetItem() on shutdown. | Serhiy Storchaka | 2014-02-12 | 1 | -2/+4 |
| | | | | | | | | This silences a Coverity complain. | ||||
* | | Issue #19255: The builtins module is restored to initial value before | Serhiy Storchaka | 2014-02-10 | 1 | -5/+8 |
| | | | | | | | | cleaning other modules. The sys and builtins modules are cleaned last. | ||||
* | | Implement PEP 451 (ModuleSpec). | Eric Snow | 2013-11-22 | 1 | -48/+5 |
| | | |||||
* | | Issue #18214: Improve finalization of Python modules to avoid setting their ↵ | Antoine Pitrou | 2013-07-31 | 1 | -8/+21 |
| | | | | | | | | globals to None, in most cases. | ||||
* | | #17115,17116: Have modules initialize the __package__ and __loader__ | Brett Cannon | 2013-05-04 | 1 | -13/+26 |
|/ | | | | | | | | | | | | | | | | | attributes to None. The long-term goal is for people to be able to rely on these attributes existing and checking for None to see if they have been set. Since import itself sets these attributes when a loader does not the only instances when the attributes are None are from someone overloading __import__() and not using a loader or someone creating a module from scratch. This patch also unifies module initialization. Before you could have different attributes with default values depending on how the module object was created. Now the only way to not get the same default set of attributes is to circumvent initialization by calling ModuleType.__new__() directly. | ||||
* | Issue #15394: Fix ref leaks in PyModule_Create. | Meador Inge | 2012-07-19 | 1 | -1/+7 |
|\ | | | | | | | Patch by Julia Lawall. | ||||
| * | Issue #15394: Fix ref leaks in PyModule_Create. | Meador Inge | 2012-07-19 | 1 | -1/+7 |
| | | | | | | | | Patch by Julia Lawall. | ||||
* | | issue 14660: Implement PEP 420, namespace packages. | Eric V. Smith | 2012-05-25 | 1 | -2/+31 |
| | | |||||
* | | Issues #13959, 14647: Re-implement imp.reload() in Lib/imp.py. | Brett Cannon | 2012-04-29 | 1 | -1/+1 |
| | | | | | | | | Thanks to Eric Snow for the patch. | ||||
* | | Rename _Py_identifier to _Py_IDENTIFIER. | Martin v. Löwis | 2011-10-14 | 1 | -1/+1 |
| | | |||||
* | | Use identifier API for PyObject_GetAttrString. | Martin v. Löwis | 2011-10-10 | 1 | -1/+2 |
| | | |||||
* | | Implement PEP 393. | Martin v. Löwis | 2011-09-28 | 1 | -5/+4 |
| | | |||||
* | | indicate return value on __dir__ methods | Benjamin Peterson | 2011-05-24 | 1 | -1/+1 |
| | | |||||
* | | move specialized dir implementations into __dir__ methods (closes #12166) | Benjamin Peterson | 2011-05-24 | 1 | -1/+29 |
| | | |||||
* | | Issue #3080: Add PyModule_NewObject() function | Victor Stinner | 2011-03-04 | 1 | -7/+16 |
| | | |||||
* | | Issue #3080: Add PyModule_GetNameObject() | Victor Stinner | 2011-02-23 | 1 | -14/+29 |
|/ | | | | | repr(module) uses %R to format module name and filenames, instead of '%s' and '%U', so surrogates from undecodable bytes in a filename (PEP 383) are escaped. | ||||
* | #4236: avoid possible Fatal Error when import is called from __del__ | R. David Murray | 2010-12-14 | 1 | -2/+3 |
| | | | | Patch by Simon Cross, crasher test code by Martin von Löwis. | ||||
* | Reverted accidental commit (from r87159) | Alexander Belopolsky | 2010-12-10 | 1 | -17/+3 |
| | |||||
* | Updated UCD version and unicode.org links to Unicode 6.0.0 | Alexander Belopolsky | 2010-12-10 | 1 | -3/+17 |
| | |||||
* | Merge branches/pep-0384. | Martin v. Löwis | 2010-12-03 | 1 | -1/+1 |
| | |||||
* | prefer clearing global objects to obscure module.__dict__ bugs #10068 | Benjamin Peterson | 2010-10-12 | 1 | -4/+1 |
| | |||||
* | Issue #9425: Create PyModule_GetFilenameObject() function | Victor Stinner | 2010-08-17 | 1 | -7/+13 |
| | | | | | | ... to get the filename as a unicode object, instead of a byte string. Function needed to support unencodable filenames. Deprecate PyModule_GetFilename() in favor on the new function. | ||||
* | Issue #9425: Create PyErr_WarnFormat() function | Victor Stinner | 2010-08-13 | 1 | -10/+7 |
| | | | | | | | Similar to PyErr_WarnEx() but use PyUnicode_FromFormatV() to format the warning message. Strip also some trailing spaces. | ||||
* | Issue #6697: Fix a crash if a module attribute name contains a surrogate | Victor Stinner | 2010-05-19 | 1 | -8/+20 |
| | |||||
* | Recorded merge of revisions 81029 via svnmerge from | Antoine Pitrou | 2010-05-09 | 1 | -321/+321 |
| | | | | | | | | | | 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. ........ | ||||
* | module_repr(): use %U to format the file name | Victor Stinner | 2010-05-07 | 1 | -5/+15 |
| | | | | Avoid useless encode/decode of the filename |