Commit Graph

3067 Commits

Author SHA1 Message Date
Martin v. Löwis 5ea823cf55 Decode NIS data to fs encoding, using the surrogate error handler. 2010-08-19 09:11:51 +00:00
Victor Stinner e8d5145e18 Create os.fsdecode(): decode from the filesystem encoding with surrogateescape
error handler, or strict error handler on Windows.

 * Rewrite os.fsencode() documentation
 * Improve os.fsencode and os.fsdecode() tests using the new PYTHONFSENCODING
   environment variable
2010-08-19 01:05:19 +00:00
Andrew M. Kuchling 4ea04a306f #7647: add ST_RDONLY, ST_NOSUID constants to os module.
(Also fix a name ordering in the ACKS file.)
2010-08-18 22:30:34 +00:00
Victor Stinner 94908bbc15 Issue #8622: Add PYTHONFSENCODING environment variable to override the
filesystem encoding.

initfsencoding() displays also a better error message if get_codeset() failed.
2010-08-18 21:23:25 +00:00
Antoine Pitrou b85e165635 Issue #5737: Add Solaris-specific mnemonics in the errno module. Patch by
Matthew Ahrens.
2010-08-18 21:05:19 +00:00
Amaury Forgeot d'Arc 324ac65ceb #5127: Even on narrow unicode builds, the C functions that access the Unicode
Database (Py_UNICODE_TOLOWER, Py_UNICODE_ISDECIMAL, and others) now accept
and return characters from the full Unicode range (Py_UCS4).

The differences from Python code are few:
- unicodedata.numeric(), unicodedata.decimal() and unicodedata.digit()
  now return the correct value for large code points
- repr() may consider more characters as printable.
2010-08-18 20:44:58 +00:00
Martin v. Löwis dfaf9ec93a Restore GIL in nis_cat in case of error. 2010-08-18 16:12:23 +00:00
Victor Stinner 6c00c1464f Issue #9425: Create PyModule_GetFilenameObject() function
... 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.
2010-08-17 23:37:11 +00:00
Victor Stinner 6961bd690e Issue #8063: Call _PyGILState_Init() earlier in Py_InitializeEx(). 2010-08-17 22:26:51 +00:00
Antoine Pitrou 79c5ef11d5 Issue #3488: Provide convenient shorthand functions `gzip.compress`
and `gzip.decompress`.  Original patch by Anand B. Pillai.
2010-08-17 21:10:05 +00:00
Antoine Pitrou 671b4d948e Issue #9612: The set object is now 64-bit clean under Windows. 2010-08-17 17:55:07 +00:00
Giampaolo Rodolà 42382fedcc fix issue #8807: adds a context parameter to POP3_SSL class. 2010-08-17 16:09:53 +00:00
Giampaolo Rodolà ccfb91c89f fix issue #8866: parameters passed to socket.getaddrinfo can now be specified as single keyword arguments. 2010-08-17 15:30:23 +00:00
Nick Coghlan d26c18adcc Issue #8202: Set sys.argv[0] to -m rather than -c while searching for the module to execute. Also updates all the cmd_line_script tests to validate the setting of sys.path[0] and the current working directory 2010-08-17 13:06:11 +00:00
Nick Coghlan 09c8123e6f Address XXX comment in dis.py: inspect.py now attempts to reuse the dis.py compiler flag values before resorting to defining its own 2010-08-17 10:18:16 +00:00
Nick Coghlan eae2da1da7 Issue 9147: Add dis.code_info() 2010-08-17 08:03:36 +00:00
Nick Coghlan 9887683f74 Document and test the resolution of issue 3445 (tolerate missing attributes in functools.update_wrapper, previously implemented as a side effect of the __annotations__ copying patch) and implement issue 9567 (add a __wrapped__ attribute when using update_wrapper) 2010-08-17 06:17:18 +00:00
Nick Coghlan 632a0c1476 Remove some lingering remnants of the short-lived functools.lfu_cache 2010-08-17 05:22:50 +00:00
Benjamin Peterson 45c257f193 add support for abstract class and static methods #5867 2010-08-17 00:52:52 +00:00
Alexander Belopolsky e29e6bffb5 Issue #665761: functools.reduce() will no longer mask exceptions other
than TypeError raised by the iterator argument.  Also added a test to
check that zip() already behaves similarly.
2010-08-16 18:55:46 +00:00
Victor Stinner 79766636b6 Issue #9599: Create PySys_FormatStdout() and PySys_FormatStderr()
Write a message formatted by PyUnicode_FromFormatV() to sys.stdout and
sys.stderr.
2010-08-16 17:36:42 +00:00
Martin v. Löwis 907229af87 Don't run pgen twice when using make -j. 2010-08-15 15:47:25 +00:00
Victor Stinner d17f219759 Oops, fix a typo in NEWS: surrogateespace => surrogateescape 2010-08-15 09:56:07 +00:00
Victor Stinner e039ffe41d Issue #9605: posix.getlogin() decodes the username with file filesystem
encoding and surrogateescape error handler. Patch written by David Watson.

