Mark Dickinson
9fade768c8
Issue #13863 : fix incorrect .pyc timestamps on Windows / NTFS (apparently due to buggy fstat)
13 years ago
Nick Coghlan
557c76c136
Fix compilation on Windows
13 years ago
Nick Coghlan
34937ce249
Issue #6074 : Forward port Windows read-only source file fix from 2.7
13 years ago
Nick Coghlan
b48c028ca7
Issue #6074 : Restore the long-broken support for running with read-only source files on Windows
13 years ago
Antoine Pitrou
6f430e4963
Issue #15604 : Update uses of PyObject_IsTrue() to check for and handle errors correctly.
Patch by Serhiy Storchaka.
14 years ago
Antoine Pitrou
c5bef75c77
Issue #15604 : Update uses of PyObject_IsTrue() to check for and handle errors correctly.
Patch by Serhiy Storchaka.
14 years ago
Matthias Klose
92636bf243
- Issue #15647 : Make isdir static for windows and posix
14 years ago
Antoine Pitrou
d576c711a5
Issue #14761 : Fix potential leak on an error case in the import machinery.
14 years ago
Antoine Pitrou
284fa08eb7
Issue #14761 : Fix potential leak on an error case in the import machinery.
14 years ago
Gregory P. Smith
a72aa843b6
Fix compiler warning related to issue #14331 . harmless.
14 years ago
Gregory P. Smith
fcdf04becc
Fixes Issue #14331 : Use significantly less stack space when importing modules by
allocating path buffers on the heap instead of the stack.
14 years ago
Gregory P. Smith
c809f98143
Fixes Issue #14331 : Use significantly less stack space when importing modules by
allocating path buffers on the heap instead of the stack.
14 years ago
Jason R. Coombs
0e17dfbdcf
Test in 6c218b9c5c4c was inadvertently converted from #ifdef to #if. Now #ifdef again.
14 years ago
Antoine Pitrou
4f22a8d739
Issue #14084 : Fix a file descriptor leak when importing a module with a bad encoding.
14 years ago
Antoine Pitrou
7214612443
In find_module(), do not silence fileno() and dup() errors.
14 years ago
Antoine Pitrou
33d15f7c85
Port import fixes from 2.7.
14 years ago
Antoine Pitrou
6f25d75f25
Remove debug output, fix assert (hopefully) and exercise signedness issues a bit more.
14 years ago
Antoine Pitrou
b744cef654
Fix temporary debug output (so, time_t is 8 bytes on some Windows builds)
14 years ago
Antoine Pitrou
11cc480ed0
Temporary debug for Windows buildbots.
14 years ago
Antoine Pitrou
0e5fd59a27
Make guard more dynamic (apparently the size of a filesystem timestamp may vary under Windows).
14 years ago
Antoine Pitrou
2be60afb7e
Issue #11235 : Fix OverflowError when trying to import a source file whose modification time doesn't fit in a 32-bit timestamp.
14 years ago
Antoine Pitrou
d1c818a9c0
Issue #11235 : Fix OverflowError when trying to import a source file whose modification time doesn't fit in a 32-bit timestamp.
14 years ago
Antoine Pitrou
6c40eb7f42
Fix the builtin module initialization code to store the init function for future reinitialization.
14 years ago
Jason R. Coombs
0737b7281e
Fix indentation
14 years ago
Jason R. Coombs
fa93cf8e3e
Extracted Windows directory detection from NullImporter.__init__. This greatly simplifies the code and fixes issue6727.
14 years ago
Jason R. Coombs
925ff7495b
Moved directory detection into an isdir function
14 years ago
Victor Stinner
63c22fac72
Issue #7732 : Fix a crash on importing a module if a directory has the same name
than a Python module (e.g. "__init__.py"): don't close the file twice.
PyFile_FromFile() does also close the file if PyString_FromString() failed. It
did already close the file on fill_file_fields() error (e.g. if the file is a
directory).
14 years ago
Victor Stinner
ed36c06f1d
Fix the import machinery if there is an error on sys.path or sys.meta_path
find_module() now raises a RuntimeError, instead of ImportError, on an error on
sys.path or sys.meta_path because load_package() and import_submodule() returns
None and clear the exception if a ImportError occurred.
14 years ago
Victor Stinner
871a0fbf46
Remove unused variable if Python is build without threads
15 years ago
Éric Araujo
5df1108de2
Add signatures to the docstring of functions added to imp by PEP 3147
14 years ago
Antoine Pitrou
8db076cf8a
Issue #10363 : Deallocate global locks in Py_Finalize().
14 years ago
Victor Stinner
53ffdc53bf
Issue #7732 : Don't open a directory as a file anymore while importing a
module. Ignore the direcotry if its name matchs the module name (e.g.
"__init__.py") and raise a ImportError instead.
14 years ago
Victor Stinner
1619132e5d
Fix the import machinery if there is an error on sys.path or sys.meta_path
find_module() now raises a RuntimeError, instead of ImportError, on an error on
sys.path or sys.meta_path because load_package() and import_submodule() returns
None and clear the exception if a ImportError occurred.
14 years ago
Victor Stinner
0af0306396
Remove unused variable if Python is build without threads
15 years ago
Martin v. Löwis
4d0d471a80
Merge branches/pep-0384.
15 years ago
Victor Stinner
ebc0052e3a
import: use PyUnicode_FSConverter to support bytes path and PEP 383
(instead of PyArg_Parse*() with "es" format and Py_FileSystemDefaultEncoding)
15 years ago
Nick Coghlan
b2ddf7979d
Issue #9573 : os.fork now works when triggered as a side effect of import (the wisdom of actually relying on this remains questionable!)
15 years ago
Georg Brandl
e5b99f0fb3
Remove redundant includes of headers that are already included by Python.h.
15 years ago
Victor Stinner
3e2b7171bf
Issue #10359 : Remove ";" after function definition, invalid in ISO C
15 years ago
Victor Stinner
ed7916dd00
find_module(): use FS encoding to display the missing __init__ warning
15 years ago
Victor Stinner
49d3f2514b
_PyImport_FixupExtension() and _PyImport_FindExtension() uses FS encoding
* 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
15 years ago
Benjamin Peterson
294a9fcba6
fix refleak
15 years ago
Victor Stinner
88bd891e6c
Fix imp_cache_from_source(): Decode make_compiled_pathname() result from the
filesystem encoding instead of utf-8.
imp_cache_from_source() encodes the input path to filesystem encoding and this
path is passed to make_compiled_pathname().
15 years ago
Victor Stinner
1a5630326f
imp_load_module() uses PyUnicode_FSConverter() to support surrogates in module
path
15 years ago
Victor Stinner
3ea23ddabf
imp.cache_from_source() uses PyUnicode_FSConverter() to support surrogates in
module path
15 years ago
Victor Stinner
8dbf629bbd
imp.load_dynamic() uses PyUnicode_FSConverter() to support surrogates
in the library path.
15 years ago
Victor Stinner
4e31443c4d
Create fileutils.c/.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
15 years ago
Victor Stinner
beb4135b8c
PyUnicode_AsWideCharString() takes a PyObject*, not a PyUnicodeObject*
All unicode functions uses PyObject* except PyUnicode_AsWideChar(). Fix the
prototype for the new function PyUnicode_AsWideCharString().
15 years ago
Brian Curtin
748cacee46
Remove an unreferenced variable. len is no longer needed.
15 years ago
Victor Stinner
255dfdb5ce
Issue #9979 : Use PyUnicode_AsWideCharString() in import.c
Don't truncate path if it is too long anymore, and allocate fewer memory (but
allocate it on the heap, not on the stack).
15 years ago