Commit Graph

410 Commits

Author SHA1 Message Date
Martin v. Löwis 3bf573f918 Bug #1686475: Support stat'ing open files on Windows again.
Will backport to 2.5.
2007-04-04 18:30:36 +00:00
Martin v. Löwis 382abeff0f Patch #1490190: posixmodule now includes os.chflags() and os.lchflags()
functions on platforms where the underlying system calls are available.
2007-02-19 10:55:19 +00:00
Georg Brandl 7a28447d4c Bug #1645944: os.access now returns bool but docstring is not updated 2007-01-27 19:38:50 +00:00
Ronald Oussoren 10168f25ad Patch #1580674: with this patch os.readlink uses the filesystem encoding to
decode unicode objects and returns an unicode object when the argument is one.
2006-10-22 10:45:18 +00:00
Martin v. Löwis 012bc7253b Bug #1567666: Emulate GetFileAttributesExA for Win95.
Will backport to 2.5.
2006-10-15 09:43:39 +00:00
Martin v. Löwis 18aaa568fd Patch #1576166: Support os.utime for directories on Windows NT+. 2006-10-15 08:43:33 +00:00
Martin v. Löwis f43893a878 Bug #1565150: Fix subsecond processing for os.utime on Windows. 2006-10-09 20:44:25 +00:00
Georg Brandl 74bb783c2f Bug #1551427: fix a wrong NULL pointer check in the win32 version
of os.urandom().
2006-09-06 06:03:59 +00:00
Neal Norwitz e0a81afb10 If _stat_float_times is false, we will try to INCREF ival which could be NULL.
Return early in that case.  The caller checks for PyErr_Occurred so this
should be ok.

Klocwork #297
2006-08-12 01:50:38 +00:00
Martin v. Löwis 982e9fea0a Bug #1524310: Properly report errors from FindNextFile in os.listdir.
Will backport to 2.4.
2006-07-24 12:54:17 +00:00
Neal Norwitz 2a30cd0ef0 Patch #1516912: improve Modules support for OpenVMS. 2006-07-10 01:18:57 +00:00
Martin v. Löwis ee1e06d497 Correct arithmetic in access on Win32. Fixes #1513646. 2006-07-02 18:44:00 +00:00
Martin v. Löwis 0e8bd7e1cc Patch #1495999: Part two of Windows CE changes.
- update header checks, using autoconf
- provide dummies for getenv, environ, and GetVersion
- adjust MSC_VER check in socketmodule.c
2006-06-10 12:23:46 +00:00
Kristján Valur Jónsson dbeaa699cd Turn off warning about deprecated CRT functions on for VisualStudio .NET 2005.
Make the definition #ARRAYSIZE conditional.  VisualStudio .NET 2005 already has it defined using a better gimmick.
2006-06-09 16:28:01 +00:00
Georg Brandl 96a8c3954c Make use of METH_O and METH_NOARGS where possible.
Use Py_UnpackTuple instead of PyArg_ParseTuple where possible.
2006-05-29 21:04:52 +00:00
Martin v. Löwis a43190bc78 Patch #1492356: Port to Windows CE (patch set 1). 2006-05-22 09:15:18 +00:00
Georg Brandl 9e5b5e4fe1 Fix typo in os.utime docstring (patch #1490189) 2006-05-17 14:18:20 +00:00
Martin v. Löwis 5f5d99c215 - Test for sys/statvfs.h before including it, as statvfs is present
on some OSX installation, but its header file is not.
Will backport to 2.4
2006-05-16 07:05:37 +00:00
Martin v. Löwis e3edaea33d Fix memory leak. 2006-05-15 05:51:36 +00:00
Martin v. Löwis 77c176d5b5 Fix alignment error on Itanium. 2006-05-12 17:22:04 +00:00
Martin v. Löwis 682b1bb95f Dynamically allocate path name buffer for Unicode
path name in listdir. Fixes #1431582.
Stop overallocating MAX_PATH characters for ANSI
path names. Stop assigning to errno.
2006-05-12 12:27:28 +00:00
Martin v. Löwis 9f485bcd68 Add missing PyMem_Free. 2006-05-08 05:25:56 +00:00
Martin v. Löwis d4e3bb3d39 Port access, chmod, parts of getcwdu, mkdir, and utime to direct Win32 API. 2006-05-06 16:32:54 +00:00
Martin v. Löwis 4fc2bda8d9 Drop now-unnecessary arguments to posix_2str. 2006-05-04 12:04:27 +00:00
Martin v. Löwis 8e0d494e41 Implement os.{chdir,rename,rmdir,remove} using Win32 directly. 2006-05-04 10:08:42 +00:00
Thomas Wouters 1ddba60e3d Define MAXPATHLEN to be at least PATH_MAX, if that's defined. Python uses
MAXPATHLEN-sized buffers for various output-buffers (like to realpath()),
and that's correct on BSD platforms, but not Linux (which uses PATH_MAX, and
does not define MAXPATHLEN.) Cursory googling suggests Linux is following a
newer standard than BSD, but in cases like this, who knows. Using the
greater of PATH_MAX and 1024 as a fallback for MAXPATHLEN seems to be the
most portable solution.
2006-04-25 15:29:46 +00:00
Ronald Oussoren d06b6f28a0 Patch 1471925 - Weak linking support for OSX
This patch causes several symbols in the socket and posix module to be weakly
linked on OSX and disables usage of ftime on OSX. These changes make it possible
to use a binary build on OSX 10.4 on a 10.3 system.
2006-04-23 11:59:25 +00:00
Martin v. Löwis 26fd9607c7 Fix more ssize_t problems. 2006-04-22 11:15:41 +00:00
Neal Norwitz 449b24ebe9 Address issues brought up by MvL on python-checkins.
I tested this with valgrind on amd64.