Reindent also posix_getlogin(), and fix a typo in the NEWS file.
2010-08-15 09:33:08 +00:00
Victor Stinner 61ec5dca2b Issue #9604: posix.initgroups() encodes the username using the fileystem
encoding and surrogateescape error handler. Patch written by David Watson.
2010-08-15 09:22:44 +00:00
Victor Stinner 5fe6de8c72 Issue #9603: posix.ttyname() and posix.ctermid() decode the terminal name
using the filesystem encoding and surrogateescape error handler. Patch
written by David Watson.
2010-08-15 09:12:51 +00:00
Florent Xicluna 09245d8682 List Misc/python-config.in in Misc/README. Fix few typos. 2010-08-14 16:56:27 +00:00
Giampaolo Rodolà 419f704d76 fix issue #8857: provide a test case for socket.getaddrinfo 2010-08-14 16:45:41 +00:00
Georg Brandl cc5943d36b Fix format. 2010-08-14 15:57:20 +00:00
Georg Brandl 9427dcfc31 Typo fix. 2010-08-14 15:46:59 +00:00
Éric Araujo a85e2175bb Manually merge r83995: Fix version{added,changed} and spacing in NEWS 2010-08-14 03:59:54 +00:00
Éric Araujo da668ff24f Use a marker in generated MANIFEST files, don't touch files without it. Fixes #8688. 2010-08-14 02:30:34 +00:00
Victor Stinner 47fcb5b4c3 Issue #9542: Create PyUnicode_FSDecoder() function
It's a ParseTuple converter: decode bytes objects to unicode using
PyUnicode_DecodeFSDefaultAndSize(); str objects are output as-is.

 * Don't specify surrogateescape error handler in the comments nor the
   documentation, but PyUnicode_DecodeFSDefaultAndSize() and
   PyUnicode_EncodeFSDefault() because these functions use strict error handler
   for the mbcs encoding (on Windows).
 * Remove PyUnicode_FSConverter() comment in unicodeobject.c to avoid
   inconsistency with unicodeobject.h.
2010-08-13 23:59:58 +00:00
Antoine Pitrou 042b128f58 Issue #9203: Computed gotos are now enabled by default on supported
compilers (which are detected by the configure script).  They can still
be disable selectively by specifying --without-computed-gotos.
2010-08-13 21:15:58 +00:00
Antoine Pitrou 3060c4573f Reapply r83877. 2010-08-13 16:27:38 +00:00
Victor Stinner 4a2b7a1b14 Issue #9425: Create PyErr_WarnFormat() function
Similar to PyErr_WarnEx() but use PyUnicode_FromFormatV() to format the warning
message.

Strip also some trailing spaces.
2010-08-13 14:03:48 +00:00
Antoine Pitrou 3e2eab19b9 Typo. 2010-08-12 15:15:01 +00:00
Antoine Pitrou 7c8bcb6f92 Issue #7467: when a file from a ZIP archive, its CRC is checked and a
BadZipfile error is raised if it doesn't match (as used to be the
case in Python 2.5 and earlier).
2010-08-12 15:11:50 +00:00
Benjamin Peterson d4efbf90d2 use pep 383 decoding for mknod and mkfifo #9570
Patch by David Watson.
2010-08-11 19:20:42 +00:00
Alexander Belopolsky f0f45142d5 Issue #2443: Added a new macro, Py_VA_COPY, which is equivalent to C99
va_copy, but available on all python platforms.  Untabified a few
unrelated files.
2010-08-11 17:31:17 +00:00
Antoine Pitrou 32cfedeb1c Issue #9550: a BufferedReader could issue an additional read when the
original read request had been satisfied, which can block indefinitely
when the underlying raw IO channel is e.g. a socket.  Report and original
patch by Jason V. Miller.
2010-08-11 13:31:33 +00:00
Antoine Pitrou b73caab436 Issue #6915: Under Windows, os.listdir() didn't release the Global
Interpreter Lock around all system calls.  Original patch by Ryan Kelly.
2010-08-09 23:39:31 +00:00
Antoine Pitrou 5af4f4b983 Issue #3757: thread-local objects now support cyclic garbage collection.
Thread-local objects involved in reference cycles will be deallocated
timely by the cyclic GC, even if the underlying thread is still running.
2010-08-09 22:38:19 +00:00
Antoine Pitrou 6e451df800 Followup to r83869 and issue #8524: rename socket.forget() to socket.detach()
and make it return the file descriptor.
2010-08-09 20:39:54 +00:00
Fred Drake a492362f9a issue #9452:
Add read_file, read_string, and read_dict to the configparser API;
new source attribute to exceptions.
2010-08-09 12:52:45 +00:00
Florent Xicluna c7eaede21e Fix ``Tools/scripts/checkpyc.py`` after PEP 3147. 2010-08-09 12:26:44 +00:00
Antoine Pitrou aba74bddd6 Revert r83877 in order to fix compilation 2010-08-09 10:47:46 +00:00
Senthil Kumaran 9f347ea545 reapply the revert made in r83875
Now the _collections is statically built, the build dependencies are in proper
order and build works fine.

Commit Log from r83874:
Issue 9396.   Apply functools.lru_cache in the place of the
random flushing cache in the re module.
2010-08-09 07:30:53 +00:00
Raymond Hettinger 31022301b5 Revert 83784 adding functools.lru_cache() to the re module.
The problem is that the re module is imported by sysconfig
and re needs functools which uses collections.OrderedDict()
but the _collectionsmodule.c code is not yet constructed
at this point in the build.

The likely best solution will be to include _collections
as part of the static build before the rest of the
boot-strapping.
2010-08-09 05:56:50 +00:00
Raymond Hettinger 4f859ed9c7 Issue 9396. Apply functools.lru_cache in the place of the
random flushing cache in the re module.
2010-08-09 04:24:42 +00:00