Victor Stinner
cc9564ecd8
Issue #3080 : Fix call to case_ok() in find_init_module()
15 years ago
Victor Stinner
1304f2d8a3
Issue #3080 : Fix case_ok() using case_bytes()
Invert name and namelen arguments.
15 years ago
Victor Stinner
fe93faf98c
Issue #3080 : Add PyImport_ImportModuleLevelObject() function
Use it for the builtin __import__ function.
15 years ago
Victor Stinner
98dbba5d20
Issue #3080 : Use repr() to format the module name on error
15 years ago
Victor Stinner
ccbf475dfd
Fix imp.cache_from_source() if the directory name contains a dot
If the directory name contains a dot but not the filename, don't strip at the
dot.
15 years ago
Victor Stinner
fe19d21815
Issue #3080 : imp.new_module() uses Unicode
15 years ago
Victor Stinner
2fd76e478f
Issue #3080 : find_module() returns the path as Unicode
15 years ago
Victor Stinner
c9a271cf2b
Issue #3080 : case_ok() expects Unicode strings
15 years ago
Victor Stinner
547a2a6d52
Issue #3080 : find_init_module() expects Unicode
15 years ago
Victor Stinner
d029621c70
Issue #3080 : Refactor find_module_path(), use return instead of break
Prepare also the API change of case_ok()
15 years ago
Victor Stinner
df75a023a0
Issue #3080 : find_module() sets an empty path for builtin and frozen modules
15 years ago
Victor Stinner
533d78399f
Issue #3080 : Rename some path variables to path_list
15 years ago
Victor Stinner
ad3c03b23e
Issue #3080 : find_module() expects module fullname and subname as Unicode
And PyImport_ReloadModule() uses Unicode for the module name.
15 years ago
Victor Stinner
58d37112ae
Issue #3080 : Drop OS/2 support for the import machinery
Sorry Andrew I MacIntyre!
15 years ago
Victor Stinner
9599de5110
Issue #3080 : Reindent and simplify import_submodule()
15 years ago
Victor Stinner
c24c8108b6
Issue #3080 : Use %R to format module name in error messages
%R format instead of %U
15 years ago
Victor Stinner
974389d92c
Issue #3080 : Use Unicode for the "The Magnum Opus of dotted-name import"
Use Unicode for module name and paths in the following functions:
* PyImport_ImportModuleLevel()
* add_submodule()
* ensure_from_list()
* get_parent()
* import_module_level()
* import_submodule()
* load_next()
* mark_miss()
15 years ago
Victor Stinner
2e5f11aaa4
Issue #3080 : PyImport_ImportModuleNoBlock() uses Unicode
15 years ago
Victor Stinner
41c5fecce0
Issue #3080 : load_module() expects name and path as Unicode
15 years ago
Victor Stinner
2f42ae53aa
Issue #3080 : Use Unicode to import source and compiled modules
* Use Unicode for module name and path in the following functions:
* get_file()
* load_source_module(), parse_source_module()
* make_compiled_pathname(), check_compiled_module(),
read_compiled_module(), load_compiled_module(), write_compiled_module(),
update_compiled_module()
* On Windows, use CreateDirectoryW() instead of mkdir()
* update_compiled_module() cannot fail anymore
15 years ago
Victor Stinner
c9abda0c04
Issue #3080 : get_sourcefile(), make_source_pathname(), load_package()
Use Unicode for module name and path in get_sourcefile(),
make_source_pathname() and load_package() functions.
15 years ago
Victor Stinner
d68c2cf237
Issue #3080 : Create find_module_path() subfunction
15 years ago
Victor Stinner
3758028299
Issue #3080 : Create find_module_path_list() subfunction
15 years ago
Victor Stinner
c696316466
Issue #3080 : Remove useless name buffer from find_module()
Rename subname argument to name, and mark it as constant.
15 years ago
Victor Stinner
7d8b77c2aa
Issue #3080 : find_module() initialize buf and *p_fp
Document also the find_module() function
15 years ago
Victor Stinner
fefd70c40d
Issue #3080 : _PyImport_LoadDynamicModule() uses Unicode for name and path
Document also that dynamic module names are ASCII only
15 years ago
Victor Stinner
4d6c1c476a
Issue #3080 : _PyWin_FindRegisteredModule() returns the path as Unicode
* Document the function
* Use RegQueryValueW() instead of RegQueryValueA()
* Use _Py_fopen() instead of fopen()
* Allocate registry key on the heap, not on the stack, and handle memory
allocation failure
* Handle Python exception in find_module()
15 years ago
Victor Stinner
21fcd0c9af
Issue #3080 : Use PyUnicode_InternFromString() for builtins
_PyImport_FixupBuiltin() and _PyImport_FindBuiltin() use
PyUnicode_InternFromString() instead of PyUnicode_FromString().
15 years ago
Victor Stinner
9587286f98
Issue #3080 : Import builtins using Unicode strings
- is_builtin(), init_builtin(), load_builtin() and other builtin related
functions use Unicode strings, instead of byte strings
- Rename _PyImport_FixupExtensionUnicode() to _PyImport_FixupExtensionObject()
- Rename _PyImport_FindExtensionUnicode() to _PyImport_FindExtensionObject()
15 years ago
Victor Stinner
53dc735168
Issue #3080 : Add PyImport_ImportFrozenModuleObject()
find_frozen(), get_frozen_object(), is_frozen_package() and other functions
related to frozen modules use Unicode strings instead of byte strings.
15 years ago
Victor Stinner
9464d61cba
Issue #3080 : PyImport_Cleanup() uses Unicode
Replace strcmp() by PyUnicode_CompareWithASCIIString()
15 years ago
Victor Stinner
942003ccf9
import.c: replace tab by spaces
15 years ago
Victor Stinner
27ee089c35
Issue #3080 : Add PyImport_AddModuleObject() and PyImport_ExecCodeModuleObject()
15 years ago
Victor Stinner
501c09a754
Issue #3080 : Mark _PyImport_FindBuiltin() argument as constant
And as a consequence, mark also name argument of
_PyImport_FindExtensionUnicode() constant too. But I plan to change this
argument type to PyObject* later.
16 years ago
Victor Stinner
9b99b448f7
Issue #3080 : Mark PyWin_FindRegisteredModule() as private
This function was not declared in Python public API (in any .h file) and not
documented. Mark it as private to prepare a change of its API.
16 years ago
Martin v. Löwis
4d0d471a80
Merge branches/pep-0384.
16 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)
16 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!)
16 years ago
Georg Brandl
e5b99f0fb3
Remove redundant includes of headers that are already included by Python.h.
16 years ago
Victor Stinner
3e2b7171bf
Issue #10359 : Remove ";" after function definition, invalid in ISO C
16 years ago
Victor Stinner
ed7916dd00
find_module(): use FS encoding to display the missing __init__ warning
16 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
16 years ago
Benjamin Peterson
294a9fcba6
fix refleak
16 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().
16 years ago
Victor Stinner
1a5630326f
imp_load_module() uses PyUnicode_FSConverter() to support surrogates in module
path
16 years ago
Victor Stinner
3ea23ddabf
imp.cache_from_source() uses PyUnicode_FSConverter() to support surrogates in
module path
16 years ago
Victor Stinner
8dbf629bbd
imp.load_dynamic() uses PyUnicode_FSConverter() to support surrogates
in the library path.
16 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
16 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().
16 years ago
Brian Curtin
748cacee46
Remove an unreferenced variable. len is no longer needed.
16 years ago