The man pages I found for diff architectures are inconsistent on this.
I'm not entirely sure this change is correct for all architectures either.

Perhaps we should just over-allocate and not worry about it?
2006-04-20 06:56:05 +00:00
Neal Norwitz 0d21b1ed54 Whitespace, fix indentation 2006-04-20 06:44:42 +00:00
Skip Montanaro 94785ef142 Correct implementation and documentation of os.confstr. Add a simple test
case.  I've yet to figure out how to provoke a None return I can test.
2006-04-20 01:29:48 +00:00
Skip Montanaro dd527fcbcd reset errno before calling confstr - use confstr() doc to simplify checks afterwards 2006-04-18 00:49:49 +00:00
Martin v. Löwis 19ab6c98cf Initialize structseq types only once. 2006-04-16 18:55:50 +00:00
Anthony Baxter ac6bd46d5c spread the extern "C" { } magic pixie dust around. Python itself builds now
using a C++ compiler. Still lots and lots of errors in the modules built by
setup.py, and a bunch of warnings from g++ in the core.
2006-04-13 02:06:09 +00:00
Anthony Baxter 64182fe0b3 Some more changes to make code compile under a C++ compiler. 2006-04-11 12:14:09 +00:00
Georg Brandl 05e89b86d6 Clear errno before calling opendir() and readdir(). 2006-04-11 07:04:06 +00:00
Georg Brandl bbfe4fad36 Bug #1467952: os.listdir() now correctly raises an error if readdir()
fails with an error condition.
2006-04-11 06:47:43 +00:00
Neal Norwitz 84a98e07f5 Fix warning about ptsname not being a prototype on Solaris. Is this prototype even necessary anymore? 2006-04-10 07:44:23 +00:00
Martin v. Löwis 5fe715f049 Properly support empty woperation in win32_startfile;
correct arguments to ShellExecuteW.
2006-04-03 23:01:24 +00:00
Georg Brandl ad89dc8794 Bug #1451503: allow unicode filenames in os.startfile(). 2006-04-03 12:26:26 +00:00
Thomas Wouters 2a9a6b0e86 In the fdopen(fd, 'a') case on UNIX, don't try to set fd's flags to -1 if
fcntl() and fdopen() both fail. Will backport.
2006-03-31 22:38:19 +00:00
Georg Brandl 644b1e7aac Add guards against fcntl() not being available on Windows. 2006-03-31 20:27:22 +00:00
Georg Brandl 54a188aed8 bug #1461855: make os.fdopen() add the O_APPEND flag if using "a" mode.
glibc, for example, does this already on its own, but it seems that
the solaris libc doesn't. This leads to Python code being able to over-
write file contents even though having specified "a" mode.
2006-03-31 20:00:11 +00:00
Neal Norwitz 1818ed705b Try to fix broken compile on openbsd. 2006-03-26 00:29:48 +00:00
Neal Norwitz 9b00a56464 Damn Coverity. I can't even sneak in a leak any more. :-) 2006-03-20 08:47:12 +00:00
Neal Norwitz 6c2f913805 The helper is only necessary for wait3/4. 2006-03-20 07:25:26 +00:00
Neal Norwitz d5a375496e Try to cleanup a lot of boilerplate #ifdef wrt wait types and make the code
more consistent (and smaller by 85 lines or so).
2006-03-20 06:48:34 +00:00
Neal Norwitz 05a45599d7 Patch #1309579: wait3 and wait4 were added to the posix module by Chad J. Schroeder.
This was a fair amount of rework of the patch.  Refactored test_fork1 so it
could be reused by the new tests for wait3/4.  Also made them into new style
unittests (derive from unittest.TestCase).
2006-03-20 06:30:08 +00:00
Neal Norwitz d1e0ef68fb SF #1445431, fix some leaks in error conditions. 2006-03-20 04:08:12 +00:00
Martin v. Löwis e920f0d340 Reformulate 42903 using an if statement. 2006-03-07 23:59:33 +00:00