summaryrefslogtreecommitdiff
path: root/Objects/moduleobject.c
Commit message (Collapse)AuthorAgeFilesLines
* Issue #28748: Private variable _Py_PackageContext is now of type "const char *"Serhiy Storchaka2016-11-211-1/+1
| | | | rather of "char *".
* Added the const qualifier to char* variables that refer to readonly internalSerhiy Storchaka2016-11-201-2/+2
| | | | UTF-8 represenatation of Unicode objects.
* Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSizeSerhiy Storchaka2016-11-201-4/+4
| | | | with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
* Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-161-1/+1
|\ | | | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
| * Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-161-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 Storchaka2016-09-261-1/+1
| | | | | | | | Patch by Xiang Zhang.
* | Merge #27782 fix from 3.5Nick Coghlan2016-08-211-29/+35
|\ \ | |/
| * Issue #27782: Fix m_methods handling in multiphase initNick Coghlan2016-08-211-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_GetDictBerker Peksag2016-08-191-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 Storchaka2016-04-061-1/+1
|
* Issue #20440: Massive replacing unsafe attribute setting code with specialSerhiy Storchaka2015-12-241-2/+1
| | | | macro Py_SETREF.
* Issue #24268: Address some PEP 489 refleaksNick Coghlan2015-05-241-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 initializationNick Coghlan2015-05-231-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 Storchaka2015-03-181-1/+1
|
* sprinkle some _PyId goodness around moduleobject.cBenjamin Peterson2014-04-241-9/+19
|
* do not override errors from descriptors on modulesBenjamin Peterson2014-04-241-10/+9
|
* Issue8297: module attribute lookup failures now include module name in error ↵Ethan Furman2014-04-241-2/+26
| | | | message.
* Issue #19255: Clear error after failed PyDict_SetItem() on shutdown.Serhiy Storchaka2014-02-121-2/+4
| | | | This silences a Coverity complain.
* Issue #19255: The builtins module is restored to initial value beforeSerhiy Storchaka2014-02-101-5/+8
| | | | cleaning other modules. The sys and builtins modules are cleaned last.
* Implement PEP 451 (ModuleSpec).Eric Snow2013-11-221-48/+5
|
* Issue #18214: Improve finalization of Python modules to avoid setting their ↵Antoine Pitrou2013-07-311-8/+21
| | | | globals to None, in most cases.
* #17115,17116: Have modules initialize the __package__ and __loader__Brett Cannon2013-05-041-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 Inge2012-07-191-1/+7
|\ | | | | | | Patch by Julia Lawall.
| * Issue #15394: Fix ref leaks in PyModule_Create.Meador Inge2012-07-191-1/+7
| | | | | | | | Patch by Julia Lawall.
* | issue 14660: Implement PEP 420, namespace packages.Eric V. Smith2012-05-241-2/+31
| |
* | Issues #13959, 14647: Re-implement imp.reload() in Lib/imp.py.Brett Cannon2012-04-291-1/+1
| | | | | | | | Thanks to Eric Snow for the patch.
* | Rename _Py_identifier to _Py_IDENTIFIER.Martin v. Löwis2011-10-141-1/+1
| |
* | Use identifier API for PyObject_GetAttrString.Martin v. Löwis2011-10-101-1/+2
| |
* | Implement PEP 393.Martin v. Löwis2011-09-281-5/+4
| |
* | indicate return value on __dir__ methodsBenjamin Peterson2011-05-241-1/+1
| |
* | move specialized dir implementations into __dir__ methods (closes #12166)Benjamin Peterson2011-05-241-1/+29
| |
* | Issue #3080: Add PyModule_NewObject() functionVictor Stinner2011-03-041-7/+16
| |
* | Issue #3080: Add PyModule_GetNameObject()Victor Stinner2011-02-231-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 Murray2010-12-141-2/+3
| | | | Patch by Simon Cross, crasher test code by Martin von Löwis.
* Reverted accidental commit (from r87159)Alexander Belopolsky2010-12-101-17/+3
|
* Updated UCD version and unicode.org links to Unicode 6.0.0Alexander Belopolsky2010-12-101-3/+17
|
* Merge branches/pep-0384.Martin v. Löwis2010-12-031-1/+1
|
* prefer clearing global objects to obscure module.__dict__ bugs #10068Benjamin Peterson2010-10-121-4/+1
|
* Issue #9425: Create PyModule_GetFilenameObject() functionVictor Stinner2010-08-171-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() functionVictor Stinner2010-08-131-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 surrogateVictor Stinner2010-05-191-8/+20
|
* Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-091-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 nameVictor Stinner2010-05-071-5/+15
| | | | Avoid useless encode/decode of the filename
* Merged revisions ↵Benjamin Peterson2009-11-131-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 75149,75260-75263,75265-75267,75292,75300,75376,75405,75429-75433,75437,75445,75501,75551,75572,75589-75591,75657,75742,75868,75952-75957,76057,76105,76139,76143,76162,76223 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r75149 | gregory.p.smith | 2009-09-29 16:56:31 -0500 (Tue, 29 Sep 2009) | 3 lines Mention issue6972 in extractall docs about overwriting things outside of the supplied path. ........ r75260 | andrew.kuchling | 2009-10-05 16:24:20 -0500 (Mon, 05 Oct 2009) | 1 line Wording fix ........ r75261 | andrew.kuchling | 2009-10-05 16:24:35 -0500 (Mon, 05 Oct 2009) | 1 line Fix narkup ........ r75262 | andrew.kuchling | 2009-10-05 16:25:03 -0500 (Mon, 05 Oct 2009) | 1 line Document 'skip' parameter to constructor ........ r75263 | andrew.kuchling | 2009-10-05 16:25:35 -0500 (Mon, 05 Oct 2009) | 1 line Note side benefit of socket.create_connection() ........ r75265 | andrew.kuchling | 2009-10-05 17:31:11 -0500 (Mon, 05 Oct 2009) | 1 line Reword sentence ........ r75266 | andrew.kuchling | 2009-10-05 17:32:48 -0500 (Mon, 05 Oct 2009) | 1 line Use standard comma punctuation; reword some sentences in the docs ........ r75267 | andrew.kuchling | 2009-10-05 17:42:56 -0500 (Mon, 05 Oct 2009) | 1 line Backport r73983: Document the thousands separator. ........ r75292 | benjamin.peterson | 2009-10-08 22:11:36 -0500 (Thu, 08 Oct 2009) | 1 line death to old CVS keyword ........ r75300 | benjamin.peterson | 2009-10-09 16:48:14 -0500 (Fri, 09 Oct 2009) | 1 line fix some coding style ........ r75376 | benjamin.peterson | 2009-10-11 20:26:07 -0500 (Sun, 11 Oct 2009) | 1 line platform we don't care about ........ r75405 | neil.schemenauer | 2009-10-14 12:17:14 -0500 (Wed, 14 Oct 2009) | 4 lines Issue #1754094: Improve the stack depth calculation in the compiler. There should be no other effect than a small decrease in memory use. Patch by Christopher Tur Lesniewski-Laas. ........ r75429 | benjamin.peterson | 2009-10-14 20:47:28 -0500 (Wed, 14 Oct 2009) | 1 line pep8ify if blocks ........ r75430 | benjamin.peterson | 2009-10-14 20:49:37 -0500 (Wed, 14 Oct 2009) | 1 line use floor division and add a test that exercises the tabsize codepath ........ r75431 | benjamin.peterson | 2009-10-14 20:56:25 -0500 (Wed, 14 Oct 2009) | 1 line change test to what I intended ........ r75432 | benjamin.peterson | 2009-10-14 22:05:39 -0500 (Wed, 14 Oct 2009) | 1 line some cleanups ........ r75433 | benjamin.peterson | 2009-10-14 22:06:55 -0500 (Wed, 14 Oct 2009) | 1 line make inspect.isabstract() always return a boolean; add a test for it, too #7069 ........ r75437 | benjamin.peterson | 2009-10-15 10:44:46 -0500 (Thu, 15 Oct 2009) | 1 line only clear a module's __dict__ if the module is the only one with a reference to it #7140 ........ r75445 | vinay.sajip | 2009-10-16 09:06:44 -0500 (Fri, 16 Oct 2009) | 1 line Issue #7120: logging: Removed import of multiprocessing which is causing crash in GAE. ........ r75501 | antoine.pitrou | 2009-10-18 13:37:11 -0500 (Sun, 18 Oct 2009) | 3 lines Add a comment about unreachable code, and fix a typo ........ r75551 | benjamin.peterson | 2009-10-19 22:14:10 -0500 (Mon, 19 Oct 2009) | 1 line use property api ........ r75572 | benjamin.peterson | 2009-10-20 16:55:17 -0500 (Tue, 20 Oct 2009) | 1 line clarify buffer arg #7178 ........ r75589 | benjamin.peterson | 2009-10-21 21:26:47 -0500 (Wed, 21 Oct 2009) | 1 line whitespace ........ r75590 | benjamin.peterson | 2009-10-21 21:36:47 -0500 (Wed, 21 Oct 2009) | 1 line rewrite to be nice to other implementations ........ r75591 | benjamin.peterson | 2009-10-21 21:50:38 -0500 (Wed, 21 Oct 2009) | 4 lines rewrite for style, clarify, and comments Also, use the hasattr() like scheme of allowing BaseException exceptions through. ........ r75657 | antoine.pitrou | 2009-10-24 07:41:27 -0500 (Sat, 24 Oct 2009) | 3 lines Fix compilation error in debug mode. ........ r75742 | benjamin.peterson | 2009-10-26 17:51:16 -0500 (Mon, 26 Oct 2009) | 1 line use 'is' instead of id() ........ r75868 | benjamin.peterson | 2009-10-27 15:59:18 -0500 (Tue, 27 Oct 2009) | 1 line test expect base classes ........ r75952 | georg.brandl | 2009-10-29 15:38:32 -0500 (Thu, 29 Oct 2009) | 1 line Use the correct function name in docstring. ........ r75953 | georg.brandl | 2009-10-29 15:39:50 -0500 (Thu, 29 Oct 2009) | 1 line Remove mention of the old -X command line switch. ........ r75954 | georg.brandl | 2009-10-29 15:53:00 -0500 (Thu, 29 Oct 2009) | 1 line Use constants instead of magic integers for test result. Do not re-run with --verbose3 for environment changing tests. ........ r75955 | georg.brandl | 2009-10-29 15:54:03 -0500 (Thu, 29 Oct 2009) | 1 line Use a single style for all the docstrings in the math module. ........ r75956 | georg.brandl | 2009-10-29 16:16:34 -0500 (Thu, 29 Oct 2009) | 1 line I do not think the "railroad" program mentioned is still available. ........ r75957 | georg.brandl | 2009-10-29 16:44:56 -0500 (Thu, 29 Oct 2009) | 1 line Fix constant name. ........ r76057 | benjamin.peterson | 2009-11-02 09:06:45 -0600 (Mon, 02 Nov 2009) | 1 line prevent a rather unlikely segfault ........ r76105 | georg.brandl | 2009-11-04 01:38:12 -0600 (Wed, 04 Nov 2009) | 1 line #7259: show correct equivalent for operator.i* operations in docstring; fix minor issues in operator docs. ........ r76139 | benjamin.peterson | 2009-11-06 19:04:38 -0600 (Fri, 06 Nov 2009) | 1 line spelling ........ r76143 | georg.brandl | 2009-11-07 02:26:07 -0600 (Sat, 07 Nov 2009) | 1 line #7271: fix typo. ........ r76162 | benjamin.peterson | 2009-11-08 22:10:53 -0600 (Sun, 08 Nov 2009) | 1 line discuss how to use -p ........ r76223 | georg.brandl | 2009-11-12 02:29:46 -0600 (Thu, 12 Nov 2009) | 1 line Give the profile module a module directive. ........
* Issue #1717: rename tp_compare to tp_reserved. I'll change theMark Dickinson2009-02-021-1/+1
| | | | | type of tp_compare in a separate commit, for ease of reversion should things go wrong.
* Issue #4838: When a module is deallocated, free the memory backing the ↵Antoine Pitrou2009-01-171-0/+2
| | | | optional module state data.
* Remove traces of Py_InitModule*.Georg Brandl2009-01-021-2/+2
|
* Issue #3740: Null-initialize module state.Martin v. Löwis2008-10-071-0/+1
| | | | Reviewed by Benjamin Peterson.
* Rename PyUnicode_AsString -> _PyUnicode_AsString andMarc-André Lemburg2008-08-071-4/+4
| | | | | | | | | PyUnicode_AsStringAndSize -> _PyUnicode_AsStringAndSize to mark them for interpreter internal use only. We'll have to rework these APIs or create new ones for the purpose of accessing the UTF-8 representation of Unicode objects for 3.1.
* Implement PEP 3121: new module initialization and finalization API.Martin v. Löwis2008-06-111-4/+155
|