Commit graph

610 commits

Author SHA1 Message Date
Victor Stinner
beac78bb24 Use PyUnicode_AsUnicodeAndSize() instead of PyUnicode_GET_SIZE() 2011-10-11 21:55:01 +02:00
Martin v. Löwis
1ee1b6fe0d Use identifier API for PyObject_GetAttrString. 2011-10-10 18:11:30 +02:00
Victor Stinner
034f6cf10c Add PyUnicode_Copy() function, include it to the public API 2011-09-30 02:26:44 +02:00
Victor Stinner
eb5657a0c5 posix module catches PyUnicode_AsUnicode() failure
* Replace PyUnicode_AS_UNICODE by PyUnicode_AsUnicode, PyUnicode_AS_UNICODE is
   no more a real macro
 * Replace Py_UNICODE by wchar_t in code specific to Windows
2011-09-30 01:44:27 +02:00
Victor Stinner
639418812f Use the new Py_ARRAY_LENGTH macro 2011-09-29 00:42:28 +02:00
Victor Stinner
6fa6777503 os.statvfs() encodes the filename to the filesystem encoding 2011-09-20 04:04:33 +02:00
Ross Lagerwall
b1e5d595af Issue #12517: Silence warning on windows buildbots (from 7fd80c61ddaa). 2011-09-19 08:30:43 +02:00
Benjamin Peterson
9428d53eb4 only compile xattrs on glibc (closes #12720) 2011-09-14 11:45:52 -04:00
Benjamin Peterson
b77fe17320 Use xattr functions from sys/xattr.h instead of attr/xattr.h (closes #12720)
sys/xattr.h is glibc while attr/xattr.h is a separate library.
2011-09-13 17:20:47 -04:00
Jesus Cea
54b01498e3 Typo 2011-09-10 01:53:19 +02:00
Jesus Cea
9c82227277 Yet another fix for #12763: test_posix failure on OpenIndiana 2011-09-10 01:40:52 +02:00
Jesus Cea
f2cb4e8b35 Close issue 12952: Solaris/Illumos (OpenIndiana) Scheduling policies 2011-09-09 23:55:42 +02:00
Larry Hastings
9e3e70b331 Issue #12904: os.utime, os.futimes, os.lutimes, and os.futimesat now write
atime and mtime with nanosecond precision on modern POSIX platforms.
2011-09-08 19:29:07 -07:00
Charles-François Natali
ea0d5fcb4a Issue #12871: sched_get_priority_(min|max) might not be defined even though
<sched.h> is available (most notably on OpenBSD when built without pthread):
add an explicit configure check.
2011-09-06 19:03:35 +02:00
Benjamin Peterson
799bd80d8a expose linux extended file system attributes (closes #12720) 2011-08-31 22:15:17 -04:00
Brian Curtin
dfc80e3d97 Replace Py_NotImplemented returns with the macro form Py_RETURN_NOTIMPLEMENTED.
The macro was introduced in #12724.
2011-08-10 20:28:54 -05:00
Benjamin Peterson
a17a5d67b4 typo 2011-08-09 16:49:13 -05:00
Benjamin Peterson
087a2a951c merge 3.2 2011-08-04 11:09:57 -05:00
Benjamin Peterson
fc9bbd1692 dosmodule is, thankfully, no more 2011-08-04 11:07:42 -05:00
Benjamin Peterson
7ac9214e43 fix arg strings 2011-08-03 08:54:26 -05:00
Benjamin Peterson
4e36d5ae88 need NULL sentinel 2011-08-02 19:56:11 -05:00
Benjamin Peterson
bad9c2f13a avoid warning when SchedParamType is not used 2011-08-02 18:42:14 -05:00
Benjamin Peterson
e3298dda6d only add sched_param if it is initialized 2011-08-02 18:40:46 -05:00
Benjamin Peterson
8f7bdd3208 I have been spoiled by chained comparisons in python 2011-08-02 18:34:30 -05:00
Benjamin Peterson
9b374bfa03 comparing on number of cpus makes more sense 2011-08-02 18:22:30 -05:00
Benjamin Peterson
0163c9aa0c fix sched defines 2011-08-02 18:11:38 -05:00
Benjamin Peterson
c5fce4ded2 check individually for some for sched_ functions 2011-08-02 18:07:32 -05:00
Benjamin Peterson
e870fe601a make_new_cpu_set takes the number of cpus 2011-08-02 17:44:26 -05:00
Benjamin Peterson
2740af8cc4 sched.h can exist without sched affinity support 2011-08-02 17:41:34 -05:00
Benjamin Peterson
94b580d423 expose sched.h functions (closes #12655) 2011-08-02 17:30:04 -05:00
Giampaolo Rodola'
210e7ca032 Issue #12442: add shutil.disk_usage() 2011-07-01 13:55:36 +02:00
Victor Stinner
6ee7a57b38 (Merge 3.2) posixmodule.c: fix function name in argument parsing
Fix os.fchown() and os.open()

Remove also trailing spaces and replace tabs by spaces.
2011-06-17 15:18:16 +02:00
Victor Stinner
26de69dff8 posixmodule.c: fix function name in argument parsing
Fix os.fchown() and os.open()

Remove also trailing spaces and replace tabs by spaces.
2011-06-17 15:15:38 +02:00
Brian Curtin
4ff1a414f8 Merge 3.2 - update to the fix for #12084 2011-06-14 10:06:41 -05:00
Brian Curtin
c8be84077b Correct completely broken os.stat behavior on Windows XP.
After 1a3e8db28d49, Windows XP could not os.stat at all due to raising
immediately when GetFinalPathNameByHandle wasn't available (pre-Vista).
The proper behavior in that situation is to just not attempt a traversal
rather than outright rejecting.

This change additionally handles a failed malloc by setting the error code
and returning false.

Patch by Hirokazu Yamamoto.
2011-06-14 09:52:50 -05:00
Brian Curtin
a87d586fd6 branch merge? 2011-06-13 16:10:32 -05:00
Brian Curtin
c9d6a501db branch merge 2011-06-13 16:03:01 -05:00
Brian Curtin
3e86c99f90 Merge from 3.2 for Issue #12084. 2011-06-13 16:00:35 -05:00
Brian Curtin
d25aef55c8 Fix #12084. os.stat on Windows wasn't working properly with relative symlinks.
Use of DeviceIoControl to obtain the symlink path via the reparse tag was
removed. The code now uses GetFinalPathNameByHandle in the case of a
symbolic link and works properly given the added test which creates a symbolic
link and calls os.stat on it from multiple locations.

Victor Stinner also noticed an issue with os.lstat following the os.stat
code path when being passed bytes. The posix_lstat function was adjusted to
properly hook up win32_lstat instead of the previous STAT macro (win32_stat).
2011-06-13 15:16:04 -05:00
Ross Lagerwall
b0ae53d8a0 Issue #9344: Add os.getgrouplist(). 2011-06-10 07:30:30 +02:00
Brian Curtin
d9463b233c Merge 3.2 2011-06-09 09:46:21 -05:00
Brian Curtin
95d028fd18 Correction to 88e318166eaf - Issue #11583
Rather than wrapping the C _isdir function in a Python function,
just import the C _isdir function directly. Additionally, add in the
docstring which was left out.
2011-06-09 09:10:38 -05:00
Brian Curtin
9a82eaade3 Fix #11583. Changed os.path.isdir to use GetFileAttributes instead of os.stat.
By changing to the Windows GetFileAttributes API in nt._isdir we can figure
out if the path is a directory without opening the file via os.stat. This has
the minor benefit of speeding up os.path.isdir by at least 2x for regular
files and 10-15x improvements were seen on symbolic links (which opened the
file multiple times during os.stat). Since os.path.isdir is used in
several places on interpreter startup, we get a minor speedup in startup time.
2011-06-08 18:43:57 -05:00
Brian Curtin
9c669ccc77 Fix #11583. Changed os.path.isdir to use GetFileAttributes instead of os.stat.
By changing to the Windows GetFileAttributes API in nt._isdir we can figure
out if the path is a directory without opening the file via os.stat. This has
the minor benefit of speeding up os.path.isdir by at least 2x for regular
files and 10-15x improvements were seen on symbolic links (which opened the
file multiple times during os.stat). Since os.path.isdir is used in
several places on interpreter startup, we get a minor speedup in startup time.
2011-06-08 18:17:18 -05:00
Charles-François Natali
368f34bb4b Issue #12196: Make os.pipe2() flags argument mandatory. 2011-06-06 19:49:47 +02:00
Charles-François Natali
daafdd5bea Issue #12196: Add pipe2() to the os module. 2011-05-29 20:07:40 +02:00
Victor Stinner
7870bdff5a Issue #6501: os.device_encoding() returns None on Windows if the application
has no console.
2011-05-23 18:12:52 +02:00
Charles-François Natali
1e045b1831 Issue #12105: Add O_CLOEXEC to the os module. 2011-05-22 20:42:32 +02:00
Victor Stinner
b90db4caf0 Issue #11918: OS/2 and VMS are no more supported because of the lack of
maintainer.
2011-04-26 22:48:24 +02:00
Antoine Pitrou
877509aef4 Issue #11382: Trivial system calls, such as dup() or pipe(), needn't
release the GIL.  Patch by Charles-François Natali.
2011-04-23 17:21:13 +02:00