Georg Brandl
7004bd1a3d
#10092 : Properly reset locale in Locale*Calendar classes. The context manager was buggy because setlocale() returns the *new* locale, not the old. Also add a test for this.
2010-10-19 18:54:25 +00:00
Alexander Belopolsky
f87cc04481
Fixed the docstring for calendar.isleap() function.
...
Thanks Boštjan Mejak for the patch.
2010-10-19 17:43:50 +00:00
Vinay Sajip
062d56b1f0
logging: Added _logRecordClass, getLogRecordClass, setLogRecordClass to increase flexibility of LogRecord creation.
2010-10-19 15:26:24 +00:00
Senthil Kumaran
7cd94b8aa2
Fix Issue10140 - Tools/scripts/pathfix.py: add option to preserve timestamps
2010-10-19 04:39:35 +00:00
Victor Stinner
e474309bb7
initfsencoding(): get_codeset() failure is now a fatal error
...
Don't fallback to utf-8 anymore to avoid mojibake. I never got any error from
his function.
2010-10-19 00:05:51 +00:00
Victor Stinner
07298a1f04
zipimport: remove arbitrary length limit from message formats
...
PyErr_Format() and PyUnicode_FromFormat() are able to allocate the right buffer
size and to catch memory allocation failures.
2010-10-18 22:45:54 +00:00
Victor Stinner
9e40fad193
zipimport: document archive encoding; fix indentation
2010-10-18 22:34:46 +00:00
Victor Stinner
965a8a1c5b
Revert r85699 and r85701 (zipimport): fullname is a module name, not a path
...
UTF-8 is just fine for module names.
2010-10-18 21:44:33 +00:00
Victor Stinner
8c8ed0a799
zipimport: fix "can't find module ..." error message
...
I cannot use %U: fullname is a bytes object, not an unicode object. %A format
cannot be used, it adds 'b' (bytes) prefix. So create cant_find_module()
function to decode the filename and raise the error message.
2010-10-18 21:21:02 +00:00
Victor Stinner
9a90900da5
PyUnicode_FromFormatV(): Fix %A format
...
It was not completly implemented. Add a test.
2010-10-18 20:59:24 +00:00
Victor Stinner
0410656b30
zipimport: find_module(), is_package() and get_source() supports surrogates
...
Use PyUnicode_FSConverter to support surrogates in the full name.
2010-10-18 20:44:08 +00:00
Victor Stinner
269aeb7c0d
zipimport: pass path size to make_filename()
...
Don't hardcode path size in make_filename().
2010-10-18 20:40:59 +00:00
Barry Warsaw
f040d7de94
One more change for issue 9807, by Matthias Klose.
...
This adds $ABIFLAGS to the static library, since it should match the shared
library name. Also, include the abiflags in python-config --libs.
2010-10-18 17:09:07 +00:00
Alexander Belopolsky
eebccfb10c
Reverted inadvertent change that slipped into r85695
2010-10-18 15:11:33 +00:00
Alexander Belopolsky
4a98e3b6d0
Issue #10117 : Tools/scripts/reindent.py now accepts source files that
...
use encoding other than ASCII or UTF-8. Source encoding is preserved
when reindented code is written to a file.
2010-10-18 14:43:38 +00:00
Georg Brandl
016cec75bd
Fix hash function type.
2010-10-18 12:24:53 +00:00
Victor Stinner
2a94f4c0ef
get_code_from_data() uses the filesystem encoding to encode the module path,
...
instead of utf-8.
2010-10-18 12:15:34 +00:00
Victor Stinner
d36c8217e1
zipimport: read_directory() uses cp437 or utf-8 (in strict mode), depending on
...
the unicode flag, to decode the filename, instead of the filesystem encoding.
Use the same choice than the zipfile module.
2010-10-18 12:13:46 +00:00
Hirokazu Yamamoto
b08820ad40
Issue #5117 : Case normalization was needed on ntpath.relpath(). And
...
fixed root directory issue on posixpath.relpath(). (Ported working fixes
from ntpath)
2010-10-18 12:13:18 +00:00
Victor Stinner
08654e18ee
zipimport: get_module_code() returns modpath as a Unicode object
...
... instead of a char*. Encode the module path to the fileystem encoding
(for PyImport_ExecCodeModuleEx) instead of utf-8.
2010-10-18 12:09:02 +00:00
Victor Stinner
26fabe1369
zipimporter_load_module() doesn't destroy mod on error
...
PyImport_AddModule() returns a borrowed reference. Don't display "import ... #
loaded from Zip ..." on error.
2010-10-18 12:03:25 +00:00
Victor Stinner
72f767e601
zipimport: encode the prefix to the fileystem encoding
2010-10-18 11:44:21 +00:00
Victor Stinner
353349caeb
zipimport, get_module_code(): avoid useless _PyUnicode_AsString()
2010-10-18 11:40:40 +00:00
Victor Stinner
c342fca222
zipimport: fix indentation
2010-10-18 11:39:05 +00:00
Georg Brandl
f038b32d0b
Remove more unneeded casts to hashfunc.
2010-10-18 07:35:09 +00:00
Georg Brandl
00da4e0b5a
Remove unneeded casts to hashfunc.
2010-10-18 07:32:48 +00:00
Georg Brandl
d49bf5e8a5
Fix type of hash function.
2010-10-18 07:30:06 +00:00
Georg Brandl
646fdd6c61
Fix compiler warning about unused static function.
2010-10-18 07:27:55 +00:00
Georg Brandl
c7f4af4cbe
Fix compiler warnings about formatting pid_t as an int, by always casting to long.
2010-10-18 05:06:18 +00:00
R. David Murray
e194dd60f0
#678250 : Make mmap flush a noop on ACCESS_READ and ACCESS_COPY.
...
Patch by Sébastien Sablé. This solves a test_mmap failure on AIX.
2010-10-18 01:14:06 +00:00
R. David Murray
051176fde8
#4499 : silence compiler warning on AIX.
...
Patch from ActiveState.
2010-10-18 00:15:31 +00:00
R. David Murray
7cefc30d34
Tighten up 'byte string' wording in base64 docs.
2010-10-17 23:12:16 +00:00
R. David Murray
a90032a3fb
#1343 : Add short_empty_elements option to XMLGenerator.
...
Patch and tests by Neil Muller.
2010-10-17 22:46:45 +00:00
Skip Montanaro
961aaf5cfa
Note the resolution of issue 9778.
2010-10-17 22:22:24 +00:00
Benjamin Peterson
e7dfeeb889
-1 is reserved for errors
2010-10-17 21:27:01 +00:00
Benjamin Peterson
e6baa46aab
fix prototype
2010-10-17 21:20:58 +00:00
Benjamin Peterson
223f091737
fix strict aliasing warnings
2010-10-17 21:12:18 +00:00
Benjamin Peterson
8f67d0893f
make hashes always the size of pointers; introduce Py_hash_t #9778
2010-10-17 20:54:53 +00:00
Victor Stinner
6fb457526c
test_httpservers: Python CGI scripts have to be encoded to utf-8
...
And not the locale encoding. With this commit, the test finally pass on Windows
with a non-ascii path :-)
2010-10-17 20:17:41 +00:00
Victor Stinner
3218c31429
test_httpservers: Fix skip test check, the python executable path have to be
...
encodable to utf-8, not to the file1 encoding.
2010-10-17 20:13:36 +00:00
Benjamin Peterson
23d05c1d98
use helper hash unimplemented function
2010-10-17 20:13:05 +00:00
Martin v. Löwis
a2e7d9bdc1
Fix T_BOOL bug of issue 8845.
2010-10-17 19:48:29 +00:00
Victor Stinner
0b0ca0c37e
test_httpservers: skip CGI tests if Python executable path is not encodable
2010-10-17 19:46:36 +00:00
Gregory P. Smith
3ebc22a628
Remove the external non-python.org hyperlink and point people to
...
Tools/gdb/libpython.py.
2010-10-17 19:40:59 +00:00
Martin v. Löwis
c980ffde14
Drop OPT:Olimit, as it confuses SunPRO (and other compilers).
2010-10-17 19:36:54 +00:00
Victor Stinner
6ffbee77dc
libpython: implementation of os.fsencode() with surrogateescape error handler
2010-10-17 19:35:30 +00:00
Victor Stinner
e0f3268715
run_file(): encode the filename with PyUnicode_EncodeFSDefault() instead of
...
PyUnicode_AsUTF8String()
2010-10-17 19:34:51 +00:00
Victor Stinner
c049982ea5
compiler_error(): use PyUnicode_DecodeFSDefault() to decode the filename,
...
instead of utf-8 in strict mode.
2010-10-17 19:16:33 +00:00
Victor Stinner
15a71cdad2
PyErr_SyntaxLocationEx() uses PyUnicode_DecodeFSDefault(), instead of
...
PyUnicode_FromString(), to decode the filename.
2010-10-17 19:03:16 +00:00
Gregory P. Smith
5b5d8d58c7
The py_decref macro was incorrect and unnecessary.
2010-10-17 18:59:56 +00:00