1990-10-14 12:07:46 +00:00
|
|
|
/* POSIX module implementation */
|
|
|
|
|
|
2012-10-05 01:48:08 +02:00
|
|
|
/* This file is also used for Windows NT/MS-Win. In that case the
|
|
|
|
|
module actually calls itself 'nt', not 'posix', and a few
|
2002-03-03 03:07:07 +00:00
|
|
|
functions are either unimplemented or implemented differently. The source
|
2002-06-30 15:26:10 +00:00
|
|
|
assumes that for Windows NT, the macro 'MS_WINDOWS' is defined independent
|
1995-03-01 10:34:45 +00:00
|
|
|
of the compiler used. Different compilers define their own feature
|
2014-10-22 12:33:23 +02:00
|
|
|
test macro, e.g. '_MSC_VER'. */
|
1995-03-01 10:34:45 +00:00
|
|
|
|
2006-03-01 01:05:10 +00:00
|
|
|
#define PY_SSIZE_T_CLEAN
|
|
|
|
|
|
2002-06-13 20:33:02 +00:00
|
|
|
#include "Python.h"
|
2019-05-13 12:35:37 +02:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
/* include <windows.h> early to avoid conflict with pycore_condvar.h:
|
|
|
|
|
|
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
|
|
|
|
|
FSCTL_GET_REPARSE_POINT is not exported with WIN32_LEAN_AND_MEAN. */
|
|
|
|
|
# include <windows.h>
|
2021-04-07 12:35:36 +01:00
|
|
|
# include <pathcch.h>
|
2019-05-13 12:35:37 +02:00
|
|
|
#endif
|
|
|
|
|
|
2020-04-15 02:35:41 +02:00
|
|
|
#include "pycore_ceval.h" // _PyEval_ReInitThreads()
|
|
|
|
|
#include "pycore_import.h" // _PyImport_ReInitLock()
|
|
|
|
|
#include "pycore_pystate.h" // _PyInterpreterState_GET()
|
|
|
|
|
#include "structmember.h" // PyMemberDef
|
2013-02-10 21:56:49 +02:00
|
|
|
#ifndef MS_WINDOWS
|
2019-05-13 12:35:37 +02:00
|
|
|
# include "posixmodule.h"
|
2014-05-05 19:46:17 +01:00
|
|
|
#else
|
2019-05-13 12:35:37 +02:00
|
|
|
# include "winreparse.h"
|
2013-02-10 21:56:49 +02:00
|
|
|
#endif
|
2002-06-13 20:33:02 +00:00
|
|
|
|
2016-04-26 17:04:18 +02:00
|
|
|
/* On android API level 21, 'AT_EACCESS' is not declared although
|
|
|
|
|
* HAVE_FACCESSAT is defined. */
|
|
|
|
|
#ifdef __ANDROID__
|
2020-04-15 15:07:31 +02:00
|
|
|
# undef HAVE_FACCESSAT
|
2016-04-26 17:04:18 +02:00
|
|
|
#endif
|
|
|
|
|
|
2016-05-28 21:03:48 +00:00
|
|
|
#include <stdio.h> /* needed for ctermid() */
|
|
|
|
|
|
2020-11-22 11:18:40 +01:00
|
|
|
/*
|
|
|
|
|
* A number of APIs are available on macOS from a certain macOS version.
|
|
|
|
|
* To support building with a new SDK while deploying to older versions
|
|
|
|
|
* the availability test is split into two:
|
|
|
|
|
* - HAVE_<FUNCTION>: The configure check for compile time availability
|
|
|
|
|
* - HAVE_<FUNCTION>_RUNTIME: Runtime check for availability
|
|
|
|
|
*
|
|
|
|
|
* The latter is always true when not on macOS, or when using a compiler
|
|
|
|
|
* that does not support __has_builtin (older versions of Xcode).
|
|
|
|
|
*
|
|
|
|
|
* Due to compiler restrictions there is one valid use of HAVE_<FUNCTION>_RUNTIME:
|
|
|
|
|
* if (HAVE_<FUNCTION>_RUNTIME) { ... }
|
|
|
|
|
*
|
|
|
|
|
* In mixing the test with other tests or using negations will result in compile
|
|
|
|
|
* errors.
|
|
|
|
|
*/
|
|
|
|
|
#if defined(__APPLE__)
|
|
|
|
|
|
2021-01-04 03:00:43 -08:00
|
|
|
#if defined(__has_builtin)
|
|
|
|
|
#if __has_builtin(__builtin_available)
|
|
|
|
|
#define HAVE_BUILTIN_AVAILABLE 1
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_BUILTIN_AVAILABLE
|
2020-11-22 11:18:40 +01:00
|
|
|
# define HAVE_FSTATAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
|
|
|
|
|
# define HAVE_FACCESSAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
|
|
|
|
|
# define HAVE_FCHMODAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
|
|
|
|
|
# define HAVE_FCHOWNAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
|
|
|
|
|
# define HAVE_LINKAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
|
|
|
|
|
# define HAVE_FDOPENDIR_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
|
|
|
|
|
# define HAVE_MKDIRAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
|
|
|
|
|
# define HAVE_RENAMEAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
|
|
|
|
|
# define HAVE_UNLINKAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
|
|
|
|
|
# define HAVE_OPENAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
|
|
|
|
|
# define HAVE_READLINKAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
|
|
|
|
|
# define HAVE_SYMLINKAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
|
|
|
|
|
# define HAVE_FUTIMENS_RUNTIME __builtin_available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *)
|
|
|
|
|
# define HAVE_UTIMENSAT_RUNTIME __builtin_available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *)
|
|
|
|
|
# define HAVE_PWRITEV_RUNTIME __builtin_available(macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0, *)
|
|
|
|
|
|
|
|
|
|
# define HAVE_POSIX_SPAWN_SETSID_RUNTIME __builtin_available(macOS 10.15, *)
|
|
|
|
|
|
|
|
|
|
#else /* Xcode 8 or earlier */
|
|
|
|
|
|
|
|
|
|
/* __builtin_available is not present in these compilers, but
|
|
|
|
|
* some of the symbols might be weak linked (10.10 SDK or later
|
|
|
|
|
* deploying on 10.9.
|
|
|
|
|
*
|
|
|
|
|
* Fall back to the older style of availability checking for
|
|
|
|
|
* symbols introduced in macOS 10.10.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
# ifdef HAVE_FSTATAT
|
|
|
|
|
# define HAVE_FSTATAT_RUNTIME (fstatat != NULL)
|
|
|
|
|
# endif
|
|
|
|
|
|
|
|
|
|
# ifdef HAVE_FACCESSAT
|
|
|
|
|
# define HAVE_FACCESSAT_RUNTIME (faccessat != NULL)
|
|
|
|
|
# endif
|
|
|
|
|
|
|
|
|
|
# ifdef HAVE_FCHMODAT
|
|
|
|
|
# define HAVE_FCHMODAT_RUNTIME (fchmodat != NULL)
|
|
|
|
|
# endif
|
|
|
|
|
|
|
|
|
|
# ifdef HAVE_FCHOWNAT
|
|
|
|
|
# define HAVE_FCHOWNAT_RUNTIME (fchownat != NULL)
|
|
|
|
|
# endif
|
|
|
|
|
|
|
|
|
|
# ifdef HAVE_LINKAT
|
|
|
|
|
# define HAVE_LINKAT_RUNTIME (linkat != NULL)
|
|
|
|
|
# endif
|
|
|
|
|
|
|
|
|
|
# ifdef HAVE_FDOPENDIR
|
|
|
|
|
# define HAVE_FDOPENDIR_RUNTIME (fdopendir != NULL)
|
|
|
|
|
# endif
|
|
|
|
|
|
|
|
|
|
# ifdef HAVE_MKDIRAT
|
|
|
|
|
# define HAVE_MKDIRAT_RUNTIME (mkdirat != NULL)
|
|
|
|
|
# endif
|
|
|
|
|
|
|
|
|
|
# ifdef HAVE_RENAMEAT
|
|
|
|
|
# define HAVE_RENAMEAT_RUNTIME (renameat != NULL)
|
|
|
|
|
# endif
|
|
|
|
|
|
|
|
|
|
# ifdef HAVE_UNLINKAT
|
|
|
|
|
# define HAVE_UNLINKAT_RUNTIME (unlinkat != NULL)
|
|
|
|
|
# endif
|
|
|
|
|
|
|
|
|
|
# ifdef HAVE_OPENAT
|
|
|
|
|
# define HAVE_OPENAT_RUNTIME (openat != NULL)
|
|
|
|
|
# endif
|
|
|
|
|
|
|
|
|
|
# ifdef HAVE_READLINKAT
|
|
|
|
|
# define HAVE_READLINKAT_RUNTIME (readlinkat != NULL)
|
|
|
|
|
# endif
|
|
|
|
|
|
|
|
|
|
# ifdef HAVE_SYMLINKAT
|
|
|
|
|
# define HAVE_SYMLINKAT_RUNTIME (symlinkat != NULL)
|
|
|
|
|
# endif
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FUTIMESAT
|
|
|
|
|
/* Some of the logic for weak linking depends on this assertion */
|
|
|
|
|
# error "HAVE_FUTIMESAT unexpectedly defined"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
# define HAVE_FSTATAT_RUNTIME 1
|
|
|
|
|
# define HAVE_FACCESSAT_RUNTIME 1
|
|
|
|
|
# define HAVE_FCHMODAT_RUNTIME 1
|
|
|
|
|
# define HAVE_FCHOWNAT_RUNTIME 1
|
|
|
|
|
# define HAVE_LINKAT_RUNTIME 1
|
|
|
|
|
# define HAVE_FDOPENDIR_RUNTIME 1
|
|
|
|
|
# define HAVE_MKDIRAT_RUNTIME 1
|
|
|
|
|
# define HAVE_RENAMEAT_RUNTIME 1
|
|
|
|
|
# define HAVE_UNLINKAT_RUNTIME 1
|
|
|
|
|
# define HAVE_OPENAT_RUNTIME 1
|
|
|
|
|
# define HAVE_READLINKAT_RUNTIME 1
|
|
|
|
|
# define HAVE_SYMLINKAT_RUNTIME 1
|
|
|
|
|
# define HAVE_FUTIMENS_RUNTIME 1
|
|
|
|
|
# define HAVE_UTIMENSAT_RUNTIME 1
|
|
|
|
|
# define HAVE_PWRITEV_RUNTIME 1
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
2006-04-21 10:40:58 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2002-06-13 20:33:02 +00:00
|
|
|
PyDoc_STRVAR(posix__doc__,
|
1997-06-02 22:20:51 +00:00
|
|
|
"This module provides access to operating system functionality that is\n\
|
|
|
|
|
standardized by the C Standard and the POSIX standard (a thinly\n\
|
|
|
|
|
disguised Unix interface). Refer to the library manual and\n\
|
2002-06-13 20:33:02 +00:00
|
|
|
corresponding Unix manual entries for more information on calls.");
|
1993-11-01 16:23:18 +00:00
|
|
|
|
2002-11-21 23:52:35 +00:00
|
|
|
|
2011-03-18 06:56:53 +02:00
|
|
|
#ifdef HAVE_SYS_UIO_H
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <sys/uio.h>
|
2011-03-18 06:56:53 +02:00
|
|
|
#endif
|
|
|
|
|
|
2017-09-05 15:53:09 +02:00
|
|
|
#ifdef HAVE_SYS_SYSMACROS_H
|
|
|
|
|
/* GNU C Library: major(), minor(), makedev() */
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <sys/sysmacros.h>
|
2017-09-05 15:53:09 +02:00
|
|
|
#endif
|
|
|
|
|
|
Merged revisions 46753-51188 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r46755 | brett.cannon | 2006-06-08 18:23:04 +0200 (Thu, 08 Jun 2006) | 4 lines
Make binascii.hexlify() use s# for its arguments instead of t# to actually
match its documentation stating it accepts any read-only buffer.
........
r46757 | brett.cannon | 2006-06-08 19:00:45 +0200 (Thu, 08 Jun 2006) | 8 lines
Buffer objects would return the read or write buffer for a wrapped object when
the char buffer was requested. Now it actually returns the char buffer if
available or raises a TypeError if it isn't (as is raised for the other buffer
types if they are not present but requested).
Not a backport candidate since it does change semantics of the buffer object
(although it could be argued this is enough of a bug to bother backporting).
........
r46760 | andrew.kuchling | 2006-06-09 03:10:17 +0200 (Fri, 09 Jun 2006) | 1 line
Update functools section
........
r46762 | tim.peters | 2006-06-09 04:11:02 +0200 (Fri, 09 Jun 2006) | 6 lines
Whitespace normalization.
Since test_file is implicated in mysterious test failures
when followed by test_optparse, if I had any brains I'd
look at the checkin that last changed test_file ;-)
........
r46763 | tim.peters | 2006-06-09 05:09:42 +0200 (Fri, 09 Jun 2006) | 5 lines
To boost morale :-), force test_optparse to run immediately
after test_file until we can figure out how to fix it.
(See python-dev; at the moment we don't even know which checkin
caused the problem.)
........
r46764 | tim.peters | 2006-06-09 05:51:41 +0200 (Fri, 09 Jun 2006) | 6 lines
AutoFileTests.tearDown(): Removed mysterious undocumented
try/except. Remove TESTFN.
Throughout: used open() instead of file(), and wrapped
long lines.
........
r46765 | tim.peters | 2006-06-09 06:02:06 +0200 (Fri, 09 Jun 2006) | 8 lines
testUnicodeOpen(): I have no idea why, but making this
test clean up after itself appears to fix the test failures
when test_optparse follows test_file.
test_main(): Get rid of TESTFN no matter what. That's
also enough to fix the mystery failures. Doesn't hurt
to fix them twice :-)
........
r46766 | tim.peters | 2006-06-09 07:12:40 +0200 (Fri, 09 Jun 2006) | 6 lines
Remove the temporary hack to force test_optparse to
run immediately after test_file. At least 8 buildbot
boxes passed since the underlying problem got fixed,
and they all failed before the fix, so there's no point
to this anymore.
........
r46767 | neal.norwitz | 2006-06-09 07:54:18 +0200 (Fri, 09 Jun 2006) | 1 line
Fix grammar and reflow
........
r46769 | andrew.kuchling | 2006-06-09 12:22:35 +0200 (Fri, 09 Jun 2006) | 1 line
Markup fix
........
r46773 | andrew.kuchling | 2006-06-09 15:15:57 +0200 (Fri, 09 Jun 2006) | 1 line
[Bug #1472827] Make saxutils.XMLGenerator handle \r\n\t in attribute values by escaping them properly. 2.4 bugfix candidate.
........
r46778 | kristjan.jonsson | 2006-06-09 18:28:01 +0200 (Fri, 09 Jun 2006) | 2 lines
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.
........
r46779 | phillip.eby | 2006-06-09 18:40:18 +0200 (Fri, 09 Jun 2006) | 2 lines
Import wsgiref into the stdlib, as of the external version 0.1-r2181.
........
r46783 | andrew.kuchling | 2006-06-09 18:44:40 +0200 (Fri, 09 Jun 2006) | 1 line
Add note about XMLGenerator bugfix
........
r46784 | andrew.kuchling | 2006-06-09 18:46:51 +0200 (Fri, 09 Jun 2006) | 1 line
Add note about wsgiref
........
r46785 | brett.cannon | 2006-06-09 19:05:48 +0200 (Fri, 09 Jun 2006) | 2 lines
Fix inconsistency in naming within an enum.
........
r46787 | tim.peters | 2006-06-09 19:47:00 +0200 (Fri, 09 Jun 2006) | 2 lines
Whitespace normalization.
........
r46792 | georg.brandl | 2006-06-09 20:29:52 +0200 (Fri, 09 Jun 2006) | 3 lines
Test file.__exit__.
........
r46794 | brett.cannon | 2006-06-09 20:40:46 +0200 (Fri, 09 Jun 2006) | 2 lines
svn:ignore .pyc and .pyo files.
........
r46795 | georg.brandl | 2006-06-09 20:45:48 +0200 (Fri, 09 Jun 2006) | 3 lines
RFE #1491485: str/unicode.endswith()/startswith() now accept a tuple as first argument.
........
r46798 | andrew.kuchling | 2006-06-09 21:03:16 +0200 (Fri, 09 Jun 2006) | 1 line
Describe startswith()/endswiith() change; add reminder about wsgiref
........
r46799 | tim.peters | 2006-06-09 21:24:44 +0200 (Fri, 09 Jun 2006) | 11 lines
Implementing a happy idea from Georg Brandl: make runtest() try to
clean up files and directories the tests often leave behind by
mistake. This is the first time in history I don't have a bogus
"db_home" directory after running the tests ;-)
Also worked on runtest's docstring, to say something about all the
arguments, and to document the non-obvious return values.
New functions runtest_inner() and cleanup_test_droppings() in
support of the above.
........
r46800 | andrew.kuchling | 2006-06-09 21:43:25 +0200 (Fri, 09 Jun 2006) | 1 line
Remove unused variable
........
r46801 | andrew.kuchling | 2006-06-09 21:56:05 +0200 (Fri, 09 Jun 2006) | 1 line
Add some wsgiref text
........
r46803 | thomas.heller | 2006-06-09 21:59:11 +0200 (Fri, 09 Jun 2006) | 1 line
set eol-style svn property
........
r46804 | thomas.heller | 2006-06-09 22:01:01 +0200 (Fri, 09 Jun 2006) | 1 line
set eol-style svn property
........
r46805 | georg.brandl | 2006-06-09 22:43:48 +0200 (Fri, 09 Jun 2006) | 3 lines
Make use of new str.startswith/endswith semantics.
Occurences in email and compiler were ignored due to backwards compat requirements.
........
r46806 | brett.cannon | 2006-06-10 00:31:23 +0200 (Sat, 10 Jun 2006) | 4 lines
An object with __call__ as an attribute, when called, will have that attribute checked for __call__ itself, and will continue to look until it finds an object without the attribute. This can lead to an infinite recursion.
Closes bug #532646, again. Will be backported.
........
r46808 | brett.cannon | 2006-06-10 00:45:54 +0200 (Sat, 10 Jun 2006) | 2 lines
Fix bug introduced in rev. 46806 by not having variable declaration at the top of a block.
........
r46812 | georg.brandl | 2006-06-10 08:40:50 +0200 (Sat, 10 Jun 2006) | 4 lines
Apply perky's fix for #1503157: "/".join([u"", u""]) raising OverflowError.
Also improve error message on overflow.
........
r46817 | martin.v.loewis | 2006-06-10 10:14:03 +0200 (Sat, 10 Jun 2006) | 2 lines
Port cygwin kill_python changes from 2.4 branch.
........
r46818 | armin.rigo | 2006-06-10 12:57:40 +0200 (Sat, 10 Jun 2006) | 4 lines
SF bug #1503294.
PyThreadState_GET() complains if the tstate is NULL, but only in debug mode.
........
r46819 | martin.v.loewis | 2006-06-10 14:23:46 +0200 (Sat, 10 Jun 2006) | 4 lines
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
........
r46820 | skip.montanaro | 2006-06-10 16:09:11 +0200 (Sat, 10 Jun 2006) | 1 line
document the class, not its initializer
........
r46821 | greg.ward | 2006-06-10 18:40:01 +0200 (Sat, 10 Jun 2006) | 4 lines
Sync with Optik docs (rev 518):
* restore "Extending optparse" section
* document ALWAYS_TYPED_ACTIONS (SF #1449311)
........
r46824 | thomas.heller | 2006-06-10 21:51:46 +0200 (Sat, 10 Jun 2006) | 8 lines
Upgrade to ctypes version 0.9.9.7.
Summary of changes:
- support for 'variable sized' data
- support for anonymous structure/union fields
- fix severe bug with certain arrays or structures containing more than 256 fields
........
r46825 | thomas.heller | 2006-06-10 21:55:36 +0200 (Sat, 10 Jun 2006) | 8 lines
Upgrade to ctypes version 0.9.9.7.
Summary of changes:
- support for 'variable sized' data
- support for anonymous structure/union fields
- fix severe bug with certain arrays or structures containing more than 256 fields
........
r46826 | fred.drake | 2006-06-10 22:01:34 +0200 (Sat, 10 Jun 2006) | 4 lines
SF patch #1303595: improve description of __builtins__, explaining how it
varies between __main__ and other modules, and strongly suggest not touching
it but using __builtin__ if absolutely necessary
........
r46827 | fred.drake | 2006-06-10 22:02:58 +0200 (Sat, 10 Jun 2006) | 1 line
credit for SF patch #1303595
........
r46831 | thomas.heller | 2006-06-10 22:29:34 +0200 (Sat, 10 Jun 2006) | 2 lines
New docs for ctypes.
........
r46834 | thomas.heller | 2006-06-10 23:07:19 +0200 (Sat, 10 Jun 2006) | 1 line
Fix a wrong printf format.
........
r46835 | thomas.heller | 2006-06-10 23:17:58 +0200 (Sat, 10 Jun 2006) | 1 line
Fix the second occurrence of the problematic printf format.
........
r46837 | thomas.heller | 2006-06-10 23:56:03 +0200 (Sat, 10 Jun 2006) | 1 line
Don't use C++ comment.
........
r46838 | thomas.heller | 2006-06-11 00:01:50 +0200 (Sun, 11 Jun 2006) | 1 line
Handle failure of PyMem_Realloc.
........
r46839 | skip.montanaro | 2006-06-11 00:38:13 +0200 (Sun, 11 Jun 2006) | 2 lines
Suppress warning on MacOSX about possible use before set of proc.
........
r46840 | tim.peters | 2006-06-11 00:51:45 +0200 (Sun, 11 Jun 2006) | 8 lines
shuffle() doscstring: Removed warning about sequence length
versus generator period. While this was a real weakness of the
older WH generator for lists with just a few dozen elements,
and so could potentially bite the naive ;-), the Twister should
show excellent behavior up to at least 600 elements.
Module docstring: reflowed some jarringly short lines.
........
r46844 | greg.ward | 2006-06-11 02:40:49 +0200 (Sun, 11 Jun 2006) | 4 lines
Bug #1361643: fix textwrap.dedent() so it handles tabs appropriately,
i.e. do *not* expand tabs, but treat them as whitespace that is not
equivalent to spaces. Add a couple of test cases. Clarify docs.
........
r46850 | neal.norwitz | 2006-06-11 07:44:18 +0200 (Sun, 11 Jun 2006) | 5 lines
Fix Coverity # 146. newDBSequenceObject would deref dbobj, so it can't be NULL.
We know it's not NULL from the ParseTuple and DbObject_Check will verify
it's not NULL.
........
r46851 | neal.norwitz | 2006-06-11 07:45:25 +0200 (Sun, 11 Jun 2006) | 4 lines
Wrap some long lines
Top/Bottom factor out some common expressions
Add a XXX comment about widing offset.
........
r46852 | neal.norwitz | 2006-06-11 07:45:47 +0200 (Sun, 11 Jun 2006) | 1 line
Add versionadded to doc
........
r46853 | neal.norwitz | 2006-06-11 07:47:14 +0200 (Sun, 11 Jun 2006) | 3 lines
Update doc to make it agree with code.
Bottom factor out some common code.
........
r46854 | neal.norwitz | 2006-06-11 07:48:14 +0200 (Sun, 11 Jun 2006) | 3 lines
f_code can't be NULL based on Frame_New and other code that derefs it.
So there doesn't seem to be much point to checking here.
........
r46855 | neal.norwitz | 2006-06-11 09:26:27 +0200 (Sun, 11 Jun 2006) | 1 line
Fix errors found by pychecker
........
r46856 | neal.norwitz | 2006-06-11 09:26:50 +0200 (Sun, 11 Jun 2006) | 1 line
warnings was imported at module scope, no need to import again
........
r46857 | neal.norwitz | 2006-06-11 09:27:56 +0200 (Sun, 11 Jun 2006) | 5 lines
Fix errors found by pychecker.
I think these changes are correct, but I'm not sure. Could someone
who knows how this module works test it? It can at least start on
the cmd line.
........
r46858 | neal.norwitz | 2006-06-11 10:35:14 +0200 (Sun, 11 Jun 2006) | 1 line
Fix errors found by pychecker
........
r46859 | ronald.oussoren | 2006-06-11 16:33:36 +0200 (Sun, 11 Jun 2006) | 4 lines
This patch improves the L&F of IDLE on OSX. The changes are conditionalized on
being in an IDLE.app bundle on darwin. This does a slight reorganisation of the
menus and adds support for file-open events.
........
r46860 | greg.ward | 2006-06-11 16:42:41 +0200 (Sun, 11 Jun 2006) | 1 line
SF #1366250: optparse docs: fix inconsistency in variable name; minor tweaks.
........
r46861 | greg.ward | 2006-06-11 18:24:11 +0200 (Sun, 11 Jun 2006) | 3 lines
Bug #1498146: fix optparse to handle Unicode strings in option help,
description, and epilog.
........
r46862 | thomas.heller | 2006-06-11 19:04:22 +0200 (Sun, 11 Jun 2006) | 2 lines
Release the GIL during COM method calls, to avoid deadlocks in
Python coded COM objects.
........
r46863 | tim.peters | 2006-06-11 21:42:51 +0200 (Sun, 11 Jun 2006) | 2 lines
Whitespace normalization.
........
r46864 | tim.peters | 2006-06-11 21:43:49 +0200 (Sun, 11 Jun 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46865 | ronald.oussoren | 2006-06-11 21:45:57 +0200 (Sun, 11 Jun 2006) | 2 lines
Remove message about using make frameworkinstall, that's no longer necesssary
........
r46866 | ronald.oussoren | 2006-06-11 22:23:29 +0200 (Sun, 11 Jun 2006) | 2 lines
Use configure to substitute the correct prefix instead of hardcoding
........
r46867 | ronald.oussoren | 2006-06-11 22:24:45 +0200 (Sun, 11 Jun 2006) | 4 lines
- Change fixapplepython23.py to ensure that it will run with /usr/bin/python
on intel macs.
- Fix some minor problems in the installer for OSX
........
r46868 | neal.norwitz | 2006-06-11 22:25:56 +0200 (Sun, 11 Jun 2006) | 5 lines
Try to fix several networking tests. The problem is that if hosts have
a search path setup, some of these hosts resolve to the wrong address.
By appending a period to the hostname, the hostname should only resolve
to what we want it to resolve to. Hopefully this doesn't break different bots.
........
r46869 | neal.norwitz | 2006-06-11 22:42:02 +0200 (Sun, 11 Jun 2006) | 7 lines
Try to fix another networking test. The problem is that if hosts have
a search path setup, some of these hosts resolve to the wrong address.
By appending a period to the hostname, the hostname should only resolve
to what we want it to resolve to. Hopefully this doesn't break different bots.
Also add more info to failure message to aid debugging test failure.
........
r46870 | neal.norwitz | 2006-06-11 22:46:46 +0200 (Sun, 11 Jun 2006) | 4 lines
Fix test on PPC64 buildbot. It raised an IOError (really an URLError which
derives from an IOError). That seems valid. Env Error includes both OSError
and IOError, so this seems like a reasonable fix.
........
r46871 | tim.peters | 2006-06-11 22:52:59 +0200 (Sun, 11 Jun 2006) | 10 lines
compare_generic_iter(): Fixed the failure of test_wsgiref's testFileWrapper
when running with -O.
test_simple_validation_error still fails under -O. That appears to be because
wsgiref's validate.py uses `assert` statements all over the place to check
arguments for sanity. That should all be changed (it's not a logical error
in the software if a user passes bogus arguments, so this isn't a reasonable
use for `assert` -- checking external preconditions should generally raise
ValueError or TypeError instead, as appropriate).
........
r46872 | neal.norwitz | 2006-06-11 23:38:38 +0200 (Sun, 11 Jun 2006) | 1 line
Get test to pass on S/390. Shout if you think this change is incorrect.
........
r46873 | neal.norwitz | 2006-06-12 04:05:55 +0200 (Mon, 12 Jun 2006) | 1 line
Cleanup Py_ssize_t a little (get rid of second #ifdef)
........
r46874 | neal.norwitz | 2006-06-12 04:06:17 +0200 (Mon, 12 Jun 2006) | 1 line
Fix some Py_ssize_t issues
........
r46875 | neal.norwitz | 2006-06-12 04:06:42 +0200 (Mon, 12 Jun 2006) | 1 line
Fix some Py_ssize_t issues
........
r46876 | neal.norwitz | 2006-06-12 04:07:24 +0200 (Mon, 12 Jun 2006) | 2 lines
Cleanup: Remove import of types to get StringTypes, we can just use basestring.
........
r46877 | neal.norwitz | 2006-06-12 04:07:57 +0200 (Mon, 12 Jun 2006) | 1 line
Don't truncate if size_t is bigger than uint
........
r46878 | neal.norwitz | 2006-06-12 04:08:41 +0200 (Mon, 12 Jun 2006) | 1 line
Don't leak the list object if there's an error allocating the item storage. Backport candidate
........
r46879 | neal.norwitz | 2006-06-12 04:09:03 +0200 (Mon, 12 Jun 2006) | 1 line
Fix typo. Backport if anyone cares. :-)
........
r46880 | neal.norwitz | 2006-06-12 04:09:34 +0200 (Mon, 12 Jun 2006) | 1 line
Fix indentation of case and a Py_ssize_t issue.
........
r46881 | neal.norwitz | 2006-06-12 04:11:18 +0200 (Mon, 12 Jun 2006) | 3 lines
Get rid of f_restricted too. Doc the other 4 ints that were already removed
at the NeedForSpeed sprint.
........
r46882 | neal.norwitz | 2006-06-12 04:13:21 +0200 (Mon, 12 Jun 2006) | 1 line
Fix the socket tests so they can be run concurrently. Backport candidate
........
r46883 | neal.norwitz | 2006-06-12 04:16:10 +0200 (Mon, 12 Jun 2006) | 1 line
i and j are initialized below when used. No need to do it twice
........
r46884 | neal.norwitz | 2006-06-12 05:05:03 +0200 (Mon, 12 Jun 2006) | 1 line
Remove unused import
........
r46885 | neal.norwitz | 2006-06-12 05:05:40 +0200 (Mon, 12 Jun 2006) | 1 line
Impl ssize_t
........
r46886 | neal.norwitz | 2006-06-12 05:33:09 +0200 (Mon, 12 Jun 2006) | 6 lines
Patch #1503046, Conditional compilation of zlib.(de)compressobj.copy
copy is only in newer versions of zlib. This should allow zlibmodule
to work with older versions like the Tru64 buildbot.
........
r46887 | phillip.eby | 2006-06-12 06:04:32 +0200 (Mon, 12 Jun 2006) | 2 lines
Sync w/external release 0.1.2. Please see PEP 360 before making changes to external packages.
........
r46888 | martin.v.loewis | 2006-06-12 06:26:31 +0200 (Mon, 12 Jun 2006) | 2 lines
Get rid of function pointer cast.
........
r46889 | thomas.heller | 2006-06-12 08:05:57 +0200 (Mon, 12 Jun 2006) | 3 lines
I don't know how that happend, but the entire file contents was
duplicated. Thanks to Simon Percivall for the heads up.
........
r46890 | nick.coghlan | 2006-06-12 10:19:37 +0200 (Mon, 12 Jun 2006) | 1 line
Fix site module docstring to match the code
........
r46891 | nick.coghlan | 2006-06-12 10:23:02 +0200 (Mon, 12 Jun 2006) | 1 line
Fix site module docstring to match the code for Mac OSX, too
........
r46892 | nick.coghlan | 2006-06-12 10:27:13 +0200 (Mon, 12 Jun 2006) | 1 line
The site module documentation also described the Windows behaviour incorrectly.
........
r46893 | nick.coghlan | 2006-06-12 12:17:11 +0200 (Mon, 12 Jun 2006) | 1 line
Make the -m switch conform to the documentation of sys.path by behaving like the -c switch
........
r46894 | kristjan.jonsson | 2006-06-12 17:45:12 +0200 (Mon, 12 Jun 2006) | 2 lines
Fix the CRT argument error handling for VisualStudio .NET 2005. Install a CRT error handler and disable the assertion for debug builds. This causes CRT to set errno to EINVAL.
This update fixes crash cases in the test suite where the default CRT error handler would cause process exit.
........
r46899 | thomas.heller | 2006-06-12 22:56:48 +0200 (Mon, 12 Jun 2006) | 1 line
Add pep-291 compatibility markers.
........
r46901 | ka-ping.yee | 2006-06-13 01:47:52 +0200 (Tue, 13 Jun 2006) | 5 lines
Add the uuid module.
This module has been tested so far on Windows XP (Python 2.4 and 2.5a2),
Mac OS X (Python 2.3, 2.4, and 2.5a2), and Linux (Python 2.4 and 2.5a2).
........
r46902 | tim.peters | 2006-06-13 02:30:01 +0200 (Tue, 13 Jun 2006) | 2 lines
Whitespace normalization.
........
r46903 | tim.peters | 2006-06-13 02:30:50 +0200 (Tue, 13 Jun 2006) | 2 lines
Added missing svn:eol-style property to text files.
........
r46905 | tim.peters | 2006-06-13 05:30:07 +0200 (Tue, 13 Jun 2006) | 5 lines
get_matching_blocks(): rewrote code & comments so they match; added
more comments about why it's this way at all; and removed what looked
like needless expense (sorting (i, j, k) triples directly should give
exactly the same order as sorting (i, (i, j, k)) pairs).
........
r46906 | neal.norwitz | 2006-06-13 06:08:53 +0200 (Tue, 13 Jun 2006) | 1 line
Don't fail if another process is listening on our port.
........
r46908 | neal.norwitz | 2006-06-13 10:28:19 +0200 (Tue, 13 Jun 2006) | 2 lines
Initialize the type object so pychecker can't crash the interpreter.
........
r46909 | neal.norwitz | 2006-06-13 10:41:06 +0200 (Tue, 13 Jun 2006) | 1 line
Verify the crash due to EncodingMap not initialized does not return
........
r46910 | thomas.heller | 2006-06-13 10:56:14 +0200 (Tue, 13 Jun 2006) | 3 lines
Add some windows datatypes that were missing from this file, and add
the aliases defined in windows header files for the structures.
........
r46911 | thomas.heller | 2006-06-13 11:40:14 +0200 (Tue, 13 Jun 2006) | 3 lines
Add back WCHAR, UINT, DOUBLE, _LARGE_INTEGER, _ULARGE_INTEGER.
VARIANT_BOOL is a special _ctypes data type, not c_short.
........
r46912 | ronald.oussoren | 2006-06-13 13:19:56 +0200 (Tue, 13 Jun 2006) | 4 lines
Linecache contains support for PEP302 loaders, but fails to deal with loaders
that return None to indicate that the module is valid but no source is
available. This patch fixes that.
........
r46913 | andrew.kuchling | 2006-06-13 13:57:04 +0200 (Tue, 13 Jun 2006) | 1 line
Mention uuid module
........
r46915 | walter.doerwald | 2006-06-13 14:02:12 +0200 (Tue, 13 Jun 2006) | 2 lines
Fix passing errors to the encoder and decoder functions.
........
r46917 | walter.doerwald | 2006-06-13 14:04:43 +0200 (Tue, 13 Jun 2006) | 3 lines
errors is an attribute in the incremental decoder
not an argument.
........
r46919 | andrew.macintyre | 2006-06-13 17:04:24 +0200 (Tue, 13 Jun 2006) | 11 lines
Patch #1454481: Make thread stack size runtime tunable.
Heavily revised, comprising revisions:
46640 - original trunk revision (backed out in r46655)
46647 - markup fix (backed out in r46655)
46692:46918 merged from branch aimacintyre-sf1454481
branch tested on buildbots (Windows buildbots had problems
not related to these changes).
........
r46920 | brett.cannon | 2006-06-13 18:06:55 +0200 (Tue, 13 Jun 2006) | 2 lines
Remove unused variable.
........
r46921 | andrew.kuchling | 2006-06-13 18:41:41 +0200 (Tue, 13 Jun 2006) | 1 line
Add ability to set stack size
........
r46923 | marc-andre.lemburg | 2006-06-13 19:04:26 +0200 (Tue, 13 Jun 2006) | 2 lines
Update pybench to version 2.0.
........
r46924 | marc-andre.lemburg | 2006-06-13 19:07:14 +0200 (Tue, 13 Jun 2006) | 2 lines
Revert wrong svn copy.
........
r46925 | andrew.macintyre | 2006-06-13 19:14:36 +0200 (Tue, 13 Jun 2006) | 2 lines
fix exception usage
........
r46927 | tim.peters | 2006-06-13 20:37:07 +0200 (Tue, 13 Jun 2006) | 2 lines
Whitespace normalization.
........
r46928 | marc-andre.lemburg | 2006-06-13 20:56:56 +0200 (Tue, 13 Jun 2006) | 9 lines
Updated to pybench 2.0.
See svn.python.org/external/pybench-2.0 for the original import of that
version.
Note that platform.py was not copied over from pybench-2.0 since
it is already part of Python 2.5.
........
r46929 | andrew.macintyre | 2006-06-13 21:02:35 +0200 (Tue, 13 Jun 2006) | 5 lines
Increase the small thread stack size to get the test
to pass reliably on the one buildbot that insists on
more than 32kB of thread stack.
........
r46930 | marc-andre.lemburg | 2006-06-13 21:20:07 +0200 (Tue, 13 Jun 2006) | 2 lines
Whitespace normalization.
........
r46931 | thomas.heller | 2006-06-13 22:18:43 +0200 (Tue, 13 Jun 2006) | 2 lines
More docs for ctypes.
........
r46932 | brett.cannon | 2006-06-13 23:34:24 +0200 (Tue, 13 Jun 2006) | 2 lines
Ignore .pyc and .pyo files in Pybench.
........
r46933 | brett.cannon | 2006-06-13 23:46:41 +0200 (Tue, 13 Jun 2006) | 7 lines
If a classic class defined a __coerce__() method that just returned its two
arguments in reverse, the interpreter would infinitely recourse trying to get a
coercion that worked. So put in a recursion check after a coercion is made and
the next call to attempt to use the coerced values.
Fixes bug #992017 and closes crashers/coerce.py .
........
r46936 | gerhard.haering | 2006-06-14 00:24:47 +0200 (Wed, 14 Jun 2006) | 3 lines
Merged changes from external pysqlite 2.3.0 release. Documentation updates will
follow in a few hours at the latest. Then we should be ready for beta1.
........
r46937 | brett.cannon | 2006-06-14 00:26:13 +0200 (Wed, 14 Jun 2006) | 2 lines
Missed test for rev. 46933; infinite recursion from __coerce__() returning its arguments reversed.
........
r46938 | gerhard.haering | 2006-06-14 00:53:48 +0200 (Wed, 14 Jun 2006) | 2 lines
Updated documentation for pysqlite 2.3.0 API.
........
r46939 | tim.peters | 2006-06-14 06:09:25 +0200 (Wed, 14 Jun 2006) | 10 lines
SequenceMatcher.get_matching_blocks(): This now guarantees that
adjacent triples in the result list describe non-adjacent matching
blocks. That's _nice_ to have, and Guido said he wanted it.
Not a bugfix candidate: Guido or not ;-), this changes visible
endcase semantics (note that some tests had to change), and
nothing about this was documented before. Since it was working
as designed, and behavior was consistent with the docs, it wasn't
"a bug".
........
r46940 | tim.peters | 2006-06-14 06:13:00 +0200 (Wed, 14 Jun 2006) | 2 lines
Repaired typo in new comment.
........
r46941 | tim.peters | 2006-06-14 06:15:27 +0200 (Wed, 14 Jun 2006) | 2 lines
Whitespace normalization.
........
r46942 | fred.drake | 2006-06-14 06:25:02 +0200 (Wed, 14 Jun 2006) | 3 lines
- make some disabled tests run what they intend when enabled
- remove some over-zealous triple-quoting
........
r46943 | fred.drake | 2006-06-14 07:04:47 +0200 (Wed, 14 Jun 2006) | 3 lines
add tests for two cases that are handled correctly in the current code,
but that SF patch 1504676 as written mis-handles
........
r46944 | fred.drake | 2006-06-14 07:15:51 +0200 (Wed, 14 Jun 2006) | 1 line
explain an XXX in more detail
........
r46945 | martin.v.loewis | 2006-06-14 07:21:04 +0200 (Wed, 14 Jun 2006) | 1 line
Patch #1455898: Incremental mode for "mbcs" codec.
........
r46946 | georg.brandl | 2006-06-14 08:08:31 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1339007: Shelf objects now don't raise an exception in their
__del__ method when initialization failed.
........
r46948 | thomas.heller | 2006-06-14 08:18:15 +0200 (Wed, 14 Jun 2006) | 1 line
Fix docstring.
........
r46949 | georg.brandl | 2006-06-14 08:29:07 +0200 (Wed, 14 Jun 2006) | 2 lines
Bug #1501122: mention __gt__ &co in description of comparison order.
........
r46951 | thomas.heller | 2006-06-14 09:08:38 +0200 (Wed, 14 Jun 2006) | 1 line
Write more docs.
........
r46952 | georg.brandl | 2006-06-14 10:31:39 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1153163: describe __add__ vs __radd__ behavior when adding
objects of same type/of subclasses of the other.
........
r46954 | georg.brandl | 2006-06-14 10:42:11 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1202018: add some common mime.types locations.
........
r46955 | georg.brandl | 2006-06-14 10:50:03 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1117556: SimpleHTTPServer now tries to find and use the system's
mime.types file for determining MIME types.
........
r46957 | thomas.heller | 2006-06-14 11:09:08 +0200 (Wed, 14 Jun 2006) | 1 line
Document paramflags.
........
r46958 | thomas.heller | 2006-06-14 11:20:11 +0200 (Wed, 14 Jun 2006) | 1 line
Add an __all__ list, since this module does 'from ctypes import *'.
........
r46959 | andrew.kuchling | 2006-06-14 15:59:15 +0200 (Wed, 14 Jun 2006) | 1 line
Add item
........
r46961 | georg.brandl | 2006-06-14 18:46:43 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #805015: doc error in PyUnicode_FromEncodedObject.
........
r46962 | gerhard.haering | 2006-06-15 00:28:37 +0200 (Thu, 15 Jun 2006) | 10 lines
- Added version checks in C code to make sure we don't trigger bugs in older
SQLite versions.
- Added version checks in test suite so that we don't execute tests that we
know will fail with older (buggy) SQLite versions.
Now, all tests should run against all SQLite versions from 3.0.8 until 3.3.6
(latest one now). The sqlite3 module can be built against all these SQLite
versions and the sqlite3 module does its best to not trigger bugs in SQLite,
but using SQLite 3.3.3 or later is recommended.
........
r46963 | tim.peters | 2006-06-15 00:38:13 +0200 (Thu, 15 Jun 2006) | 2 lines
Whitespace normalization.
........
r46964 | neal.norwitz | 2006-06-15 06:54:29 +0200 (Thu, 15 Jun 2006) | 9 lines
Speculative checkin (requires approval of Gerhard Haering)
This backs out the test changes in 46962 which prevented crashes
by not running the tests via a version check. All the version checks
added in that rev were removed from the tests.
Code was added to the error handler in connection.c that seems
to work with older versions of sqlite including 3.1.3.
........
r46965 | neal.norwitz | 2006-06-15 07:55:49 +0200 (Thu, 15 Jun 2006) | 1 line
Try to narrow window of failure on slow/busy boxes (ppc64 buildbot)
........
r46966 | martin.v.loewis | 2006-06-15 08:45:05 +0200 (Thu, 15 Jun 2006) | 2 lines
Make import/lookup of mbcs fail on non-Windows systems.
........
r46967 | ronald.oussoren | 2006-06-15 10:14:18 +0200 (Thu, 15 Jun 2006) | 2 lines
Patch #1446489 (zipfile: support for ZIP64)
........
r46968 | neal.norwitz | 2006-06-15 10:16:44 +0200 (Thu, 15 Jun 2006) | 6 lines
Re-revert this change. Install the version check and don't run the test
until Gerhard has time to fully debug the issue. This affects versions
before 3.2.1 (possibly only versions earlier than 3.1.3).
Based on discussion on python-checkins.
........
r46969 | gregory.p.smith | 2006-06-15 10:52:32 +0200 (Thu, 15 Jun 2006) | 6 lines
- bsddb: multithreaded DB access using the simple bsddb module interface
now works reliably. It has been updated to use automatic BerkeleyDB
deadlock detection and the bsddb.dbutils.DeadlockWrap wrapper to retry
database calls that would previously deadlock. [SF python bug #775414]
........
r46970 | gregory.p.smith | 2006-06-15 11:23:52 +0200 (Thu, 15 Jun 2006) | 2 lines
minor documentation cleanup. mention the bsddb.db interface explicitly by name.
........
r46971 | neal.norwitz | 2006-06-15 11:57:03 +0200 (Thu, 15 Jun 2006) | 5 lines
Steal the trick from test_compiler to print out a slow msg.
This will hopefully get the buildbots to pass. Not sure this
test will be feasible or even work. But everything is red now,
so it can't get much worse.
........
r46972 | neal.norwitz | 2006-06-15 12:24:49 +0200 (Thu, 15 Jun 2006) | 1 line
Print some more info to get an idea of how much longer the test will last
........
r46981 | tim.peters | 2006-06-15 20:04:40 +0200 (Thu, 15 Jun 2006) | 6 lines
Try to reduce the extreme peak memory and disk-space use
of this test. It probably still requires more disk space
than most buildbots have, and in any case is still so
intrusive that if we don't find another way to test this I'm
taking my buildbot offline permanently ;-)
........
r46982 | tim.peters | 2006-06-15 20:06:29 +0200 (Thu, 15 Jun 2006) | 2 lines
Whitespace normalization.
........
r46983 | tim.peters | 2006-06-15 20:07:28 +0200 (Thu, 15 Jun 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46984 | tim.peters | 2006-06-15 20:38:19 +0200 (Thu, 15 Jun 2006) | 2 lines
Oops -- I introduced an off-by-6436159488 error.
........
r46990 | neal.norwitz | 2006-06-16 06:30:34 +0200 (Fri, 16 Jun 2006) | 1 line
Disable this test until we can determine what to do about it
........
r46991 | neal.norwitz | 2006-06-16 06:31:06 +0200 (Fri, 16 Jun 2006) | 1 line
Param name is dir, not directory. Update docstring. Backport candidate
........
r46992 | neal.norwitz | 2006-06-16 06:31:28 +0200 (Fri, 16 Jun 2006) | 1 line
Add missing period in comment.
........
r46993 | neal.norwitz | 2006-06-16 06:32:43 +0200 (Fri, 16 Jun 2006) | 1 line
Fix whitespace, there are memory leaks in this module.
........
r46995 | fred.drake | 2006-06-17 01:45:06 +0200 (Sat, 17 Jun 2006) | 3 lines
SF patch 1504676: Make sgmllib char and entity references pluggable
(implementation/tests contributed by Sam Ruby)
........
r46996 | fred.drake | 2006-06-17 03:07:54 +0200 (Sat, 17 Jun 2006) | 1 line
fix change that broke the htmllib tests
........
r46998 | martin.v.loewis | 2006-06-17 11:15:14 +0200 (Sat, 17 Jun 2006) | 3 lines
Patch #763580: Add name and value arguments to
Tkinter variable classes.
........
r46999 | martin.v.loewis | 2006-06-17 11:20:41 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #1096231: Add default argument to wm_iconbitmap.
........
r47000 | martin.v.loewis | 2006-06-17 11:25:15 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #1494750: Destroy master after deleting children.
........
r47003 | george.yoshida | 2006-06-17 18:31:52 +0200 (Sat, 17 Jun 2006) | 2 lines
markup fix
........
r47005 | george.yoshida | 2006-06-17 18:39:13 +0200 (Sat, 17 Jun 2006) | 4 lines
Update url.
Old url returned status code:301 Moved permanently.
........
r47007 | martin.v.loewis | 2006-06-17 20:44:27 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #812986: Update the canvas even if not tracing.
........
r47008 | martin.v.loewis | 2006-06-17 21:03:26 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #815924: Restore ability to pass type= and icon=
........
r47009 | neal.norwitz | 2006-06-18 00:37:45 +0200 (Sun, 18 Jun 2006) | 1 line
Fix typo in docstring
........
r47010 | neal.norwitz | 2006-06-18 00:38:15 +0200 (Sun, 18 Jun 2006) | 1 line
Fix memory leak reported by valgrind while running test_subprocess
........
r47011 | fred.drake | 2006-06-18 04:57:35 +0200 (Sun, 18 Jun 2006) | 1 line
remove unnecessary markup
........
r47013 | neal.norwitz | 2006-06-18 21:35:01 +0200 (Sun, 18 Jun 2006) | 7 lines
Prevent spurious leaks when running regrtest.py -R. There may be more
issues that crop up from time to time, but this change seems to have been
pretty stable (no spurious warnings) for about a week.
Other modules which use threads may require similar use of
threading_setup/threading_cleanup from test_support.
........
r47014 | neal.norwitz | 2006-06-18 21:37:40 +0200 (Sun, 18 Jun 2006) | 9 lines
The hppa ubuntu box sometimes hangs forever in these tests. My guess
is that the wait is failing for some reason. Use WNOHANG, so we won't
wait until the buildbot kills the test suite.
I haven't been able to reproduce the failure, so I'm not sure if
this will help or not. Hopefully, this change will cause the test
to fail, rather than hang. That will be better since we will get
the rest of the test results. It may also help us debug the real problem.
........
r47015 | neal.norwitz | 2006-06-18 22:10:24 +0200 (Sun, 18 Jun 2006) | 1 line
Revert 47014 until it is more robust
........
r47016 | thomas.heller | 2006-06-18 23:27:04 +0200 (Sun, 18 Jun 2006) | 6 lines
Fix typos.
Fix doctest example.
Mention in the tutorial that 'errcheck' is explained in the ref manual.
Use better wording in some places.
Remoce code examples that shouldn't be in the tutorial.
Remove some XXX notices.
........
r47017 | georg.brandl | 2006-06-19 00:17:29 +0200 (Mon, 19 Jun 2006) | 3 lines
Patch #1507676: improve exception messages in abstract.c, object.c and typeobject.c.
........
r47018 | neal.norwitz | 2006-06-19 07:40:44 +0200 (Mon, 19 Jun 2006) | 1 line
Use Py_ssize_t
........
r47019 | georg.brandl | 2006-06-19 08:35:54 +0200 (Mon, 19 Jun 2006) | 3 lines
Add news entry about error msg improvement.
........
r47020 | thomas.heller | 2006-06-19 09:07:49 +0200 (Mon, 19 Jun 2006) | 2 lines
Try to repair the failing test on the OpenBSD buildbot. Trial and error...
........
r47021 | tim.peters | 2006-06-19 09:45:16 +0200 (Mon, 19 Jun 2006) | 2 lines
Whitespace normalization.
........
r47022 | walter.doerwald | 2006-06-19 10:07:50 +0200 (Mon, 19 Jun 2006) | 4 lines
Patch #1506645: add Python wrappers for the curses functions
is_term_resized, resize_term and resizeterm. This uses three
separate configure checks (one for each function).
........
r47023 | walter.doerwald | 2006-06-19 10:14:09 +0200 (Mon, 19 Jun 2006) | 2 lines
Make check order match in configure and configure.in.
........
r47024 | tim.peters | 2006-06-19 10:14:28 +0200 (Mon, 19 Jun 2006) | 3 lines
Repair KeyError when running test_threaded_import under -R,
as reported by Neal on python-dev.
........
r47025 | thomas.heller | 2006-06-19 10:32:46 +0200 (Mon, 19 Jun 2006) | 3 lines
Next try to fix the OpenBSD buildbot tests:
Use ctypes.util.find_library to locate the C runtime library
on platforms where is returns useful results.
........
r47026 | tim.peters | 2006-06-19 11:09:44 +0200 (Mon, 19 Jun 2006) | 13 lines
TestHelp.make_parser(): This was making a permanent change to
os.environ (setting envar COLUMNS), which at least caused
test_float_default() to fail if the tests were run more than once.
This repairs the test_optparse -R failures Neal reported on
python-dev. It also explains some seemingly bizarre test_optparse
failures we saw a couple weeks ago on the buildbots, when
test_optparse failed due to test_file failing to clean up after
itself, and then test_optparse failed in an entirely different
way when regrtest's -w option ran test_optparse a second time.
It's now obvious that make_parser() permanently changing os.environ
was responsible for the second half of that.
........
r47027 | anthony.baxter | 2006-06-19 14:04:15 +0200 (Mon, 19 Jun 2006) | 2 lines
Preparing for 2.5b1.
........
r47029 | fred.drake | 2006-06-19 19:31:16 +0200 (Mon, 19 Jun 2006) | 1 line
remove non-working document formats from edist
........
r47030 | gerhard.haering | 2006-06-19 23:17:35 +0200 (Mon, 19 Jun 2006) | 5 lines
Fixed a memory leak that was introduced with incorrect usage of the Python weak
reference API in pysqlite 2.2.1.
Bumbed pysqlite version number to upcoming pysqlite 2.3.1 release.
........
r47032 | ka-ping.yee | 2006-06-20 00:49:36 +0200 (Tue, 20 Jun 2006) | 2 lines
Remove Python 2.3 compatibility comment.
........
r47033 | trent.mick | 2006-06-20 01:21:25 +0200 (Tue, 20 Jun 2006) | 2 lines
Upgrade pyexpat to expat 2.0.0 (http://python.org/sf/1462338).
........
r47034 | trent.mick | 2006-06-20 01:57:41 +0200 (Tue, 20 Jun 2006) | 3 lines
[ 1295808 ] expat symbols should be namespaced in pyexpat
(http://python.org/sf/1295808)
........
r47039 | andrew.kuchling | 2006-06-20 13:52:16 +0200 (Tue, 20 Jun 2006) | 1 line
Uncomment wsgiref section
........
r47040 | andrew.kuchling | 2006-06-20 14:15:09 +0200 (Tue, 20 Jun 2006) | 1 line
Add four library items
........
r47041 | andrew.kuchling | 2006-06-20 14:19:54 +0200 (Tue, 20 Jun 2006) | 1 line
Terminology and typography fixes
........
r47042 | andrew.kuchling | 2006-06-20 15:05:12 +0200 (Tue, 20 Jun 2006) | 1 line
Add introductory paragraphs summarizing the release; minor edits
........
r47043 | andrew.kuchling | 2006-06-20 15:11:29 +0200 (Tue, 20 Jun 2006) | 1 line
Minor edits and rearrangements; markup fix
........
r47044 | andrew.kuchling | 2006-06-20 15:20:30 +0200 (Tue, 20 Jun 2006) | 1 line
[Bug #1504456] Mention xml -> xmlcore change
........
r47047 | brett.cannon | 2006-06-20 19:30:26 +0200 (Tue, 20 Jun 2006) | 2 lines
Raise TestSkipped when the test socket connection is refused.
........
r47049 | brett.cannon | 2006-06-20 21:20:17 +0200 (Tue, 20 Jun 2006) | 2 lines
Fix typo of exception name.
........
r47053 | brett.cannon | 2006-06-21 18:57:57 +0200 (Wed, 21 Jun 2006) | 5 lines
At the C level, tuple arguments are passed in directly to the exception
constructor, meaning it is treated as *args, not as a single argument. This
means using the 'message' attribute won't work (until Py3K comes around),
and so one must grab from 'arg' to get the error number.
........
r47054 | andrew.kuchling | 2006-06-21 19:10:18 +0200 (Wed, 21 Jun 2006) | 1 line
Link to LibRef module documentation
........
r47055 | andrew.kuchling | 2006-06-21 19:17:10 +0200 (Wed, 21 Jun 2006) | 1 line
Note some of Barry's work
........
r47056 | andrew.kuchling | 2006-06-21 19:17:28 +0200 (Wed, 21 Jun 2006) | 1 line
Bump version
........
r47057 | georg.brandl | 2006-06-21 19:45:17 +0200 (Wed, 21 Jun 2006) | 3 lines
fix [ 1509132 ] compiler module builds incorrect AST for TryExceptFinally
........
r47058 | georg.brandl | 2006-06-21 19:52:36 +0200 (Wed, 21 Jun 2006) | 3 lines
Make test_fcntl aware of netbsd3.
........
r47059 | georg.brandl | 2006-06-21 19:53:17 +0200 (Wed, 21 Jun 2006) | 3 lines
Patch #1509001: expected skips for netbsd3.
........
r47060 | gerhard.haering | 2006-06-21 22:55:04 +0200 (Wed, 21 Jun 2006) | 2 lines
Removed call to enable_callback_tracebacks that slipped in by accident.
........
r47061 | armin.rigo | 2006-06-21 23:58:50 +0200 (Wed, 21 Jun 2006) | 13 lines
Fix for an obscure bug introduced by revs 46806 and 46808, with a test.
The problem of checking too eagerly for recursive calls is the
following: if a RuntimeError is caused by recursion, and if code needs
to normalize it immediately (as in the 2nd test), then
PyErr_NormalizeException() needs a call to the RuntimeError class to
instantiate it, and this hits the recursion limit again... causing
PyErr_NormalizeException() to never finish.
Moved this particular recursion check to slot_tp_call(), which is not
involved in instantiating built-in exceptions.
Backport candidate.
........
r47064 | neal.norwitz | 2006-06-22 08:30:50 +0200 (Thu, 22 Jun 2006) | 3 lines
Copy the wsgiref package during make install.
........
r47065 | neal.norwitz | 2006-06-22 08:35:30 +0200 (Thu, 22 Jun 2006) | 1 line
Reset the doc date to today for the automatic doc builds
........
r47067 | andrew.kuchling | 2006-06-22 15:10:23 +0200 (Thu, 22 Jun 2006) | 1 line
Mention how to suppress warnings
........
r47069 | georg.brandl | 2006-06-22 16:46:17 +0200 (Thu, 22 Jun 2006) | 3 lines
Set lineno correctly on list, tuple and dict literals.
........
r47070 | georg.brandl | 2006-06-22 16:46:46 +0200 (Thu, 22 Jun 2006) | 4 lines
Test for correct compilation of try-except-finally stmt.
Test for correct lineno on list, tuple, dict literals.
........
r47071 | fred.drake | 2006-06-22 17:50:08 +0200 (Thu, 22 Jun 2006) | 1 line
fix markup nit
........
r47072 | brett.cannon | 2006-06-22 18:49:14 +0200 (Thu, 22 Jun 2006) | 6 lines
'warning's was improperly requiring that a command-line Warning category be
both a subclass of Warning and a subclass of types.ClassType. The latter is no
longer true thanks to new-style exceptions.
Closes bug #1510580. Thanks to AMK for the test.
........
r47073 | ronald.oussoren | 2006-06-22 20:33:54 +0200 (Thu, 22 Jun 2006) | 3 lines
MacOSX: Add a message to the first screen of the installer that tells
users how to avoid updates to their shell profile.
........
r47074 | georg.brandl | 2006-06-22 21:02:18 +0200 (Thu, 22 Jun 2006) | 3 lines
Fix my name ;)
........
r47075 | thomas.heller | 2006-06-22 21:07:36 +0200 (Thu, 22 Jun 2006) | 2 lines
Small fixes, mostly in the markup.
........
r47076 | peter.astrand | 2006-06-22 22:06:46 +0200 (Thu, 22 Jun 2006) | 1 line
Make it possible to run test_subprocess.py on Python 2.2, which lacks test_support.is_resource_enabled.
........
r47077 | peter.astrand | 2006-06-22 22:21:26 +0200 (Thu, 22 Jun 2006) | 1 line
Applied patch #1506758: Prevent MemoryErrors with large MAXFD.
........
r47079 | neal.norwitz | 2006-06-23 05:32:44 +0200 (Fri, 23 Jun 2006) | 1 line
Fix refleak
........
r47080 | fred.drake | 2006-06-23 08:03:45 +0200 (Fri, 23 Jun 2006) | 9 lines
- SF bug #853506: IP6 address parsing in sgmllib
('[' and ']' were not accepted in unquoted attribute values)
- cleaned up tests of character and entity reference decoding so the
tests cover the documented relationships among handle_charref,
handle_entityref, convert_charref, convert_codepoint, and
convert_entityref, without bringing up Unicode issues that sgmllib
cannot be involved in
........
r47085 | andrew.kuchling | 2006-06-23 21:23:40 +0200 (Fri, 23 Jun 2006) | 11 lines
Fit Makefile for the Python doc environment better; this is a step toward
including the howtos in the build process.
* Put LaTeX output in ../paper-<whatever>/.
* Put HTML output in ../html/
* Explain some of the Makefile variables
* Remove some cruft dating to my environment (e.g. the 'web' target)
This makefile isn't currently invoked by the documentation build process,
so these changes won't destabilize anything.
........
r47086 | hyeshik.chang | 2006-06-23 23:16:18 +0200 (Fri, 23 Jun 2006) | 5 lines
Bug #1511381: codec_getstreamcodec() in codec.c is corrected to
omit a default "error" argument for NULL pointer. This allows
the parser to take a codec from cjkcodecs again.
(Reported by Taewook Kang and reviewed by Walter Doerwald)
........
r47091 | ronald.oussoren | 2006-06-25 22:44:16 +0200 (Sun, 25 Jun 2006) | 6 lines
Workaround for bug #1512124
Without this patch IDLE will get unresponsive when you open the debugger
window on OSX. This is both using the system Tcl/Tk on Tiger as the latest
universal download from tk-components.sf.net.
........
r47092 | ronald.oussoren | 2006-06-25 23:14:19 +0200 (Sun, 25 Jun 2006) | 3 lines
Drop the calldll demo's for macos, calldll isn't present anymore, no need
to keep the demo's around.
........
r47093 | ronald.oussoren | 2006-06-25 23:15:58 +0200 (Sun, 25 Jun 2006) | 3 lines
Use a path without a double slash to compile the .py files after installation
(macosx, binary installer). This fixes bug #1508369 for python 2.5.
........
r47094 | ronald.oussoren | 2006-06-25 23:19:06 +0200 (Sun, 25 Jun 2006) | 3 lines
Also install the .egg-info files in Lib. This will cause wsgiref.egg-info to
be installed.
........
r47097 | andrew.kuchling | 2006-06-26 14:40:02 +0200 (Mon, 26 Jun 2006) | 1 line
[Bug #1511998] Various comments from Nick Coghlan; thanks!
........
r47098 | andrew.kuchling | 2006-06-26 14:43:43 +0200 (Mon, 26 Jun 2006) | 1 line
Describe workaround for PyRange_New()'s removal
........
r47099 | andrew.kuchling | 2006-06-26 15:08:24 +0200 (Mon, 26 Jun 2006) | 5 lines
[Bug #1512163] Fix typo.
This change will probably break tests on FreeBSD buildbots, but I'll check in
a fix for that next.
........
r47100 | andrew.kuchling | 2006-06-26 15:12:16 +0200 (Mon, 26 Jun 2006) | 9 lines
[Bug #1512163] Use one set of locking methods, lockf();
remove the flock() calls.
On FreeBSD, the two methods lockf() and flock() end up using the same
mechanism and the second one fails. A Linux man page claims that the
two methods are orthogonal (so locks acquired one way don't interact
with locks acquired the other way) but that clearly must be false.
........
r47101 | andrew.kuchling | 2006-06-26 15:23:10 +0200 (Mon, 26 Jun 2006) | 5 lines
Add a test for a conflicting lock.
On slow machines, maybe the time intervals (2 sec, 0.5 sec) will be too tight.
I'll see how the buildbots like it.
........
r47103 | andrew.kuchling | 2006-06-26 16:33:24 +0200 (Mon, 26 Jun 2006) | 1 line
Windows doesn't have os.fork(). I'll just disable this test for now
........
r47106 | andrew.kuchling | 2006-06-26 19:00:35 +0200 (Mon, 26 Jun 2006) | 9 lines
Attempt to fix build failure on OS X and Debian alpha; the symptom is
consistent with os.wait() returning immediately because some other
subprocess had previously exited; the test suite then immediately
tries to lock the mailbox and gets an error saying it's already
locked.
To fix this, do a waitpid() so the test suite only continues once
the intended child process has exited.
........
r47113 | neal.norwitz | 2006-06-27 06:06:46 +0200 (Tue, 27 Jun 2006) | 1 line
Ignore some more warnings in the dynamic linker on an older gentoo
........
r47114 | neal.norwitz | 2006-06-27 06:09:13 +0200 (Tue, 27 Jun 2006) | 6 lines
Instead of doing a make test, run the regression tests out of the installed
copy. This will hopefully catch problems where directories are added
under Lib/ but not to Makefile.pre.in. This breaks out the 2 runs
of the test suite with and without -O which is also nicer.
........
r47115 | neal.norwitz | 2006-06-27 06:12:58 +0200 (Tue, 27 Jun 2006) | 5 lines
Fix SF bug #1513032, 'make install' failure on FreeBSD 5.3.
No need to install lib-old, it's empty in 2.5.
........
r47116 | neal.norwitz | 2006-06-27 06:23:06 +0200 (Tue, 27 Jun 2006) | 1 line
Test unimportant change to verify buildbot does not try to build
........
r47117 | neal.norwitz | 2006-06-27 06:26:30 +0200 (Tue, 27 Jun 2006) | 1 line
Try again: test unimportant change to verify buildbot does not try to build
........
r47118 | neal.norwitz | 2006-06-27 06:28:56 +0200 (Tue, 27 Jun 2006) | 1 line
Verify buildbot picks up these changes (really needs testing after last change to Makefile.pre.in)
........
r47121 | vinay.sajip | 2006-06-27 09:34:37 +0200 (Tue, 27 Jun 2006) | 1 line
Removed buggy exception handling in doRollover of rotating file handlers. Exceptions now propagate to caller.
........
r47123 | ronald.oussoren | 2006-06-27 12:08:25 +0200 (Tue, 27 Jun 2006) | 3 lines
MacOSX: fix rather dumb buglet that made it impossible to create extensions on
OSX 10.3 when using a binary distribution build on 10.4.
........
r47125 | tim.peters | 2006-06-27 13:52:49 +0200 (Tue, 27 Jun 2006) | 2 lines
Whitespace normalization.
........
r47128 | ronald.oussoren | 2006-06-27 14:53:52 +0200 (Tue, 27 Jun 2006) | 8 lines
Use staticly build copies of zlib and bzip2 to build the OSX installer, that
way the resulting binaries have a better change of running on 10.3.
This patch also updates the search logic for sleepycat db3/4, without this
patch you cannot use a sleepycat build with a non-standard prefix; with this
you can (at least on OSX) if you add the prefix to CPPFLAGS/LDFLAGS at
configure-time. This change is needed to build the binary installer for OSX.
........
r47131 | ronald.oussoren | 2006-06-27 17:45:32 +0200 (Tue, 27 Jun 2006) | 5 lines
macosx: Install a libpython2.5.a inside the framework as a symlink to the actual
dylib at the root of the framework, that way tools that expect a unix-like
install (python-config, but more importantly external products like
mod_python) work correctly.
........
r47137 | neal.norwitz | 2006-06-28 07:03:22 +0200 (Wed, 28 Jun 2006) | 4 lines
According to the man pages on Gentoo Linux and Tru64, EACCES or EAGAIN
can be returned if fcntl (lockf) fails. This fixes the test failure
on Tru64 by checking for either error rather than just EAGAIN.
........
r47139 | neal.norwitz | 2006-06-28 08:28:31 +0200 (Wed, 28 Jun 2006) | 5 lines
Fix bug #1512695: cPickle.loads could crash if it was interrupted with
a KeyboardInterrupt since PyTuple_Pack was passed a NULL.
Will backport.
........
r47142 | nick.coghlan | 2006-06-28 12:41:47 +0200 (Wed, 28 Jun 2006) | 1 line
Make full module name available as __module_name__ even when __name__ is set to something else (like '__main__')
........
r47143 | armin.rigo | 2006-06-28 12:49:51 +0200 (Wed, 28 Jun 2006) | 2 lines
A couple of crashers of the "won't fix" kind.
........
r47147 | andrew.kuchling | 2006-06-28 16:25:20 +0200 (Wed, 28 Jun 2006) | 1 line
[Bug #1508766] Add docs for uuid module; docs written by George Yoshida, with minor rearrangements by me.
........
r47148 | andrew.kuchling | 2006-06-28 16:27:21 +0200 (Wed, 28 Jun 2006) | 1 line
[Bug #1508766] Add docs for uuid module; this puts the module in the 'Internet Protocols' section. Arguably this module could also have gone in the chapters on strings or encodings, maybe even the crypto chapter. Fred, please move if you see fit.
........
r47151 | georg.brandl | 2006-06-28 22:23:25 +0200 (Wed, 28 Jun 2006) | 3 lines
Fix end_fill().
........
r47153 | trent.mick | 2006-06-28 22:30:41 +0200 (Wed, 28 Jun 2006) | 2 lines
Mention the expat upgrade and pyexpat fix I put in 2.5b1.
........
r47154 | fred.drake | 2006-06-29 02:51:53 +0200 (Thu, 29 Jun 2006) | 6 lines
SF bug #1504333: sgmlib should allow angle brackets in quoted values
(modified patch by Sam Ruby; changed to use separate REs for start and end
tags to reduce matching cost for end tags; extended tests; updated to avoid
breaking previous changes to support IPv6 addresses in unquoted attribute
values)
........
r47156 | fred.drake | 2006-06-29 04:57:48 +0200 (Thu, 29 Jun 2006) | 1 line
document recent bugfixes in sgmllib
........
r47158 | neal.norwitz | 2006-06-29 06:10:08 +0200 (Thu, 29 Jun 2006) | 10 lines
Add new utility function, reap_children(), to test_support. This should
be called at the end of each test that spawns children (perhaps it
should be called from regrtest instead?). This will hopefully prevent
some of the unexplained failures in the buildbots (hppa and alpha)
during tests that spawn children. The problems were not reproducible.
There were many zombies that remained at the end of several tests.
In the worst case, this shouldn't cause any more problems,
though it may not help either. Time will tell.
........
r47159 | neal.norwitz | 2006-06-29 07:48:14 +0200 (Thu, 29 Jun 2006) | 5 lines
This should fix the buildbot failure on s/390 which can't connect to gmail.org.
It makes the error message consistent and always sends to stderr.
It would be much better for all the networking tests to hit only python.org.
........
r47161 | thomas.heller | 2006-06-29 20:34:15 +0200 (Thu, 29 Jun 2006) | 3 lines
Protect the thread api calls in the _ctypes extension module within
#ifdef WITH_THREADS/#endif blocks. Found by Sam Rushing.
........
r47162 | martin.v.loewis | 2006-06-29 20:58:44 +0200 (Thu, 29 Jun 2006) | 2 lines
Patch #1509163: MS Toolkit Compiler no longer available
........
r47163 | skip.montanaro | 2006-06-29 21:20:09 +0200 (Thu, 29 Jun 2006) | 1 line
add string methods to index
........
r47164 | vinay.sajip | 2006-06-30 02:13:08 +0200 (Fri, 30 Jun 2006) | 1 line
Fixed bug in fileConfig() which failed to clear logging._handlerList
........
r47166 | tim.peters | 2006-06-30 08:18:39 +0200 (Fri, 30 Jun 2006) | 2 lines
Whitespace normalization.
........
r47170 | neal.norwitz | 2006-06-30 09:32:16 +0200 (Fri, 30 Jun 2006) | 1 line
Silence compiler warning
........
r47171 | neal.norwitz | 2006-06-30 09:32:46 +0200 (Fri, 30 Jun 2006) | 1 line
Another problem reported by Coverity. Backport candidate.
........
r47175 | thomas.heller | 2006-06-30 19:44:54 +0200 (Fri, 30 Jun 2006) | 2 lines
Revert the use of PY_FORMAT_SIZE_T in PyErr_Format.
........
r47176 | tim.peters | 2006-06-30 20:34:51 +0200 (Fri, 30 Jun 2006) | 2 lines
Remove now-unused fidding with PY_FORMAT_SIZE_T.
........
r47177 | georg.brandl | 2006-06-30 20:47:56 +0200 (Fri, 30 Jun 2006) | 3 lines
Document decorator usage of property.
........
r47181 | fred.drake | 2006-06-30 21:29:25 +0200 (Fri, 30 Jun 2006) | 4 lines
- consistency nit: always include "()" in \function and \method
(*should* be done by the presentation, but that requires changes all over)
- avoid spreading the __name meme
........
r47188 | vinay.sajip | 2006-07-01 12:45:20 +0200 (Sat, 01 Jul 2006) | 1 line
Added entry for fileConfig() bugfix.
........
r47189 | vinay.sajip | 2006-07-01 12:47:20 +0200 (Sat, 01 Jul 2006) | 1 line
Added duplicate call to fileConfig() to ensure that it cleans up after itself correctly.
........
r47190 | martin.v.loewis | 2006-07-01 17:33:37 +0200 (Sat, 01 Jul 2006) | 2 lines
Release all forwarded functions in .close. Fixes #1513223.
........
r47191 | fred.drake | 2006-07-01 18:28:20 +0200 (Sat, 01 Jul 2006) | 7 lines
SF bug #1296433 (Expat bug #1515266): Unchecked calls to character data
handler would cause a segfault. This merges in Expat's lib/xmlparse.c
revisions 1.154 and 1.155, which fix this and a closely related problem
(the later does not affect Python).
Moved the crasher test to the tests for xml.parsers.expat.
........
r47197 | gerhard.haering | 2006-07-02 19:48:30 +0200 (Sun, 02 Jul 2006) | 4 lines
The sqlite3 module did cut off data from the SQLite database at the first null
character before sending it to a custom converter. This has been fixed now.
........
r47198 | martin.v.loewis | 2006-07-02 20:44:00 +0200 (Sun, 02 Jul 2006) | 1 line
Correct arithmetic in access on Win32. Fixes #1513646.
........
r47203 | thomas.heller | 2006-07-03 09:58:09 +0200 (Mon, 03 Jul 2006) | 1 line
Cleanup: Remove commented out code.
........
r47204 | thomas.heller | 2006-07-03 09:59:50 +0200 (Mon, 03 Jul 2006) | 1 line
Don't run the doctests with Python 2.3 because it doesn't have the ELLIPSIS flag.
........
r47205 | thomas.heller | 2006-07-03 10:04:05 +0200 (Mon, 03 Jul 2006) | 7 lines
Fixes so that _ctypes can be compiled with the MingW compiler.
It seems that the definition of '__attribute__(x)' was responsible for
the compiler ignoring the '__fastcall' attribute on the
ffi_closure_SYSV function in libffi_msvc/ffi.c, took me quite some
time to figure this out.
........
r47206 | thomas.heller | 2006-07-03 10:08:14 +0200 (Mon, 03 Jul 2006) | 11 lines
Add a new function uses_seh() to the _ctypes extension module. This
will return True if Windows Structured Exception handling (SEH) is
used when calling functions, False otherwise.
Currently, only MSVC supports SEH.
Fix the test so that it doesn't crash when run with MingW compiled
_ctypes. Note that two tests are still failing when mingw is used, I
suspect structure layout differences and function calling conventions
between MSVC and MingW.
........
r47207 | tim.peters | 2006-07-03 10:23:19 +0200 (Mon, 03 Jul 2006) | 2 lines
Whitespace normalization.
........
r47208 | martin.v.loewis | 2006-07-03 11:44:00 +0200 (Mon, 03 Jul 2006) | 3 lines
Only setup canvas when it is first created.
Fixes #1514703
........
r47209 | martin.v.loewis | 2006-07-03 12:05:30 +0200 (Mon, 03 Jul 2006) | 3 lines
Reimplement turtle.circle using a polyline, to allow correct
filling of arcs. Also fixes #1514693.
........
r47210 | martin.v.loewis | 2006-07-03 12:19:49 +0200 (Mon, 03 Jul 2006) | 3 lines
Bug #1514693: Update turtle's heading when switching between
degrees and radians.
........
r47211 | martin.v.loewis | 2006-07-03 13:12:06 +0200 (Mon, 03 Jul 2006) | 2 lines
Document functions added in 2.3 and 2.5.
........
r47212 | martin.v.loewis | 2006-07-03 14:19:50 +0200 (Mon, 03 Jul 2006) | 3 lines
Bug #1417699: Reject locale-specific decimal point in float()
and atof().
........
r47213 | martin.v.loewis | 2006-07-03 14:28:58 +0200 (Mon, 03 Jul 2006) | 3 lines
Bug #1267547: Put proper recursive setup.py call into the
spec file generated by bdist_rpm.
........
r47215 | martin.v.loewis | 2006-07-03 15:01:35 +0200 (Mon, 03 Jul 2006) | 3 lines
Patch #825417: Fix timeout processing in expect,
read_until. Will backport to 2.4.
........
r47218 | martin.v.loewis | 2006-07-03 15:47:40 +0200 (Mon, 03 Jul 2006) | 2 lines
Put method-wrappers into trashcan. Fixes #927248.
........
r47219 | andrew.kuchling | 2006-07-03 16:07:30 +0200 (Mon, 03 Jul 2006) | 1 line
[Bug #1515932] Clarify description of slice assignment
........
r47220 | andrew.kuchling | 2006-07-03 16:16:09 +0200 (Mon, 03 Jul 2006) | 4 lines
[Bug #1511911] Clarify description of optional arguments to sorted()
by improving the xref to the section on lists, and by
copying the explanations of the arguments (with a slight modification).
........
r47223 | kristjan.jonsson | 2006-07-03 16:59:05 +0200 (Mon, 03 Jul 2006) | 1 line
Fix build problems with the platform SDK on windows. It is not sufficient to test for the C compiler version when determining if we have the secure CRT from microsoft. Must test with an undocumented macro, __STDC_SECURE_LIB__ too.
........
r47224 | ronald.oussoren | 2006-07-04 14:30:22 +0200 (Tue, 04 Jul 2006) | 7 lines
Sync the darwin/x86 port libffi with the copy in PyObjC. This fixes a number
of bugs in that port. The most annoying ones were due to some subtle differences
between the document ABI and the actual implementation :-(
(there are no python unittests that fail without this patch, but without it
some of libffi's unittests fail).
........
r47234 | georg.brandl | 2006-07-05 10:21:00 +0200 (Wed, 05 Jul 2006) | 3 lines
Remove remaining references to OverflowWarning.
........
r47236 | thomas.heller | 2006-07-05 11:13:56 +0200 (Wed, 05 Jul 2006) | 3 lines
Fix the bitfield test when _ctypes is compiled with MingW. Structures
containing bitfields may have different layout on MSVC and MingW .
........
r47237 | thomas.wouters | 2006-07-05 13:03:49 +0200 (Wed, 05 Jul 2006) | 15 lines
Fix bug in passing tuples to string.Template. All other values (with working
str() or repr()) would work, just not multi-value tuples. Probably not a
backport candidate, since it changes the behaviour of passing a
single-element tuple:
>>> string.Template("$foo").substitute(dict(foo=(1,)))
'(1,)'
versus
'1'
........
r47241 | georg.brandl | 2006-07-05 16:18:45 +0200 (Wed, 05 Jul 2006) | 2 lines
Patch #1517490: fix glitches in filter() docs.
........
r47244 | georg.brandl | 2006-07-05 17:50:05 +0200 (Wed, 05 Jul 2006) | 2 lines
no need to elaborate "string".
........
r47251 | neal.norwitz | 2006-07-06 06:28:59 +0200 (Thu, 06 Jul 2006) | 3 lines
Fix refleaks reported by Shane Hathaway in SF patch #1515361. This change
contains only the changes related to leaking the copy variable.
........
r47253 | fred.drake | 2006-07-06 07:13:22 +0200 (Thu, 06 Jul 2006) | 4 lines
- back out Expat change; the final fix to Expat will be different
- change the pyexpat wrapper to not be so sensitive to this detail of the
Expat implementation (the ex-crasher test still passes)
........
r47257 | neal.norwitz | 2006-07-06 08:45:08 +0200 (Thu, 06 Jul 2006) | 1 line
Add a NEWS entry for a recent pyexpat fix
........
r47258 | martin.v.loewis | 2006-07-06 08:55:58 +0200 (Thu, 06 Jul 2006) | 2 lines
Add sqlite3.dll to the DLLs component, not to the TkDLLs component.
Fixes #1517388.
........
r47259 | martin.v.loewis | 2006-07-06 09:05:21 +0200 (Thu, 06 Jul 2006) | 1 line
Properly quote compileall and Lib paths in case TARGETDIR has a space.
........
r47260 | thomas.heller | 2006-07-06 09:50:18 +0200 (Thu, 06 Jul 2006) | 5 lines
Revert the change done in svn revision 47206:
Add a new function uses_seh() to the _ctypes extension module. This
will return True if Windows Structured Exception handling (SEH) is
used when calling functions, False otherwise.
........
r47261 | armin.rigo | 2006-07-06 09:58:18 +0200 (Thu, 06 Jul 2006) | 3 lines
A couple of examples about how to attack the fact that _PyType_Lookup()
returns a borrowed ref. Many of the calls are open to attack.
........
r47262 | thomas.heller | 2006-07-06 10:28:14 +0200 (Thu, 06 Jul 2006) | 2 lines
The test that calls a function with invalid arguments and catches the
resulting Windows access violation will not be run by default.
........
r47263 | thomas.heller | 2006-07-06 10:48:35 +0200 (Thu, 06 Jul 2006) | 5 lines
Patch #1517790: It is now possible to use custom objects in the ctypes
foreign function argtypes sequence as long as they provide a
from_param method, no longer is it required that the object is a
ctypes type.
........
r47264 | thomas.heller | 2006-07-06 10:58:40 +0200 (Thu, 06 Jul 2006) | 2 lines
Document the Struture and Union constructors.
........
r47265 | thomas.heller | 2006-07-06 11:11:22 +0200 (Thu, 06 Jul 2006) | 2 lines
Document the changes in svn revision 47263, from patch #1517790.
........
r47267 | ronald.oussoren | 2006-07-06 12:13:35 +0200 (Thu, 06 Jul 2006) | 7 lines
This patch solves the problem Skip was seeing with zlib, this patch ensures that
configure uses similar compiler flags as setup.py when doing the zlib test.
Without this patch configure would use the first shared library on the linker
path, with this patch it uses the first shared or static library on that path
just like setup.py.
........
r47268 | thomas.wouters | 2006-07-06 12:48:28 +0200 (Thu, 06 Jul 2006) | 4 lines
NEWS entry for r47267: fixing configure's zlib probing.
........
r47269 | fredrik.lundh | 2006-07-06 14:29:24 +0200 (Thu, 06 Jul 2006) | 3 lines
added XMLParser alias for cElementTree compatibility
........
r47271 | nick.coghlan | 2006-07-06 14:53:04 +0200 (Thu, 06 Jul 2006) | 1 line
Revert the __module_name__ changes made in rev 47142. We'll revisit this in Python 2.6
........
r47272 | nick.coghlan | 2006-07-06 15:04:56 +0200 (Thu, 06 Jul 2006) | 1 line
Update the tutorial section on relative imports
........
r47273 | nick.coghlan | 2006-07-06 15:35:27 +0200 (Thu, 06 Jul 2006) | 1 line
Ignore ImportWarning by default
........
r47274 | nick.coghlan | 2006-07-06 15:41:34 +0200 (Thu, 06 Jul 2006) | 1 line
Cover ImportWarning, PendingDeprecationWarning and simplefilter() in the warnings module docs
........
r47275 | nick.coghlan | 2006-07-06 15:47:18 +0200 (Thu, 06 Jul 2006) | 1 line
Add NEWS entries for the ImportWarning change and documentation update
........
r47276 | andrew.kuchling | 2006-07-06 15:57:28 +0200 (Thu, 06 Jul 2006) | 1 line
ImportWarning is now silent by default
........
r47277 | thomas.heller | 2006-07-06 17:06:05 +0200 (Thu, 06 Jul 2006) | 2 lines
Document the correct return type of PyLong_AsUnsignedLongLongMask.
........
r47278 | hyeshik.chang | 2006-07-06 17:21:52 +0200 (Thu, 06 Jul 2006) | 2 lines
Add a testcase for r47086 which fixed a bug in codec_getstreamcodec().
........
r47279 | hyeshik.chang | 2006-07-06 17:39:24 +0200 (Thu, 06 Jul 2006) | 3 lines
Test using all CJK encodings for the testcases which don't require
specific encodings.
........
r47280 | martin.v.loewis | 2006-07-06 21:28:03 +0200 (Thu, 06 Jul 2006) | 2 lines
Properly generate logical file ids. Fixes #1515998.
Also correct typo in Control.mapping.
........
r47287 | neal.norwitz | 2006-07-07 08:03:15 +0200 (Fri, 07 Jul 2006) | 17 lines
Restore rev 47014:
The hppa ubuntu box sometimes hangs forever in these tests. My guess
is that the wait is failing for some reason. Use WNOHANG, so we won't
wait until the buildbot kills the test suite.
I haven't been able to reproduce the failure, so I'm not sure if
this will help or not. Hopefully, this change will cause the test
to fail, rather than hang. That will be better since we will get
the rest of the test results. It may also help us debug the real problem.
*** The reason this originally failed was because there were many
zombie children outstanding before rev 47158 cleaned them up.
There are still hangs in test_subprocess that need to be addressed,
but that will take more work. This should close some holes.
........
r47289 | georg.brandl | 2006-07-07 10:15:12 +0200 (Fri, 07 Jul 2006) | 3 lines
Fix RFC number.
........
r50489 | neal.norwitz | 2006-07-08 07:31:37 +0200 (Sat, 08 Jul 2006) | 1 line
Fix SF bug #1519018: 'as' is now validated properly in import statements
........
r50490 | georg.brandl | 2006-07-08 14:15:27 +0200 (Sat, 08 Jul 2006) | 3 lines
Add an additional test for bug #1519018.
........
r50491 | tim.peters | 2006-07-08 21:55:05 +0200 (Sat, 08 Jul 2006) | 2 lines
Whitespace normalization.
........
r50493 | neil.schemenauer | 2006-07-09 18:16:34 +0200 (Sun, 09 Jul 2006) | 2 lines
Fix AST compiler bug #1501934: incorrect LOAD/STORE_GLOBAL generation.
........
r50495 | neil.schemenauer | 2006-07-09 23:19:29 +0200 (Sun, 09 Jul 2006) | 2 lines
Fix SF bug 1441486: bad unary minus folding in compiler.
........
r50497 | neal.norwitz | 2006-07-10 00:14:42 +0200 (Mon, 10 Jul 2006) | 4 lines
On 64 bit systems, int literals that use less than 64 bits are now ints
rather than longs. This also fixes the test for eval(-sys.maxint - 1).
........
r50500 | neal.norwitz | 2006-07-10 02:04:44 +0200 (Mon, 10 Jul 2006) | 4 lines
Bug #1512814, Fix incorrect lineno's when code at module scope
started after line 256.
........
r50501 | neal.norwitz | 2006-07-10 02:05:34 +0200 (Mon, 10 Jul 2006) | 1 line
Fix doco. Backport candidate.
........
r50503 | neal.norwitz | 2006-07-10 02:23:17 +0200 (Mon, 10 Jul 2006) | 5 lines
Part of SF patch #1484695. This removes dead code. The chksum was
already verified in .frombuf() on the lines above. If there was
a problem an exception is raised, so there was no way this condition
could have been true.
........
r50504 | neal.norwitz | 2006-07-10 03:18:57 +0200 (Mon, 10 Jul 2006) | 3 lines
Patch #1516912: improve Modules support for OpenVMS.
........
r50506 | neal.norwitz | 2006-07-10 04:36:41 +0200 (Mon, 10 Jul 2006) | 7 lines
Patch #1504046: Add documentation for xml.etree.
/F wrote the text docs, Englebert Gruber massaged it to latex and I
did some more massaging to try and improve the consistency and
fix some name mismatches between the declaration and text.
........
r50509 | martin.v.loewis | 2006-07-10 09:23:48 +0200 (Mon, 10 Jul 2006) | 2 lines
Introduce DISTUTILS_USE_SDK as a flag to determine whether the
SDK environment should be used. Fixes #1508010.
........
r50510 | martin.v.loewis | 2006-07-10 09:26:41 +0200 (Mon, 10 Jul 2006) | 1 line
Change error message to indicate that VS2003 is necessary to build extension modules, not the .NET SDK.
........
r50511 | martin.v.loewis | 2006-07-10 09:29:41 +0200 (Mon, 10 Jul 2006) | 1 line
Add svn:ignore.
........
r50512 | anthony.baxter | 2006-07-10 09:41:04 +0200 (Mon, 10 Jul 2006) | 1 line
preparing for 2.5b2
........
r50513 | thomas.heller | 2006-07-10 11:10:28 +0200 (Mon, 10 Jul 2006) | 2 lines
Fix bug #1518190: accept any integer or long value in the
ctypes.c_void_p constructor.
........
r50514 | thomas.heller | 2006-07-10 11:31:06 +0200 (Mon, 10 Jul 2006) | 3 lines
Fixed a segfault when ctypes.wintypes were imported on
non-Windows machines.
........
r50516 | thomas.heller | 2006-07-10 13:11:10 +0200 (Mon, 10 Jul 2006) | 3 lines
Assigning None to pointer type structure fields possible overwrote
wrong fields.
........
r50517 | thomas.heller | 2006-07-10 13:17:37 +0200 (Mon, 10 Jul 2006) | 5 lines
Moved the ctypes news entries from the 'Library' section into the
'Extension Modules' section where they belong, probably.
This destroyes the original order of the news entries, don't know
if that is important or not.
........
r50526 | phillip.eby | 2006-07-10 21:03:29 +0200 (Mon, 10 Jul 2006) | 2 lines
Fix SF#1516184 and add a test to prevent regression.
........
r50528 | phillip.eby | 2006-07-10 21:18:35 +0200 (Mon, 10 Jul 2006) | 2 lines
Fix SF#1457312: bad socket error handling in distutils "upload" command.
........
r50537 | peter.astrand | 2006-07-10 22:39:49 +0200 (Mon, 10 Jul 2006) | 1 line
Make it possible to run test_subprocess.py with Python 2.2, which lacks test_support.reap_children().
........
r50541 | tim.peters | 2006-07-10 23:08:24 +0200 (Mon, 10 Jul 2006) | 5 lines
After approval from Anthony, merge the tim-current_frames
branch into the trunk. This adds a new sys._current_frames()
function, which returns a dict mapping thread id to topmost
thread stack frame.
........
r50542 | tim.peters | 2006-07-10 23:11:49 +0200 (Mon, 10 Jul 2006) | 2 lines
Whitespace normalization.
........
r50553 | martin.v.loewis | 2006-07-11 00:11:28 +0200 (Tue, 11 Jul 2006) | 4 lines
Patch #1519566: Remove unused _tofill member.
Make begin_fill idempotent.
Update demo2 to demonstrate filling of concave shapes.
........
r50567 | anthony.baxter | 2006-07-11 04:04:09 +0200 (Tue, 11 Jul 2006) | 4 lines
#1494314: Fix a regression with high-numbered sockets in 2.4.3. This
means that select() on sockets > FD_SETSIZE (typically 1024) work again.
The patch makes sockets use poll() internally where available.
........
r50568 | tim.peters | 2006-07-11 04:17:48 +0200 (Tue, 11 Jul 2006) | 2 lines
Whitespace normalization.
........
r50575 | thomas.heller | 2006-07-11 18:42:05 +0200 (Tue, 11 Jul 2006) | 1 line
Add missing Py_DECREF.
........
r50576 | thomas.heller | 2006-07-11 18:44:25 +0200 (Tue, 11 Jul 2006) | 1 line
Add missing Py_DECREFs.
........
r50579 | andrew.kuchling | 2006-07-11 19:20:16 +0200 (Tue, 11 Jul 2006) | 1 line
Bump version number; add sys._current_frames
........
r50582 | thomas.heller | 2006-07-11 20:28:35 +0200 (Tue, 11 Jul 2006) | 3 lines
When a foreign function is retrived by calling __getitem__ on a ctypes
library instance, do not set it as attribute.
........
r50583 | thomas.heller | 2006-07-11 20:40:50 +0200 (Tue, 11 Jul 2006) | 2 lines
Change the ctypes version number to 1.0.0.
........
r50597 | neal.norwitz | 2006-07-12 07:26:17 +0200 (Wed, 12 Jul 2006) | 3 lines
Bug #1520864: unpacking singleton tuples in for loop (for x, in) work again.
........
r50598 | neal.norwitz | 2006-07-12 07:26:35 +0200 (Wed, 12 Jul 2006) | 1 line
Fix function name in error msg
........
r50599 | neal.norwitz | 2006-07-12 07:27:46 +0200 (Wed, 12 Jul 2006) | 4 lines
Fix uninitialized memory read reported by Valgrind when running doctest.
This could happen if size == 0.
........
r50600 | neal.norwitz | 2006-07-12 09:28:29 +0200 (Wed, 12 Jul 2006) | 1 line
Actually change the MAGIC #. Create a new section for 2.5c1 and mention the impact of changing the MAGIC #.
........
r50601 | thomas.heller | 2006-07-12 10:43:47 +0200 (Wed, 12 Jul 2006) | 3 lines
Fix #1467450: ctypes now uses RTLD_GLOBAL by default on OSX 10.3 to
load shared libraries.
........
r50604 | thomas.heller | 2006-07-12 16:25:18 +0200 (Wed, 12 Jul 2006) | 3 lines
Fix the wrong description of LibraryLoader.LoadLibrary, and document
the DEFAULT_MODE constant.
........
r50607 | georg.brandl | 2006-07-12 17:31:17 +0200 (Wed, 12 Jul 2006) | 3 lines
Accept long options "--help" and "--version".
........
r50617 | thomas.heller | 2006-07-13 11:53:47 +0200 (Thu, 13 Jul 2006) | 3 lines
A misspelled preprocessor symbol caused ctypes to be always compiled
without thread support. Replaced WITH_THREADS with WITH_THREAD.
........
r50619 | thomas.heller | 2006-07-13 19:01:14 +0200 (Thu, 13 Jul 2006) | 3 lines
Fix #1521375. When running with root priviledges, 'gcc -o /dev/null'
did overwrite /dev/null. Use a temporary file instead of /dev/null.
........
r50620 | thomas.heller | 2006-07-13 19:05:13 +0200 (Thu, 13 Jul 2006) | 2 lines
Fix misleading words.
........
r50622 | andrew.kuchling | 2006-07-13 19:37:26 +0200 (Thu, 13 Jul 2006) | 1 line
Typo fix
........
r50629 | georg.brandl | 2006-07-14 09:12:54 +0200 (Fri, 14 Jul 2006) | 3 lines
Patch #1521874: grammar errors in doanddont.tex.
........
r50630 | neal.norwitz | 2006-07-14 09:20:04 +0200 (Fri, 14 Jul 2006) | 1 line
Try to improve grammar further.
........
r50631 | martin.v.loewis | 2006-07-14 11:58:55 +0200 (Fri, 14 Jul 2006) | 1 line
Extend build_ssl to Win64, using VSExtComp.
........
r50632 | martin.v.loewis | 2006-07-14 14:10:09 +0200 (Fri, 14 Jul 2006) | 1 line
Add debug output to analyse buildbot failure.
........
r50633 | martin.v.loewis | 2006-07-14 14:31:05 +0200 (Fri, 14 Jul 2006) | 1 line
Fix Debug build of _ssl.
........
r50636 | andrew.kuchling | 2006-07-14 15:32:38 +0200 (Fri, 14 Jul 2006) | 1 line
Mention new options
........
r50638 | peter.astrand | 2006-07-14 16:04:45 +0200 (Fri, 14 Jul 2006) | 1 line
Bug #1223937: CalledProcessError.errno -> CalledProcessError.returncode.
........
r50640 | thomas.heller | 2006-07-14 17:01:05 +0200 (Fri, 14 Jul 2006) | 4 lines
Make the prototypes of our private PyUnicode_FromWideChar and
PyUnicode_AsWideChar replacement functions compatible to the official
functions by using Py_ssize_t instead of int.
........
r50643 | thomas.heller | 2006-07-14 19:51:14 +0200 (Fri, 14 Jul 2006) | 3 lines
Patch #1521817: The index range checking on ctypes arrays containing
exactly one element is enabled again.
........
r50647 | thomas.heller | 2006-07-14 20:22:50 +0200 (Fri, 14 Jul 2006) | 2 lines
Updates for the ctypes documentation.
........
r50655 | fredrik.lundh | 2006-07-14 23:45:48 +0200 (Fri, 14 Jul 2006) | 3 lines
typo
........
r50664 | george.yoshida | 2006-07-15 18:03:49 +0200 (Sat, 15 Jul 2006) | 2 lines
Bug #15187702 : ext/win-cookbook.html has a broken link to distutils
........
r50667 | bob.ippolito | 2006-07-15 18:53:15 +0200 (Sat, 15 Jul 2006) | 1 line
Patch #1220874: Update the binhex module for Mach-O.
........
r50671 | fred.drake | 2006-07-16 03:21:20 +0200 (Sun, 16 Jul 2006) | 1 line
clean up some link markup
........
r50673 | neal.norwitz | 2006-07-16 03:50:38 +0200 (Sun, 16 Jul 2006) | 4 lines
Bug #1512814, Fix incorrect lineno's when code within a function
had more than 255 blank lines. Byte codes need to go first, line #s second.
........
r50674 | neal.norwitz | 2006-07-16 04:00:32 +0200 (Sun, 16 Jul 2006) | 5 lines
a & b were dereffed above, so they are known to be valid pointers.
z is known to be NULL, nothing to DECREF.
Reported by Klockwork, #107.
........
r50675 | neal.norwitz | 2006-07-16 04:02:57 +0200 (Sun, 16 Jul 2006) | 5 lines
self is dereffed (and passed as first arg), so it's known to be good.
func is returned from PyArg_ParseTuple and also dereffed.
Reported by Klocwork, #30 (self one at least).
........
r50676 | neal.norwitz | 2006-07-16 04:05:35 +0200 (Sun, 16 Jul 2006) | 4 lines
proto was dereffed above and is known to be good. No need for X.
Reported by Klocwork, #39.
........
r50677 | neal.norwitz | 2006-07-16 04:15:27 +0200 (Sun, 16 Jul 2006) | 5 lines
Fix memory leaks in some conditions.
Reported by Klocwork #152.
........
r50678 | neal.norwitz | 2006-07-16 04:17:36 +0200 (Sun, 16 Jul 2006) | 4 lines
Fix memory leak under some conditions.
Reported by Klocwork, #98.
........
r50679 | neal.norwitz | 2006-07-16 04:22:30 +0200 (Sun, 16 Jul 2006) | 8 lines
Use sizeof(buffer) instead of duplicating the constants to ensure they won't
be wrong.
The real change is to pass (bufsz - 1) to PyOS_ascii_formatd and 1
to strncat. strncat copies n+1 bytes from src (not dest).
Reported by Klocwork #58.
........
r50680 | neal.norwitz | 2006-07-16 04:32:03 +0200 (Sun, 16 Jul 2006) | 5 lines
Handle a NULL name properly.
Reported by Klocwork #67
........
r50681 | neal.norwitz | 2006-07-16 04:35:47 +0200 (Sun, 16 Jul 2006) | 6 lines
PyFunction_SetDefaults() is documented as taking None or a tuple.
A NULL would crash the PyTuple_Check(). Now make NULL return a SystemError.
Reported by Klocwork #73.
........
r50683 | neal.norwitz | 2006-07-17 02:55:45 +0200 (Mon, 17 Jul 2006) | 5 lines
Stop INCREFing name, then checking if it's NULL. name (f_name) should never
be NULL so assert it. Fix one place where we could have passed NULL.
Reported by Klocwork #66.
........
r50684 | neal.norwitz | 2006-07-17 02:57:15 +0200 (Mon, 17 Jul 2006) | 5 lines
otherset is known to be non-NULL based on checks before and DECREF after.
DECREF otherset rather than XDECREF in error conditions too.
Reported by Klockwork #154.
........
r50685 | neal.norwitz | 2006-07-17 02:59:04 +0200 (Mon, 17 Jul 2006) | 7 lines
Reported by Klocwork #151.
v2 can be NULL if exception2 is NULL. I don't think that condition can happen,
but I'm not sure it can't either. Now the code will protect against either
being NULL.
........
r50686 | neal.norwitz | 2006-07-17 03:00:16 +0200 (Mon, 17 Jul 2006) | 1 line
Add NEWS entry for a bunch of fixes due to warnings produced by Klocworks static analysis tool.
........
r50687 | fred.drake | 2006-07-17 07:47:52 +0200 (Mon, 17 Jul 2006) | 3 lines
document xmlcore (still minimal; needs mention in each of the xml.* modules)
SF bug #1504456 (partial)
........
r50688 | georg.brandl | 2006-07-17 15:23:46 +0200 (Mon, 17 Jul 2006) | 3 lines
Remove usage of sets module (patch #1500609).
........
r50689 | georg.brandl | 2006-07-17 15:26:33 +0200 (Mon, 17 Jul 2006) | 3 lines
Add missing NEWS item (#1522771)
........
r50690 | andrew.kuchling | 2006-07-17 18:47:54 +0200 (Mon, 17 Jul 2006) | 1 line
Attribute more features
........
r50692 | kurt.kaiser | 2006-07-17 23:59:27 +0200 (Mon, 17 Jul 2006) | 8 lines
Patch 1479219 - Tal Einat
1. 'as' highlighted as builtin in comment string on import line
2. Comments such as "#False identity" which start with a keyword immediately
after the '#' character aren't colored as comments.
3. u or U beginning unicode string not correctly highlighted
Closes bug 1325071
........
r50693 | barry.warsaw | 2006-07-18 01:07:51 +0200 (Tue, 18 Jul 2006) | 16 lines
decode_rfc2231(): Be more robust against buggy RFC 2231 encodings.
Specifically, instead of raising a ValueError when there is a single tick in
the parameter, simply return that the entire string unquoted, with None for
both the charset and the language. Also, if there are more than 2 ticks in
the parameter, interpret the first three parts as the standard RFC 2231 parts,
then the rest of the parts as the encoded string.
Test cases added.
Original fewer-than-3-parts fix by Tokio Kikuchi.
Resolves SF bug # 1218081. I will back port the fix and tests to Python 2.4
(email 3.0) and Python 2.3 (email 2.5).
Also, bump the version number to email 4.0.1, removing the 'alpha' moniker.
........
r50695 | kurt.kaiser | 2006-07-18 06:03:16 +0200 (Tue, 18 Jul 2006) | 2 lines
Rebinding Tab key was inserting 'tab' instead of 'Tab'. Bug 1179168.
........
r50696 | brett.cannon | 2006-07-18 06:41:36 +0200 (Tue, 18 Jul 2006) | 6 lines
Fix bug #1520914. Starting in 2.4, time.strftime() began to check the bounds
of values in the time tuple passed in. Unfortunately people came to rely on
undocumented behaviour of setting unneeded values to 0, regardless of if it was
within the valid range. Now those values force the value internally to the
minimum value when 0 is passed in.
........
r50697 | facundo.batista | 2006-07-18 14:16:13 +0200 (Tue, 18 Jul 2006) | 1 line
Comments and docs cleanups, and some little fixes, provided by Santiágo Peresón
........
r50704 | martin.v.loewis | 2006-07-18 19:46:31 +0200 (Tue, 18 Jul 2006) | 2 lines
Patch #1524429: Use repr instead of backticks again.
........
r50706 | tim.peters | 2006-07-18 23:55:15 +0200 (Tue, 18 Jul 2006) | 2 lines
Whitespace normalization.
........
r50708 | tim.peters | 2006-07-19 02:03:19 +0200 (Wed, 19 Jul 2006) | 18 lines
SF bug 1524317: configure --without-threads fails to build
Moved the code for _PyThread_CurrentFrames() up, so it's no longer
in a huge "#ifdef WITH_THREAD" block (I didn't realize it /was/ in
one).
Changed test_sys's test_current_frames() so it passes with or without
thread supported compiled in.
Note that test_sys fails when Python is compiled without threads,
but for an unrelated reason (the old test_exit() fails with an
indirect ImportError on the `thread` module). There are also
other unrelated compilation failures without threads, in extension
modules (like ctypes); at least the core compiles again.
Do we really support --without-threads? If so, there are several
problems remaining.
........
r50713 | thomas.heller | 2006-07-19 11:09:32 +0200 (Wed, 19 Jul 2006) | 4 lines
Make sure the _ctypes extension can be compiled when WITH_THREAD is
not defined on Windows, even if that configuration is probably not
supported at all.
........
r50715 | martin.v.loewis | 2006-07-19 19:18:32 +0200 (Wed, 19 Jul 2006) | 4 lines
Revert r50706 (Whitespace normalization) and
r50697: Comments and docs cleanups, and some little fixes
per recommendation from Raymond Hettinger.
........
r50719 | phillip.eby | 2006-07-20 17:54:16 +0200 (Thu, 20 Jul 2006) | 4 lines
Fix SF#1516184 (again) and add a test to prevent regression.
(There was a problem with empty filenames still causing recursion)
........
r50720 | georg.brandl | 2006-07-20 18:28:39 +0200 (Thu, 20 Jul 2006) | 3 lines
Guard for _active being None in __del__ method.
........
r50721 | vinay.sajip | 2006-07-20 18:28:39 +0200 (Thu, 20 Jul 2006) | 1 line
Updated documentation for TimedRotatingFileHandler relating to how rollover files are named. The previous documentation was wrongly the same as for RotatingFileHandler.
........
r50731 | fred.drake | 2006-07-20 22:11:57 +0200 (Thu, 20 Jul 2006) | 1 line
markup fix
........
r50739 | kurt.kaiser | 2006-07-21 00:22:52 +0200 (Fri, 21 Jul 2006) | 7 lines
Avoid occasional failure to detect closing paren properly.
Patch 1407280 Tal Einat
M ParenMatch.py
M NEWS.txt
M CREDITS.txt
........
r50740 | vinay.sajip | 2006-07-21 01:20:12 +0200 (Fri, 21 Jul 2006) | 1 line
Addressed SF#1524081 by using a dictionary to map level names to syslog priority names, rather than a string.lower().
........
r50741 | neal.norwitz | 2006-07-21 07:29:58 +0200 (Fri, 21 Jul 2006) | 1 line
Add some asserts that we got good params passed
........
r50742 | neal.norwitz | 2006-07-21 07:31:02 +0200 (Fri, 21 Jul 2006) | 5 lines
Move the initialization of some pointers earlier. The problem is
that if we call Py_DECREF(frame) like we do if allocating locals fails,
frame_dealloc() will try to use these bogus values and crash.
........
r50743 | neal.norwitz | 2006-07-21 07:32:28 +0200 (Fri, 21 Jul 2006) | 4 lines
Handle allocation failures gracefully. Found with failmalloc.
Many (all?) of these could be backported.
........
r50745 | neal.norwitz | 2006-07-21 09:59:02 +0200 (Fri, 21 Jul 2006) | 1 line
Speel initialise write. Tanks Anthony.
........
r50746 | neal.norwitz | 2006-07-21 09:59:47 +0200 (Fri, 21 Jul 2006) | 2 lines
Handle more memory allocation failures without crashing.
........
r50754 | barry.warsaw | 2006-07-21 16:51:07 +0200 (Fri, 21 Jul 2006) | 23 lines
More RFC 2231 improvements for the email 4.0 package. As Mark Sapiro rightly
points out there are really two types of continued headers defined in this
RFC (i.e. "encoded" parameters with the form "name*0*=" and unencoded
parameters with the form "name*0="), but we were were handling them both the
same way and that isn't correct.
This patch should be much more RFC compliant in that only encoded params are
%-decoded and the charset/language information is only extract if there are
any encoded params in the segments. If there are no encoded params then the
RFC says that there will be no charset/language parts.
Note however that this will change the return value for Message.get_param() in
some cases. For example, whereas before if you had all unencoded param
continuations you would have still gotten a 3-tuple back from this method
(with charset and language == None), you will now get just a string. I don't
believe this is a backward incompatible change though because the
documentation for this method already indicates that either return value is
possible and that you must do an isinstance(val, tuple) check to discriminate
between the two. (Yeah that API kind of sucks but we can't change /that/
without breaking code.)
Test cases, some documentation updates, and a NEWS item accompany this patch.
........
r50759 | georg.brandl | 2006-07-21 19:36:31 +0200 (Fri, 21 Jul 2006) | 3 lines
Fix check for empty list (vs. None).
........
r50771 | brett.cannon | 2006-07-22 00:44:07 +0200 (Sat, 22 Jul 2006) | 2 lines
Remove an XXX marker in a comment.
........
r50773 | neal.norwitz | 2006-07-22 18:20:49 +0200 (Sat, 22 Jul 2006) | 1 line
Fix more memory allocation issues found with failmalloc.
........
r50774 | neal.norwitz | 2006-07-22 19:00:57 +0200 (Sat, 22 Jul 2006) | 1 line
Don't fail if the directory already exists
........
r50775 | greg.ward | 2006-07-23 04:25:53 +0200 (Sun, 23 Jul 2006) | 6 lines
Be a lot smarter about whether this test passes: instead of assuming
that a 2.93 sec audio file will always take 3.1 sec (as it did on the
hardware I had when I first wrote the test), expect that it will take
2.93 sec +/- 10%, and only fail if it's outside of that range.
Compute the expected
........
r50776 | kurt.kaiser | 2006-07-23 06:19:49 +0200 (Sun, 23 Jul 2006) | 2 lines
Tooltips failed on new-syle class __init__ args. Bug 1027566 Loren Guthrie
........
r50777 | neal.norwitz | 2006-07-23 09:50:36 +0200 (Sun, 23 Jul 2006) | 1 line
Handle more mem alloc issues found with failmalloc
........
r50778 | neal.norwitz | 2006-07-23 09:51:58 +0200 (Sun, 23 Jul 2006) | 5 lines
If the for loop isn't entered, entryblock will be NULL. If passed
to stackdepth_walk it will be dereffed.
Not sure if I found with failmalloc or Klockwork #55.
........
r50779 | neal.norwitz | 2006-07-23 09:53:14 +0200 (Sun, 23 Jul 2006) | 4 lines
Move the initialization of size_a down below the check for a being NULL.
Reported by Klocwork #106
........
r50780 | neal.norwitz | 2006-07-23 09:55:55 +0200 (Sun, 23 Jul 2006) | 9 lines
Check the allocation of b_objects and return if there was a failure.
Also fix a few memory leaks in other failure scenarios.
It seems that if b_objects == Py_None, we will have an extra ref to
b_objects. Add XXX comment so hopefully someone documents why the
else isn't necessary or adds it in.
Reported by Klocwork #20
........
r50781 | neal.norwitz | 2006-07-23 09:57:11 +0200 (Sun, 23 Jul 2006) | 2 lines
Fix memory leaks spotted by Klocwork #37.
........
r50782 | neal.norwitz | 2006-07-23 09:59:00 +0200 (Sun, 23 Jul 2006) | 5 lines
nextlink can be NULL if teedataobject_new fails, so use XINCREF.
Ensure that dataobj is never NULL.
Reported by Klocwork #102
........
r50783 | neal.norwitz | 2006-07-23 10:01:43 +0200 (Sun, 23 Jul 2006) | 8 lines
Ensure we don't write beyond errText. I think I got this right, but
it definitely could use some review to ensure I'm not off by one
and there's no possible overflow/wrap-around of bytes_left.
Reported by Klocwork #1.
Fix a problem if there is a failure allocating self->db.
Found with failmalloc.
........
r50784 | ronald.oussoren | 2006-07-23 11:41:09 +0200 (Sun, 23 Jul 2006) | 3 lines
Without this patch CMD-W won't close EditorWindows on MacOS X. This solves
part of bug #1517990.
........
r50785 | ronald.oussoren | 2006-07-23 11:46:11 +0200 (Sun, 23 Jul 2006) | 5 lines
Fix for bug #1517996: Class and Path browsers show Tk menu
This patch replaces the menubar that is used by AquaTk for windows without a
menubar of their own by one that is more appropriate for IDLE.
........
r50786 | andrew.macintyre | 2006-07-23 14:57:02 +0200 (Sun, 23 Jul 2006) | 2 lines
Build updates for OS/2 EMX port
........
r50787 | andrew.macintyre | 2006-07-23 15:00:04 +0200 (Sun, 23 Jul 2006) | 3 lines
bugfix: PyThread_start_new_thread() returns the thread ID, not a flag;
will backport.
........
r50789 | andrew.macintyre | 2006-07-23 15:04:00 +0200 (Sun, 23 Jul 2006) | 2 lines
Get mailbox module working on OS/2 EMX port.
........
r50791 | greg.ward | 2006-07-23 18:05:51 +0200 (Sun, 23 Jul 2006) | 1 line
Resync optparse with Optik 1.5.3: minor tweaks for/to tests.
........
r50794 | martin.v.loewis | 2006-07-24 07:05:22 +0200 (Mon, 24 Jul 2006) | 2 lines
Update list of unsupported systems. Fixes #1510853.
........
r50795 | martin.v.loewis | 2006-07-24 12:26:33 +0200 (Mon, 24 Jul 2006) | 1 line
Patch #1448199: Release GIL around ConnectRegistry.
........
r50796 | martin.v.loewis | 2006-07-24 13:54:53 +0200 (Mon, 24 Jul 2006) | 3 lines
Patch #1232023: Don't include empty path component from registry,
so that the current directory does not get added to sys.path.
Also fixes #1526785.
........
r50797 | martin.v.loewis | 2006-07-24 14:54:17 +0200 (Mon, 24 Jul 2006) | 3 lines
Bug #1524310: Properly report errors from FindNextFile in os.listdir.
Will backport to 2.4.
........
r50800 | georg.brandl | 2006-07-24 15:28:57 +0200 (Mon, 24 Jul 2006) | 7 lines
Patch #1523356: fix determining include dirs in python-config.
Also don't install "python-config" when doing altinstall, but
always install "python-config2.x" and make a link to it like
with the main executable.
........
r50802 | georg.brandl | 2006-07-24 15:46:47 +0200 (Mon, 24 Jul 2006) | 3 lines
Patch #1527744: right order of includes in order to have HAVE_CONIO_H defined properly.
........
r50803 | georg.brandl | 2006-07-24 16:09:56 +0200 (Mon, 24 Jul 2006) | 3 lines
Patch #1515343: Fix printing of deprecated string exceptions with a
value in the traceback module.
........
r50804 | kurt.kaiser | 2006-07-24 19:13:23 +0200 (Mon, 24 Jul 2006) | 7 lines
EditorWindow failed when used stand-alone if sys.ps1 not set.
Bug 1010370 Dave Florek
M EditorWindow.py
M PyShell.py
M NEWS.txt
........
r50805 | kurt.kaiser | 2006-07-24 20:05:51 +0200 (Mon, 24 Jul 2006) | 6 lines
- EditorWindow.test() was failing. Bug 1417598
M EditorWindow.py
M ScriptBinding.py
M NEWS.txt
........
r50808 | georg.brandl | 2006-07-24 22:11:35 +0200 (Mon, 24 Jul 2006) | 3 lines
Repair accidental NameError.
........
r50809 | tim.peters | 2006-07-24 23:02:15 +0200 (Mon, 24 Jul 2006) | 2 lines
Whitespace normalization.
........
r50810 | greg.ward | 2006-07-25 04:11:12 +0200 (Tue, 25 Jul 2006) | 3 lines
Don't use standard assert: want tests to fail even when run with -O.
Delete cruft.
........
r50811 | tim.peters | 2006-07-25 06:07:22 +0200 (Tue, 25 Jul 2006) | 10 lines
current_frames_with_threads(): There's actually no way
to guess /which/ line the spawned thread is in at the time
sys._current_frames() is called: we know it finished
enter_g.set(), but can't know whether the instruction
counter has advanced to the following leave_g.wait().
The latter is overwhelming most likely, but not guaranteed,
and I see that the "x86 Ubuntu dapper (icc) trunk" buildbot
found it on the other line once. Changed the test so it
passes in either case.
........
r50815 | martin.v.loewis | 2006-07-25 11:53:12 +0200 (Tue, 25 Jul 2006) | 2 lines
Bug #1525817: Don't truncate short lines in IDLE's tool tips.
........
r50816 | martin.v.loewis | 2006-07-25 12:05:47 +0200 (Tue, 25 Jul 2006) | 3 lines
Bug #978833: Really close underlying socket in _socketobject.close.
Will backport to 2.4.
........
r50817 | martin.v.loewis | 2006-07-25 12:11:14 +0200 (Tue, 25 Jul 2006) | 1 line
Revert incomplete checkin.
........
r50819 | georg.brandl | 2006-07-25 12:22:34 +0200 (Tue, 25 Jul 2006) | 4 lines
Patch #1525766: correctly pass onerror arg to recursive calls
of pkg.walk_packages. Also improve the docstrings.
........
r50825 | brett.cannon | 2006-07-25 19:32:20 +0200 (Tue, 25 Jul 2006) | 2 lines
Add comment for changes to test_ossaudiodev.
........
r50826 | brett.cannon | 2006-07-25 19:34:36 +0200 (Tue, 25 Jul 2006) | 3 lines
Fix a bug in the messages for an assert failure where not enough arguments to a string
were being converted in the format.
........
r50828 | armin.rigo | 2006-07-25 20:09:57 +0200 (Tue, 25 Jul 2006) | 2 lines
Document why is and is not a good way to fix the gc_inspection crasher.
........
r50829 | armin.rigo | 2006-07-25 20:11:07 +0200 (Tue, 25 Jul 2006) | 5 lines
Added another crasher, which hit me today (I was not intentionally
writing such code, of course, but it took some gdb time to figure out
what my bug was).
........
r50830 | armin.rigo | 2006-07-25 20:38:39 +0200 (Tue, 25 Jul 2006) | 3 lines
Document the crashers that will not go away soon as "won't fix",
and explain why.
........
r50831 | ronald.oussoren | 2006-07-25 21:13:35 +0200 (Tue, 25 Jul 2006) | 3 lines
Install the compatibility symlink to libpython.a on OSX using 'ln -sf' instead
of 'ln -s', this avoid problems when reinstalling python.
........
r50832 | ronald.oussoren | 2006-07-25 21:20:54 +0200 (Tue, 25 Jul 2006) | 7 lines
Fix for bug #1525447 (renaming to MacOSmodule.c would also work, but not
without causing problems for anyone that is on a case-insensitive filesystem).
Setup.py tries to compile the MacOS extension from MacOSmodule.c, while the
actual file is named macosmodule.c. This is no problem on the (default)
case-insensitive filesystem, but doesn't work on case-sensitive filesystems.
........
r50833 | ronald.oussoren | 2006-07-25 22:28:55 +0200 (Tue, 25 Jul 2006) | 7 lines
Fix bug #1517990: IDLE keybindings on OSX
This adds a new key definition for OSX, which is slightly different from the
classic mac definition.
Also add NEWS item for a couple of bugfixes I added recently.
........
r50834 | tim.peters | 2006-07-26 00:30:24 +0200 (Wed, 26 Jul 2006) | 2 lines
Whitespace normalization.
........
r50839 | neal.norwitz | 2006-07-26 06:00:18 +0200 (Wed, 26 Jul 2006) | 1 line
Hmm, only python2.x is installed, not plain python. Did that change recently?
........
r50840 | barry.warsaw | 2006-07-26 07:54:46 +0200 (Wed, 26 Jul 2006) | 6 lines
Forward port some fixes that were in email 2.5 but for some reason didn't make
it into email 4.0. Specifically, in Message.get_content_charset(), handle RFC
2231 headers that contain an encoding not known to Python, or a character in
the data that isn't in the charset encoding. Also forward port the
appropriate unit tests.
........
r50841 | georg.brandl | 2006-07-26 09:23:32 +0200 (Wed, 26 Jul 2006) | 3 lines
NEWS entry for #1525766.
........
r50842 | georg.brandl | 2006-07-26 09:40:17 +0200 (Wed, 26 Jul 2006) | 3 lines
Bug #1459963: properly capitalize HTTP header names.
........
r50843 | georg.brandl | 2006-07-26 10:03:10 +0200 (Wed, 26 Jul 2006) | 6 lines
Part of bug #1523610: fix miscalculation of buffer length.
Also add a guard against NULL in converttuple and add a test case
(that previously would have crashed).
........
r50844 | martin.v.loewis | 2006-07-26 14:12:56 +0200 (Wed, 26 Jul 2006) | 3 lines
Bug #978833: Really close underlying socket in _socketobject.close.
Fix httplib.HTTPConnection.getresponse to not close the
socket if it is still needed for the response.
........
r50845 | andrew.kuchling | 2006-07-26 19:16:52 +0200 (Wed, 26 Jul 2006) | 1 line
[Bug #1471938] Fix build problem on Solaris 8 by conditionalizing the use of mvwgetnstr(); it was conditionalized a few lines below. Fix from Paul Eggert. I also tried out the STRICT_SYSV_CURSES case and am therefore removing the 'untested' comment.
........
r50846 | andrew.kuchling | 2006-07-26 19:18:01 +0200 (Wed, 26 Jul 2006) | 1 line
Correct error message
........
r50847 | andrew.kuchling | 2006-07-26 19:19:39 +0200 (Wed, 26 Jul 2006) | 1 line
Minor grammar fix
........
r50848 | andrew.kuchling | 2006-07-26 19:22:21 +0200 (Wed, 26 Jul 2006) | 1 line
Put news item in right section
........
r50850 | andrew.kuchling | 2006-07-26 20:03:12 +0200 (Wed, 26 Jul 2006) | 1 line
Use sys.exc_info()
........
r50851 | andrew.kuchling | 2006-07-26 20:15:45 +0200 (Wed, 26 Jul 2006) | 1 line
Use sys.exc_info()
........
r50852 | phillip.eby | 2006-07-26 21:48:27 +0200 (Wed, 26 Jul 2006) | 4 lines
Allow the 'onerror' argument to walk_packages() to catch any Exception, not
just ImportError. This allows documentation tools to better skip unimportable
packages.
........
r50854 | tim.peters | 2006-07-27 01:23:15 +0200 (Thu, 27 Jul 2006) | 2 lines
Whitespace normalization.
........
r50855 | tim.peters | 2006-07-27 03:14:53 +0200 (Thu, 27 Jul 2006) | 21 lines
Bug #1521947: possible bug in mystrtol.c with recent gcc.
In general, C doesn't define anything about what happens when
an operation on a signed integral type overflows, and PyOS_strtol()
did several formally undefined things of that nature on signed
longs. Some version of gcc apparently tries to exploit that now,
and PyOS_strtol() could fail to detect overflow then.
Tried to repair all that, although it seems at least as likely to me
that we'll get screwed by bad platform definitions for LONG_MIN
and/or LONG_MAX now. For that reason, I don't recommend backporting
this.
Note that I have no box on which this makes a lick of difference --
can't really test it, except to note that it didn't break anything
on my boxes.
Silent change: PyOS_strtol() used to return the hard-coded 0x7fffffff
in case of overflow. Now it returns LONG_MAX. They're the same only on
32-bit boxes (although C doesn't guarantee that either ...).
........
r50856 | neal.norwitz | 2006-07-27 05:51:58 +0200 (Thu, 27 Jul 2006) | 6 lines
Don't kill a normal instance of python running on windows when checking
to kill a cygwin instance. build\\python.exe was matching a normal windows
instance. Prefix that with a \\ to ensure build is a directory and not
PCbuild. As discussed on python-dev.
........
r50857 | neal.norwitz | 2006-07-27 05:55:39 +0200 (Thu, 27 Jul 2006) | 5 lines
Closure can't be NULL at this point since we know it's a tuple.
Reported by Klocwork # 74.
........
r50858 | neal.norwitz | 2006-07-27 06:04:50 +0200 (Thu, 27 Jul 2006) | 1 line
No functional change. Add comment and assert to describe why there cannot be overflow which was reported by Klocwork. Discussed on python-dev
........
r50859 | martin.v.loewis | 2006-07-27 08:38:16 +0200 (Thu, 27 Jul 2006) | 3 lines
Bump distutils version to 2.5, as several new features
have been introduced since 2.4.
........
r50860 | andrew.kuchling | 2006-07-27 14:18:20 +0200 (Thu, 27 Jul 2006) | 1 line
Reformat docstring; fix typo
........
r50861 | georg.brandl | 2006-07-27 17:05:36 +0200 (Thu, 27 Jul 2006) | 6 lines
Add test_main() methods. These three tests were never run
by regrtest.py.
We really need a simpler testing framework.
........
r50862 | tim.peters | 2006-07-27 17:09:20 +0200 (Thu, 27 Jul 2006) | 2 lines
News for patch #1529686.
........
r50863 | tim.peters | 2006-07-27 17:11:00 +0200 (Thu, 27 Jul 2006) | 2 lines
Whitespace normalization.
........
r50864 | georg.brandl | 2006-07-27 17:38:33 +0200 (Thu, 27 Jul 2006) | 3 lines
Amend news entry.
........
r50865 | georg.brandl | 2006-07-27 18:08:15 +0200 (Thu, 27 Jul 2006) | 3 lines
Make uuid test suite pass on this box by requesting output with LC_ALL=C.
........
r50866 | andrew.kuchling | 2006-07-27 20:37:33 +0200 (Thu, 27 Jul 2006) | 1 line
Add example
........
r50867 | thomas.heller | 2006-07-27 20:39:55 +0200 (Thu, 27 Jul 2006) | 9 lines
Remove code that is no longer used (ctypes.com).
Fix the DllGetClassObject and DllCanUnloadNow so that they forward the
call to the comtypes.server.inprocserver module.
The latter was never documented, never used by published code, and
didn't work anyway, so I think it does not deserve a NEWS entry (but I
might be wrong).
........
r50868 | andrew.kuchling | 2006-07-27 20:41:21 +0200 (Thu, 27 Jul 2006) | 1 line
Typo fix ('publically' is rare, poss. non-standard)
........
r50869 | andrew.kuchling | 2006-07-27 20:42:41 +0200 (Thu, 27 Jul 2006) | 1 line
Add missing word
........
r50870 | andrew.kuchling | 2006-07-27 20:44:10 +0200 (Thu, 27 Jul 2006) | 1 line
Repair typos
........
r50872 | andrew.kuchling | 2006-07-27 20:53:33 +0200 (Thu, 27 Jul 2006) | 1 line
Update URL; add example
........
r50873 | andrew.kuchling | 2006-07-27 21:07:29 +0200 (Thu, 27 Jul 2006) | 1 line
Add punctuation mark; add some examples
........
r50874 | andrew.kuchling | 2006-07-27 21:11:07 +0200 (Thu, 27 Jul 2006) | 1 line
Mention base64 module; rewrite last sentence to be more positive
........
r50875 | andrew.kuchling | 2006-07-27 21:12:49 +0200 (Thu, 27 Jul 2006) | 1 line
If binhex is higher-level than binascii, it should come first in the chapter
........
r50876 | tim.peters | 2006-07-27 22:47:24 +0200 (Thu, 27 Jul 2006) | 28 lines
check_node(): stop spraying mystery output to stderr.
When a node number disagrees, keep track of all sources & the
node numbers they reported, and stick all that in the error message.
Changed all callers to supply a non-empty "source" argument; made
the "source" argument non-optional.
On my box, test_uuid still fails, but with the less confusing output:
AssertionError: different sources disagree on node:
from source 'getnode1', node was 00038a000015
from source 'getnode2', node was 00038a000015
from source 'ipconfig', node was 001111b2b7bf
Only the last one appears to be correct; e.g.,
C:\Code\python\PCbuild>getmac
Physical Address Transport Name
=================== ==========================================================
00-11-11-B2-B7-BF \Device\Tcpip_{190FB163-5AFD-4483-86A1-2FE16AC61FF1}
62-A1-AC-6C-FD-BE \Device\Tcpip_{8F77DF5A-EA3D-4F1D-975E-D472CEE6438A}
E2-1F-01-C6-5D-88 \Device\Tcpip_{CD18F76B-2EF3-409F-9B8A-6481EE70A1E4}
I can't find anything on my box with MAC 00-03-8a-00-00-15, and am
not clear on where that comes from.
........
r50878 | andrew.kuchling | 2006-07-28 00:40:05 +0200 (Fri, 28 Jul 2006) | 1 line
Reword paragraph
........
r50879 | andrew.kuchling | 2006-07-28 00:49:38 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50880 | andrew.kuchling | 2006-07-28 00:49:54 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50881 | barry.warsaw | 2006-07-28 01:43:15 +0200 (Fri, 28 Jul 2006) | 27 lines
Patch #1520294: Support for getset and member descriptors in types.py,
inspect.py, and pydoc.py. Specifically, this allows for querying the type of
an object against these built-in C types and more importantly, for getting
their docstrings printed in the interactive interpreter's help() function.
This patch includes a new built-in module called _types which provides
definitions of getset and member descriptors for use by the types.py module.
These types are exposed as types.GetSetDescriptorType and
types.MemberDescriptorType. Query functions are provided as
inspect.isgetsetdescriptor() and inspect.ismemberdescriptor(). The
implementations of these are robust enough to work with Python implementations
other than CPython, which may not have these fundamental types.
The patch also includes documentation and test suite updates.
I commit these changes now under these guiding principles:
1. Silence is assent. The release manager has not said "no", and of the few
people that cared enough to respond to the thread, the worst vote was "0".
2. It's easier to ask for forgiveness than permission.
3. It's so dang easy to revert stuff in svn, that you could view this as a
forcing function. :)
Windows build patches will follow.
........
r50882 | tim.peters | 2006-07-28 01:44:37 +0200 (Fri, 28 Jul 2006) | 4 lines
Bug #1529297: The rewrite of doctest for Python 2.4 unintentionally
lost that tests are sorted by name before being run. ``DocTestFinder``
has been changed to sort the list of tests it returns.
........
r50883 | tim.peters | 2006-07-28 01:45:48 +0200 (Fri, 28 Jul 2006) | 2 lines
Whitespace normalization.
........
r50884 | tim.peters | 2006-07-28 01:46:36 +0200 (Fri, 28 Jul 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r50885 | barry.warsaw | 2006-07-28 01:50:40 +0200 (Fri, 28 Jul 2006) | 4 lines
Enable the building of the _types module on Windows.
Note that this has only been tested for VS 2003 since that's all I have.
........
r50887 | tim.peters | 2006-07-28 02:23:15 +0200 (Fri, 28 Jul 2006) | 7 lines
defdict_reduce(): Plug leaks.
We didn't notice these before because test_defaultdict didn't
actually do anything before Georg fixed that earlier today.
Neal's next refleak run then showed test_defaultdict leaking
9 references on each run. That's repaired by this checkin.
........
r50888 | tim.peters | 2006-07-28 02:30:00 +0200 (Fri, 28 Jul 2006) | 2 lines
News about the repaired memory leak in defaultdict.
........
r50889 | gregory.p.smith | 2006-07-28 03:35:25 +0200 (Fri, 28 Jul 2006) | 7 lines
- pybsddb Bug #1527939: bsddb module DBEnv dbremove and dbrename
methods now allow their database parameter to be None as the
sleepycat API allows.
Also adds an appropriate test case for DBEnv.dbrename and dbremove.
........
r50895 | neal.norwitz | 2006-07-28 06:22:34 +0200 (Fri, 28 Jul 2006) | 1 line
Ensure the actual number matches the expected count
........
r50896 | tim.peters | 2006-07-28 06:51:59 +0200 (Fri, 28 Jul 2006) | 6 lines
Live with that "the hardware address" is an ill-defined
concept, and that different ways of trying to find "the
hardware address" may return different results. Certainly
true on both of my Windows boxes, and in different ways
(see whining on python-dev).
........
r50897 | neal.norwitz | 2006-07-28 09:21:27 +0200 (Fri, 28 Jul 2006) | 3 lines
Try to find the MAC addr on various flavours of Unix. This seems hopeless.
The reduces the test_uuid failures, but there's still another method failing.
........
r50898 | martin.v.loewis | 2006-07-28 09:45:49 +0200 (Fri, 28 Jul 2006) | 2 lines
Add UUID for upcoming 2.5b3.
........
r50899 | matt.fleming | 2006-07-28 13:27:27 +0200 (Fri, 28 Jul 2006) | 3 lines
Allow socketmodule to compile on NetBSD -current, whose bluetooth API
differs from both Linux and FreeBSD. Accepted by Neal Norwitz.
........
r50900 | andrew.kuchling | 2006-07-28 14:07:12 +0200 (Fri, 28 Jul 2006) | 1 line
[Patch #1529811] Correction to description of r|* mode
........
r50901 | andrew.kuchling | 2006-07-28 14:18:22 +0200 (Fri, 28 Jul 2006) | 1 line
Typo fix
........
r50902 | andrew.kuchling | 2006-07-28 14:32:43 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50903 | andrew.kuchling | 2006-07-28 14:33:19 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50904 | andrew.kuchling | 2006-07-28 14:45:55 +0200 (Fri, 28 Jul 2006) | 1 line
Don't overwrite built-in name; add some blank lines for readability
........
r50905 | andrew.kuchling | 2006-07-28 14:48:07 +0200 (Fri, 28 Jul 2006) | 1 line
Add example. Should I propagate this example to all the other DBM-ish modules, too?
........
r50912 | georg.brandl | 2006-07-28 20:31:39 +0200 (Fri, 28 Jul 2006) | 3 lines
Patch #1529686: also run test_email_codecs with regrtest.py.
........
r50913 | georg.brandl | 2006-07-28 20:36:01 +0200 (Fri, 28 Jul 2006) | 3 lines
Fix spelling.
........
r50915 | thomas.heller | 2006-07-28 21:42:40 +0200 (Fri, 28 Jul 2006) | 3 lines
Remove a useless XXX comment.
Cosmetic changes to the code so that the #ifdef _UNICODE block
doesn't mess emacs code formatting.
........
r50916 | phillip.eby | 2006-07-28 23:12:07 +0200 (Fri, 28 Jul 2006) | 5 lines
Bug #1529871: The speed enhancement patch #921466 broke Python's compliance
with PEP 302. This was fixed by adding an ``imp.NullImporter`` type that is
used in ``sys.path_importer_cache`` to cache non-directory paths and avoid
excessive filesystem operations during imports.
........
r50917 | phillip.eby | 2006-07-28 23:31:54 +0200 (Fri, 28 Jul 2006) | 2 lines
Fix svn merge spew.
........
r50918 | thomas.heller | 2006-07-28 23:43:20 +0200 (Fri, 28 Jul 2006) | 4 lines
Patch #1529514: More openbsd platforms for ctypes.
Regenerated Modules/_ctypes/libffi/configure with autoconf 2.59.
Approved by Neal.
........
r50922 | georg.brandl | 2006-07-29 10:51:21 +0200 (Sat, 29 Jul 2006) | 2 lines
Bug #835255: The "closure" argument to new.function() is now documented.
........
r50924 | georg.brandl | 2006-07-29 11:33:26 +0200 (Sat, 29 Jul 2006) | 3 lines
Bug #1441397: The compiler module now recognizes module and function
docstrings correctly as it did in Python 2.4.
........
r50925 | georg.brandl | 2006-07-29 12:25:46 +0200 (Sat, 29 Jul 2006) | 4 lines
Revert rev 42617, it was introduced to work around bug #1441397.
test_compiler now passes again.
........
r50926 | fred.drake | 2006-07-29 15:22:49 +0200 (Sat, 29 Jul 2006) | 1 line
update target version number
........
r50927 | andrew.kuchling | 2006-07-29 15:56:48 +0200 (Sat, 29 Jul 2006) | 1 line
Add example
........
r50928 | andrew.kuchling | 2006-07-29 16:04:47 +0200 (Sat, 29 Jul 2006) | 1 line
Update URL
........
r50930 | andrew.kuchling | 2006-07-29 16:08:15 +0200 (Sat, 29 Jul 2006) | 1 line
Reword paragraph to match the order of the subsequent sections
........
r50931 | andrew.kuchling | 2006-07-29 16:21:15 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1529157] Mention raw_input() and input(); while I'm at it, reword the description a bit
........
r50932 | andrew.kuchling | 2006-07-29 16:42:48 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1519571] Document some missing functions: setup(), title(), done()
........
r50933 | andrew.kuchling | 2006-07-29 16:43:55 +0200 (Sat, 29 Jul 2006) | 1 line
Fix docstring punctuation
........
r50934 | andrew.kuchling | 2006-07-29 17:10:32 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1414697] Change docstring of set/frozenset types to specify that the contents are unique. Raymond, please feel free to edit or revert.
........
r50935 | andrew.kuchling | 2006-07-29 17:35:21 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1530382] Document SSL.server(), .issuer() methods
........
r50936 | andrew.kuchling | 2006-07-29 17:42:46 +0200 (Sat, 29 Jul 2006) | 1 line
Typo fix
........
r50937 | andrew.kuchling | 2006-07-29 17:43:13 +0200 (Sat, 29 Jul 2006) | 1 line
Tweak wording
........
r50938 | matt.fleming | 2006-07-29 17:55:30 +0200 (Sat, 29 Jul 2006) | 2 lines
Fix typo
........
r50939 | andrew.kuchling | 2006-07-29 17:57:08 +0200 (Sat, 29 Jul 2006) | 6 lines
[Bug #1528258] Mention that the 'data' argument can be None.
The constructor docs referred the reader to the add_data() method's docs,
but they weren't very helpful. I've simply copied an earlier explanation
of 'data' that's more useful.
........
r50940 | andrew.kuchling | 2006-07-29 18:08:40 +0200 (Sat, 29 Jul 2006) | 1 line
Set bug/patch count. Take a bow, everyone!
........
r50941 | fred.drake | 2006-07-29 18:56:15 +0200 (Sat, 29 Jul 2006) | 18 lines
expunge the xmlcore changes:
41667, 41668 - initial switch to xmlcore
47044 - mention of xmlcore in What's New
50687 - mention of xmlcore in the library reference
re-apply xmlcore changes to xml:
41674 - line ending changes (re-applied manually), directory props
41677 - add cElementTree wrapper
41678 - PSF licensing for etree
41812 - whitespace normalization
42724 - fix svn:eol-style settings
43681, 43682 - remove Python version-compatibility cruft from minidom
46773 - fix encoding of \r\n\t in attr values in saxutils
47269 - added XMLParser alias for cElementTree compatibility
additional tests were added in Lib/test/test_sax.py that failed with
the xmlcore changes; these relate to SF bugs #1511497, #1513611
........
r50942 | andrew.kuchling | 2006-07-29 20:14:07 +0200 (Sat, 29 Jul 2006) | 17 lines
Reorganize the docs for 'file' and 'open()' after some discussion with Fred.
We want to encourage users to write open() when opening a file, but
open() was described with a single paragraph and
'file' had lots of explanation of the mode and bufsize arguments.
I've shrunk the description of 'file' to cross-reference to the 'File
objects' section, and to open() for an explanation of the arguments.
open() now has all the paragraphs about the mode string. The bufsize
argument was moved up so that it isn't buried at the end; now there's
1 paragraph on mode, 1 on bufsize, and then 3 more on mode. Various
other edits and rearrangements were made in the process.
It's probably best to read the final text and not to try to make sense
of the diffs.
........
r50943 | fred.drake | 2006-07-29 20:19:19 +0200 (Sat, 29 Jul 2006) | 1 line
restore test un-intentionally removed in the xmlcore purge (revision 50941)
........
r50944 | fred.drake | 2006-07-29 20:33:29 +0200 (Sat, 29 Jul 2006) | 3 lines
make the reference to older versions of the documentation a link
to the right page on python.org
........
r50945 | fred.drake | 2006-07-29 21:09:01 +0200 (Sat, 29 Jul 2006) | 1 line
document the footnote usage pattern
........
r50947 | fred.drake | 2006-07-29 21:14:10 +0200 (Sat, 29 Jul 2006) | 1 line
emphasize and oddball nuance of LaTeX comment syntax
........
r50948 | andrew.kuchling | 2006-07-29 21:24:04 +0200 (Sat, 29 Jul 2006) | 1 line
[Patch #1490989 from Skip Montanaro] Mention debugging builds in the API documentation. I've changed Skip's patch to point to Misc/SpecialBuilds and fiddled with the markup a bit.
........
r50949 | neal.norwitz | 2006-07-29 21:29:35 +0200 (Sat, 29 Jul 2006) | 6 lines
Disable these tests until they are reliable across platforms.
These problems may mask more important, real problems.
One or both methods are known to fail on: Solaris, OpenBSD, Debian, Ubuntu.
They pass on Windows and some Linux boxes.
........
r50950 | andrew.kuchling | 2006-07-29 21:50:37 +0200 (Sat, 29 Jul 2006) | 1 line
[Patch #1068277] Clarify that os.path.exists() can return False depending on permissions. Fred approved committing this patch in December 2004!
........
r50952 | fred.drake | 2006-07-29 22:04:42 +0200 (Sat, 29 Jul 2006) | 6 lines
SF bug #1193966: Weakref types documentation misplaced
The information about supporting weakrefs with types defined in C extensions
is moved to the Extending & Embedding manual. Py_TPFLAGS_HAVE_WEAKREFS is
no longer mentioned since it is part of Py_TPFLAGS_DEFAULT.
........
r50953 | skip.montanaro | 2006-07-29 22:06:05 +0200 (Sat, 29 Jul 2006) | 4 lines
Add a comment to the csv reader documentation that explains why the
treatment of newlines changed in 2.5. Pulled almost verbatim from a comment
by Andrew McNamara in <http://python.org/sf/1465014>.
........
r50954 | neal.norwitz | 2006-07-29 22:20:52 +0200 (Sat, 29 Jul 2006) | 3 lines
If the executable doesn't exist, there's no reason to try to start it.
This prevents garbage about command not found being printed on Solaris.
........
r50955 | fred.drake | 2006-07-29 22:21:25 +0200 (Sat, 29 Jul 2006) | 1 line
fix minor markup error that introduced extra punctuation
........
r50957 | neal.norwitz | 2006-07-29 22:37:08 +0200 (Sat, 29 Jul 2006) | 3 lines
Disable test_getnode too, since this is also unreliable.
........
r50958 | andrew.kuchling | 2006-07-29 23:27:12 +0200 (Sat, 29 Jul 2006) | 1 line
Follow TeX's conventions for hyphens
........
r50959 | andrew.kuchling | 2006-07-29 23:30:21 +0200 (Sat, 29 Jul 2006) | 1 line
Fix case for 'Unix'
........
r50960 | fred.drake | 2006-07-30 01:34:57 +0200 (Sun, 30 Jul 2006) | 1 line
markup cleanups
........
r50961 | andrew.kuchling | 2006-07-30 02:27:34 +0200 (Sun, 30 Jul 2006) | 1 line
Minor typo fixes
........
r50962 | andrew.kuchling | 2006-07-30 02:37:56 +0200 (Sun, 30 Jul 2006) | 1 line
[Bug #793553] Correct description of keyword arguments for SSL authentication
........
r50963 | tim.peters | 2006-07-30 02:58:15 +0200 (Sun, 30 Jul 2006) | 2 lines
Whitespace normalization.
........
r50964 | fred.drake | 2006-07-30 05:03:43 +0200 (Sun, 30 Jul 2006) | 1 line
lots of markup nits, most commonly Unix/unix --> \UNIX
........
r50965 | fred.drake | 2006-07-30 07:41:28 +0200 (Sun, 30 Jul 2006) | 1 line
update information on wxPython, from Robin Dunn
........
r50966 | fred.drake | 2006-07-30 07:49:49 +0200 (Sun, 30 Jul 2006) | 4 lines
remove possibly-outdated comment on what GUI toolkit is most commonly used;
it is hard to know whether this is right, and it does not add valuable reference information
at any rate
........
r50967 | fred.drake | 2006-07-30 07:55:39 +0200 (Sun, 30 Jul 2006) | 3 lines
- remove yet another reference to how commonly Tkinter is (thought to be) used
- fix an internal section reference
........
r50968 | neal.norwitz | 2006-07-30 08:53:31 +0200 (Sun, 30 Jul 2006) | 4 lines
Patch #1531113: Fix augmented assignment with yield expressions.
Also fix a SystemError when trying to assign to yield expressions.
........
r50969 | neal.norwitz | 2006-07-30 08:55:48 +0200 (Sun, 30 Jul 2006) | 5 lines
Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().
This provides the proper warning for struct.pack().
PyErr_Warn() is now deprecated in favor of PyErr_WarnEx().
As mentioned by Tim Peters on python-dev.
........
r50970 | neal.norwitz | 2006-07-30 08:57:04 +0200 (Sun, 30 Jul 2006) | 3 lines
Bug #1515471: string.replace() accepts character buffers again.
Pass the char* and size around rather than PyObject's.
........
r50971 | neal.norwitz | 2006-07-30 08:59:13 +0200 (Sun, 30 Jul 2006) | 1 line
Whitespace normalization
........
r50973 | georg.brandl | 2006-07-30 12:53:32 +0200 (Sun, 30 Jul 2006) | 3 lines
Clarify that __op__ methods must return NotImplemented if they don't support the operation.
........
r50974 | georg.brandl | 2006-07-30 13:07:23 +0200 (Sun, 30 Jul 2006) | 3 lines
Bug #1002398: The documentation for os.path.sameopenfile now correctly
refers to file descriptors, not file objects.
........
r50977 | martin.v.loewis | 2006-07-30 15:00:31 +0200 (Sun, 30 Jul 2006) | 3 lines
Don't copy directory stat times in shutil.copytree on Windows
Fixes #1525866.
........
r50978 | martin.v.loewis | 2006-07-30 15:14:05 +0200 (Sun, 30 Jul 2006) | 3 lines
Base __version__ on sys.version_info, as distutils is
no longer maintained separatedly.
........
r50979 | martin.v.loewis | 2006-07-30 15:27:31 +0200 (Sun, 30 Jul 2006) | 3 lines
Mention Cygwin in distutils error message about a missing VS 2003.
Fixes #1257728.
........
r50982 | martin.v.loewis | 2006-07-30 16:09:47 +0200 (Sun, 30 Jul 2006) | 5 lines
Drop usage of test -e in configure as it is not portable.
Fixes #1439538
Will backport to 2.4
Also regenerate pyconfig.h.in.
........
r50984 | georg.brandl | 2006-07-30 18:20:10 +0200 (Sun, 30 Jul 2006) | 3 lines
Fix makefile changes for python-config.
........
r50985 | george.yoshida | 2006-07-30 18:37:37 +0200 (Sun, 30 Jul 2006) | 2 lines
Rename struct.pack_to to struct.pack_into as changed in revision 46642.
........
r50986 | george.yoshida | 2006-07-30 18:41:30 +0200 (Sun, 30 Jul 2006) | 2 lines
Typo fix
........
r50987 | neal.norwitz | 2006-07-30 21:18:13 +0200 (Sun, 30 Jul 2006) | 1 line
Add some asserts and update comments
........
r50988 | neal.norwitz | 2006-07-30 21:18:38 +0200 (Sun, 30 Jul 2006) | 1 line
Verify that the signal handlers were really called
........
r50989 | neal.norwitz | 2006-07-30 21:20:42 +0200 (Sun, 30 Jul 2006) | 3 lines
Try to prevent hangs on Tru64/Alpha buildbot. I'm not certain this will help
and may need to be reverted if it causes problems.
........
r50990 | georg.brandl | 2006-07-30 22:18:51 +0200 (Sun, 30 Jul 2006) | 2 lines
Bug #1531349: right <-> left glitch in __rop__ description.
........
r50992 | tim.peters | 2006-07-31 03:46:03 +0200 (Mon, 31 Jul 2006) | 2 lines
Whitespace normalization.
........
r50993 | andrew.mcnamara | 2006-07-31 04:27:48 +0200 (Mon, 31 Jul 2006) | 2 lines
Redo the comment about the 2.5 change in quoted-newline handling.
........
r50994 | tim.peters | 2006-07-31 04:40:23 +0200 (Mon, 31 Jul 2006) | 10 lines
ZipFile.close(): Killed one of the struct.pack deprecation
warnings on Win32.
Also added an XXX about the line:
pos3 = self.fp.tell()
`pos3` is never referenced, and I have no idea what the code
intended to do instead.
........
r50996 | tim.peters | 2006-07-31 04:53:03 +0200 (Mon, 31 Jul 2006) | 8 lines
ZipFile.close(): Kill the other struct.pack deprecation
warning on Windows.
Afraid I can't detect a pattern to when the pack formats decide
to use a signed or unsigned format code -- appears nearly
arbitrary to my eyes. So I left all the pack formats alone and
changed the special-case data values instead.
........
r50997 | skip.montanaro | 2006-07-31 05:09:45 +0200 (Mon, 31 Jul 2006) | 1 line
minor tweaks
........
r50998 | skip.montanaro | 2006-07-31 05:11:11 +0200 (Mon, 31 Jul 2006) | 1 line
minor tweaks
........
r50999 | andrew.kuchling | 2006-07-31 14:20:24 +0200 (Mon, 31 Jul 2006) | 1 line
Add refcounts for PyErr_WarnEx
........
r51000 | andrew.kuchling | 2006-07-31 14:39:05 +0200 (Mon, 31 Jul 2006) | 9 lines
Document PyErr_WarnEx. (Bad Neal! No biscuit!)
Is the explanation of the 'stacklevel' parameter clear? Please feel free
to edit it.
I don't have LaTeX installed on this machine, so haven't verified that the
markup is correct. Will check tonight, or maybe the automatic doc build will
tell me.
........
r51001 | andrew.kuchling | 2006-07-31 14:52:26 +0200 (Mon, 31 Jul 2006) | 1 line
Add PyErr_WarnEx()
........
r51002 | andrew.kuchling | 2006-07-31 15:18:27 +0200 (Mon, 31 Jul 2006) | 1 line
Mention csv newline changes
........
r51003 | andrew.kuchling | 2006-07-31 17:22:58 +0200 (Mon, 31 Jul 2006) | 1 line
Typo fix
........
r51004 | andrew.kuchling | 2006-07-31 17:23:43 +0200 (Mon, 31 Jul 2006) | 1 line
Remove reference to notation
........
r51005 | georg.brandl | 2006-07-31 18:00:34 +0200 (Mon, 31 Jul 2006) | 3 lines
Fix function name.
........
r51006 | andrew.kuchling | 2006-07-31 18:10:24 +0200 (Mon, 31 Jul 2006) | 1 line
[Bug #1514540] Instead of putting the standard types in a section, put them in a chapter of their own. This means string methods will now show up in the ToC. (Should the types come before or after the functions+exceptions+constants chapter? I've put them after, for now.)
........
r51007 | andrew.kuchling | 2006-07-31 18:22:05 +0200 (Mon, 31 Jul 2006) | 1 line
[Bug #848556] Remove \d* from second alternative to avoid exponential case when repeating match
........
r51008 | andrew.kuchling | 2006-07-31 18:27:57 +0200 (Mon, 31 Jul 2006) | 1 line
Update list of files; fix a typo
........
r51013 | andrew.kuchling | 2006-08-01 18:24:30 +0200 (Tue, 01 Aug 2006) | 1 line
typo fix
........
r51018 | thomas.heller | 2006-08-01 18:54:43 +0200 (Tue, 01 Aug 2006) | 2 lines
Fix a potential segfault and various potentail refcount leaks
in the cast() function.
........
r51020 | thomas.heller | 2006-08-01 19:46:10 +0200 (Tue, 01 Aug 2006) | 1 line
Minimal useful docstring for CopyComPointer.
........
r51021 | andrew.kuchling | 2006-08-01 20:16:15 +0200 (Tue, 01 Aug 2006) | 8 lines
[Patch #1520905] Attempt to suppress core file created by test_subprocess.py.
Patch by Douglas Greiman.
The test_run_abort() testcase produces a core file on Unix systems,
even though the test is successful. This can be confusing or alarming
to someone who runs 'make test' and then finds that the Python
interpreter apparently crashed.
........
r51023 | georg.brandl | 2006-08-01 20:49:24 +0200 (Tue, 01 Aug 2006) | 3 lines
os.urandom no longer masks unrelated exceptions like SystemExit or
KeyboardInterrupt.
........
r51025 | thomas.heller | 2006-08-01 21:14:15 +0200 (Tue, 01 Aug 2006) | 2 lines
Speed up PyType_stgdict and PyObject_stgdict.
........
r51027 | ronald.oussoren | 2006-08-01 22:30:31 +0200 (Tue, 01 Aug 2006) | 3 lines
Make sure the postinstall action that optionally updates the user's profile
on MacOS X actually works correctly in all cases.
........
r51028 | ronald.oussoren | 2006-08-01 23:00:57 +0200 (Tue, 01 Aug 2006) | 4 lines
This fixes bug #1527397: PythonLauncher runs scripts with the wrong working
directory. It also fixes a bug where PythonLauncher failed to launch scripts
when the scriptname (or the path to the script) contains quotes.
........
r51031 | tim.peters | 2006-08-02 05:27:46 +0200 (Wed, 02 Aug 2006) | 2 lines
Whitespace normalization.
........
r51032 | tim.peters | 2006-08-02 06:12:36 +0200 (Wed, 02 Aug 2006) | 19 lines
Try to squash struct.pack warnings on the "amd64 gentoo trunk"
buildbot (& possibly other 64-bit boxes) during test_gzip.
The native zlib crc32 function returns an unsigned 32-bit integer,
which the Python wrapper implicitly casts to C long. Therefore the
same crc can "look negative" on a 32-bit box but "look positive" on
a 64-bit box. This patch papers over that platform difference when
writing the crc to file.
It may be better to change the Python wrapper, either to make
the result "look positive" on all platforms (which means it may
have to return a Python long at times on a 32-bit box), or to
keep the sign the same across boxes. But that would be a visible
change in what users see, while the current hack changes no
visible behavior (well, apart from stopping the struct deprecation
warning).
Note that the module-level write32() function is no longer used.
........
r51033 | neal.norwitz | 2006-08-02 06:27:11 +0200 (Wed, 02 Aug 2006) | 4 lines
Prevent memory leak on error.
Reported by Klocwork #36
........
r51034 | tim.peters | 2006-08-02 07:20:08 +0200 (Wed, 02 Aug 2006) | 9 lines
_Stream.close(): Try to kill struct.pack() warnings when
writing the crc to file on the "PPC64 Debian trunk" buildbot
when running test_tarfile.
This is again a case where the native zlib crc is an unsigned
32-bit int, but the Python wrapper implicitly casts it to
signed C long, so that "the sign bit looks different" on
different platforms.
........
r51035 | ronald.oussoren | 2006-08-02 08:10:10 +0200 (Wed, 02 Aug 2006) | 2 lines
Updated documentation for the script that builds the OSX installer.
........
r51036 | neal.norwitz | 2006-08-02 08:14:22 +0200 (Wed, 02 Aug 2006) | 2 lines
_PyWeakref_GetWeakrefCount() now returns a Py_ssize_t instead of long.
........
r51037 | neal.norwitz | 2006-08-02 08:15:10 +0200 (Wed, 02 Aug 2006) | 1 line
v is already checked for NULL, so just DECREF it
........
r51038 | neal.norwitz | 2006-08-02 08:19:19 +0200 (Wed, 02 Aug 2006) | 1 line
Let us know when there was a problem and the child had to kill the parent
........
r51039 | neal.norwitz | 2006-08-02 08:46:21 +0200 (Wed, 02 Aug 2006) | 5 lines
Patch #1519025 and bug #926423: If a KeyboardInterrupt occurs during
a socket operation on a socket with a timeout, the exception will be
caught correctly. Previously, the exception was not caught.
........
r51040 | neal.norwitz | 2006-08-02 09:09:32 +0200 (Wed, 02 Aug 2006) | 1 line
Add some explanation about Klocwork and Coverity static analysis
........
r51041 | anthony.baxter | 2006-08-02 09:43:09 +0200 (Wed, 02 Aug 2006) | 1 line
pre-release machinations
........
r51043 | thomas.heller | 2006-08-02 13:35:31 +0200 (Wed, 02 Aug 2006) | 4 lines
A few nore words about what ctypes does.
Document that using the wrong calling convention can also raise
'ValueError: Procedure called with the wrong number of arguments'.
........
r51045 | thomas.heller | 2006-08-02 14:00:13 +0200 (Wed, 02 Aug 2006) | 1 line
Fix a mistake.
........
r51046 | martin.v.loewis | 2006-08-02 15:53:55 +0200 (Wed, 02 Aug 2006) | 3 lines
Correction of patch #1455898: In the mbcs decoder, set final=False
for stream decoder, but final=True for the decode function.
........
r51049 | tim.peters | 2006-08-02 20:19:35 +0200 (Wed, 02 Aug 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r51079 | neal.norwitz | 2006-08-04 06:50:21 +0200 (Fri, 04 Aug 2006) | 3 lines
Bug #1531405, format_exception no longer raises an exception if
str(exception) raised an exception.
........
r51080 | neal.norwitz | 2006-08-04 06:58:47 +0200 (Fri, 04 Aug 2006) | 11 lines
Bug #1191458: tracing over for loops now produces a line event
on each iteration. I'm not positive this is the best way to handle
this. I'm also not sure that there aren't other cases where
the lnotab is generated incorrectly. It would be great if people
that use pdb or tracing could test heavily.
Also:
* Remove dead/duplicated code that wasn't used/necessary
because we already handled the docstring prior to entering the loop.
* add some debugging code into the compiler (#if 0'd out).
........
r51081 | neal.norwitz | 2006-08-04 07:09:28 +0200 (Fri, 04 Aug 2006) | 4 lines
Bug #1333982: string/number constants were inappropriately stored
in the byte code and co_consts even if they were not used, ie
immediately popped off the stack.
........
r51082 | neal.norwitz | 2006-08-04 07:12:19 +0200 (Fri, 04 Aug 2006) | 1 line
There were really two issues
........
r51084 | fred.drake | 2006-08-04 07:17:21 +0200 (Fri, 04 Aug 2006) | 1 line
SF patch #1534048 (bug #1531003): fix typo in error message
........
r51085 | gregory.p.smith | 2006-08-04 07:17:47 +0200 (Fri, 04 Aug 2006) | 3 lines
fix typos
........
r51087 | georg.brandl | 2006-08-04 08:03:53 +0200 (Fri, 04 Aug 2006) | 3 lines
Fix bug caused by first decrefing, then increfing.
........
r51109 | neil.schemenauer | 2006-08-04 18:20:30 +0200 (Fri, 04 Aug 2006) | 5 lines
Fix the 'compiler' package to generate correct code for MAKE_CLOSURE.
In the 2.5 development cycle, MAKE_CLOSURE as changed to take free
variables as a tuple rather than as individual items on the stack.
Closes patch #1534084.
........
r51110 | georg.brandl | 2006-08-04 20:03:37 +0200 (Fri, 04 Aug 2006) | 3 lines
Change fix for segfaulting property(), add a NEWS entry and a test.
........
r51111 | georg.brandl | 2006-08-04 20:07:34 +0200 (Fri, 04 Aug 2006) | 3 lines
Better fix for bug #1531405, not executing str(value) twice.
........
r51112 | thomas.heller | 2006-08-04 20:17:40 +0200 (Fri, 04 Aug 2006) | 1 line
On Windows, make PyErr_Warn an exported function again.
........
r51113 | thomas.heller | 2006-08-04 20:57:34 +0200 (Fri, 04 Aug 2006) | 4 lines
Fix #1530448 - fix ctypes build failure on solaris 10.
The '-mimpure-text' linker flag is required when linking _ctypes.so.
........
r51114 | thomas.heller | 2006-08-04 21:49:31 +0200 (Fri, 04 Aug 2006) | 3 lines
Fix #1534738: win32 debug version of _msi must be _msi_d.pyd, not _msi.pyd.
Fix the name of the pdb file as well.
........
r51115 | andrew.kuchling | 2006-08-04 22:37:43 +0200 (Fri, 04 Aug 2006) | 1 line
Typo fixes
........
r51116 | andrew.kuchling | 2006-08-04 23:10:03 +0200 (Fri, 04 Aug 2006) | 1 line
Fix mangled sentence
........
r51118 | tim.peters | 2006-08-05 00:00:35 +0200 (Sat, 05 Aug 2006) | 2 lines
Whitespace normalization.
........
r51119 | bob.ippolito | 2006-08-05 01:59:21 +0200 (Sat, 05 Aug 2006) | 5 lines
Fix #1530559, struct.pack raises TypeError where it used to convert.
Passing float arguments to struct.pack when integers are expected
now triggers a DeprecationWarning.
........
r51123 | georg.brandl | 2006-08-05 08:10:54 +0200 (Sat, 05 Aug 2006) | 3 lines
Patch #1534922: correct and enhance unittest docs.
........
r51126 | georg.brandl | 2006-08-06 09:06:33 +0200 (Sun, 06 Aug 2006) | 2 lines
Bug #1535182: really test the xreadlines() method of bz2 objects.
........
r51128 | georg.brandl | 2006-08-06 09:26:21 +0200 (Sun, 06 Aug 2006) | 4 lines
Bug #1535081: A leading underscore has been added to the names of
the md5 and sha modules, so add it in Modules/Setup.dist too.
........
r51129 | georg.brandl | 2006-08-06 10:23:54 +0200 (Sun, 06 Aug 2006) | 3 lines
Bug #1535165: fixed a segfault in input() and raw_input() when
sys.stdin is closed.
........
r51131 | georg.brandl | 2006-08-06 11:17:16 +0200 (Sun, 06 Aug 2006) | 2 lines
Don't produce output in test_builtin.
........
r51133 | andrew.macintyre | 2006-08-06 14:37:03 +0200 (Sun, 06 Aug 2006) | 4 lines
test_threading now skips testing alternate thread stack sizes on
platforms that don't support changing thread stack size.
........
r51134 | andrew.kuchling | 2006-08-07 00:07:04 +0200 (Mon, 07 Aug 2006) | 2 lines
[Patch #1464056] Ensure that we use the panelw library when linking with ncursesw.
Once I see how the buildbots react, I'll backport this to 2.4.
........
r51137 | georg.brandl | 2006-08-08 13:52:34 +0200 (Tue, 08 Aug 2006) | 3 lines
webbrowser: Silence stderr output if no gconftool or gnome browser found
........
r51138 | georg.brandl | 2006-08-08 13:56:21 +0200 (Tue, 08 Aug 2006) | 7 lines
Remove "non-mapping" and "non-sequence" from TypeErrors raised by
PyMapping_Size and PySequence_Size.
Because len() tries first sequence, then mapping size, it will always
raise a "non-mapping object has no len" error which is confusing.
........
r51139 | thomas.heller | 2006-08-08 19:37:00 +0200 (Tue, 08 Aug 2006) | 3 lines
memcmp() can return values other than -1, 0, and +1 but tp_compare
must not.
........
r51140 | thomas.heller | 2006-08-08 19:39:20 +0200 (Tue, 08 Aug 2006) | 1 line
Remove accidently committed, duplicated test.
........
r51147 | andrew.kuchling | 2006-08-08 20:50:14 +0200 (Tue, 08 Aug 2006) | 1 line
Reword paragraph to clarify
........
r51148 | andrew.kuchling | 2006-08-08 20:56:08 +0200 (Tue, 08 Aug 2006) | 1 line
Move obmalloc item into C API section
........
r51149 | andrew.kuchling | 2006-08-08 21:00:14 +0200 (Tue, 08 Aug 2006) | 1 line
'Other changes' section now has only one item; move the item elsewhere and remove the section
........
r51150 | andrew.kuchling | 2006-08-08 21:00:34 +0200 (Tue, 08 Aug 2006) | 1 line
Bump version number
........
r51151 | georg.brandl | 2006-08-08 22:11:22 +0200 (Tue, 08 Aug 2006) | 2 lines
Bug #1536828: typo: TypeType should have been StringType.
........
r51153 | georg.brandl | 2006-08-08 22:13:13 +0200 (Tue, 08 Aug 2006) | 2 lines
Bug #1536660: separate two words.
........
r51155 | georg.brandl | 2006-08-08 22:48:10 +0200 (Tue, 08 Aug 2006) | 3 lines
``str`` is now the same object as ``types.StringType``.
........
r51156 | tim.peters | 2006-08-09 02:52:26 +0200 (Wed, 09 Aug 2006) | 2 lines
Whitespace normalization.
........
r51158 | georg.brandl | 2006-08-09 09:03:22 +0200 (Wed, 09 Aug 2006) | 4 lines
Introduce an upper bound on tuple nesting depth in
C argument format strings; fixes rest of #1523610.
........
r51160 | martin.v.loewis | 2006-08-09 09:57:39 +0200 (Wed, 09 Aug 2006) | 4 lines
__hash__ may now return long int; the final hash
value is obtained by invoking hash on the long int.
Fixes #1536021.
........
r51168 | andrew.kuchling | 2006-08-09 15:03:41 +0200 (Wed, 09 Aug 2006) | 1 line
[Bug #1536021] Mention __hash__ change
........
r51169 | andrew.kuchling | 2006-08-09 15:57:05 +0200 (Wed, 09 Aug 2006) | 1 line
[Patch #1534027] Add notes on locale module changes
........
r51170 | andrew.kuchling | 2006-08-09 16:05:35 +0200 (Wed, 09 Aug 2006) | 1 line
Add missing 'self' parameters
........
r51171 | andrew.kuchling | 2006-08-09 16:06:19 +0200 (Wed, 09 Aug 2006) | 1 line
Reindent code
........
r51172 | armin.rigo | 2006-08-09 16:55:26 +0200 (Wed, 09 Aug 2006) | 2 lines
Fix and test for an infinite C recursion.
........
r51173 | ronald.oussoren | 2006-08-09 16:56:33 +0200 (Wed, 09 Aug 2006) | 2 lines
It's unlikely that future versions will require _POSIX_C_SOURCE
........
r51178 | armin.rigo | 2006-08-09 17:37:26 +0200 (Wed, 09 Aug 2006) | 2 lines
Concatenation on a long string breaks (SF #1526585).
........
r51180 | kurt.kaiser | 2006-08-09 18:46:15 +0200 (Wed, 09 Aug 2006) | 8 lines
1. When used w/o subprocess, all exceptions were preceeded by an error
message claiming they were IDLE internal errors (since 1.2a1).
2. Add Ronald Oussoren to CREDITS
M NEWS.txt
M PyShell.py
M CREDITS.txt
........
r51181 | kurt.kaiser | 2006-08-09 19:47:15 +0200 (Wed, 09 Aug 2006) | 4 lines
As a slight enhancement to the previous checkin, improve the
internal error reporting by moving message to IDLE console.
........
r51182 | andrew.kuchling | 2006-08-09 20:23:14 +0200 (Wed, 09 Aug 2006) | 1 line
Typo fix
........
r51183 | kurt.kaiser | 2006-08-09 22:34:46 +0200 (Wed, 09 Aug 2006) | 2 lines
ToggleTab dialog was setting indent to 8 even if cancelled (since 1.2a1).
........
r51184 | martin.v.loewis | 2006-08-10 01:42:18 +0200 (Thu, 10 Aug 2006) | 2 lines
Add some commentary on -mimpure-text.
........
r51185 | tim.peters | 2006-08-10 02:58:49 +0200 (Thu, 10 Aug 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r51186 | kurt.kaiser | 2006-08-10 03:41:17 +0200 (Thu, 10 Aug 2006) | 2 lines
Changing tokenize (39046) to detect dedent broke tabnanny check (since 1.2a1)
........
r51187 | tim.peters | 2006-08-10 05:01:26 +0200 (Thu, 10 Aug 2006) | 13 lines
test_copytree_simple(): This was leaving behind two new temp
directories each time it ran, at least on Windows.
Several changes: explicitly closed all files; wrapped long
lines; stopped suppressing errors when removing a file or
directory fails (removing /shouldn't/ fail!); and changed
what appeared to be incorrect usage of os.removedirs() (that
doesn't remove empty directories at and /under/ the given
path, instead it must be given an empty leaf directory and
then deletes empty directories moving /up/ the path -- could
be that the conceptually simpler shutil.rmtree() was really
actually intended here).
........
2006-08-11 14:57:12 +00:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <sys/types.h>
|
Merged revisions 46753-51188 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r46755 | brett.cannon | 2006-06-08 18:23:04 +0200 (Thu, 08 Jun 2006) | 4 lines
Make binascii.hexlify() use s# for its arguments instead of t# to actually
match its documentation stating it accepts any read-only buffer.
........
r46757 | brett.cannon | 2006-06-08 19:00:45 +0200 (Thu, 08 Jun 2006) | 8 lines
Buffer objects would return the read or write buffer for a wrapped object when
the char buffer was requested. Now it actually returns the char buffer if
available or raises a TypeError if it isn't (as is raised for the other buffer
types if they are not present but requested).
Not a backport candidate since it does change semantics of the buffer object
(although it could be argued this is enough of a bug to bother backporting).
........
r46760 | andrew.kuchling | 2006-06-09 03:10:17 +0200 (Fri, 09 Jun 2006) | 1 line
Update functools section
........
r46762 | tim.peters | 2006-06-09 04:11:02 +0200 (Fri, 09 Jun 2006) | 6 lines
Whitespace normalization.
Since test_file is implicated in mysterious test failures
when followed by test_optparse, if I had any brains I'd
look at the checkin that last changed test_file ;-)
........
r46763 | tim.peters | 2006-06-09 05:09:42 +0200 (Fri, 09 Jun 2006) | 5 lines
To boost morale :-), force test_optparse to run immediately
after test_file until we can figure out how to fix it.
(See python-dev; at the moment we don't even know which checkin
caused the problem.)
........
r46764 | tim.peters | 2006-06-09 05:51:41 +0200 (Fri, 09 Jun 2006) | 6 lines
AutoFileTests.tearDown(): Removed mysterious undocumented
try/except. Remove TESTFN.
Throughout: used open() instead of file(), and wrapped
long lines.
........
r46765 | tim.peters | 2006-06-09 06:02:06 +0200 (Fri, 09 Jun 2006) | 8 lines
testUnicodeOpen(): I have no idea why, but making this
test clean up after itself appears to fix the test failures
when test_optparse follows test_file.
test_main(): Get rid of TESTFN no matter what. That's
also enough to fix the mystery failures. Doesn't hurt
to fix them twice :-)
........
r46766 | tim.peters | 2006-06-09 07:12:40 +0200 (Fri, 09 Jun 2006) | 6 lines
Remove the temporary hack to force test_optparse to
run immediately after test_file. At least 8 buildbot
boxes passed since the underlying problem got fixed,
and they all failed before the fix, so there's no point
to this anymore.
........
r46767 | neal.norwitz | 2006-06-09 07:54:18 +0200 (Fri, 09 Jun 2006) | 1 line
Fix grammar and reflow
........
r46769 | andrew.kuchling | 2006-06-09 12:22:35 +0200 (Fri, 09 Jun 2006) | 1 line
Markup fix
........
r46773 | andrew.kuchling | 2006-06-09 15:15:57 +0200 (Fri, 09 Jun 2006) | 1 line
[Bug #1472827] Make saxutils.XMLGenerator handle \r\n\t in attribute values by escaping them properly. 2.4 bugfix candidate.
........
r46778 | kristjan.jonsson | 2006-06-09 18:28:01 +0200 (Fri, 09 Jun 2006) | 2 lines
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.
........
r46779 | phillip.eby | 2006-06-09 18:40:18 +0200 (Fri, 09 Jun 2006) | 2 lines
Import wsgiref into the stdlib, as of the external version 0.1-r2181.
........
r46783 | andrew.kuchling | 2006-06-09 18:44:40 +0200 (Fri, 09 Jun 2006) | 1 line
Add note about XMLGenerator bugfix
........
r46784 | andrew.kuchling | 2006-06-09 18:46:51 +0200 (Fri, 09 Jun 2006) | 1 line
Add note about wsgiref
........
r46785 | brett.cannon | 2006-06-09 19:05:48 +0200 (Fri, 09 Jun 2006) | 2 lines
Fix inconsistency in naming within an enum.
........
r46787 | tim.peters | 2006-06-09 19:47:00 +0200 (Fri, 09 Jun 2006) | 2 lines
Whitespace normalization.
........
r46792 | georg.brandl | 2006-06-09 20:29:52 +0200 (Fri, 09 Jun 2006) | 3 lines
Test file.__exit__.
........
r46794 | brett.cannon | 2006-06-09 20:40:46 +0200 (Fri, 09 Jun 2006) | 2 lines
svn:ignore .pyc and .pyo files.
........
r46795 | georg.brandl | 2006-06-09 20:45:48 +0200 (Fri, 09 Jun 2006) | 3 lines
RFE #1491485: str/unicode.endswith()/startswith() now accept a tuple as first argument.
........
r46798 | andrew.kuchling | 2006-06-09 21:03:16 +0200 (Fri, 09 Jun 2006) | 1 line
Describe startswith()/endswiith() change; add reminder about wsgiref
........
r46799 | tim.peters | 2006-06-09 21:24:44 +0200 (Fri, 09 Jun 2006) | 11 lines
Implementing a happy idea from Georg Brandl: make runtest() try to
clean up files and directories the tests often leave behind by
mistake. This is the first time in history I don't have a bogus
"db_home" directory after running the tests ;-)
Also worked on runtest's docstring, to say something about all the
arguments, and to document the non-obvious return values.
New functions runtest_inner() and cleanup_test_droppings() in
support of the above.
........
r46800 | andrew.kuchling | 2006-06-09 21:43:25 +0200 (Fri, 09 Jun 2006) | 1 line
Remove unused variable
........
r46801 | andrew.kuchling | 2006-06-09 21:56:05 +0200 (Fri, 09 Jun 2006) | 1 line
Add some wsgiref text
........
r46803 | thomas.heller | 2006-06-09 21:59:11 +0200 (Fri, 09 Jun 2006) | 1 line
set eol-style svn property
........
r46804 | thomas.heller | 2006-06-09 22:01:01 +0200 (Fri, 09 Jun 2006) | 1 line
set eol-style svn property
........
r46805 | georg.brandl | 2006-06-09 22:43:48 +0200 (Fri, 09 Jun 2006) | 3 lines
Make use of new str.startswith/endswith semantics.
Occurences in email and compiler were ignored due to backwards compat requirements.
........
r46806 | brett.cannon | 2006-06-10 00:31:23 +0200 (Sat, 10 Jun 2006) | 4 lines
An object with __call__ as an attribute, when called, will have that attribute checked for __call__ itself, and will continue to look until it finds an object without the attribute. This can lead to an infinite recursion.
Closes bug #532646, again. Will be backported.
........
r46808 | brett.cannon | 2006-06-10 00:45:54 +0200 (Sat, 10 Jun 2006) | 2 lines
Fix bug introduced in rev. 46806 by not having variable declaration at the top of a block.
........
r46812 | georg.brandl | 2006-06-10 08:40:50 +0200 (Sat, 10 Jun 2006) | 4 lines
Apply perky's fix for #1503157: "/".join([u"", u""]) raising OverflowError.
Also improve error message on overflow.
........
r46817 | martin.v.loewis | 2006-06-10 10:14:03 +0200 (Sat, 10 Jun 2006) | 2 lines
Port cygwin kill_python changes from 2.4 branch.
........
r46818 | armin.rigo | 2006-06-10 12:57:40 +0200 (Sat, 10 Jun 2006) | 4 lines
SF bug #1503294.
PyThreadState_GET() complains if the tstate is NULL, but only in debug mode.
........
r46819 | martin.v.loewis | 2006-06-10 14:23:46 +0200 (Sat, 10 Jun 2006) | 4 lines
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
........
r46820 | skip.montanaro | 2006-06-10 16:09:11 +0200 (Sat, 10 Jun 2006) | 1 line
document the class, not its initializer
........
r46821 | greg.ward | 2006-06-10 18:40:01 +0200 (Sat, 10 Jun 2006) | 4 lines
Sync with Optik docs (rev 518):
* restore "Extending optparse" section
* document ALWAYS_TYPED_ACTIONS (SF #1449311)
........
r46824 | thomas.heller | 2006-06-10 21:51:46 +0200 (Sat, 10 Jun 2006) | 8 lines
Upgrade to ctypes version 0.9.9.7.
Summary of changes:
- support for 'variable sized' data
- support for anonymous structure/union fields
- fix severe bug with certain arrays or structures containing more than 256 fields
........
r46825 | thomas.heller | 2006-06-10 21:55:36 +0200 (Sat, 10 Jun 2006) | 8 lines
Upgrade to ctypes version 0.9.9.7.
Summary of changes:
- support for 'variable sized' data
- support for anonymous structure/union fields
- fix severe bug with certain arrays or structures containing more than 256 fields
........
r46826 | fred.drake | 2006-06-10 22:01:34 +0200 (Sat, 10 Jun 2006) | 4 lines
SF patch #1303595: improve description of __builtins__, explaining how it
varies between __main__ and other modules, and strongly suggest not touching
it but using __builtin__ if absolutely necessary
........
r46827 | fred.drake | 2006-06-10 22:02:58 +0200 (Sat, 10 Jun 2006) | 1 line
credit for SF patch #1303595
........
r46831 | thomas.heller | 2006-06-10 22:29:34 +0200 (Sat, 10 Jun 2006) | 2 lines
New docs for ctypes.
........
r46834 | thomas.heller | 2006-06-10 23:07:19 +0200 (Sat, 10 Jun 2006) | 1 line
Fix a wrong printf format.
........
r46835 | thomas.heller | 2006-06-10 23:17:58 +0200 (Sat, 10 Jun 2006) | 1 line
Fix the second occurrence of the problematic printf format.
........
r46837 | thomas.heller | 2006-06-10 23:56:03 +0200 (Sat, 10 Jun 2006) | 1 line
Don't use C++ comment.
........
r46838 | thomas.heller | 2006-06-11 00:01:50 +0200 (Sun, 11 Jun 2006) | 1 line
Handle failure of PyMem_Realloc.
........
r46839 | skip.montanaro | 2006-06-11 00:38:13 +0200 (Sun, 11 Jun 2006) | 2 lines
Suppress warning on MacOSX about possible use before set of proc.
........
r46840 | tim.peters | 2006-06-11 00:51:45 +0200 (Sun, 11 Jun 2006) | 8 lines
shuffle() doscstring: Removed warning about sequence length
versus generator period. While this was a real weakness of the
older WH generator for lists with just a few dozen elements,
and so could potentially bite the naive ;-), the Twister should
show excellent behavior up to at least 600 elements.
Module docstring: reflowed some jarringly short lines.
........
r46844 | greg.ward | 2006-06-11 02:40:49 +0200 (Sun, 11 Jun 2006) | 4 lines
Bug #1361643: fix textwrap.dedent() so it handles tabs appropriately,
i.e. do *not* expand tabs, but treat them as whitespace that is not
equivalent to spaces. Add a couple of test cases. Clarify docs.
........
r46850 | neal.norwitz | 2006-06-11 07:44:18 +0200 (Sun, 11 Jun 2006) | 5 lines
Fix Coverity # 146. newDBSequenceObject would deref dbobj, so it can't be NULL.
We know it's not NULL from the ParseTuple and DbObject_Check will verify
it's not NULL.
........
r46851 | neal.norwitz | 2006-06-11 07:45:25 +0200 (Sun, 11 Jun 2006) | 4 lines
Wrap some long lines
Top/Bottom factor out some common expressions
Add a XXX comment about widing offset.
........
r46852 | neal.norwitz | 2006-06-11 07:45:47 +0200 (Sun, 11 Jun 2006) | 1 line
Add versionadded to doc
........
r46853 | neal.norwitz | 2006-06-11 07:47:14 +0200 (Sun, 11 Jun 2006) | 3 lines
Update doc to make it agree with code.
Bottom factor out some common code.
........
r46854 | neal.norwitz | 2006-06-11 07:48:14 +0200 (Sun, 11 Jun 2006) | 3 lines
f_code can't be NULL based on Frame_New and other code that derefs it.
So there doesn't seem to be much point to checking here.
........
r46855 | neal.norwitz | 2006-06-11 09:26:27 +0200 (Sun, 11 Jun 2006) | 1 line
Fix errors found by pychecker
........
r46856 | neal.norwitz | 2006-06-11 09:26:50 +0200 (Sun, 11 Jun 2006) | 1 line
warnings was imported at module scope, no need to import again
........
r46857 | neal.norwitz | 2006-06-11 09:27:56 +0200 (Sun, 11 Jun 2006) | 5 lines
Fix errors found by pychecker.
I think these changes are correct, but I'm not sure. Could someone
who knows how this module works test it? It can at least start on
the cmd line.
........
r46858 | neal.norwitz | 2006-06-11 10:35:14 +0200 (Sun, 11 Jun 2006) | 1 line
Fix errors found by pychecker
........
r46859 | ronald.oussoren | 2006-06-11 16:33:36 +0200 (Sun, 11 Jun 2006) | 4 lines
This patch improves the L&F of IDLE on OSX. The changes are conditionalized on
being in an IDLE.app bundle on darwin. This does a slight reorganisation of the
menus and adds support for file-open events.
........
r46860 | greg.ward | 2006-06-11 16:42:41 +0200 (Sun, 11 Jun 2006) | 1 line
SF #1366250: optparse docs: fix inconsistency in variable name; minor tweaks.
........
r46861 | greg.ward | 2006-06-11 18:24:11 +0200 (Sun, 11 Jun 2006) | 3 lines
Bug #1498146: fix optparse to handle Unicode strings in option help,
description, and epilog.
........
r46862 | thomas.heller | 2006-06-11 19:04:22 +0200 (Sun, 11 Jun 2006) | 2 lines
Release the GIL during COM method calls, to avoid deadlocks in
Python coded COM objects.
........
r46863 | tim.peters | 2006-06-11 21:42:51 +0200 (Sun, 11 Jun 2006) | 2 lines
Whitespace normalization.
........
r46864 | tim.peters | 2006-06-11 21:43:49 +0200 (Sun, 11 Jun 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46865 | ronald.oussoren | 2006-06-11 21:45:57 +0200 (Sun, 11 Jun 2006) | 2 lines
Remove message about using make frameworkinstall, that's no longer necesssary
........
r46866 | ronald.oussoren | 2006-06-11 22:23:29 +0200 (Sun, 11 Jun 2006) | 2 lines
Use configure to substitute the correct prefix instead of hardcoding
........
r46867 | ronald.oussoren | 2006-06-11 22:24:45 +0200 (Sun, 11 Jun 2006) | 4 lines
- Change fixapplepython23.py to ensure that it will run with /usr/bin/python
on intel macs.
- Fix some minor problems in the installer for OSX
........
r46868 | neal.norwitz | 2006-06-11 22:25:56 +0200 (Sun, 11 Jun 2006) | 5 lines
Try to fix several networking tests. The problem is that if hosts have
a search path setup, some of these hosts resolve to the wrong address.
By appending a period to the hostname, the hostname should only resolve
to what we want it to resolve to. Hopefully this doesn't break different bots.
........
r46869 | neal.norwitz | 2006-06-11 22:42:02 +0200 (Sun, 11 Jun 2006) | 7 lines
Try to fix another networking test. The problem is that if hosts have
a search path setup, some of these hosts resolve to the wrong address.
By appending a period to the hostname, the hostname should only resolve
to what we want it to resolve to. Hopefully this doesn't break different bots.
Also add more info to failure message to aid debugging test failure.
........
r46870 | neal.norwitz | 2006-06-11 22:46:46 +0200 (Sun, 11 Jun 2006) | 4 lines
Fix test on PPC64 buildbot. It raised an IOError (really an URLError which
derives from an IOError). That seems valid. Env Error includes both OSError
and IOError, so this seems like a reasonable fix.
........
r46871 | tim.peters | 2006-06-11 22:52:59 +0200 (Sun, 11 Jun 2006) | 10 lines
compare_generic_iter(): Fixed the failure of test_wsgiref's testFileWrapper
when running with -O.
test_simple_validation_error still fails under -O. That appears to be because
wsgiref's validate.py uses `assert` statements all over the place to check
arguments for sanity. That should all be changed (it's not a logical error
in the software if a user passes bogus arguments, so this isn't a reasonable
use for `assert` -- checking external preconditions should generally raise
ValueError or TypeError instead, as appropriate).
........
r46872 | neal.norwitz | 2006-06-11 23:38:38 +0200 (Sun, 11 Jun 2006) | 1 line
Get test to pass on S/390. Shout if you think this change is incorrect.
........
r46873 | neal.norwitz | 2006-06-12 04:05:55 +0200 (Mon, 12 Jun 2006) | 1 line
Cleanup Py_ssize_t a little (get rid of second #ifdef)
........
r46874 | neal.norwitz | 2006-06-12 04:06:17 +0200 (Mon, 12 Jun 2006) | 1 line
Fix some Py_ssize_t issues
........
r46875 | neal.norwitz | 2006-06-12 04:06:42 +0200 (Mon, 12 Jun 2006) | 1 line
Fix some Py_ssize_t issues
........
r46876 | neal.norwitz | 2006-06-12 04:07:24 +0200 (Mon, 12 Jun 2006) | 2 lines
Cleanup: Remove import of types to get StringTypes, we can just use basestring.
........
r46877 | neal.norwitz | 2006-06-12 04:07:57 +0200 (Mon, 12 Jun 2006) | 1 line
Don't truncate if size_t is bigger than uint
........
r46878 | neal.norwitz | 2006-06-12 04:08:41 +0200 (Mon, 12 Jun 2006) | 1 line
Don't leak the list object if there's an error allocating the item storage. Backport candidate
........
r46879 | neal.norwitz | 2006-06-12 04:09:03 +0200 (Mon, 12 Jun 2006) | 1 line
Fix typo. Backport if anyone cares. :-)
........
r46880 | neal.norwitz | 2006-06-12 04:09:34 +0200 (Mon, 12 Jun 2006) | 1 line
Fix indentation of case and a Py_ssize_t issue.
........
r46881 | neal.norwitz | 2006-06-12 04:11:18 +0200 (Mon, 12 Jun 2006) | 3 lines
Get rid of f_restricted too. Doc the other 4 ints that were already removed
at the NeedForSpeed sprint.
........
r46882 | neal.norwitz | 2006-06-12 04:13:21 +0200 (Mon, 12 Jun 2006) | 1 line
Fix the socket tests so they can be run concurrently. Backport candidate
........
r46883 | neal.norwitz | 2006-06-12 04:16:10 +0200 (Mon, 12 Jun 2006) | 1 line
i and j are initialized below when used. No need to do it twice
........
r46884 | neal.norwitz | 2006-06-12 05:05:03 +0200 (Mon, 12 Jun 2006) | 1 line
Remove unused import
........
r46885 | neal.norwitz | 2006-06-12 05:05:40 +0200 (Mon, 12 Jun 2006) | 1 line
Impl ssize_t
........
r46886 | neal.norwitz | 2006-06-12 05:33:09 +0200 (Mon, 12 Jun 2006) | 6 lines
Patch #1503046, Conditional compilation of zlib.(de)compressobj.copy
copy is only in newer versions of zlib. This should allow zlibmodule
to work with older versions like the Tru64 buildbot.
........
r46887 | phillip.eby | 2006-06-12 06:04:32 +0200 (Mon, 12 Jun 2006) | 2 lines
Sync w/external release 0.1.2. Please see PEP 360 before making changes to external packages.
........
r46888 | martin.v.loewis | 2006-06-12 06:26:31 +0200 (Mon, 12 Jun 2006) | 2 lines
Get rid of function pointer cast.
........
r46889 | thomas.heller | 2006-06-12 08:05:57 +0200 (Mon, 12 Jun 2006) | 3 lines
I don't know how that happend, but the entire file contents was
duplicated. Thanks to Simon Percivall for the heads up.
........
r46890 | nick.coghlan | 2006-06-12 10:19:37 +0200 (Mon, 12 Jun 2006) | 1 line
Fix site module docstring to match the code
........
r46891 | nick.coghlan | 2006-06-12 10:23:02 +0200 (Mon, 12 Jun 2006) | 1 line
Fix site module docstring to match the code for Mac OSX, too
........
r46892 | nick.coghlan | 2006-06-12 10:27:13 +0200 (Mon, 12 Jun 2006) | 1 line
The site module documentation also described the Windows behaviour incorrectly.
........
r46893 | nick.coghlan | 2006-06-12 12:17:11 +0200 (Mon, 12 Jun 2006) | 1 line
Make the -m switch conform to the documentation of sys.path by behaving like the -c switch
........
r46894 | kristjan.jonsson | 2006-06-12 17:45:12 +0200 (Mon, 12 Jun 2006) | 2 lines
Fix the CRT argument error handling for VisualStudio .NET 2005. Install a CRT error handler and disable the assertion for debug builds. This causes CRT to set errno to EINVAL.
This update fixes crash cases in the test suite where the default CRT error handler would cause process exit.
........
r46899 | thomas.heller | 2006-06-12 22:56:48 +0200 (Mon, 12 Jun 2006) | 1 line
Add pep-291 compatibility markers.
........
r46901 | ka-ping.yee | 2006-06-13 01:47:52 +0200 (Tue, 13 Jun 2006) | 5 lines
Add the uuid module.
This module has been tested so far on Windows XP (Python 2.4 and 2.5a2),
Mac OS X (Python 2.3, 2.4, and 2.5a2), and Linux (Python 2.4 and 2.5a2).
........
r46902 | tim.peters | 2006-06-13 02:30:01 +0200 (Tue, 13 Jun 2006) | 2 lines
Whitespace normalization.
........
r46903 | tim.peters | 2006-06-13 02:30:50 +0200 (Tue, 13 Jun 2006) | 2 lines
Added missing svn:eol-style property to text files.
........
r46905 | tim.peters | 2006-06-13 05:30:07 +0200 (Tue, 13 Jun 2006) | 5 lines
get_matching_blocks(): rewrote code & comments so they match; added
more comments about why it's this way at all; and removed what looked
like needless expense (sorting (i, j, k) triples directly should give
exactly the same order as sorting (i, (i, j, k)) pairs).
........
r46906 | neal.norwitz | 2006-06-13 06:08:53 +0200 (Tue, 13 Jun 2006) | 1 line
Don't fail if another process is listening on our port.
........
r46908 | neal.norwitz | 2006-06-13 10:28:19 +0200 (Tue, 13 Jun 2006) | 2 lines
Initialize the type object so pychecker can't crash the interpreter.
........
r46909 | neal.norwitz | 2006-06-13 10:41:06 +0200 (Tue, 13 Jun 2006) | 1 line
Verify the crash due to EncodingMap not initialized does not return
........
r46910 | thomas.heller | 2006-06-13 10:56:14 +0200 (Tue, 13 Jun 2006) | 3 lines
Add some windows datatypes that were missing from this file, and add
the aliases defined in windows header files for the structures.
........
r46911 | thomas.heller | 2006-06-13 11:40:14 +0200 (Tue, 13 Jun 2006) | 3 lines
Add back WCHAR, UINT, DOUBLE, _LARGE_INTEGER, _ULARGE_INTEGER.
VARIANT_BOOL is a special _ctypes data type, not c_short.
........
r46912 | ronald.oussoren | 2006-06-13 13:19:56 +0200 (Tue, 13 Jun 2006) | 4 lines
Linecache contains support for PEP302 loaders, but fails to deal with loaders
that return None to indicate that the module is valid but no source is
available. This patch fixes that.
........
r46913 | andrew.kuchling | 2006-06-13 13:57:04 +0200 (Tue, 13 Jun 2006) | 1 line
Mention uuid module
........
r46915 | walter.doerwald | 2006-06-13 14:02:12 +0200 (Tue, 13 Jun 2006) | 2 lines
Fix passing errors to the encoder and decoder functions.
........
r46917 | walter.doerwald | 2006-06-13 14:04:43 +0200 (Tue, 13 Jun 2006) | 3 lines
errors is an attribute in the incremental decoder
not an argument.
........
r46919 | andrew.macintyre | 2006-06-13 17:04:24 +0200 (Tue, 13 Jun 2006) | 11 lines
Patch #1454481: Make thread stack size runtime tunable.
Heavily revised, comprising revisions:
46640 - original trunk revision (backed out in r46655)
46647 - markup fix (backed out in r46655)
46692:46918 merged from branch aimacintyre-sf1454481
branch tested on buildbots (Windows buildbots had problems
not related to these changes).
........
r46920 | brett.cannon | 2006-06-13 18:06:55 +0200 (Tue, 13 Jun 2006) | 2 lines
Remove unused variable.
........
r46921 | andrew.kuchling | 2006-06-13 18:41:41 +0200 (Tue, 13 Jun 2006) | 1 line
Add ability to set stack size
........
r46923 | marc-andre.lemburg | 2006-06-13 19:04:26 +0200 (Tue, 13 Jun 2006) | 2 lines
Update pybench to version 2.0.
........
r46924 | marc-andre.lemburg | 2006-06-13 19:07:14 +0200 (Tue, 13 Jun 2006) | 2 lines
Revert wrong svn copy.
........
r46925 | andrew.macintyre | 2006-06-13 19:14:36 +0200 (Tue, 13 Jun 2006) | 2 lines
fix exception usage
........
r46927 | tim.peters | 2006-06-13 20:37:07 +0200 (Tue, 13 Jun 2006) | 2 lines
Whitespace normalization.
........
r46928 | marc-andre.lemburg | 2006-06-13 20:56:56 +0200 (Tue, 13 Jun 2006) | 9 lines
Updated to pybench 2.0.
See svn.python.org/external/pybench-2.0 for the original import of that
version.
Note that platform.py was not copied over from pybench-2.0 since
it is already part of Python 2.5.
........
r46929 | andrew.macintyre | 2006-06-13 21:02:35 +0200 (Tue, 13 Jun 2006) | 5 lines
Increase the small thread stack size to get the test
to pass reliably on the one buildbot that insists on
more than 32kB of thread stack.
........
r46930 | marc-andre.lemburg | 2006-06-13 21:20:07 +0200 (Tue, 13 Jun 2006) | 2 lines
Whitespace normalization.
........
r46931 | thomas.heller | 2006-06-13 22:18:43 +0200 (Tue, 13 Jun 2006) | 2 lines
More docs for ctypes.
........
r46932 | brett.cannon | 2006-06-13 23:34:24 +0200 (Tue, 13 Jun 2006) | 2 lines
Ignore .pyc and .pyo files in Pybench.
........
r46933 | brett.cannon | 2006-06-13 23:46:41 +0200 (Tue, 13 Jun 2006) | 7 lines
If a classic class defined a __coerce__() method that just returned its two
arguments in reverse, the interpreter would infinitely recourse trying to get a
coercion that worked. So put in a recursion check after a coercion is made and
the next call to attempt to use the coerced values.
Fixes bug #992017 and closes crashers/coerce.py .
........
r46936 | gerhard.haering | 2006-06-14 00:24:47 +0200 (Wed, 14 Jun 2006) | 3 lines
Merged changes from external pysqlite 2.3.0 release. Documentation updates will
follow in a few hours at the latest. Then we should be ready for beta1.
........
r46937 | brett.cannon | 2006-06-14 00:26:13 +0200 (Wed, 14 Jun 2006) | 2 lines
Missed test for rev. 46933; infinite recursion from __coerce__() returning its arguments reversed.
........
r46938 | gerhard.haering | 2006-06-14 00:53:48 +0200 (Wed, 14 Jun 2006) | 2 lines
Updated documentation for pysqlite 2.3.0 API.
........
r46939 | tim.peters | 2006-06-14 06:09:25 +0200 (Wed, 14 Jun 2006) | 10 lines
SequenceMatcher.get_matching_blocks(): This now guarantees that
adjacent triples in the result list describe non-adjacent matching
blocks. That's _nice_ to have, and Guido said he wanted it.
Not a bugfix candidate: Guido or not ;-), this changes visible
endcase semantics (note that some tests had to change), and
nothing about this was documented before. Since it was working
as designed, and behavior was consistent with the docs, it wasn't
"a bug".
........
r46940 | tim.peters | 2006-06-14 06:13:00 +0200 (Wed, 14 Jun 2006) | 2 lines
Repaired typo in new comment.
........
r46941 | tim.peters | 2006-06-14 06:15:27 +0200 (Wed, 14 Jun 2006) | 2 lines
Whitespace normalization.
........
r46942 | fred.drake | 2006-06-14 06:25:02 +0200 (Wed, 14 Jun 2006) | 3 lines
- make some disabled tests run what they intend when enabled
- remove some over-zealous triple-quoting
........
r46943 | fred.drake | 2006-06-14 07:04:47 +0200 (Wed, 14 Jun 2006) | 3 lines
add tests for two cases that are handled correctly in the current code,
but that SF patch 1504676 as written mis-handles
........
r46944 | fred.drake | 2006-06-14 07:15:51 +0200 (Wed, 14 Jun 2006) | 1 line
explain an XXX in more detail
........
r46945 | martin.v.loewis | 2006-06-14 07:21:04 +0200 (Wed, 14 Jun 2006) | 1 line
Patch #1455898: Incremental mode for "mbcs" codec.
........
r46946 | georg.brandl | 2006-06-14 08:08:31 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1339007: Shelf objects now don't raise an exception in their
__del__ method when initialization failed.
........
r46948 | thomas.heller | 2006-06-14 08:18:15 +0200 (Wed, 14 Jun 2006) | 1 line
Fix docstring.
........
r46949 | georg.brandl | 2006-06-14 08:29:07 +0200 (Wed, 14 Jun 2006) | 2 lines
Bug #1501122: mention __gt__ &co in description of comparison order.
........
r46951 | thomas.heller | 2006-06-14 09:08:38 +0200 (Wed, 14 Jun 2006) | 1 line
Write more docs.
........
r46952 | georg.brandl | 2006-06-14 10:31:39 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1153163: describe __add__ vs __radd__ behavior when adding
objects of same type/of subclasses of the other.
........
r46954 | georg.brandl | 2006-06-14 10:42:11 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1202018: add some common mime.types locations.
........
r46955 | georg.brandl | 2006-06-14 10:50:03 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1117556: SimpleHTTPServer now tries to find and use the system's
mime.types file for determining MIME types.
........
r46957 | thomas.heller | 2006-06-14 11:09:08 +0200 (Wed, 14 Jun 2006) | 1 line
Document paramflags.
........
r46958 | thomas.heller | 2006-06-14 11:20:11 +0200 (Wed, 14 Jun 2006) | 1 line
Add an __all__ list, since this module does 'from ctypes import *'.
........
r46959 | andrew.kuchling | 2006-06-14 15:59:15 +0200 (Wed, 14 Jun 2006) | 1 line
Add item
........
r46961 | georg.brandl | 2006-06-14 18:46:43 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #805015: doc error in PyUnicode_FromEncodedObject.
........
r46962 | gerhard.haering | 2006-06-15 00:28:37 +0200 (Thu, 15 Jun 2006) | 10 lines
- Added version checks in C code to make sure we don't trigger bugs in older
SQLite versions.
- Added version checks in test suite so that we don't execute tests that we
know will fail with older (buggy) SQLite versions.
Now, all tests should run against all SQLite versions from 3.0.8 until 3.3.6
(latest one now). The sqlite3 module can be built against all these SQLite
versions and the sqlite3 module does its best to not trigger bugs in SQLite,
but using SQLite 3.3.3 or later is recommended.
........
r46963 | tim.peters | 2006-06-15 00:38:13 +0200 (Thu, 15 Jun 2006) | 2 lines
Whitespace normalization.
........
r46964 | neal.norwitz | 2006-06-15 06:54:29 +0200 (Thu, 15 Jun 2006) | 9 lines
Speculative checkin (requires approval of Gerhard Haering)
This backs out the test changes in 46962 which prevented crashes
by not running the tests via a version check. All the version checks
added in that rev were removed from the tests.
Code was added to the error handler in connection.c that seems
to work with older versions of sqlite including 3.1.3.
........
r46965 | neal.norwitz | 2006-06-15 07:55:49 +0200 (Thu, 15 Jun 2006) | 1 line
Try to narrow window of failure on slow/busy boxes (ppc64 buildbot)
........
r46966 | martin.v.loewis | 2006-06-15 08:45:05 +0200 (Thu, 15 Jun 2006) | 2 lines
Make import/lookup of mbcs fail on non-Windows systems.
........
r46967 | ronald.oussoren | 2006-06-15 10:14:18 +0200 (Thu, 15 Jun 2006) | 2 lines
Patch #1446489 (zipfile: support for ZIP64)
........
r46968 | neal.norwitz | 2006-06-15 10:16:44 +0200 (Thu, 15 Jun 2006) | 6 lines
Re-revert this change. Install the version check and don't run the test
until Gerhard has time to fully debug the issue. This affects versions
before 3.2.1 (possibly only versions earlier than 3.1.3).
Based on discussion on python-checkins.
........
r46969 | gregory.p.smith | 2006-06-15 10:52:32 +0200 (Thu, 15 Jun 2006) | 6 lines
- bsddb: multithreaded DB access using the simple bsddb module interface
now works reliably. It has been updated to use automatic BerkeleyDB
deadlock detection and the bsddb.dbutils.DeadlockWrap wrapper to retry
database calls that would previously deadlock. [SF python bug #775414]
........
r46970 | gregory.p.smith | 2006-06-15 11:23:52 +0200 (Thu, 15 Jun 2006) | 2 lines
minor documentation cleanup. mention the bsddb.db interface explicitly by name.
........
r46971 | neal.norwitz | 2006-06-15 11:57:03 +0200 (Thu, 15 Jun 2006) | 5 lines
Steal the trick from test_compiler to print out a slow msg.
This will hopefully get the buildbots to pass. Not sure this
test will be feasible or even work. But everything is red now,
so it can't get much worse.
........
r46972 | neal.norwitz | 2006-06-15 12:24:49 +0200 (Thu, 15 Jun 2006) | 1 line
Print some more info to get an idea of how much longer the test will last
........
r46981 | tim.peters | 2006-06-15 20:04:40 +0200 (Thu, 15 Jun 2006) | 6 lines
Try to reduce the extreme peak memory and disk-space use
of this test. It probably still requires more disk space
than most buildbots have, and in any case is still so
intrusive that if we don't find another way to test this I'm
taking my buildbot offline permanently ;-)
........
r46982 | tim.peters | 2006-06-15 20:06:29 +0200 (Thu, 15 Jun 2006) | 2 lines
Whitespace normalization.
........
r46983 | tim.peters | 2006-06-15 20:07:28 +0200 (Thu, 15 Jun 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46984 | tim.peters | 2006-06-15 20:38:19 +0200 (Thu, 15 Jun 2006) | 2 lines
Oops -- I introduced an off-by-6436159488 error.
........
r46990 | neal.norwitz | 2006-06-16 06:30:34 +0200 (Fri, 16 Jun 2006) | 1 line
Disable this test until we can determine what to do about it
........
r46991 | neal.norwitz | 2006-06-16 06:31:06 +0200 (Fri, 16 Jun 2006) | 1 line
Param name is dir, not directory. Update docstring. Backport candidate
........
r46992 | neal.norwitz | 2006-06-16 06:31:28 +0200 (Fri, 16 Jun 2006) | 1 line
Add missing period in comment.
........
r46993 | neal.norwitz | 2006-06-16 06:32:43 +0200 (Fri, 16 Jun 2006) | 1 line
Fix whitespace, there are memory leaks in this module.
........
r46995 | fred.drake | 2006-06-17 01:45:06 +0200 (Sat, 17 Jun 2006) | 3 lines
SF patch 1504676: Make sgmllib char and entity references pluggable
(implementation/tests contributed by Sam Ruby)
........
r46996 | fred.drake | 2006-06-17 03:07:54 +0200 (Sat, 17 Jun 2006) | 1 line
fix change that broke the htmllib tests
........
r46998 | martin.v.loewis | 2006-06-17 11:15:14 +0200 (Sat, 17 Jun 2006) | 3 lines
Patch #763580: Add name and value arguments to
Tkinter variable classes.
........
r46999 | martin.v.loewis | 2006-06-17 11:20:41 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #1096231: Add default argument to wm_iconbitmap.
........
r47000 | martin.v.loewis | 2006-06-17 11:25:15 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #1494750: Destroy master after deleting children.
........
r47003 | george.yoshida | 2006-06-17 18:31:52 +0200 (Sat, 17 Jun 2006) | 2 lines
markup fix
........
r47005 | george.yoshida | 2006-06-17 18:39:13 +0200 (Sat, 17 Jun 2006) | 4 lines
Update url.
Old url returned status code:301 Moved permanently.
........
r47007 | martin.v.loewis | 2006-06-17 20:44:27 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #812986: Update the canvas even if not tracing.
........
r47008 | martin.v.loewis | 2006-06-17 21:03:26 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #815924: Restore ability to pass type= and icon=
........
r47009 | neal.norwitz | 2006-06-18 00:37:45 +0200 (Sun, 18 Jun 2006) | 1 line
Fix typo in docstring
........
r47010 | neal.norwitz | 2006-06-18 00:38:15 +0200 (Sun, 18 Jun 2006) | 1 line
Fix memory leak reported by valgrind while running test_subprocess
........
r47011 | fred.drake | 2006-06-18 04:57:35 +0200 (Sun, 18 Jun 2006) | 1 line
remove unnecessary markup
........
r47013 | neal.norwitz | 2006-06-18 21:35:01 +0200 (Sun, 18 Jun 2006) | 7 lines
Prevent spurious leaks when running regrtest.py -R. There may be more
issues that crop up from time to time, but this change seems to have been
pretty stable (no spurious warnings) for about a week.
Other modules which use threads may require similar use of
threading_setup/threading_cleanup from test_support.
........
r47014 | neal.norwitz | 2006-06-18 21:37:40 +0200 (Sun, 18 Jun 2006) | 9 lines
The hppa ubuntu box sometimes hangs forever in these tests. My guess
is that the wait is failing for some reason. Use WNOHANG, so we won't
wait until the buildbot kills the test suite.
I haven't been able to reproduce the failure, so I'm not sure if
this will help or not. Hopefully, this change will cause the test
to fail, rather than hang. That will be better since we will get
the rest of the test results. It may also help us debug the real problem.
........
r47015 | neal.norwitz | 2006-06-18 22:10:24 +0200 (Sun, 18 Jun 2006) | 1 line
Revert 47014 until it is more robust
........
r47016 | thomas.heller | 2006-06-18 23:27:04 +0200 (Sun, 18 Jun 2006) | 6 lines
Fix typos.
Fix doctest example.
Mention in the tutorial that 'errcheck' is explained in the ref manual.
Use better wording in some places.
Remoce code examples that shouldn't be in the tutorial.
Remove some XXX notices.
........
r47017 | georg.brandl | 2006-06-19 00:17:29 +0200 (Mon, 19 Jun 2006) | 3 lines
Patch #1507676: improve exception messages in abstract.c, object.c and typeobject.c.
........
r47018 | neal.norwitz | 2006-06-19 07:40:44 +0200 (Mon, 19 Jun 2006) | 1 line
Use Py_ssize_t
........
r47019 | georg.brandl | 2006-06-19 08:35:54 +0200 (Mon, 19 Jun 2006) | 3 lines
Add news entry about error msg improvement.
........
r47020 | thomas.heller | 2006-06-19 09:07:49 +0200 (Mon, 19 Jun 2006) | 2 lines
Try to repair the failing test on the OpenBSD buildbot. Trial and error...
........
r47021 | tim.peters | 2006-06-19 09:45:16 +0200 (Mon, 19 Jun 2006) | 2 lines
Whitespace normalization.
........
r47022 | walter.doerwald | 2006-06-19 10:07:50 +0200 (Mon, 19 Jun 2006) | 4 lines
Patch #1506645: add Python wrappers for the curses functions
is_term_resized, resize_term and resizeterm. This uses three
separate configure checks (one for each function).
........
r47023 | walter.doerwald | 2006-06-19 10:14:09 +0200 (Mon, 19 Jun 2006) | 2 lines
Make check order match in configure and configure.in.
........
r47024 | tim.peters | 2006-06-19 10:14:28 +0200 (Mon, 19 Jun 2006) | 3 lines
Repair KeyError when running test_threaded_import under -R,
as reported by Neal on python-dev.
........
r47025 | thomas.heller | 2006-06-19 10:32:46 +0200 (Mon, 19 Jun 2006) | 3 lines
Next try to fix the OpenBSD buildbot tests:
Use ctypes.util.find_library to locate the C runtime library
on platforms where is returns useful results.
........
r47026 | tim.peters | 2006-06-19 11:09:44 +0200 (Mon, 19 Jun 2006) | 13 lines
TestHelp.make_parser(): This was making a permanent change to
os.environ (setting envar COLUMNS), which at least caused
test_float_default() to fail if the tests were run more than once.
This repairs the test_optparse -R failures Neal reported on
python-dev. It also explains some seemingly bizarre test_optparse
failures we saw a couple weeks ago on the buildbots, when
test_optparse failed due to test_file failing to clean up after
itself, and then test_optparse failed in an entirely different
way when regrtest's -w option ran test_optparse a second time.
It's now obvious that make_parser() permanently changing os.environ
was responsible for the second half of that.
........
r47027 | anthony.baxter | 2006-06-19 14:04:15 +0200 (Mon, 19 Jun 2006) | 2 lines
Preparing for 2.5b1.
........
r47029 | fred.drake | 2006-06-19 19:31:16 +0200 (Mon, 19 Jun 2006) | 1 line
remove non-working document formats from edist
........
r47030 | gerhard.haering | 2006-06-19 23:17:35 +0200 (Mon, 19 Jun 2006) | 5 lines
Fixed a memory leak that was introduced with incorrect usage of the Python weak
reference API in pysqlite 2.2.1.
Bumbed pysqlite version number to upcoming pysqlite 2.3.1 release.
........
r47032 | ka-ping.yee | 2006-06-20 00:49:36 +0200 (Tue, 20 Jun 2006) | 2 lines
Remove Python 2.3 compatibility comment.
........
r47033 | trent.mick | 2006-06-20 01:21:25 +0200 (Tue, 20 Jun 2006) | 2 lines
Upgrade pyexpat to expat 2.0.0 (http://python.org/sf/1462338).
........
r47034 | trent.mick | 2006-06-20 01:57:41 +0200 (Tue, 20 Jun 2006) | 3 lines
[ 1295808 ] expat symbols should be namespaced in pyexpat
(http://python.org/sf/1295808)
........
r47039 | andrew.kuchling | 2006-06-20 13:52:16 +0200 (Tue, 20 Jun 2006) | 1 line
Uncomment wsgiref section
........
r47040 | andrew.kuchling | 2006-06-20 14:15:09 +0200 (Tue, 20 Jun 2006) | 1 line
Add four library items
........
r47041 | andrew.kuchling | 2006-06-20 14:19:54 +0200 (Tue, 20 Jun 2006) | 1 line
Terminology and typography fixes
........
r47042 | andrew.kuchling | 2006-06-20 15:05:12 +0200 (Tue, 20 Jun 2006) | 1 line
Add introductory paragraphs summarizing the release; minor edits
........
r47043 | andrew.kuchling | 2006-06-20 15:11:29 +0200 (Tue, 20 Jun 2006) | 1 line
Minor edits and rearrangements; markup fix
........
r47044 | andrew.kuchling | 2006-06-20 15:20:30 +0200 (Tue, 20 Jun 2006) | 1 line
[Bug #1504456] Mention xml -> xmlcore change
........
r47047 | brett.cannon | 2006-06-20 19:30:26 +0200 (Tue, 20 Jun 2006) | 2 lines
Raise TestSkipped when the test socket connection is refused.
........
r47049 | brett.cannon | 2006-06-20 21:20:17 +0200 (Tue, 20 Jun 2006) | 2 lines
Fix typo of exception name.
........
r47053 | brett.cannon | 2006-06-21 18:57:57 +0200 (Wed, 21 Jun 2006) | 5 lines
At the C level, tuple arguments are passed in directly to the exception
constructor, meaning it is treated as *args, not as a single argument. This
means using the 'message' attribute won't work (until Py3K comes around),
and so one must grab from 'arg' to get the error number.
........
r47054 | andrew.kuchling | 2006-06-21 19:10:18 +0200 (Wed, 21 Jun 2006) | 1 line
Link to LibRef module documentation
........
r47055 | andrew.kuchling | 2006-06-21 19:17:10 +0200 (Wed, 21 Jun 2006) | 1 line
Note some of Barry's work
........
r47056 | andrew.kuchling | 2006-06-21 19:17:28 +0200 (Wed, 21 Jun 2006) | 1 line
Bump version
........
r47057 | georg.brandl | 2006-06-21 19:45:17 +0200 (Wed, 21 Jun 2006) | 3 lines
fix [ 1509132 ] compiler module builds incorrect AST for TryExceptFinally
........
r47058 | georg.brandl | 2006-06-21 19:52:36 +0200 (Wed, 21 Jun 2006) | 3 lines
Make test_fcntl aware of netbsd3.
........
r47059 | georg.brandl | 2006-06-21 19:53:17 +0200 (Wed, 21 Jun 2006) | 3 lines
Patch #1509001: expected skips for netbsd3.
........
r47060 | gerhard.haering | 2006-06-21 22:55:04 +0200 (Wed, 21 Jun 2006) | 2 lines
Removed call to enable_callback_tracebacks that slipped in by accident.
........
r47061 | armin.rigo | 2006-06-21 23:58:50 +0200 (Wed, 21 Jun 2006) | 13 lines
Fix for an obscure bug introduced by revs 46806 and 46808, with a test.
The problem of checking too eagerly for recursive calls is the
following: if a RuntimeError is caused by recursion, and if code needs
to normalize it immediately (as in the 2nd test), then
PyErr_NormalizeException() needs a call to the RuntimeError class to
instantiate it, and this hits the recursion limit again... causing
PyErr_NormalizeException() to never finish.
Moved this particular recursion check to slot_tp_call(), which is not
involved in instantiating built-in exceptions.
Backport candidate.
........
r47064 | neal.norwitz | 2006-06-22 08:30:50 +0200 (Thu, 22 Jun 2006) | 3 lines
Copy the wsgiref package during make install.
........
r47065 | neal.norwitz | 2006-06-22 08:35:30 +0200 (Thu, 22 Jun 2006) | 1 line
Reset the doc date to today for the automatic doc builds
........
r47067 | andrew.kuchling | 2006-06-22 15:10:23 +0200 (Thu, 22 Jun 2006) | 1 line
Mention how to suppress warnings
........
r47069 | georg.brandl | 2006-06-22 16:46:17 +0200 (Thu, 22 Jun 2006) | 3 lines
Set lineno correctly on list, tuple and dict literals.
........
r47070 | georg.brandl | 2006-06-22 16:46:46 +0200 (Thu, 22 Jun 2006) | 4 lines
Test for correct compilation of try-except-finally stmt.
Test for correct lineno on list, tuple, dict literals.
........
r47071 | fred.drake | 2006-06-22 17:50:08 +0200 (Thu, 22 Jun 2006) | 1 line
fix markup nit
........
r47072 | brett.cannon | 2006-06-22 18:49:14 +0200 (Thu, 22 Jun 2006) | 6 lines
'warning's was improperly requiring that a command-line Warning category be
both a subclass of Warning and a subclass of types.ClassType. The latter is no
longer true thanks to new-style exceptions.
Closes bug #1510580. Thanks to AMK for the test.
........
r47073 | ronald.oussoren | 2006-06-22 20:33:54 +0200 (Thu, 22 Jun 2006) | 3 lines
MacOSX: Add a message to the first screen of the installer that tells
users how to avoid updates to their shell profile.
........
r47074 | georg.brandl | 2006-06-22 21:02:18 +0200 (Thu, 22 Jun 2006) | 3 lines
Fix my name ;)
........
r47075 | thomas.heller | 2006-06-22 21:07:36 +0200 (Thu, 22 Jun 2006) | 2 lines
Small fixes, mostly in the markup.
........
r47076 | peter.astrand | 2006-06-22 22:06:46 +0200 (Thu, 22 Jun 2006) | 1 line
Make it possible to run test_subprocess.py on Python 2.2, which lacks test_support.is_resource_enabled.
........
r47077 | peter.astrand | 2006-06-22 22:21:26 +0200 (Thu, 22 Jun 2006) | 1 line
Applied patch #1506758: Prevent MemoryErrors with large MAXFD.
........
r47079 | neal.norwitz | 2006-06-23 05:32:44 +0200 (Fri, 23 Jun 2006) | 1 line
Fix refleak
........
r47080 | fred.drake | 2006-06-23 08:03:45 +0200 (Fri, 23 Jun 2006) | 9 lines
- SF bug #853506: IP6 address parsing in sgmllib
('[' and ']' were not accepted in unquoted attribute values)
- cleaned up tests of character and entity reference decoding so the
tests cover the documented relationships among handle_charref,
handle_entityref, convert_charref, convert_codepoint, and
convert_entityref, without bringing up Unicode issues that sgmllib
cannot be involved in
........
r47085 | andrew.kuchling | 2006-06-23 21:23:40 +0200 (Fri, 23 Jun 2006) | 11 lines
Fit Makefile for the Python doc environment better; this is a step toward
including the howtos in the build process.
* Put LaTeX output in ../paper-<whatever>/.
* Put HTML output in ../html/
* Explain some of the Makefile variables
* Remove some cruft dating to my environment (e.g. the 'web' target)
This makefile isn't currently invoked by the documentation build process,
so these changes won't destabilize anything.
........
r47086 | hyeshik.chang | 2006-06-23 23:16:18 +0200 (Fri, 23 Jun 2006) | 5 lines
Bug #1511381: codec_getstreamcodec() in codec.c is corrected to
omit a default "error" argument for NULL pointer. This allows
the parser to take a codec from cjkcodecs again.
(Reported by Taewook Kang and reviewed by Walter Doerwald)
........
r47091 | ronald.oussoren | 2006-06-25 22:44:16 +0200 (Sun, 25 Jun 2006) | 6 lines
Workaround for bug #1512124
Without this patch IDLE will get unresponsive when you open the debugger
window on OSX. This is both using the system Tcl/Tk on Tiger as the latest
universal download from tk-components.sf.net.
........
r47092 | ronald.oussoren | 2006-06-25 23:14:19 +0200 (Sun, 25 Jun 2006) | 3 lines
Drop the calldll demo's for macos, calldll isn't present anymore, no need
to keep the demo's around.
........
r47093 | ronald.oussoren | 2006-06-25 23:15:58 +0200 (Sun, 25 Jun 2006) | 3 lines
Use a path without a double slash to compile the .py files after installation
(macosx, binary installer). This fixes bug #1508369 for python 2.5.
........
r47094 | ronald.oussoren | 2006-06-25 23:19:06 +0200 (Sun, 25 Jun 2006) | 3 lines
Also install the .egg-info files in Lib. This will cause wsgiref.egg-info to
be installed.
........
r47097 | andrew.kuchling | 2006-06-26 14:40:02 +0200 (Mon, 26 Jun 2006) | 1 line
[Bug #1511998] Various comments from Nick Coghlan; thanks!
........
r47098 | andrew.kuchling | 2006-06-26 14:43:43 +0200 (Mon, 26 Jun 2006) | 1 line
Describe workaround for PyRange_New()'s removal
........
r47099 | andrew.kuchling | 2006-06-26 15:08:24 +0200 (Mon, 26 Jun 2006) | 5 lines
[Bug #1512163] Fix typo.
This change will probably break tests on FreeBSD buildbots, but I'll check in
a fix for that next.
........
r47100 | andrew.kuchling | 2006-06-26 15:12:16 +0200 (Mon, 26 Jun 2006) | 9 lines
[Bug #1512163] Use one set of locking methods, lockf();
remove the flock() calls.
On FreeBSD, the two methods lockf() and flock() end up using the same
mechanism and the second one fails. A Linux man page claims that the
two methods are orthogonal (so locks acquired one way don't interact
with locks acquired the other way) but that clearly must be false.
........
r47101 | andrew.kuchling | 2006-06-26 15:23:10 +0200 (Mon, 26 Jun 2006) | 5 lines
Add a test for a conflicting lock.
On slow machines, maybe the time intervals (2 sec, 0.5 sec) will be too tight.
I'll see how the buildbots like it.
........
r47103 | andrew.kuchling | 2006-06-26 16:33:24 +0200 (Mon, 26 Jun 2006) | 1 line
Windows doesn't have os.fork(). I'll just disable this test for now
........
r47106 | andrew.kuchling | 2006-06-26 19:00:35 +0200 (Mon, 26 Jun 2006) | 9 lines
Attempt to fix build failure on OS X and Debian alpha; the symptom is
consistent with os.wait() returning immediately because some other
subprocess had previously exited; the test suite then immediately
tries to lock the mailbox and gets an error saying it's already
locked.
To fix this, do a waitpid() so the test suite only continues once
the intended child process has exited.
........
r47113 | neal.norwitz | 2006-06-27 06:06:46 +0200 (Tue, 27 Jun 2006) | 1 line
Ignore some more warnings in the dynamic linker on an older gentoo
........
r47114 | neal.norwitz | 2006-06-27 06:09:13 +0200 (Tue, 27 Jun 2006) | 6 lines
Instead of doing a make test, run the regression tests out of the installed
copy. This will hopefully catch problems where directories are added
under Lib/ but not to Makefile.pre.in. This breaks out the 2 runs
of the test suite with and without -O which is also nicer.
........
r47115 | neal.norwitz | 2006-06-27 06:12:58 +0200 (Tue, 27 Jun 2006) | 5 lines
Fix SF bug #1513032, 'make install' failure on FreeBSD 5.3.
No need to install lib-old, it's empty in 2.5.
........
r47116 | neal.norwitz | 2006-06-27 06:23:06 +0200 (Tue, 27 Jun 2006) | 1 line
Test unimportant change to verify buildbot does not try to build
........
r47117 | neal.norwitz | 2006-06-27 06:26:30 +0200 (Tue, 27 Jun 2006) | 1 line
Try again: test unimportant change to verify buildbot does not try to build
........
r47118 | neal.norwitz | 2006-06-27 06:28:56 +0200 (Tue, 27 Jun 2006) | 1 line
Verify buildbot picks up these changes (really needs testing after last change to Makefile.pre.in)
........
r47121 | vinay.sajip | 2006-06-27 09:34:37 +0200 (Tue, 27 Jun 2006) | 1 line
Removed buggy exception handling in doRollover of rotating file handlers. Exceptions now propagate to caller.
........
r47123 | ronald.oussoren | 2006-06-27 12:08:25 +0200 (Tue, 27 Jun 2006) | 3 lines
MacOSX: fix rather dumb buglet that made it impossible to create extensions on
OSX 10.3 when using a binary distribution build on 10.4.
........
r47125 | tim.peters | 2006-06-27 13:52:49 +0200 (Tue, 27 Jun 2006) | 2 lines
Whitespace normalization.
........
r47128 | ronald.oussoren | 2006-06-27 14:53:52 +0200 (Tue, 27 Jun 2006) | 8 lines
Use staticly build copies of zlib and bzip2 to build the OSX installer, that
way the resulting binaries have a better change of running on 10.3.
This patch also updates the search logic for sleepycat db3/4, without this
patch you cannot use a sleepycat build with a non-standard prefix; with this
you can (at least on OSX) if you add the prefix to CPPFLAGS/LDFLAGS at
configure-time. This change is needed to build the binary installer for OSX.
........
r47131 | ronald.oussoren | 2006-06-27 17:45:32 +0200 (Tue, 27 Jun 2006) | 5 lines
macosx: Install a libpython2.5.a inside the framework as a symlink to the actual
dylib at the root of the framework, that way tools that expect a unix-like
install (python-config, but more importantly external products like
mod_python) work correctly.
........
r47137 | neal.norwitz | 2006-06-28 07:03:22 +0200 (Wed, 28 Jun 2006) | 4 lines
According to the man pages on Gentoo Linux and Tru64, EACCES or EAGAIN
can be returned if fcntl (lockf) fails. This fixes the test failure
on Tru64 by checking for either error rather than just EAGAIN.
........
r47139 | neal.norwitz | 2006-06-28 08:28:31 +0200 (Wed, 28 Jun 2006) | 5 lines
Fix bug #1512695: cPickle.loads could crash if it was interrupted with
a KeyboardInterrupt since PyTuple_Pack was passed a NULL.
Will backport.
........
r47142 | nick.coghlan | 2006-06-28 12:41:47 +0200 (Wed, 28 Jun 2006) | 1 line
Make full module name available as __module_name__ even when __name__ is set to something else (like '__main__')
........
r47143 | armin.rigo | 2006-06-28 12:49:51 +0200 (Wed, 28 Jun 2006) | 2 lines
A couple of crashers of the "won't fix" kind.
........
r47147 | andrew.kuchling | 2006-06-28 16:25:20 +0200 (Wed, 28 Jun 2006) | 1 line
[Bug #1508766] Add docs for uuid module; docs written by George Yoshida, with minor rearrangements by me.
........
r47148 | andrew.kuchling | 2006-06-28 16:27:21 +0200 (Wed, 28 Jun 2006) | 1 line
[Bug #1508766] Add docs for uuid module; this puts the module in the 'Internet Protocols' section. Arguably this module could also have gone in the chapters on strings or encodings, maybe even the crypto chapter. Fred, please move if you see fit.
........
r47151 | georg.brandl | 2006-06-28 22:23:25 +0200 (Wed, 28 Jun 2006) | 3 lines
Fix end_fill().
........
r47153 | trent.mick | 2006-06-28 22:30:41 +0200 (Wed, 28 Jun 2006) | 2 lines
Mention the expat upgrade and pyexpat fix I put in 2.5b1.
........
r47154 | fred.drake | 2006-06-29 02:51:53 +0200 (Thu, 29 Jun 2006) | 6 lines
SF bug #1504333: sgmlib should allow angle brackets in quoted values
(modified patch by Sam Ruby; changed to use separate REs for start and end
tags to reduce matching cost for end tags; extended tests; updated to avoid
breaking previous changes to support IPv6 addresses in unquoted attribute
values)
........
r47156 | fred.drake | 2006-06-29 04:57:48 +0200 (Thu, 29 Jun 2006) | 1 line
document recent bugfixes in sgmllib
........
r47158 | neal.norwitz | 2006-06-29 06:10:08 +0200 (Thu, 29 Jun 2006) | 10 lines
Add new utility function, reap_children(), to test_support. This should
be called at the end of each test that spawns children (perhaps it
should be called from regrtest instead?). This will hopefully prevent
some of the unexplained failures in the buildbots (hppa and alpha)
during tests that spawn children. The problems were not reproducible.
There were many zombies that remained at the end of several tests.
In the worst case, this shouldn't cause any more problems,
though it may not help either. Time will tell.
........
r47159 | neal.norwitz | 2006-06-29 07:48:14 +0200 (Thu, 29 Jun 2006) | 5 lines
This should fix the buildbot failure on s/390 which can't connect to gmail.org.
It makes the error message consistent and always sends to stderr.
It would be much better for all the networking tests to hit only python.org.
........
r47161 | thomas.heller | 2006-06-29 20:34:15 +0200 (Thu, 29 Jun 2006) | 3 lines
Protect the thread api calls in the _ctypes extension module within
#ifdef WITH_THREADS/#endif blocks. Found by Sam Rushing.
........
r47162 | martin.v.loewis | 2006-06-29 20:58:44 +0200 (Thu, 29 Jun 2006) | 2 lines
Patch #1509163: MS Toolkit Compiler no longer available
........
r47163 | skip.montanaro | 2006-06-29 21:20:09 +0200 (Thu, 29 Jun 2006) | 1 line
add string methods to index
........
r47164 | vinay.sajip | 2006-06-30 02:13:08 +0200 (Fri, 30 Jun 2006) | 1 line
Fixed bug in fileConfig() which failed to clear logging._handlerList
........
r47166 | tim.peters | 2006-06-30 08:18:39 +0200 (Fri, 30 Jun 2006) | 2 lines
Whitespace normalization.
........
r47170 | neal.norwitz | 2006-06-30 09:32:16 +0200 (Fri, 30 Jun 2006) | 1 line
Silence compiler warning
........
r47171 | neal.norwitz | 2006-06-30 09:32:46 +0200 (Fri, 30 Jun 2006) | 1 line
Another problem reported by Coverity. Backport candidate.
........
r47175 | thomas.heller | 2006-06-30 19:44:54 +0200 (Fri, 30 Jun 2006) | 2 lines
Revert the use of PY_FORMAT_SIZE_T in PyErr_Format.
........
r47176 | tim.peters | 2006-06-30 20:34:51 +0200 (Fri, 30 Jun 2006) | 2 lines
Remove now-unused fidding with PY_FORMAT_SIZE_T.
........
r47177 | georg.brandl | 2006-06-30 20:47:56 +0200 (Fri, 30 Jun 2006) | 3 lines
Document decorator usage of property.
........
r47181 | fred.drake | 2006-06-30 21:29:25 +0200 (Fri, 30 Jun 2006) | 4 lines
- consistency nit: always include "()" in \function and \method
(*should* be done by the presentation, but that requires changes all over)
- avoid spreading the __name meme
........
r47188 | vinay.sajip | 2006-07-01 12:45:20 +0200 (Sat, 01 Jul 2006) | 1 line
Added entry for fileConfig() bugfix.
........
r47189 | vinay.sajip | 2006-07-01 12:47:20 +0200 (Sat, 01 Jul 2006) | 1 line
Added duplicate call to fileConfig() to ensure that it cleans up after itself correctly.
........
r47190 | martin.v.loewis | 2006-07-01 17:33:37 +0200 (Sat, 01 Jul 2006) | 2 lines
Release all forwarded functions in .close. Fixes #1513223.
........
r47191 | fred.drake | 2006-07-01 18:28:20 +0200 (Sat, 01 Jul 2006) | 7 lines
SF bug #1296433 (Expat bug #1515266): Unchecked calls to character data
handler would cause a segfault. This merges in Expat's lib/xmlparse.c
revisions 1.154 and 1.155, which fix this and a closely related problem
(the later does not affect Python).
Moved the crasher test to the tests for xml.parsers.expat.
........
r47197 | gerhard.haering | 2006-07-02 19:48:30 +0200 (Sun, 02 Jul 2006) | 4 lines
The sqlite3 module did cut off data from the SQLite database at the first null
character before sending it to a custom converter. This has been fixed now.
........
r47198 | martin.v.loewis | 2006-07-02 20:44:00 +0200 (Sun, 02 Jul 2006) | 1 line
Correct arithmetic in access on Win32. Fixes #1513646.
........
r47203 | thomas.heller | 2006-07-03 09:58:09 +0200 (Mon, 03 Jul 2006) | 1 line
Cleanup: Remove commented out code.
........
r47204 | thomas.heller | 2006-07-03 09:59:50 +0200 (Mon, 03 Jul 2006) | 1 line
Don't run the doctests with Python 2.3 because it doesn't have the ELLIPSIS flag.
........
r47205 | thomas.heller | 2006-07-03 10:04:05 +0200 (Mon, 03 Jul 2006) | 7 lines
Fixes so that _ctypes can be compiled with the MingW compiler.
It seems that the definition of '__attribute__(x)' was responsible for
the compiler ignoring the '__fastcall' attribute on the
ffi_closure_SYSV function in libffi_msvc/ffi.c, took me quite some
time to figure this out.
........
r47206 | thomas.heller | 2006-07-03 10:08:14 +0200 (Mon, 03 Jul 2006) | 11 lines
Add a new function uses_seh() to the _ctypes extension module. This
will return True if Windows Structured Exception handling (SEH) is
used when calling functions, False otherwise.
Currently, only MSVC supports SEH.
Fix the test so that it doesn't crash when run with MingW compiled
_ctypes. Note that two tests are still failing when mingw is used, I
suspect structure layout differences and function calling conventions
between MSVC and MingW.
........
r47207 | tim.peters | 2006-07-03 10:23:19 +0200 (Mon, 03 Jul 2006) | 2 lines
Whitespace normalization.
........
r47208 | martin.v.loewis | 2006-07-03 11:44:00 +0200 (Mon, 03 Jul 2006) | 3 lines
Only setup canvas when it is first created.
Fixes #1514703
........
r47209 | martin.v.loewis | 2006-07-03 12:05:30 +0200 (Mon, 03 Jul 2006) | 3 lines
Reimplement turtle.circle using a polyline, to allow correct
filling of arcs. Also fixes #1514693.
........
r47210 | martin.v.loewis | 2006-07-03 12:19:49 +0200 (Mon, 03 Jul 2006) | 3 lines
Bug #1514693: Update turtle's heading when switching between
degrees and radians.
........
r47211 | martin.v.loewis | 2006-07-03 13:12:06 +0200 (Mon, 03 Jul 2006) | 2 lines
Document functions added in 2.3 and 2.5.
........
r47212 | martin.v.loewis | 2006-07-03 14:19:50 +0200 (Mon, 03 Jul 2006) | 3 lines
Bug #1417699: Reject locale-specific decimal point in float()
and atof().
........
r47213 | martin.v.loewis | 2006-07-03 14:28:58 +0200 (Mon, 03 Jul 2006) | 3 lines
Bug #1267547: Put proper recursive setup.py call into the
spec file generated by bdist_rpm.
........
r47215 | martin.v.loewis | 2006-07-03 15:01:35 +0200 (Mon, 03 Jul 2006) | 3 lines
Patch #825417: Fix timeout processing in expect,
read_until. Will backport to 2.4.
........
r47218 | martin.v.loewis | 2006-07-03 15:47:40 +0200 (Mon, 03 Jul 2006) | 2 lines
Put method-wrappers into trashcan. Fixes #927248.
........
r47219 | andrew.kuchling | 2006-07-03 16:07:30 +0200 (Mon, 03 Jul 2006) | 1 line
[Bug #1515932] Clarify description of slice assignment
........
r47220 | andrew.kuchling | 2006-07-03 16:16:09 +0200 (Mon, 03 Jul 2006) | 4 lines
[Bug #1511911] Clarify description of optional arguments to sorted()
by improving the xref to the section on lists, and by
copying the explanations of the arguments (with a slight modification).
........
r47223 | kristjan.jonsson | 2006-07-03 16:59:05 +0200 (Mon, 03 Jul 2006) | 1 line
Fix build problems with the platform SDK on windows. It is not sufficient to test for the C compiler version when determining if we have the secure CRT from microsoft. Must test with an undocumented macro, __STDC_SECURE_LIB__ too.
........
r47224 | ronald.oussoren | 2006-07-04 14:30:22 +0200 (Tue, 04 Jul 2006) | 7 lines
Sync the darwin/x86 port libffi with the copy in PyObjC. This fixes a number
of bugs in that port. The most annoying ones were due to some subtle differences
between the document ABI and the actual implementation :-(
(there are no python unittests that fail without this patch, but without it
some of libffi's unittests fail).
........
r47234 | georg.brandl | 2006-07-05 10:21:00 +0200 (Wed, 05 Jul 2006) | 3 lines
Remove remaining references to OverflowWarning.
........
r47236 | thomas.heller | 2006-07-05 11:13:56 +0200 (Wed, 05 Jul 2006) | 3 lines
Fix the bitfield test when _ctypes is compiled with MingW. Structures
containing bitfields may have different layout on MSVC and MingW .
........
r47237 | thomas.wouters | 2006-07-05 13:03:49 +0200 (Wed, 05 Jul 2006) | 15 lines
Fix bug in passing tuples to string.Template. All other values (with working
str() or repr()) would work, just not multi-value tuples. Probably not a
backport candidate, since it changes the behaviour of passing a
single-element tuple:
>>> string.Template("$foo").substitute(dict(foo=(1,)))
'(1,)'
versus
'1'
........
r47241 | georg.brandl | 2006-07-05 16:18:45 +0200 (Wed, 05 Jul 2006) | 2 lines
Patch #1517490: fix glitches in filter() docs.
........
r47244 | georg.brandl | 2006-07-05 17:50:05 +0200 (Wed, 05 Jul 2006) | 2 lines
no need to elaborate "string".
........
r47251 | neal.norwitz | 2006-07-06 06:28:59 +0200 (Thu, 06 Jul 2006) | 3 lines
Fix refleaks reported by Shane Hathaway in SF patch #1515361. This change
contains only the changes related to leaking the copy variable.
........
r47253 | fred.drake | 2006-07-06 07:13:22 +0200 (Thu, 06 Jul 2006) | 4 lines
- back out Expat change; the final fix to Expat will be different
- change the pyexpat wrapper to not be so sensitive to this detail of the
Expat implementation (the ex-crasher test still passes)
........
r47257 | neal.norwitz | 2006-07-06 08:45:08 +0200 (Thu, 06 Jul 2006) | 1 line
Add a NEWS entry for a recent pyexpat fix
........
r47258 | martin.v.loewis | 2006-07-06 08:55:58 +0200 (Thu, 06 Jul 2006) | 2 lines
Add sqlite3.dll to the DLLs component, not to the TkDLLs component.
Fixes #1517388.
........
r47259 | martin.v.loewis | 2006-07-06 09:05:21 +0200 (Thu, 06 Jul 2006) | 1 line
Properly quote compileall and Lib paths in case TARGETDIR has a space.
........
r47260 | thomas.heller | 2006-07-06 09:50:18 +0200 (Thu, 06 Jul 2006) | 5 lines
Revert the change done in svn revision 47206:
Add a new function uses_seh() to the _ctypes extension module. This
will return True if Windows Structured Exception handling (SEH) is
used when calling functions, False otherwise.
........
r47261 | armin.rigo | 2006-07-06 09:58:18 +0200 (Thu, 06 Jul 2006) | 3 lines
A couple of examples about how to attack the fact that _PyType_Lookup()
returns a borrowed ref. Many of the calls are open to attack.
........
r47262 | thomas.heller | 2006-07-06 10:28:14 +0200 (Thu, 06 Jul 2006) | 2 lines
The test that calls a function with invalid arguments and catches the
resulting Windows access violation will not be run by default.
........
r47263 | thomas.heller | 2006-07-06 10:48:35 +0200 (Thu, 06 Jul 2006) | 5 lines
Patch #1517790: It is now possible to use custom objects in the ctypes
foreign function argtypes sequence as long as they provide a
from_param method, no longer is it required that the object is a
ctypes type.
........
r47264 | thomas.heller | 2006-07-06 10:58:40 +0200 (Thu, 06 Jul 2006) | 2 lines
Document the Struture and Union constructors.
........
r47265 | thomas.heller | 2006-07-06 11:11:22 +0200 (Thu, 06 Jul 2006) | 2 lines
Document the changes in svn revision 47263, from patch #1517790.
........
r47267 | ronald.oussoren | 2006-07-06 12:13:35 +0200 (Thu, 06 Jul 2006) | 7 lines
This patch solves the problem Skip was seeing with zlib, this patch ensures that
configure uses similar compiler flags as setup.py when doing the zlib test.
Without this patch configure would use the first shared library on the linker
path, with this patch it uses the first shared or static library on that path
just like setup.py.
........
r47268 | thomas.wouters | 2006-07-06 12:48:28 +0200 (Thu, 06 Jul 2006) | 4 lines
NEWS entry for r47267: fixing configure's zlib probing.
........
r47269 | fredrik.lundh | 2006-07-06 14:29:24 +0200 (Thu, 06 Jul 2006) | 3 lines
added XMLParser alias for cElementTree compatibility
........
r47271 | nick.coghlan | 2006-07-06 14:53:04 +0200 (Thu, 06 Jul 2006) | 1 line
Revert the __module_name__ changes made in rev 47142. We'll revisit this in Python 2.6
........
r47272 | nick.coghlan | 2006-07-06 15:04:56 +0200 (Thu, 06 Jul 2006) | 1 line
Update the tutorial section on relative imports
........
r47273 | nick.coghlan | 2006-07-06 15:35:27 +0200 (Thu, 06 Jul 2006) | 1 line
Ignore ImportWarning by default
........
r47274 | nick.coghlan | 2006-07-06 15:41:34 +0200 (Thu, 06 Jul 2006) | 1 line
Cover ImportWarning, PendingDeprecationWarning and simplefilter() in the warnings module docs
........
r47275 | nick.coghlan | 2006-07-06 15:47:18 +0200 (Thu, 06 Jul 2006) | 1 line
Add NEWS entries for the ImportWarning change and documentation update
........
r47276 | andrew.kuchling | 2006-07-06 15:57:28 +0200 (Thu, 06 Jul 2006) | 1 line
ImportWarning is now silent by default
........
r47277 | thomas.heller | 2006-07-06 17:06:05 +0200 (Thu, 06 Jul 2006) | 2 lines
Document the correct return type of PyLong_AsUnsignedLongLongMask.
........
r47278 | hyeshik.chang | 2006-07-06 17:21:52 +0200 (Thu, 06 Jul 2006) | 2 lines
Add a testcase for r47086 which fixed a bug in codec_getstreamcodec().
........
r47279 | hyeshik.chang | 2006-07-06 17:39:24 +0200 (Thu, 06 Jul 2006) | 3 lines
Test using all CJK encodings for the testcases which don't require
specific encodings.
........
r47280 | martin.v.loewis | 2006-07-06 21:28:03 +0200 (Thu, 06 Jul 2006) | 2 lines
Properly generate logical file ids. Fixes #1515998.
Also correct typo in Control.mapping.
........
r47287 | neal.norwitz | 2006-07-07 08:03:15 +0200 (Fri, 07 Jul 2006) | 17 lines
Restore rev 47014:
The hppa ubuntu box sometimes hangs forever in these tests. My guess
is that the wait is failing for some reason. Use WNOHANG, so we won't
wait until the buildbot kills the test suite.
I haven't been able to reproduce the failure, so I'm not sure if
this will help or not. Hopefully, this change will cause the test
to fail, rather than hang. That will be better since we will get
the rest of the test results. It may also help us debug the real problem.
*** The reason this originally failed was because there were many
zombie children outstanding before rev 47158 cleaned them up.
There are still hangs in test_subprocess that need to be addressed,
but that will take more work. This should close some holes.
........
r47289 | georg.brandl | 2006-07-07 10:15:12 +0200 (Fri, 07 Jul 2006) | 3 lines
Fix RFC number.
........
r50489 | neal.norwitz | 2006-07-08 07:31:37 +0200 (Sat, 08 Jul 2006) | 1 line
Fix SF bug #1519018: 'as' is now validated properly in import statements
........
r50490 | georg.brandl | 2006-07-08 14:15:27 +0200 (Sat, 08 Jul 2006) | 3 lines
Add an additional test for bug #1519018.
........
r50491 | tim.peters | 2006-07-08 21:55:05 +0200 (Sat, 08 Jul 2006) | 2 lines
Whitespace normalization.
........
r50493 | neil.schemenauer | 2006-07-09 18:16:34 +0200 (Sun, 09 Jul 2006) | 2 lines
Fix AST compiler bug #1501934: incorrect LOAD/STORE_GLOBAL generation.
........
r50495 | neil.schemenauer | 2006-07-09 23:19:29 +0200 (Sun, 09 Jul 2006) | 2 lines
Fix SF bug 1441486: bad unary minus folding in compiler.
........
r50497 | neal.norwitz | 2006-07-10 00:14:42 +0200 (Mon, 10 Jul 2006) | 4 lines
On 64 bit systems, int literals that use less than 64 bits are now ints
rather than longs. This also fixes the test for eval(-sys.maxint - 1).
........
r50500 | neal.norwitz | 2006-07-10 02:04:44 +0200 (Mon, 10 Jul 2006) | 4 lines
Bug #1512814, Fix incorrect lineno's when code at module scope
started after line 256.
........
r50501 | neal.norwitz | 2006-07-10 02:05:34 +0200 (Mon, 10 Jul 2006) | 1 line
Fix doco. Backport candidate.
........
r50503 | neal.norwitz | 2006-07-10 02:23:17 +0200 (Mon, 10 Jul 2006) | 5 lines
Part of SF patch #1484695. This removes dead code. The chksum was
already verified in .frombuf() on the lines above. If there was
a problem an exception is raised, so there was no way this condition
could have been true.
........
r50504 | neal.norwitz | 2006-07-10 03:18:57 +0200 (Mon, 10 Jul 2006) | 3 lines
Patch #1516912: improve Modules support for OpenVMS.
........
r50506 | neal.norwitz | 2006-07-10 04:36:41 +0200 (Mon, 10 Jul 2006) | 7 lines
Patch #1504046: Add documentation for xml.etree.
/F wrote the text docs, Englebert Gruber massaged it to latex and I
did some more massaging to try and improve the consistency and
fix some name mismatches between the declaration and text.
........
r50509 | martin.v.loewis | 2006-07-10 09:23:48 +0200 (Mon, 10 Jul 2006) | 2 lines
Introduce DISTUTILS_USE_SDK as a flag to determine whether the
SDK environment should be used. Fixes #1508010.
........
r50510 | martin.v.loewis | 2006-07-10 09:26:41 +0200 (Mon, 10 Jul 2006) | 1 line
Change error message to indicate that VS2003 is necessary to build extension modules, not the .NET SDK.
........
r50511 | martin.v.loewis | 2006-07-10 09:29:41 +0200 (Mon, 10 Jul 2006) | 1 line
Add svn:ignore.
........
r50512 | anthony.baxter | 2006-07-10 09:41:04 +0200 (Mon, 10 Jul 2006) | 1 line
preparing for 2.5b2
........
r50513 | thomas.heller | 2006-07-10 11:10:28 +0200 (Mon, 10 Jul 2006) | 2 lines
Fix bug #1518190: accept any integer or long value in the
ctypes.c_void_p constructor.
........
r50514 | thomas.heller | 2006-07-10 11:31:06 +0200 (Mon, 10 Jul 2006) | 3 lines
Fixed a segfault when ctypes.wintypes were imported on
non-Windows machines.
........
r50516 | thomas.heller | 2006-07-10 13:11:10 +0200 (Mon, 10 Jul 2006) | 3 lines
Assigning None to pointer type structure fields possible overwrote
wrong fields.
........
r50517 | thomas.heller | 2006-07-10 13:17:37 +0200 (Mon, 10 Jul 2006) | 5 lines
Moved the ctypes news entries from the 'Library' section into the
'Extension Modules' section where they belong, probably.
This destroyes the original order of the news entries, don't know
if that is important or not.
........
r50526 | phillip.eby | 2006-07-10 21:03:29 +0200 (Mon, 10 Jul 2006) | 2 lines
Fix SF#1516184 and add a test to prevent regression.
........
r50528 | phillip.eby | 2006-07-10 21:18:35 +0200 (Mon, 10 Jul 2006) | 2 lines
Fix SF#1457312: bad socket error handling in distutils "upload" command.
........
r50537 | peter.astrand | 2006-07-10 22:39:49 +0200 (Mon, 10 Jul 2006) | 1 line
Make it possible to run test_subprocess.py with Python 2.2, which lacks test_support.reap_children().
........
r50541 | tim.peters | 2006-07-10 23:08:24 +0200 (Mon, 10 Jul 2006) | 5 lines
After approval from Anthony, merge the tim-current_frames
branch into the trunk. This adds a new sys._current_frames()
function, which returns a dict mapping thread id to topmost
thread stack frame.
........
r50542 | tim.peters | 2006-07-10 23:11:49 +0200 (Mon, 10 Jul 2006) | 2 lines
Whitespace normalization.
........
r50553 | martin.v.loewis | 2006-07-11 00:11:28 +0200 (Tue, 11 Jul 2006) | 4 lines
Patch #1519566: Remove unused _tofill member.
Make begin_fill idempotent.
Update demo2 to demonstrate filling of concave shapes.
........
r50567 | anthony.baxter | 2006-07-11 04:04:09 +0200 (Tue, 11 Jul 2006) | 4 lines
#1494314: Fix a regression with high-numbered sockets in 2.4.3. This
means that select() on sockets > FD_SETSIZE (typically 1024) work again.
The patch makes sockets use poll() internally where available.
........
r50568 | tim.peters | 2006-07-11 04:17:48 +0200 (Tue, 11 Jul 2006) | 2 lines
Whitespace normalization.
........
r50575 | thomas.heller | 2006-07-11 18:42:05 +0200 (Tue, 11 Jul 2006) | 1 line
Add missing Py_DECREF.
........
r50576 | thomas.heller | 2006-07-11 18:44:25 +0200 (Tue, 11 Jul 2006) | 1 line
Add missing Py_DECREFs.
........
r50579 | andrew.kuchling | 2006-07-11 19:20:16 +0200 (Tue, 11 Jul 2006) | 1 line
Bump version number; add sys._current_frames
........
r50582 | thomas.heller | 2006-07-11 20:28:35 +0200 (Tue, 11 Jul 2006) | 3 lines
When a foreign function is retrived by calling __getitem__ on a ctypes
library instance, do not set it as attribute.
........
r50583 | thomas.heller | 2006-07-11 20:40:50 +0200 (Tue, 11 Jul 2006) | 2 lines
Change the ctypes version number to 1.0.0.
........
r50597 | neal.norwitz | 2006-07-12 07:26:17 +0200 (Wed, 12 Jul 2006) | 3 lines
Bug #1520864: unpacking singleton tuples in for loop (for x, in) work again.
........
r50598 | neal.norwitz | 2006-07-12 07:26:35 +0200 (Wed, 12 Jul 2006) | 1 line
Fix function name in error msg
........
r50599 | neal.norwitz | 2006-07-12 07:27:46 +0200 (Wed, 12 Jul 2006) | 4 lines
Fix uninitialized memory read reported by Valgrind when running doctest.
This could happen if size == 0.
........
r50600 | neal.norwitz | 2006-07-12 09:28:29 +0200 (Wed, 12 Jul 2006) | 1 line
Actually change the MAGIC #. Create a new section for 2.5c1 and mention the impact of changing the MAGIC #.
........
r50601 | thomas.heller | 2006-07-12 10:43:47 +0200 (Wed, 12 Jul 2006) | 3 lines
Fix #1467450: ctypes now uses RTLD_GLOBAL by default on OSX 10.3 to
load shared libraries.
........
r50604 | thomas.heller | 2006-07-12 16:25:18 +0200 (Wed, 12 Jul 2006) | 3 lines
Fix the wrong description of LibraryLoader.LoadLibrary, and document
the DEFAULT_MODE constant.
........
r50607 | georg.brandl | 2006-07-12 17:31:17 +0200 (Wed, 12 Jul 2006) | 3 lines
Accept long options "--help" and "--version".
........
r50617 | thomas.heller | 2006-07-13 11:53:47 +0200 (Thu, 13 Jul 2006) | 3 lines
A misspelled preprocessor symbol caused ctypes to be always compiled
without thread support. Replaced WITH_THREADS with WITH_THREAD.
........
r50619 | thomas.heller | 2006-07-13 19:01:14 +0200 (Thu, 13 Jul 2006) | 3 lines
Fix #1521375. When running with root priviledges, 'gcc -o /dev/null'
did overwrite /dev/null. Use a temporary file instead of /dev/null.
........
r50620 | thomas.heller | 2006-07-13 19:05:13 +0200 (Thu, 13 Jul 2006) | 2 lines
Fix misleading words.
........
r50622 | andrew.kuchling | 2006-07-13 19:37:26 +0200 (Thu, 13 Jul 2006) | 1 line
Typo fix
........
r50629 | georg.brandl | 2006-07-14 09:12:54 +0200 (Fri, 14 Jul 2006) | 3 lines
Patch #1521874: grammar errors in doanddont.tex.
........
r50630 | neal.norwitz | 2006-07-14 09:20:04 +0200 (Fri, 14 Jul 2006) | 1 line
Try to improve grammar further.
........
r50631 | martin.v.loewis | 2006-07-14 11:58:55 +0200 (Fri, 14 Jul 2006) | 1 line
Extend build_ssl to Win64, using VSExtComp.
........
r50632 | martin.v.loewis | 2006-07-14 14:10:09 +0200 (Fri, 14 Jul 2006) | 1 line
Add debug output to analyse buildbot failure.
........
r50633 | martin.v.loewis | 2006-07-14 14:31:05 +0200 (Fri, 14 Jul 2006) | 1 line
Fix Debug build of _ssl.
........
r50636 | andrew.kuchling | 2006-07-14 15:32:38 +0200 (Fri, 14 Jul 2006) | 1 line
Mention new options
........
r50638 | peter.astrand | 2006-07-14 16:04:45 +0200 (Fri, 14 Jul 2006) | 1 line
Bug #1223937: CalledProcessError.errno -> CalledProcessError.returncode.
........
r50640 | thomas.heller | 2006-07-14 17:01:05 +0200 (Fri, 14 Jul 2006) | 4 lines
Make the prototypes of our private PyUnicode_FromWideChar and
PyUnicode_AsWideChar replacement functions compatible to the official
functions by using Py_ssize_t instead of int.
........
r50643 | thomas.heller | 2006-07-14 19:51:14 +0200 (Fri, 14 Jul 2006) | 3 lines
Patch #1521817: The index range checking on ctypes arrays containing
exactly one element is enabled again.
........
r50647 | thomas.heller | 2006-07-14 20:22:50 +0200 (Fri, 14 Jul 2006) | 2 lines
Updates for the ctypes documentation.
........
r50655 | fredrik.lundh | 2006-07-14 23:45:48 +0200 (Fri, 14 Jul 2006) | 3 lines
typo
........
r50664 | george.yoshida | 2006-07-15 18:03:49 +0200 (Sat, 15 Jul 2006) | 2 lines
Bug #15187702 : ext/win-cookbook.html has a broken link to distutils
........
r50667 | bob.ippolito | 2006-07-15 18:53:15 +0200 (Sat, 15 Jul 2006) | 1 line
Patch #1220874: Update the binhex module for Mach-O.
........
r50671 | fred.drake | 2006-07-16 03:21:20 +0200 (Sun, 16 Jul 2006) | 1 line
clean up some link markup
........
r50673 | neal.norwitz | 2006-07-16 03:50:38 +0200 (Sun, 16 Jul 2006) | 4 lines
Bug #1512814, Fix incorrect lineno's when code within a function
had more than 255 blank lines. Byte codes need to go first, line #s second.
........
r50674 | neal.norwitz | 2006-07-16 04:00:32 +0200 (Sun, 16 Jul 2006) | 5 lines
a & b were dereffed above, so they are known to be valid pointers.
z is known to be NULL, nothing to DECREF.
Reported by Klockwork, #107.
........
r50675 | neal.norwitz | 2006-07-16 04:02:57 +0200 (Sun, 16 Jul 2006) | 5 lines
self is dereffed (and passed as first arg), so it's known to be good.
func is returned from PyArg_ParseTuple and also dereffed.
Reported by Klocwork, #30 (self one at least).
........
r50676 | neal.norwitz | 2006-07-16 04:05:35 +0200 (Sun, 16 Jul 2006) | 4 lines
proto was dereffed above and is known to be good. No need for X.
Reported by Klocwork, #39.
........
r50677 | neal.norwitz | 2006-07-16 04:15:27 +0200 (Sun, 16 Jul 2006) | 5 lines
Fix memory leaks in some conditions.
Reported by Klocwork #152.
........
r50678 | neal.norwitz | 2006-07-16 04:17:36 +0200 (Sun, 16 Jul 2006) | 4 lines
Fix memory leak under some conditions.
Reported by Klocwork, #98.
........
r50679 | neal.norwitz | 2006-07-16 04:22:30 +0200 (Sun, 16 Jul 2006) | 8 lines
Use sizeof(buffer) instead of duplicating the constants to ensure they won't
be wrong.
The real change is to pass (bufsz - 1) to PyOS_ascii_formatd and 1
to strncat. strncat copies n+1 bytes from src (not dest).
Reported by Klocwork #58.
........
r50680 | neal.norwitz | 2006-07-16 04:32:03 +0200 (Sun, 16 Jul 2006) | 5 lines
Handle a NULL name properly.
Reported by Klocwork #67
........
r50681 | neal.norwitz | 2006-07-16 04:35:47 +0200 (Sun, 16 Jul 2006) | 6 lines
PyFunction_SetDefaults() is documented as taking None or a tuple.
A NULL would crash the PyTuple_Check(). Now make NULL return a SystemError.
Reported by Klocwork #73.
........
r50683 | neal.norwitz | 2006-07-17 02:55:45 +0200 (Mon, 17 Jul 2006) | 5 lines
Stop INCREFing name, then checking if it's NULL. name (f_name) should never
be NULL so assert it. Fix one place where we could have passed NULL.
Reported by Klocwork #66.
........
r50684 | neal.norwitz | 2006-07-17 02:57:15 +0200 (Mon, 17 Jul 2006) | 5 lines
otherset is known to be non-NULL based on checks before and DECREF after.
DECREF otherset rather than XDECREF in error conditions too.
Reported by Klockwork #154.
........
r50685 | neal.norwitz | 2006-07-17 02:59:04 +0200 (Mon, 17 Jul 2006) | 7 lines
Reported by Klocwork #151.
v2 can be NULL if exception2 is NULL. I don't think that condition can happen,
but I'm not sure it can't either. Now the code will protect against either
being NULL.
........
r50686 | neal.norwitz | 2006-07-17 03:00:16 +0200 (Mon, 17 Jul 2006) | 1 line
Add NEWS entry for a bunch of fixes due to warnings produced by Klocworks static analysis tool.
........
r50687 | fred.drake | 2006-07-17 07:47:52 +0200 (Mon, 17 Jul 2006) | 3 lines
document xmlcore (still minimal; needs mention in each of the xml.* modules)
SF bug #1504456 (partial)
........
r50688 | georg.brandl | 2006-07-17 15:23:46 +0200 (Mon, 17 Jul 2006) | 3 lines
Remove usage of sets module (patch #1500609).
........
r50689 | georg.brandl | 2006-07-17 15:26:33 +0200 (Mon, 17 Jul 2006) | 3 lines
Add missing NEWS item (#1522771)
........
r50690 | andrew.kuchling | 2006-07-17 18:47:54 +0200 (Mon, 17 Jul 2006) | 1 line
Attribute more features
........
r50692 | kurt.kaiser | 2006-07-17 23:59:27 +0200 (Mon, 17 Jul 2006) | 8 lines
Patch 1479219 - Tal Einat
1. 'as' highlighted as builtin in comment string on import line
2. Comments such as "#False identity" which start with a keyword immediately
after the '#' character aren't colored as comments.
3. u or U beginning unicode string not correctly highlighted
Closes bug 1325071
........
r50693 | barry.warsaw | 2006-07-18 01:07:51 +0200 (Tue, 18 Jul 2006) | 16 lines
decode_rfc2231(): Be more robust against buggy RFC 2231 encodings.
Specifically, instead of raising a ValueError when there is a single tick in
the parameter, simply return that the entire string unquoted, with None for
both the charset and the language. Also, if there are more than 2 ticks in
the parameter, interpret the first three parts as the standard RFC 2231 parts,
then the rest of the parts as the encoded string.
Test cases added.
Original fewer-than-3-parts fix by Tokio Kikuchi.
Resolves SF bug # 1218081. I will back port the fix and tests to Python 2.4
(email 3.0) and Python 2.3 (email 2.5).
Also, bump the version number to email 4.0.1, removing the 'alpha' moniker.
........
r50695 | kurt.kaiser | 2006-07-18 06:03:16 +0200 (Tue, 18 Jul 2006) | 2 lines
Rebinding Tab key was inserting 'tab' instead of 'Tab'. Bug 1179168.
........
r50696 | brett.cannon | 2006-07-18 06:41:36 +0200 (Tue, 18 Jul 2006) | 6 lines
Fix bug #1520914. Starting in 2.4, time.strftime() began to check the bounds
of values in the time tuple passed in. Unfortunately people came to rely on
undocumented behaviour of setting unneeded values to 0, regardless of if it was
within the valid range. Now those values force the value internally to the
minimum value when 0 is passed in.
........
r50697 | facundo.batista | 2006-07-18 14:16:13 +0200 (Tue, 18 Jul 2006) | 1 line
Comments and docs cleanups, and some little fixes, provided by Santiágo Peresón
........
r50704 | martin.v.loewis | 2006-07-18 19:46:31 +0200 (Tue, 18 Jul 2006) | 2 lines
Patch #1524429: Use repr instead of backticks again.
........
r50706 | tim.peters | 2006-07-18 23:55:15 +0200 (Tue, 18 Jul 2006) | 2 lines
Whitespace normalization.
........
r50708 | tim.peters | 2006-07-19 02:03:19 +0200 (Wed, 19 Jul 2006) | 18 lines
SF bug 1524317: configure --without-threads fails to build
Moved the code for _PyThread_CurrentFrames() up, so it's no longer
in a huge "#ifdef WITH_THREAD" block (I didn't realize it /was/ in
one).
Changed test_sys's test_current_frames() so it passes with or without
thread supported compiled in.
Note that test_sys fails when Python is compiled without threads,
but for an unrelated reason (the old test_exit() fails with an
indirect ImportError on the `thread` module). There are also
other unrelated compilation failures without threads, in extension
modules (like ctypes); at least the core compiles again.
Do we really support --without-threads? If so, there are several
problems remaining.
........
r50713 | thomas.heller | 2006-07-19 11:09:32 +0200 (Wed, 19 Jul 2006) | 4 lines
Make sure the _ctypes extension can be compiled when WITH_THREAD is
not defined on Windows, even if that configuration is probably not
supported at all.
........
r50715 | martin.v.loewis | 2006-07-19 19:18:32 +0200 (Wed, 19 Jul 2006) | 4 lines
Revert r50706 (Whitespace normalization) and
r50697: Comments and docs cleanups, and some little fixes
per recommendation from Raymond Hettinger.
........
r50719 | phillip.eby | 2006-07-20 17:54:16 +0200 (Thu, 20 Jul 2006) | 4 lines
Fix SF#1516184 (again) and add a test to prevent regression.
(There was a problem with empty filenames still causing recursion)
........
r50720 | georg.brandl | 2006-07-20 18:28:39 +0200 (Thu, 20 Jul 2006) | 3 lines
Guard for _active being None in __del__ method.
........
r50721 | vinay.sajip | 2006-07-20 18:28:39 +0200 (Thu, 20 Jul 2006) | 1 line
Updated documentation for TimedRotatingFileHandler relating to how rollover files are named. The previous documentation was wrongly the same as for RotatingFileHandler.
........
r50731 | fred.drake | 2006-07-20 22:11:57 +0200 (Thu, 20 Jul 2006) | 1 line
markup fix
........
r50739 | kurt.kaiser | 2006-07-21 00:22:52 +0200 (Fri, 21 Jul 2006) | 7 lines
Avoid occasional failure to detect closing paren properly.
Patch 1407280 Tal Einat
M ParenMatch.py
M NEWS.txt
M CREDITS.txt
........
r50740 | vinay.sajip | 2006-07-21 01:20:12 +0200 (Fri, 21 Jul 2006) | 1 line
Addressed SF#1524081 by using a dictionary to map level names to syslog priority names, rather than a string.lower().
........
r50741 | neal.norwitz | 2006-07-21 07:29:58 +0200 (Fri, 21 Jul 2006) | 1 line
Add some asserts that we got good params passed
........
r50742 | neal.norwitz | 2006-07-21 07:31:02 +0200 (Fri, 21 Jul 2006) | 5 lines
Move the initialization of some pointers earlier. The problem is
that if we call Py_DECREF(frame) like we do if allocating locals fails,
frame_dealloc() will try to use these bogus values and crash.
........
r50743 | neal.norwitz | 2006-07-21 07:32:28 +0200 (Fri, 21 Jul 2006) | 4 lines
Handle allocation failures gracefully. Found with failmalloc.
Many (all?) of these could be backported.
........
r50745 | neal.norwitz | 2006-07-21 09:59:02 +0200 (Fri, 21 Jul 2006) | 1 line
Speel initialise write. Tanks Anthony.
........
r50746 | neal.norwitz | 2006-07-21 09:59:47 +0200 (Fri, 21 Jul 2006) | 2 lines
Handle more memory allocation failures without crashing.
........
r50754 | barry.warsaw | 2006-07-21 16:51:07 +0200 (Fri, 21 Jul 2006) | 23 lines
More RFC 2231 improvements for the email 4.0 package. As Mark Sapiro rightly
points out there are really two types of continued headers defined in this
RFC (i.e. "encoded" parameters with the form "name*0*=" and unencoded
parameters with the form "name*0="), but we were were handling them both the
same way and that isn't correct.
This patch should be much more RFC compliant in that only encoded params are
%-decoded and the charset/language information is only extract if there are
any encoded params in the segments. If there are no encoded params then the
RFC says that there will be no charset/language parts.
Note however that this will change the return value for Message.get_param() in
some cases. For example, whereas before if you had all unencoded param
continuations you would have still gotten a 3-tuple back from this method
(with charset and language == None), you will now get just a string. I don't
believe this is a backward incompatible change though because the
documentation for this method already indicates that either return value is
possible and that you must do an isinstance(val, tuple) check to discriminate
between the two. (Yeah that API kind of sucks but we can't change /that/
without breaking code.)
Test cases, some documentation updates, and a NEWS item accompany this patch.
........
r50759 | georg.brandl | 2006-07-21 19:36:31 +0200 (Fri, 21 Jul 2006) | 3 lines
Fix check for empty list (vs. None).
........
r50771 | brett.cannon | 2006-07-22 00:44:07 +0200 (Sat, 22 Jul 2006) | 2 lines
Remove an XXX marker in a comment.
........
r50773 | neal.norwitz | 2006-07-22 18:20:49 +0200 (Sat, 22 Jul 2006) | 1 line
Fix more memory allocation issues found with failmalloc.
........
r50774 | neal.norwitz | 2006-07-22 19:00:57 +0200 (Sat, 22 Jul 2006) | 1 line
Don't fail if the directory already exists
........
r50775 | greg.ward | 2006-07-23 04:25:53 +0200 (Sun, 23 Jul 2006) | 6 lines
Be a lot smarter about whether this test passes: instead of assuming
that a 2.93 sec audio file will always take 3.1 sec (as it did on the
hardware I had when I first wrote the test), expect that it will take
2.93 sec +/- 10%, and only fail if it's outside of that range.
Compute the expected
........
r50776 | kurt.kaiser | 2006-07-23 06:19:49 +0200 (Sun, 23 Jul 2006) | 2 lines
Tooltips failed on new-syle class __init__ args. Bug 1027566 Loren Guthrie
........
r50777 | neal.norwitz | 2006-07-23 09:50:36 +0200 (Sun, 23 Jul 2006) | 1 line
Handle more mem alloc issues found with failmalloc
........
r50778 | neal.norwitz | 2006-07-23 09:51:58 +0200 (Sun, 23 Jul 2006) | 5 lines
If the for loop isn't entered, entryblock will be NULL. If passed
to stackdepth_walk it will be dereffed.
Not sure if I found with failmalloc or Klockwork #55.
........
r50779 | neal.norwitz | 2006-07-23 09:53:14 +0200 (Sun, 23 Jul 2006) | 4 lines
Move the initialization of size_a down below the check for a being NULL.
Reported by Klocwork #106
........
r50780 | neal.norwitz | 2006-07-23 09:55:55 +0200 (Sun, 23 Jul 2006) | 9 lines
Check the allocation of b_objects and return if there was a failure.
Also fix a few memory leaks in other failure scenarios.
It seems that if b_objects == Py_None, we will have an extra ref to
b_objects. Add XXX comment so hopefully someone documents why the
else isn't necessary or adds it in.
Reported by Klocwork #20
........
r50781 | neal.norwitz | 2006-07-23 09:57:11 +0200 (Sun, 23 Jul 2006) | 2 lines
Fix memory leaks spotted by Klocwork #37.
........
r50782 | neal.norwitz | 2006-07-23 09:59:00 +0200 (Sun, 23 Jul 2006) | 5 lines
nextlink can be NULL if teedataobject_new fails, so use XINCREF.
Ensure that dataobj is never NULL.
Reported by Klocwork #102
........
r50783 | neal.norwitz | 2006-07-23 10:01:43 +0200 (Sun, 23 Jul 2006) | 8 lines
Ensure we don't write beyond errText. I think I got this right, but
it definitely could use some review to ensure I'm not off by one
and there's no possible overflow/wrap-around of bytes_left.
Reported by Klocwork #1.
Fix a problem if there is a failure allocating self->db.
Found with failmalloc.
........
r50784 | ronald.oussoren | 2006-07-23 11:41:09 +0200 (Sun, 23 Jul 2006) | 3 lines
Without this patch CMD-W won't close EditorWindows on MacOS X. This solves
part of bug #1517990.
........
r50785 | ronald.oussoren | 2006-07-23 11:46:11 +0200 (Sun, 23 Jul 2006) | 5 lines
Fix for bug #1517996: Class and Path browsers show Tk menu
This patch replaces the menubar that is used by AquaTk for windows without a
menubar of their own by one that is more appropriate for IDLE.
........
r50786 | andrew.macintyre | 2006-07-23 14:57:02 +0200 (Sun, 23 Jul 2006) | 2 lines
Build updates for OS/2 EMX port
........
r50787 | andrew.macintyre | 2006-07-23 15:00:04 +0200 (Sun, 23 Jul 2006) | 3 lines
bugfix: PyThread_start_new_thread() returns the thread ID, not a flag;
will backport.
........
r50789 | andrew.macintyre | 2006-07-23 15:04:00 +0200 (Sun, 23 Jul 2006) | 2 lines
Get mailbox module working on OS/2 EMX port.
........
r50791 | greg.ward | 2006-07-23 18:05:51 +0200 (Sun, 23 Jul 2006) | 1 line
Resync optparse with Optik 1.5.3: minor tweaks for/to tests.
........
r50794 | martin.v.loewis | 2006-07-24 07:05:22 +0200 (Mon, 24 Jul 2006) | 2 lines
Update list of unsupported systems. Fixes #1510853.
........
r50795 | martin.v.loewis | 2006-07-24 12:26:33 +0200 (Mon, 24 Jul 2006) | 1 line
Patch #1448199: Release GIL around ConnectRegistry.
........
r50796 | martin.v.loewis | 2006-07-24 13:54:53 +0200 (Mon, 24 Jul 2006) | 3 lines
Patch #1232023: Don't include empty path component from registry,
so that the current directory does not get added to sys.path.
Also fixes #1526785.
........
r50797 | martin.v.loewis | 2006-07-24 14:54:17 +0200 (Mon, 24 Jul 2006) | 3 lines
Bug #1524310: Properly report errors from FindNextFile in os.listdir.
Will backport to 2.4.
........
r50800 | georg.brandl | 2006-07-24 15:28:57 +0200 (Mon, 24 Jul 2006) | 7 lines
Patch #1523356: fix determining include dirs in python-config.
Also don't install "python-config" when doing altinstall, but
always install "python-config2.x" and make a link to it like
with the main executable.
........
r50802 | georg.brandl | 2006-07-24 15:46:47 +0200 (Mon, 24 Jul 2006) | 3 lines
Patch #1527744: right order of includes in order to have HAVE_CONIO_H defined properly.
........
r50803 | georg.brandl | 2006-07-24 16:09:56 +0200 (Mon, 24 Jul 2006) | 3 lines
Patch #1515343: Fix printing of deprecated string exceptions with a
value in the traceback module.
........
r50804 | kurt.kaiser | 2006-07-24 19:13:23 +0200 (Mon, 24 Jul 2006) | 7 lines
EditorWindow failed when used stand-alone if sys.ps1 not set.
Bug 1010370 Dave Florek
M EditorWindow.py
M PyShell.py
M NEWS.txt
........
r50805 | kurt.kaiser | 2006-07-24 20:05:51 +0200 (Mon, 24 Jul 2006) | 6 lines
- EditorWindow.test() was failing. Bug 1417598
M EditorWindow.py
M ScriptBinding.py
M NEWS.txt
........
r50808 | georg.brandl | 2006-07-24 22:11:35 +0200 (Mon, 24 Jul 2006) | 3 lines
Repair accidental NameError.
........
r50809 | tim.peters | 2006-07-24 23:02:15 +0200 (Mon, 24 Jul 2006) | 2 lines
Whitespace normalization.
........
r50810 | greg.ward | 2006-07-25 04:11:12 +0200 (Tue, 25 Jul 2006) | 3 lines
Don't use standard assert: want tests to fail even when run with -O.
Delete cruft.
........
r50811 | tim.peters | 2006-07-25 06:07:22 +0200 (Tue, 25 Jul 2006) | 10 lines
current_frames_with_threads(): There's actually no way
to guess /which/ line the spawned thread is in at the time
sys._current_frames() is called: we know it finished
enter_g.set(), but can't know whether the instruction
counter has advanced to the following leave_g.wait().
The latter is overwhelming most likely, but not guaranteed,
and I see that the "x86 Ubuntu dapper (icc) trunk" buildbot
found it on the other line once. Changed the test so it
passes in either case.
........
r50815 | martin.v.loewis | 2006-07-25 11:53:12 +0200 (Tue, 25 Jul 2006) | 2 lines
Bug #1525817: Don't truncate short lines in IDLE's tool tips.
........
r50816 | martin.v.loewis | 2006-07-25 12:05:47 +0200 (Tue, 25 Jul 2006) | 3 lines
Bug #978833: Really close underlying socket in _socketobject.close.
Will backport to 2.4.
........
r50817 | martin.v.loewis | 2006-07-25 12:11:14 +0200 (Tue, 25 Jul 2006) | 1 line
Revert incomplete checkin.
........
r50819 | georg.brandl | 2006-07-25 12:22:34 +0200 (Tue, 25 Jul 2006) | 4 lines
Patch #1525766: correctly pass onerror arg to recursive calls
of pkg.walk_packages. Also improve the docstrings.
........
r50825 | brett.cannon | 2006-07-25 19:32:20 +0200 (Tue, 25 Jul 2006) | 2 lines
Add comment for changes to test_ossaudiodev.
........
r50826 | brett.cannon | 2006-07-25 19:34:36 +0200 (Tue, 25 Jul 2006) | 3 lines
Fix a bug in the messages for an assert failure where not enough arguments to a string
were being converted in the format.
........
r50828 | armin.rigo | 2006-07-25 20:09:57 +0200 (Tue, 25 Jul 2006) | 2 lines
Document why is and is not a good way to fix the gc_inspection crasher.
........
r50829 | armin.rigo | 2006-07-25 20:11:07 +0200 (Tue, 25 Jul 2006) | 5 lines
Added another crasher, which hit me today (I was not intentionally
writing such code, of course, but it took some gdb time to figure out
what my bug was).
........
r50830 | armin.rigo | 2006-07-25 20:38:39 +0200 (Tue, 25 Jul 2006) | 3 lines
Document the crashers that will not go away soon as "won't fix",
and explain why.
........
r50831 | ronald.oussoren | 2006-07-25 21:13:35 +0200 (Tue, 25 Jul 2006) | 3 lines
Install the compatibility symlink to libpython.a on OSX using 'ln -sf' instead
of 'ln -s', this avoid problems when reinstalling python.
........
r50832 | ronald.oussoren | 2006-07-25 21:20:54 +0200 (Tue, 25 Jul 2006) | 7 lines
Fix for bug #1525447 (renaming to MacOSmodule.c would also work, but not
without causing problems for anyone that is on a case-insensitive filesystem).
Setup.py tries to compile the MacOS extension from MacOSmodule.c, while the
actual file is named macosmodule.c. This is no problem on the (default)
case-insensitive filesystem, but doesn't work on case-sensitive filesystems.
........
r50833 | ronald.oussoren | 2006-07-25 22:28:55 +0200 (Tue, 25 Jul 2006) | 7 lines
Fix bug #1517990: IDLE keybindings on OSX
This adds a new key definition for OSX, which is slightly different from the
classic mac definition.
Also add NEWS item for a couple of bugfixes I added recently.
........
r50834 | tim.peters | 2006-07-26 00:30:24 +0200 (Wed, 26 Jul 2006) | 2 lines
Whitespace normalization.
........
r50839 | neal.norwitz | 2006-07-26 06:00:18 +0200 (Wed, 26 Jul 2006) | 1 line
Hmm, only python2.x is installed, not plain python. Did that change recently?
........
r50840 | barry.warsaw | 2006-07-26 07:54:46 +0200 (Wed, 26 Jul 2006) | 6 lines
Forward port some fixes that were in email 2.5 but for some reason didn't make
it into email 4.0. Specifically, in Message.get_content_charset(), handle RFC
2231 headers that contain an encoding not known to Python, or a character in
the data that isn't in the charset encoding. Also forward port the
appropriate unit tests.
........
r50841 | georg.brandl | 2006-07-26 09:23:32 +0200 (Wed, 26 Jul 2006) | 3 lines
NEWS entry for #1525766.
........
r50842 | georg.brandl | 2006-07-26 09:40:17 +0200 (Wed, 26 Jul 2006) | 3 lines
Bug #1459963: properly capitalize HTTP header names.
........
r50843 | georg.brandl | 2006-07-26 10:03:10 +0200 (Wed, 26 Jul 2006) | 6 lines
Part of bug #1523610: fix miscalculation of buffer length.
Also add a guard against NULL in converttuple and add a test case
(that previously would have crashed).
........
r50844 | martin.v.loewis | 2006-07-26 14:12:56 +0200 (Wed, 26 Jul 2006) | 3 lines
Bug #978833: Really close underlying socket in _socketobject.close.
Fix httplib.HTTPConnection.getresponse to not close the
socket if it is still needed for the response.
........
r50845 | andrew.kuchling | 2006-07-26 19:16:52 +0200 (Wed, 26 Jul 2006) | 1 line
[Bug #1471938] Fix build problem on Solaris 8 by conditionalizing the use of mvwgetnstr(); it was conditionalized a few lines below. Fix from Paul Eggert. I also tried out the STRICT_SYSV_CURSES case and am therefore removing the 'untested' comment.
........
r50846 | andrew.kuchling | 2006-07-26 19:18:01 +0200 (Wed, 26 Jul 2006) | 1 line
Correct error message
........
r50847 | andrew.kuchling | 2006-07-26 19:19:39 +0200 (Wed, 26 Jul 2006) | 1 line
Minor grammar fix
........
r50848 | andrew.kuchling | 2006-07-26 19:22:21 +0200 (Wed, 26 Jul 2006) | 1 line
Put news item in right section
........
r50850 | andrew.kuchling | 2006-07-26 20:03:12 +0200 (Wed, 26 Jul 2006) | 1 line
Use sys.exc_info()
........
r50851 | andrew.kuchling | 2006-07-26 20:15:45 +0200 (Wed, 26 Jul 2006) | 1 line
Use sys.exc_info()
........
r50852 | phillip.eby | 2006-07-26 21:48:27 +0200 (Wed, 26 Jul 2006) | 4 lines
Allow the 'onerror' argument to walk_packages() to catch any Exception, not
just ImportError. This allows documentation tools to better skip unimportable
packages.
........
r50854 | tim.peters | 2006-07-27 01:23:15 +0200 (Thu, 27 Jul 2006) | 2 lines
Whitespace normalization.
........
r50855 | tim.peters | 2006-07-27 03:14:53 +0200 (Thu, 27 Jul 2006) | 21 lines
Bug #1521947: possible bug in mystrtol.c with recent gcc.
In general, C doesn't define anything about what happens when
an operation on a signed integral type overflows, and PyOS_strtol()
did several formally undefined things of that nature on signed
longs. Some version of gcc apparently tries to exploit that now,
and PyOS_strtol() could fail to detect overflow then.
Tried to repair all that, although it seems at least as likely to me
that we'll get screwed by bad platform definitions for LONG_MIN
and/or LONG_MAX now. For that reason, I don't recommend backporting
this.
Note that I have no box on which this makes a lick of difference --
can't really test it, except to note that it didn't break anything
on my boxes.
Silent change: PyOS_strtol() used to return the hard-coded 0x7fffffff
in case of overflow. Now it returns LONG_MAX. They're the same only on
32-bit boxes (although C doesn't guarantee that either ...).
........
r50856 | neal.norwitz | 2006-07-27 05:51:58 +0200 (Thu, 27 Jul 2006) | 6 lines
Don't kill a normal instance of python running on windows when checking
to kill a cygwin instance. build\\python.exe was matching a normal windows
instance. Prefix that with a \\ to ensure build is a directory and not
PCbuild. As discussed on python-dev.
........
r50857 | neal.norwitz | 2006-07-27 05:55:39 +0200 (Thu, 27 Jul 2006) | 5 lines
Closure can't be NULL at this point since we know it's a tuple.
Reported by Klocwork # 74.
........
r50858 | neal.norwitz | 2006-07-27 06:04:50 +0200 (Thu, 27 Jul 2006) | 1 line
No functional change. Add comment and assert to describe why there cannot be overflow which was reported by Klocwork. Discussed on python-dev
........
r50859 | martin.v.loewis | 2006-07-27 08:38:16 +0200 (Thu, 27 Jul 2006) | 3 lines
Bump distutils version to 2.5, as several new features
have been introduced since 2.4.
........
r50860 | andrew.kuchling | 2006-07-27 14:18:20 +0200 (Thu, 27 Jul 2006) | 1 line
Reformat docstring; fix typo
........
r50861 | georg.brandl | 2006-07-27 17:05:36 +0200 (Thu, 27 Jul 2006) | 6 lines
Add test_main() methods. These three tests were never run
by regrtest.py.
We really need a simpler testing framework.
........
r50862 | tim.peters | 2006-07-27 17:09:20 +0200 (Thu, 27 Jul 2006) | 2 lines
News for patch #1529686.
........
r50863 | tim.peters | 2006-07-27 17:11:00 +0200 (Thu, 27 Jul 2006) | 2 lines
Whitespace normalization.
........
r50864 | georg.brandl | 2006-07-27 17:38:33 +0200 (Thu, 27 Jul 2006) | 3 lines
Amend news entry.
........
r50865 | georg.brandl | 2006-07-27 18:08:15 +0200 (Thu, 27 Jul 2006) | 3 lines
Make uuid test suite pass on this box by requesting output with LC_ALL=C.
........
r50866 | andrew.kuchling | 2006-07-27 20:37:33 +0200 (Thu, 27 Jul 2006) | 1 line
Add example
........
r50867 | thomas.heller | 2006-07-27 20:39:55 +0200 (Thu, 27 Jul 2006) | 9 lines
Remove code that is no longer used (ctypes.com).
Fix the DllGetClassObject and DllCanUnloadNow so that they forward the
call to the comtypes.server.inprocserver module.
The latter was never documented, never used by published code, and
didn't work anyway, so I think it does not deserve a NEWS entry (but I
might be wrong).
........
r50868 | andrew.kuchling | 2006-07-27 20:41:21 +0200 (Thu, 27 Jul 2006) | 1 line
Typo fix ('publically' is rare, poss. non-standard)
........
r50869 | andrew.kuchling | 2006-07-27 20:42:41 +0200 (Thu, 27 Jul 2006) | 1 line
Add missing word
........
r50870 | andrew.kuchling | 2006-07-27 20:44:10 +0200 (Thu, 27 Jul 2006) | 1 line
Repair typos
........
r50872 | andrew.kuchling | 2006-07-27 20:53:33 +0200 (Thu, 27 Jul 2006) | 1 line
Update URL; add example
........
r50873 | andrew.kuchling | 2006-07-27 21:07:29 +0200 (Thu, 27 Jul 2006) | 1 line
Add punctuation mark; add some examples
........
r50874 | andrew.kuchling | 2006-07-27 21:11:07 +0200 (Thu, 27 Jul 2006) | 1 line
Mention base64 module; rewrite last sentence to be more positive
........
r50875 | andrew.kuchling | 2006-07-27 21:12:49 +0200 (Thu, 27 Jul 2006) | 1 line
If binhex is higher-level than binascii, it should come first in the chapter
........
r50876 | tim.peters | 2006-07-27 22:47:24 +0200 (Thu, 27 Jul 2006) | 28 lines
check_node(): stop spraying mystery output to stderr.
When a node number disagrees, keep track of all sources & the
node numbers they reported, and stick all that in the error message.
Changed all callers to supply a non-empty "source" argument; made
the "source" argument non-optional.
On my box, test_uuid still fails, but with the less confusing output:
AssertionError: different sources disagree on node:
from source 'getnode1', node was 00038a000015
from source 'getnode2', node was 00038a000015
from source 'ipconfig', node was 001111b2b7bf
Only the last one appears to be correct; e.g.,
C:\Code\python\PCbuild>getmac
Physical Address Transport Name
=================== ==========================================================
00-11-11-B2-B7-BF \Device\Tcpip_{190FB163-5AFD-4483-86A1-2FE16AC61FF1}
62-A1-AC-6C-FD-BE \Device\Tcpip_{8F77DF5A-EA3D-4F1D-975E-D472CEE6438A}
E2-1F-01-C6-5D-88 \Device\Tcpip_{CD18F76B-2EF3-409F-9B8A-6481EE70A1E4}
I can't find anything on my box with MAC 00-03-8a-00-00-15, and am
not clear on where that comes from.
........
r50878 | andrew.kuchling | 2006-07-28 00:40:05 +0200 (Fri, 28 Jul 2006) | 1 line
Reword paragraph
........
r50879 | andrew.kuchling | 2006-07-28 00:49:38 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50880 | andrew.kuchling | 2006-07-28 00:49:54 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50881 | barry.warsaw | 2006-07-28 01:43:15 +0200 (Fri, 28 Jul 2006) | 27 lines
Patch #1520294: Support for getset and member descriptors in types.py,
inspect.py, and pydoc.py. Specifically, this allows for querying the type of
an object against these built-in C types and more importantly, for getting
their docstrings printed in the interactive interpreter's help() function.
This patch includes a new built-in module called _types which provides
definitions of getset and member descriptors for use by the types.py module.
These types are exposed as types.GetSetDescriptorType and
types.MemberDescriptorType. Query functions are provided as
inspect.isgetsetdescriptor() and inspect.ismemberdescriptor(). The
implementations of these are robust enough to work with Python implementations
other than CPython, which may not have these fundamental types.
The patch also includes documentation and test suite updates.
I commit these changes now under these guiding principles:
1. Silence is assent. The release manager has not said "no", and of the few
people that cared enough to respond to the thread, the worst vote was "0".
2. It's easier to ask for forgiveness than permission.
3. It's so dang easy to revert stuff in svn, that you could view this as a
forcing function. :)
Windows build patches will follow.
........
r50882 | tim.peters | 2006-07-28 01:44:37 +0200 (Fri, 28 Jul 2006) | 4 lines
Bug #1529297: The rewrite of doctest for Python 2.4 unintentionally
lost that tests are sorted by name before being run. ``DocTestFinder``
has been changed to sort the list of tests it returns.
........
r50883 | tim.peters | 2006-07-28 01:45:48 +0200 (Fri, 28 Jul 2006) | 2 lines
Whitespace normalization.
........
r50884 | tim.peters | 2006-07-28 01:46:36 +0200 (Fri, 28 Jul 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r50885 | barry.warsaw | 2006-07-28 01:50:40 +0200 (Fri, 28 Jul 2006) | 4 lines
Enable the building of the _types module on Windows.
Note that this has only been tested for VS 2003 since that's all I have.
........
r50887 | tim.peters | 2006-07-28 02:23:15 +0200 (Fri, 28 Jul 2006) | 7 lines
defdict_reduce(): Plug leaks.
We didn't notice these before because test_defaultdict didn't
actually do anything before Georg fixed that earlier today.
Neal's next refleak run then showed test_defaultdict leaking
9 references on each run. That's repaired by this checkin.
........
r50888 | tim.peters | 2006-07-28 02:30:00 +0200 (Fri, 28 Jul 2006) | 2 lines
News about the repaired memory leak in defaultdict.
........
r50889 | gregory.p.smith | 2006-07-28 03:35:25 +0200 (Fri, 28 Jul 2006) | 7 lines
- pybsddb Bug #1527939: bsddb module DBEnv dbremove and dbrename
methods now allow their database parameter to be None as the
sleepycat API allows.
Also adds an appropriate test case for DBEnv.dbrename and dbremove.
........
r50895 | neal.norwitz | 2006-07-28 06:22:34 +0200 (Fri, 28 Jul 2006) | 1 line
Ensure the actual number matches the expected count
........
r50896 | tim.peters | 2006-07-28 06:51:59 +0200 (Fri, 28 Jul 2006) | 6 lines
Live with that "the hardware address" is an ill-defined
concept, and that different ways of trying to find "the
hardware address" may return different results. Certainly
true on both of my Windows boxes, and in different ways
(see whining on python-dev).
........
r50897 | neal.norwitz | 2006-07-28 09:21:27 +0200 (Fri, 28 Jul 2006) | 3 lines
Try to find the MAC addr on various flavours of Unix. This seems hopeless.
The reduces the test_uuid failures, but there's still another method failing.
........
r50898 | martin.v.loewis | 2006-07-28 09:45:49 +0200 (Fri, 28 Jul 2006) | 2 lines
Add UUID for upcoming 2.5b3.
........
r50899 | matt.fleming | 2006-07-28 13:27:27 +0200 (Fri, 28 Jul 2006) | 3 lines
Allow socketmodule to compile on NetBSD -current, whose bluetooth API
differs from both Linux and FreeBSD. Accepted by Neal Norwitz.
........
r50900 | andrew.kuchling | 2006-07-28 14:07:12 +0200 (Fri, 28 Jul 2006) | 1 line
[Patch #1529811] Correction to description of r|* mode
........
r50901 | andrew.kuchling | 2006-07-28 14:18:22 +0200 (Fri, 28 Jul 2006) | 1 line
Typo fix
........
r50902 | andrew.kuchling | 2006-07-28 14:32:43 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50903 | andrew.kuchling | 2006-07-28 14:33:19 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50904 | andrew.kuchling | 2006-07-28 14:45:55 +0200 (Fri, 28 Jul 2006) | 1 line
Don't overwrite built-in name; add some blank lines for readability
........
r50905 | andrew.kuchling | 2006-07-28 14:48:07 +0200 (Fri, 28 Jul 2006) | 1 line
Add example. Should I propagate this example to all the other DBM-ish modules, too?
........
r50912 | georg.brandl | 2006-07-28 20:31:39 +0200 (Fri, 28 Jul 2006) | 3 lines
Patch #1529686: also run test_email_codecs with regrtest.py.
........
r50913 | georg.brandl | 2006-07-28 20:36:01 +0200 (Fri, 28 Jul 2006) | 3 lines
Fix spelling.
........
r50915 | thomas.heller | 2006-07-28 21:42:40 +0200 (Fri, 28 Jul 2006) | 3 lines
Remove a useless XXX comment.
Cosmetic changes to the code so that the #ifdef _UNICODE block
doesn't mess emacs code formatting.
........
r50916 | phillip.eby | 2006-07-28 23:12:07 +0200 (Fri, 28 Jul 2006) | 5 lines
Bug #1529871: The speed enhancement patch #921466 broke Python's compliance
with PEP 302. This was fixed by adding an ``imp.NullImporter`` type that is
used in ``sys.path_importer_cache`` to cache non-directory paths and avoid
excessive filesystem operations during imports.
........
r50917 | phillip.eby | 2006-07-28 23:31:54 +0200 (Fri, 28 Jul 2006) | 2 lines
Fix svn merge spew.
........
r50918 | thomas.heller | 2006-07-28 23:43:20 +0200 (Fri, 28 Jul 2006) | 4 lines
Patch #1529514: More openbsd platforms for ctypes.
Regenerated Modules/_ctypes/libffi/configure with autoconf 2.59.
Approved by Neal.
........
r50922 | georg.brandl | 2006-07-29 10:51:21 +0200 (Sat, 29 Jul 2006) | 2 lines
Bug #835255: The "closure" argument to new.function() is now documented.
........
r50924 | georg.brandl | 2006-07-29 11:33:26 +0200 (Sat, 29 Jul 2006) | 3 lines
Bug #1441397: The compiler module now recognizes module and function
docstrings correctly as it did in Python 2.4.
........
r50925 | georg.brandl | 2006-07-29 12:25:46 +0200 (Sat, 29 Jul 2006) | 4 lines
Revert rev 42617, it was introduced to work around bug #1441397.
test_compiler now passes again.
........
r50926 | fred.drake | 2006-07-29 15:22:49 +0200 (Sat, 29 Jul 2006) | 1 line
update target version number
........
r50927 | andrew.kuchling | 2006-07-29 15:56:48 +0200 (Sat, 29 Jul 2006) | 1 line
Add example
........
r50928 | andrew.kuchling | 2006-07-29 16:04:47 +0200 (Sat, 29 Jul 2006) | 1 line
Update URL
........
r50930 | andrew.kuchling | 2006-07-29 16:08:15 +0200 (Sat, 29 Jul 2006) | 1 line
Reword paragraph to match the order of the subsequent sections
........
r50931 | andrew.kuchling | 2006-07-29 16:21:15 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1529157] Mention raw_input() and input(); while I'm at it, reword the description a bit
........
r50932 | andrew.kuchling | 2006-07-29 16:42:48 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1519571] Document some missing functions: setup(), title(), done()
........
r50933 | andrew.kuchling | 2006-07-29 16:43:55 +0200 (Sat, 29 Jul 2006) | 1 line
Fix docstring punctuation
........
r50934 | andrew.kuchling | 2006-07-29 17:10:32 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1414697] Change docstring of set/frozenset types to specify that the contents are unique. Raymond, please feel free to edit or revert.
........
r50935 | andrew.kuchling | 2006-07-29 17:35:21 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1530382] Document SSL.server(), .issuer() methods
........
r50936 | andrew.kuchling | 2006-07-29 17:42:46 +0200 (Sat, 29 Jul 2006) | 1 line
Typo fix
........
r50937 | andrew.kuchling | 2006-07-29 17:43:13 +0200 (Sat, 29 Jul 2006) | 1 line
Tweak wording
........
r50938 | matt.fleming | 2006-07-29 17:55:30 +0200 (Sat, 29 Jul 2006) | 2 lines
Fix typo
........
r50939 | andrew.kuchling | 2006-07-29 17:57:08 +0200 (Sat, 29 Jul 2006) | 6 lines
[Bug #1528258] Mention that the 'data' argument can be None.
The constructor docs referred the reader to the add_data() method's docs,
but they weren't very helpful. I've simply copied an earlier explanation
of 'data' that's more useful.
........
r50940 | andrew.kuchling | 2006-07-29 18:08:40 +0200 (Sat, 29 Jul 2006) | 1 line
Set bug/patch count. Take a bow, everyone!
........
r50941 | fred.drake | 2006-07-29 18:56:15 +0200 (Sat, 29 Jul 2006) | 18 lines
expunge the xmlcore changes:
41667, 41668 - initial switch to xmlcore
47044 - mention of xmlcore in What's New
50687 - mention of xmlcore in the library reference
re-apply xmlcore changes to xml:
41674 - line ending changes (re-applied manually), directory props
41677 - add cElementTree wrapper
41678 - PSF licensing for etree
41812 - whitespace normalization
42724 - fix svn:eol-style settings
43681, 43682 - remove Python version-compatibility cruft from minidom
46773 - fix encoding of \r\n\t in attr values in saxutils
47269 - added XMLParser alias for cElementTree compatibility
additional tests were added in Lib/test/test_sax.py that failed with
the xmlcore changes; these relate to SF bugs #1511497, #1513611
........
r50942 | andrew.kuchling | 2006-07-29 20:14:07 +0200 (Sat, 29 Jul 2006) | 17 lines
Reorganize the docs for 'file' and 'open()' after some discussion with Fred.
We want to encourage users to write open() when opening a file, but
open() was described with a single paragraph and
'file' had lots of explanation of the mode and bufsize arguments.
I've shrunk the description of 'file' to cross-reference to the 'File
objects' section, and to open() for an explanation of the arguments.
open() now has all the paragraphs about the mode string. The bufsize
argument was moved up so that it isn't buried at the end; now there's
1 paragraph on mode, 1 on bufsize, and then 3 more on mode. Various
other edits and rearrangements were made in the process.
It's probably best to read the final text and not to try to make sense
of the diffs.
........
r50943 | fred.drake | 2006-07-29 20:19:19 +0200 (Sat, 29 Jul 2006) | 1 line
restore test un-intentionally removed in the xmlcore purge (revision 50941)
........
r50944 | fred.drake | 2006-07-29 20:33:29 +0200 (Sat, 29 Jul 2006) | 3 lines
make the reference to older versions of the documentation a link
to the right page on python.org
........
r50945 | fred.drake | 2006-07-29 21:09:01 +0200 (Sat, 29 Jul 2006) | 1 line
document the footnote usage pattern
........
r50947 | fred.drake | 2006-07-29 21:14:10 +0200 (Sat, 29 Jul 2006) | 1 line
emphasize and oddball nuance of LaTeX comment syntax
........
r50948 | andrew.kuchling | 2006-07-29 21:24:04 +0200 (Sat, 29 Jul 2006) | 1 line
[Patch #1490989 from Skip Montanaro] Mention debugging builds in the API documentation. I've changed Skip's patch to point to Misc/SpecialBuilds and fiddled with the markup a bit.
........
r50949 | neal.norwitz | 2006-07-29 21:29:35 +0200 (Sat, 29 Jul 2006) | 6 lines
Disable these tests until they are reliable across platforms.
These problems may mask more important, real problems.
One or both methods are known to fail on: Solaris, OpenBSD, Debian, Ubuntu.
They pass on Windows and some Linux boxes.
........
r50950 | andrew.kuchling | 2006-07-29 21:50:37 +0200 (Sat, 29 Jul 2006) | 1 line
[Patch #1068277] Clarify that os.path.exists() can return False depending on permissions. Fred approved committing this patch in December 2004!
........
r50952 | fred.drake | 2006-07-29 22:04:42 +0200 (Sat, 29 Jul 2006) | 6 lines
SF bug #1193966: Weakref types documentation misplaced
The information about supporting weakrefs with types defined in C extensions
is moved to the Extending & Embedding manual. Py_TPFLAGS_HAVE_WEAKREFS is
no longer mentioned since it is part of Py_TPFLAGS_DEFAULT.
........
r50953 | skip.montanaro | 2006-07-29 22:06:05 +0200 (Sat, 29 Jul 2006) | 4 lines
Add a comment to the csv reader documentation that explains why the
treatment of newlines changed in 2.5. Pulled almost verbatim from a comment
by Andrew McNamara in <http://python.org/sf/1465014>.
........
r50954 | neal.norwitz | 2006-07-29 22:20:52 +0200 (Sat, 29 Jul 2006) | 3 lines
If the executable doesn't exist, there's no reason to try to start it.
This prevents garbage about command not found being printed on Solaris.
........
r50955 | fred.drake | 2006-07-29 22:21:25 +0200 (Sat, 29 Jul 2006) | 1 line
fix minor markup error that introduced extra punctuation
........
r50957 | neal.norwitz | 2006-07-29 22:37:08 +0200 (Sat, 29 Jul 2006) | 3 lines
Disable test_getnode too, since this is also unreliable.
........
r50958 | andrew.kuchling | 2006-07-29 23:27:12 +0200 (Sat, 29 Jul 2006) | 1 line
Follow TeX's conventions for hyphens
........
r50959 | andrew.kuchling | 2006-07-29 23:30:21 +0200 (Sat, 29 Jul 2006) | 1 line
Fix case for 'Unix'
........
r50960 | fred.drake | 2006-07-30 01:34:57 +0200 (Sun, 30 Jul 2006) | 1 line
markup cleanups
........
r50961 | andrew.kuchling | 2006-07-30 02:27:34 +0200 (Sun, 30 Jul 2006) | 1 line
Minor typo fixes
........
r50962 | andrew.kuchling | 2006-07-30 02:37:56 +0200 (Sun, 30 Jul 2006) | 1 line
[Bug #793553] Correct description of keyword arguments for SSL authentication
........
r50963 | tim.peters | 2006-07-30 02:58:15 +0200 (Sun, 30 Jul 2006) | 2 lines
Whitespace normalization.
........
r50964 | fred.drake | 2006-07-30 05:03:43 +0200 (Sun, 30 Jul 2006) | 1 line
lots of markup nits, most commonly Unix/unix --> \UNIX
........
r50965 | fred.drake | 2006-07-30 07:41:28 +0200 (Sun, 30 Jul 2006) | 1 line
update information on wxPython, from Robin Dunn
........
r50966 | fred.drake | 2006-07-30 07:49:49 +0200 (Sun, 30 Jul 2006) | 4 lines
remove possibly-outdated comment on what GUI toolkit is most commonly used;
it is hard to know whether this is right, and it does not add valuable reference information
at any rate
........
r50967 | fred.drake | 2006-07-30 07:55:39 +0200 (Sun, 30 Jul 2006) | 3 lines
- remove yet another reference to how commonly Tkinter is (thought to be) used
- fix an internal section reference
........
r50968 | neal.norwitz | 2006-07-30 08:53:31 +0200 (Sun, 30 Jul 2006) | 4 lines
Patch #1531113: Fix augmented assignment with yield expressions.
Also fix a SystemError when trying to assign to yield expressions.
........
r50969 | neal.norwitz | 2006-07-30 08:55:48 +0200 (Sun, 30 Jul 2006) | 5 lines
Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().
This provides the proper warning for struct.pack().
PyErr_Warn() is now deprecated in favor of PyErr_WarnEx().
As mentioned by Tim Peters on python-dev.
........
r50970 | neal.norwitz | 2006-07-30 08:57:04 +0200 (Sun, 30 Jul 2006) | 3 lines
Bug #1515471: string.replace() accepts character buffers again.
Pass the char* and size around rather than PyObject's.
........
r50971 | neal.norwitz | 2006-07-30 08:59:13 +0200 (Sun, 30 Jul 2006) | 1 line
Whitespace normalization
........
r50973 | georg.brandl | 2006-07-30 12:53:32 +0200 (Sun, 30 Jul 2006) | 3 lines
Clarify that __op__ methods must return NotImplemented if they don't support the operation.
........
r50974 | georg.brandl | 2006-07-30 13:07:23 +0200 (Sun, 30 Jul 2006) | 3 lines
Bug #1002398: The documentation for os.path.sameopenfile now correctly
refers to file descriptors, not file objects.
........
r50977 | martin.v.loewis | 2006-07-30 15:00:31 +0200 (Sun, 30 Jul 2006) | 3 lines
Don't copy directory stat times in shutil.copytree on Windows
Fixes #1525866.
........
r50978 | martin.v.loewis | 2006-07-30 15:14:05 +0200 (Sun, 30 Jul 2006) | 3 lines
Base __version__ on sys.version_info, as distutils is
no longer maintained separatedly.
........
r50979 | martin.v.loewis | 2006-07-30 15:27:31 +0200 (Sun, 30 Jul 2006) | 3 lines
Mention Cygwin in distutils error message about a missing VS 2003.
Fixes #1257728.
........
r50982 | martin.v.loewis | 2006-07-30 16:09:47 +0200 (Sun, 30 Jul 2006) | 5 lines
Drop usage of test -e in configure as it is not portable.
Fixes #1439538
Will backport to 2.4
Also regenerate pyconfig.h.in.
........
r50984 | georg.brandl | 2006-07-30 18:20:10 +0200 (Sun, 30 Jul 2006) | 3 lines
Fix makefile changes for python-config.
........
r50985 | george.yoshida | 2006-07-30 18:37:37 +0200 (Sun, 30 Jul 2006) | 2 lines
Rename struct.pack_to to struct.pack_into as changed in revision 46642.
........
r50986 | george.yoshida | 2006-07-30 18:41:30 +0200 (Sun, 30 Jul 2006) | 2 lines
Typo fix
........
r50987 | neal.norwitz | 2006-07-30 21:18:13 +0200 (Sun, 30 Jul 2006) | 1 line
Add some asserts and update comments
........
r50988 | neal.norwitz | 2006-07-30 21:18:38 +0200 (Sun, 30 Jul 2006) | 1 line
Verify that the signal handlers were really called
........
r50989 | neal.norwitz | 2006-07-30 21:20:42 +0200 (Sun, 30 Jul 2006) | 3 lines
Try to prevent hangs on Tru64/Alpha buildbot. I'm not certain this will help
and may need to be reverted if it causes problems.
........
r50990 | georg.brandl | 2006-07-30 22:18:51 +0200 (Sun, 30 Jul 2006) | 2 lines
Bug #1531349: right <-> left glitch in __rop__ description.
........
r50992 | tim.peters | 2006-07-31 03:46:03 +0200 (Mon, 31 Jul 2006) | 2 lines
Whitespace normalization.
........
r50993 | andrew.mcnamara | 2006-07-31 04:27:48 +0200 (Mon, 31 Jul 2006) | 2 lines
Redo the comment about the 2.5 change in quoted-newline handling.
........
r50994 | tim.peters | 2006-07-31 04:40:23 +0200 (Mon, 31 Jul 2006) | 10 lines
ZipFile.close(): Killed one of the struct.pack deprecation
warnings on Win32.
Also added an XXX about the line:
pos3 = self.fp.tell()
`pos3` is never referenced, and I have no idea what the code
intended to do instead.
........
r50996 | tim.peters | 2006-07-31 04:53:03 +0200 (Mon, 31 Jul 2006) | 8 lines
ZipFile.close(): Kill the other struct.pack deprecation
warning on Windows.
Afraid I can't detect a pattern to when the pack formats decide
to use a signed or unsigned format code -- appears nearly
arbitrary to my eyes. So I left all the pack formats alone and
changed the special-case data values instead.
........
r50997 | skip.montanaro | 2006-07-31 05:09:45 +0200 (Mon, 31 Jul 2006) | 1 line
minor tweaks
........
r50998 | skip.montanaro | 2006-07-31 05:11:11 +0200 (Mon, 31 Jul 2006) | 1 line
minor tweaks
........
r50999 | andrew.kuchling | 2006-07-31 14:20:24 +0200 (Mon, 31 Jul 2006) | 1 line
Add refcounts for PyErr_WarnEx
........
r51000 | andrew.kuchling | 2006-07-31 14:39:05 +0200 (Mon, 31 Jul 2006) | 9 lines
Document PyErr_WarnEx. (Bad Neal! No biscuit!)
Is the explanation of the 'stacklevel' parameter clear? Please feel free
to edit it.
I don't have LaTeX installed on this machine, so haven't verified that the
markup is correct. Will check tonight, or maybe the automatic doc build will
tell me.
........
r51001 | andrew.kuchling | 2006-07-31 14:52:26 +0200 (Mon, 31 Jul 2006) | 1 line
Add PyErr_WarnEx()
........
r51002 | andrew.kuchling | 2006-07-31 15:18:27 +0200 (Mon, 31 Jul 2006) | 1 line
Mention csv newline changes
........
r51003 | andrew.kuchling | 2006-07-31 17:22:58 +0200 (Mon, 31 Jul 2006) | 1 line
Typo fix
........
r51004 | andrew.kuchling | 2006-07-31 17:23:43 +0200 (Mon, 31 Jul 2006) | 1 line
Remove reference to notation
........
r51005 | georg.brandl | 2006-07-31 18:00:34 +0200 (Mon, 31 Jul 2006) | 3 lines
Fix function name.
........
r51006 | andrew.kuchling | 2006-07-31 18:10:24 +0200 (Mon, 31 Jul 2006) | 1 line
[Bug #1514540] Instead of putting the standard types in a section, put them in a chapter of their own. This means string methods will now show up in the ToC. (Should the types come before or after the functions+exceptions+constants chapter? I've put them after, for now.)
........
r51007 | andrew.kuchling | 2006-07-31 18:22:05 +0200 (Mon, 31 Jul 2006) | 1 line
[Bug #848556] Remove \d* from second alternative to avoid exponential case when repeating match
........
r51008 | andrew.kuchling | 2006-07-31 18:27:57 +0200 (Mon, 31 Jul 2006) | 1 line
Update list of files; fix a typo
........
r51013 | andrew.kuchling | 2006-08-01 18:24:30 +0200 (Tue, 01 Aug 2006) | 1 line
typo fix
........
r51018 | thomas.heller | 2006-08-01 18:54:43 +0200 (Tue, 01 Aug 2006) | 2 lines
Fix a potential segfault and various potentail refcount leaks
in the cast() function.
........
r51020 | thomas.heller | 2006-08-01 19:46:10 +0200 (Tue, 01 Aug 2006) | 1 line
Minimal useful docstring for CopyComPointer.
........
r51021 | andrew.kuchling | 2006-08-01 20:16:15 +0200 (Tue, 01 Aug 2006) | 8 lines
[Patch #1520905] Attempt to suppress core file created by test_subprocess.py.
Patch by Douglas Greiman.
The test_run_abort() testcase produces a core file on Unix systems,
even though the test is successful. This can be confusing or alarming
to someone who runs 'make test' and then finds that the Python
interpreter apparently crashed.
........
r51023 | georg.brandl | 2006-08-01 20:49:24 +0200 (Tue, 01 Aug 2006) | 3 lines
os.urandom no longer masks unrelated exceptions like SystemExit or
KeyboardInterrupt.
........
r51025 | thomas.heller | 2006-08-01 21:14:15 +0200 (Tue, 01 Aug 2006) | 2 lines
Speed up PyType_stgdict and PyObject_stgdict.
........
r51027 | ronald.oussoren | 2006-08-01 22:30:31 +0200 (Tue, 01 Aug 2006) | 3 lines
Make sure the postinstall action that optionally updates the user's profile
on MacOS X actually works correctly in all cases.
........
r51028 | ronald.oussoren | 2006-08-01 23:00:57 +0200 (Tue, 01 Aug 2006) | 4 lines
This fixes bug #1527397: PythonLauncher runs scripts with the wrong working
directory. It also fixes a bug where PythonLauncher failed to launch scripts
when the scriptname (or the path to the script) contains quotes.
........
r51031 | tim.peters | 2006-08-02 05:27:46 +0200 (Wed, 02 Aug 2006) | 2 lines
Whitespace normalization.
........
r51032 | tim.peters | 2006-08-02 06:12:36 +0200 (Wed, 02 Aug 2006) | 19 lines
Try to squash struct.pack warnings on the "amd64 gentoo trunk"
buildbot (& possibly other 64-bit boxes) during test_gzip.
The native zlib crc32 function returns an unsigned 32-bit integer,
which the Python wrapper implicitly casts to C long. Therefore the
same crc can "look negative" on a 32-bit box but "look positive" on
a 64-bit box. This patch papers over that platform difference when
writing the crc to file.
It may be better to change the Python wrapper, either to make
the result "look positive" on all platforms (which means it may
have to return a Python long at times on a 32-bit box), or to
keep the sign the same across boxes. But that would be a visible
change in what users see, while the current hack changes no
visible behavior (well, apart from stopping the struct deprecation
warning).
Note that the module-level write32() function is no longer used.
........
r51033 | neal.norwitz | 2006-08-02 06:27:11 +0200 (Wed, 02 Aug 2006) | 4 lines
Prevent memory leak on error.
Reported by Klocwork #36
........
r51034 | tim.peters | 2006-08-02 07:20:08 +0200 (Wed, 02 Aug 2006) | 9 lines
_Stream.close(): Try to kill struct.pack() warnings when
writing the crc to file on the "PPC64 Debian trunk" buildbot
when running test_tarfile.
This is again a case where the native zlib crc is an unsigned
32-bit int, but the Python wrapper implicitly casts it to
signed C long, so that "the sign bit looks different" on
different platforms.
........
r51035 | ronald.oussoren | 2006-08-02 08:10:10 +0200 (Wed, 02 Aug 2006) | 2 lines
Updated documentation for the script that builds the OSX installer.
........
r51036 | neal.norwitz | 2006-08-02 08:14:22 +0200 (Wed, 02 Aug 2006) | 2 lines
_PyWeakref_GetWeakrefCount() now returns a Py_ssize_t instead of long.
........
r51037 | neal.norwitz | 2006-08-02 08:15:10 +0200 (Wed, 02 Aug 2006) | 1 line
v is already checked for NULL, so just DECREF it
........
r51038 | neal.norwitz | 2006-08-02 08:19:19 +0200 (Wed, 02 Aug 2006) | 1 line
Let us know when there was a problem and the child had to kill the parent
........
r51039 | neal.norwitz | 2006-08-02 08:46:21 +0200 (Wed, 02 Aug 2006) | 5 lines
Patch #1519025 and bug #926423: If a KeyboardInterrupt occurs during
a socket operation on a socket with a timeout, the exception will be
caught correctly. Previously, the exception was not caught.
........
r51040 | neal.norwitz | 2006-08-02 09:09:32 +0200 (Wed, 02 Aug 2006) | 1 line
Add some explanation about Klocwork and Coverity static analysis
........
r51041 | anthony.baxter | 2006-08-02 09:43:09 +0200 (Wed, 02 Aug 2006) | 1 line
pre-release machinations
........
r51043 | thomas.heller | 2006-08-02 13:35:31 +0200 (Wed, 02 Aug 2006) | 4 lines
A few nore words about what ctypes does.
Document that using the wrong calling convention can also raise
'ValueError: Procedure called with the wrong number of arguments'.
........
r51045 | thomas.heller | 2006-08-02 14:00:13 +0200 (Wed, 02 Aug 2006) | 1 line
Fix a mistake.
........
r51046 | martin.v.loewis | 2006-08-02 15:53:55 +0200 (Wed, 02 Aug 2006) | 3 lines
Correction of patch #1455898: In the mbcs decoder, set final=False
for stream decoder, but final=True for the decode function.
........
r51049 | tim.peters | 2006-08-02 20:19:35 +0200 (Wed, 02 Aug 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r51079 | neal.norwitz | 2006-08-04 06:50:21 +0200 (Fri, 04 Aug 2006) | 3 lines
Bug #1531405, format_exception no longer raises an exception if
str(exception) raised an exception.
........
r51080 | neal.norwitz | 2006-08-04 06:58:47 +0200 (Fri, 04 Aug 2006) | 11 lines
Bug #1191458: tracing over for loops now produces a line event
on each iteration. I'm not positive this is the best way to handle
this. I'm also not sure that there aren't other cases where
the lnotab is generated incorrectly. It would be great if people
that use pdb or tracing could test heavily.
Also:
* Remove dead/duplicated code that wasn't used/necessary
because we already handled the docstring prior to entering the loop.
* add some debugging code into the compiler (#if 0'd out).
........
r51081 | neal.norwitz | 2006-08-04 07:09:28 +0200 (Fri, 04 Aug 2006) | 4 lines
Bug #1333982: string/number constants were inappropriately stored
in the byte code and co_consts even if they were not used, ie
immediately popped off the stack.
........
r51082 | neal.norwitz | 2006-08-04 07:12:19 +0200 (Fri, 04 Aug 2006) | 1 line
There were really two issues
........
r51084 | fred.drake | 2006-08-04 07:17:21 +0200 (Fri, 04 Aug 2006) | 1 line
SF patch #1534048 (bug #1531003): fix typo in error message
........
r51085 | gregory.p.smith | 2006-08-04 07:17:47 +0200 (Fri, 04 Aug 2006) | 3 lines
fix typos
........
r51087 | georg.brandl | 2006-08-04 08:03:53 +0200 (Fri, 04 Aug 2006) | 3 lines
Fix bug caused by first decrefing, then increfing.
........
r51109 | neil.schemenauer | 2006-08-04 18:20:30 +0200 (Fri, 04 Aug 2006) | 5 lines
Fix the 'compiler' package to generate correct code for MAKE_CLOSURE.
In the 2.5 development cycle, MAKE_CLOSURE as changed to take free
variables as a tuple rather than as individual items on the stack.
Closes patch #1534084.
........
r51110 | georg.brandl | 2006-08-04 20:03:37 +0200 (Fri, 04 Aug 2006) | 3 lines
Change fix for segfaulting property(), add a NEWS entry and a test.
........
r51111 | georg.brandl | 2006-08-04 20:07:34 +0200 (Fri, 04 Aug 2006) | 3 lines
Better fix for bug #1531405, not executing str(value) twice.
........
r51112 | thomas.heller | 2006-08-04 20:17:40 +0200 (Fri, 04 Aug 2006) | 1 line
On Windows, make PyErr_Warn an exported function again.
........
r51113 | thomas.heller | 2006-08-04 20:57:34 +0200 (Fri, 04 Aug 2006) | 4 lines
Fix #1530448 - fix ctypes build failure on solaris 10.
The '-mimpure-text' linker flag is required when linking _ctypes.so.
........
r51114 | thomas.heller | 2006-08-04 21:49:31 +0200 (Fri, 04 Aug 2006) | 3 lines
Fix #1534738: win32 debug version of _msi must be _msi_d.pyd, not _msi.pyd.
Fix the name of the pdb file as well.
........
r51115 | andrew.kuchling | 2006-08-04 22:37:43 +0200 (Fri, 04 Aug 2006) | 1 line
Typo fixes
........
r51116 | andrew.kuchling | 2006-08-04 23:10:03 +0200 (Fri, 04 Aug 2006) | 1 line
Fix mangled sentence
........
r51118 | tim.peters | 2006-08-05 00:00:35 +0200 (Sat, 05 Aug 2006) | 2 lines
Whitespace normalization.
........
r51119 | bob.ippolito | 2006-08-05 01:59:21 +0200 (Sat, 05 Aug 2006) | 5 lines
Fix #1530559, struct.pack raises TypeError where it used to convert.
Passing float arguments to struct.pack when integers are expected
now triggers a DeprecationWarning.
........
r51123 | georg.brandl | 2006-08-05 08:10:54 +0200 (Sat, 05 Aug 2006) | 3 lines
Patch #1534922: correct and enhance unittest docs.
........
r51126 | georg.brandl | 2006-08-06 09:06:33 +0200 (Sun, 06 Aug 2006) | 2 lines
Bug #1535182: really test the xreadlines() method of bz2 objects.
........
r51128 | georg.brandl | 2006-08-06 09:26:21 +0200 (Sun, 06 Aug 2006) | 4 lines
Bug #1535081: A leading underscore has been added to the names of
the md5 and sha modules, so add it in Modules/Setup.dist too.
........
r51129 | georg.brandl | 2006-08-06 10:23:54 +0200 (Sun, 06 Aug 2006) | 3 lines
Bug #1535165: fixed a segfault in input() and raw_input() when
sys.stdin is closed.
........
r51131 | georg.brandl | 2006-08-06 11:17:16 +0200 (Sun, 06 Aug 2006) | 2 lines
Don't produce output in test_builtin.
........
r51133 | andrew.macintyre | 2006-08-06 14:37:03 +0200 (Sun, 06 Aug 2006) | 4 lines
test_threading now skips testing alternate thread stack sizes on
platforms that don't support changing thread stack size.
........
r51134 | andrew.kuchling | 2006-08-07 00:07:04 +0200 (Mon, 07 Aug 2006) | 2 lines
[Patch #1464056] Ensure that we use the panelw library when linking with ncursesw.
Once I see how the buildbots react, I'll backport this to 2.4.
........
r51137 | georg.brandl | 2006-08-08 13:52:34 +0200 (Tue, 08 Aug 2006) | 3 lines
webbrowser: Silence stderr output if no gconftool or gnome browser found
........
r51138 | georg.brandl | 2006-08-08 13:56:21 +0200 (Tue, 08 Aug 2006) | 7 lines
Remove "non-mapping" and "non-sequence" from TypeErrors raised by
PyMapping_Size and PySequence_Size.
Because len() tries first sequence, then mapping size, it will always
raise a "non-mapping object has no len" error which is confusing.
........
r51139 | thomas.heller | 2006-08-08 19:37:00 +0200 (Tue, 08 Aug 2006) | 3 lines
memcmp() can return values other than -1, 0, and +1 but tp_compare
must not.
........
r51140 | thomas.heller | 2006-08-08 19:39:20 +0200 (Tue, 08 Aug 2006) | 1 line
Remove accidently committed, duplicated test.
........
r51147 | andrew.kuchling | 2006-08-08 20:50:14 +0200 (Tue, 08 Aug 2006) | 1 line
Reword paragraph to clarify
........
r51148 | andrew.kuchling | 2006-08-08 20:56:08 +0200 (Tue, 08 Aug 2006) | 1 line
Move obmalloc item into C API section
........
r51149 | andrew.kuchling | 2006-08-08 21:00:14 +0200 (Tue, 08 Aug 2006) | 1 line
'Other changes' section now has only one item; move the item elsewhere and remove the section
........
r51150 | andrew.kuchling | 2006-08-08 21:00:34 +0200 (Tue, 08 Aug 2006) | 1 line
Bump version number
........
r51151 | georg.brandl | 2006-08-08 22:11:22 +0200 (Tue, 08 Aug 2006) | 2 lines
Bug #1536828: typo: TypeType should have been StringType.
........
r51153 | georg.brandl | 2006-08-08 22:13:13 +0200 (Tue, 08 Aug 2006) | 2 lines
Bug #1536660: separate two words.
........
r51155 | georg.brandl | 2006-08-08 22:48:10 +0200 (Tue, 08 Aug 2006) | 3 lines
``str`` is now the same object as ``types.StringType``.
........
r51156 | tim.peters | 2006-08-09 02:52:26 +0200 (Wed, 09 Aug 2006) | 2 lines
Whitespace normalization.
........
r51158 | georg.brandl | 2006-08-09 09:03:22 +0200 (Wed, 09 Aug 2006) | 4 lines
Introduce an upper bound on tuple nesting depth in
C argument format strings; fixes rest of #1523610.
........
r51160 | martin.v.loewis | 2006-08-09 09:57:39 +0200 (Wed, 09 Aug 2006) | 4 lines
__hash__ may now return long int; the final hash
value is obtained by invoking hash on the long int.
Fixes #1536021.
........
r51168 | andrew.kuchling | 2006-08-09 15:03:41 +0200 (Wed, 09 Aug 2006) | 1 line
[Bug #1536021] Mention __hash__ change
........
r51169 | andrew.kuchling | 2006-08-09 15:57:05 +0200 (Wed, 09 Aug 2006) | 1 line
[Patch #1534027] Add notes on locale module changes
........
r51170 | andrew.kuchling | 2006-08-09 16:05:35 +0200 (Wed, 09 Aug 2006) | 1 line
Add missing 'self' parameters
........
r51171 | andrew.kuchling | 2006-08-09 16:06:19 +0200 (Wed, 09 Aug 2006) | 1 line
Reindent code
........
r51172 | armin.rigo | 2006-08-09 16:55:26 +0200 (Wed, 09 Aug 2006) | 2 lines
Fix and test for an infinite C recursion.
........
r51173 | ronald.oussoren | 2006-08-09 16:56:33 +0200 (Wed, 09 Aug 2006) | 2 lines
It's unlikely that future versions will require _POSIX_C_SOURCE
........
r51178 | armin.rigo | 2006-08-09 17:37:26 +0200 (Wed, 09 Aug 2006) | 2 lines
Concatenation on a long string breaks (SF #1526585).
........
r51180 | kurt.kaiser | 2006-08-09 18:46:15 +0200 (Wed, 09 Aug 2006) | 8 lines
1. When used w/o subprocess, all exceptions were preceeded by an error
message claiming they were IDLE internal errors (since 1.2a1).
2. Add Ronald Oussoren to CREDITS
M NEWS.txt
M PyShell.py
M CREDITS.txt
........
r51181 | kurt.kaiser | 2006-08-09 19:47:15 +0200 (Wed, 09 Aug 2006) | 4 lines
As a slight enhancement to the previous checkin, improve the
internal error reporting by moving message to IDLE console.
........
r51182 | andrew.kuchling | 2006-08-09 20:23:14 +0200 (Wed, 09 Aug 2006) | 1 line
Typo fix
........
r51183 | kurt.kaiser | 2006-08-09 22:34:46 +0200 (Wed, 09 Aug 2006) | 2 lines
ToggleTab dialog was setting indent to 8 even if cancelled (since 1.2a1).
........
r51184 | martin.v.loewis | 2006-08-10 01:42:18 +0200 (Thu, 10 Aug 2006) | 2 lines
Add some commentary on -mimpure-text.
........
r51185 | tim.peters | 2006-08-10 02:58:49 +0200 (Thu, 10 Aug 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r51186 | kurt.kaiser | 2006-08-10 03:41:17 +0200 (Thu, 10 Aug 2006) | 2 lines
Changing tokenize (39046) to detect dedent broke tabnanny check (since 1.2a1)
........
r51187 | tim.peters | 2006-08-10 05:01:26 +0200 (Thu, 10 Aug 2006) | 13 lines
test_copytree_simple(): This was leaving behind two new temp
directories each time it ran, at least on Windows.
Several changes: explicitly closed all files; wrapped long
lines; stopped suppressing errors when removing a file or
directory fails (removing /shouldn't/ fail!); and changed
what appeared to be incorrect usage of os.removedirs() (that
doesn't remove empty directories at and /under/ the given
path, instead it must be given an empty leaf directory and
then deletes empty directories moving /up/ the path -- could
be that the conceptually simpler shutil.rmtree() was really
actually intended here).
........
2006-08-11 14:57:12 +00:00
|
|
|
#endif /* HAVE_SYS_TYPES_H */
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SYS_STAT_H
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <sys/stat.h>
|
Merged revisions 46753-51188 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r46755 | brett.cannon | 2006-06-08 18:23:04 +0200 (Thu, 08 Jun 2006) | 4 lines
Make binascii.hexlify() use s# for its arguments instead of t# to actually
match its documentation stating it accepts any read-only buffer.
........
r46757 | brett.cannon | 2006-06-08 19:00:45 +0200 (Thu, 08 Jun 2006) | 8 lines
Buffer objects would return the read or write buffer for a wrapped object when
the char buffer was requested. Now it actually returns the char buffer if
available or raises a TypeError if it isn't (as is raised for the other buffer
types if they are not present but requested).
Not a backport candidate since it does change semantics of the buffer object
(although it could be argued this is enough of a bug to bother backporting).
........
r46760 | andrew.kuchling | 2006-06-09 03:10:17 +0200 (Fri, 09 Jun 2006) | 1 line
Update functools section
........
r46762 | tim.peters | 2006-06-09 04:11:02 +0200 (Fri, 09 Jun 2006) | 6 lines
Whitespace normalization.
Since test_file is implicated in mysterious test failures
when followed by test_optparse, if I had any brains I'd
look at the checkin that last changed test_file ;-)
........
r46763 | tim.peters | 2006-06-09 05:09:42 +0200 (Fri, 09 Jun 2006) | 5 lines
To boost morale :-), force test_optparse to run immediately
after test_file until we can figure out how to fix it.
(See python-dev; at the moment we don't even know which checkin
caused the problem.)
........
r46764 | tim.peters | 2006-06-09 05:51:41 +0200 (Fri, 09 Jun 2006) | 6 lines
AutoFileTests.tearDown(): Removed mysterious undocumented
try/except. Remove TESTFN.
Throughout: used open() instead of file(), and wrapped
long lines.
........
r46765 | tim.peters | 2006-06-09 06:02:06 +0200 (Fri, 09 Jun 2006) | 8 lines
testUnicodeOpen(): I have no idea why, but making this
test clean up after itself appears to fix the test failures
when test_optparse follows test_file.
test_main(): Get rid of TESTFN no matter what. That's
also enough to fix the mystery failures. Doesn't hurt
to fix them twice :-)
........
r46766 | tim.peters | 2006-06-09 07:12:40 +0200 (Fri, 09 Jun 2006) | 6 lines
Remove the temporary hack to force test_optparse to
run immediately after test_file. At least 8 buildbot
boxes passed since the underlying problem got fixed,
and they all failed before the fix, so there's no point
to this anymore.
........
r46767 | neal.norwitz | 2006-06-09 07:54:18 +0200 (Fri, 09 Jun 2006) | 1 line
Fix grammar and reflow
........
r46769 | andrew.kuchling | 2006-06-09 12:22:35 +0200 (Fri, 09 Jun 2006) | 1 line
Markup fix
........
r46773 | andrew.kuchling | 2006-06-09 15:15:57 +0200 (Fri, 09 Jun 2006) | 1 line
[Bug #1472827] Make saxutils.XMLGenerator handle \r\n\t in attribute values by escaping them properly. 2.4 bugfix candidate.
........
r46778 | kristjan.jonsson | 2006-06-09 18:28:01 +0200 (Fri, 09 Jun 2006) | 2 lines
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.
........
r46779 | phillip.eby | 2006-06-09 18:40:18 +0200 (Fri, 09 Jun 2006) | 2 lines
Import wsgiref into the stdlib, as of the external version 0.1-r2181.
........
r46783 | andrew.kuchling | 2006-06-09 18:44:40 +0200 (Fri, 09 Jun 2006) | 1 line
Add note about XMLGenerator bugfix
........
r46784 | andrew.kuchling | 2006-06-09 18:46:51 +0200 (Fri, 09 Jun 2006) | 1 line
Add note about wsgiref
........
r46785 | brett.cannon | 2006-06-09 19:05:48 +0200 (Fri, 09 Jun 2006) | 2 lines
Fix inconsistency in naming within an enum.
........
r46787 | tim.peters | 2006-06-09 19:47:00 +0200 (Fri, 09 Jun 2006) | 2 lines
Whitespace normalization.
........
r46792 | georg.brandl | 2006-06-09 20:29:52 +0200 (Fri, 09 Jun 2006) | 3 lines
Test file.__exit__.
........
r46794 | brett.cannon | 2006-06-09 20:40:46 +0200 (Fri, 09 Jun 2006) | 2 lines
svn:ignore .pyc and .pyo files.
........
r46795 | georg.brandl | 2006-06-09 20:45:48 +0200 (Fri, 09 Jun 2006) | 3 lines
RFE #1491485: str/unicode.endswith()/startswith() now accept a tuple as first argument.
........
r46798 | andrew.kuchling | 2006-06-09 21:03:16 +0200 (Fri, 09 Jun 2006) | 1 line
Describe startswith()/endswiith() change; add reminder about wsgiref
........
r46799 | tim.peters | 2006-06-09 21:24:44 +0200 (Fri, 09 Jun 2006) | 11 lines
Implementing a happy idea from Georg Brandl: make runtest() try to
clean up files and directories the tests often leave behind by
mistake. This is the first time in history I don't have a bogus
"db_home" directory after running the tests ;-)
Also worked on runtest's docstring, to say something about all the
arguments, and to document the non-obvious return values.
New functions runtest_inner() and cleanup_test_droppings() in
support of the above.
........
r46800 | andrew.kuchling | 2006-06-09 21:43:25 +0200 (Fri, 09 Jun 2006) | 1 line
Remove unused variable
........
r46801 | andrew.kuchling | 2006-06-09 21:56:05 +0200 (Fri, 09 Jun 2006) | 1 line
Add some wsgiref text
........
r46803 | thomas.heller | 2006-06-09 21:59:11 +0200 (Fri, 09 Jun 2006) | 1 line
set eol-style svn property
........
r46804 | thomas.heller | 2006-06-09 22:01:01 +0200 (Fri, 09 Jun 2006) | 1 line
set eol-style svn property
........
r46805 | georg.brandl | 2006-06-09 22:43:48 +0200 (Fri, 09 Jun 2006) | 3 lines
Make use of new str.startswith/endswith semantics.
Occurences in email and compiler were ignored due to backwards compat requirements.
........
r46806 | brett.cannon | 2006-06-10 00:31:23 +0200 (Sat, 10 Jun 2006) | 4 lines
An object with __call__ as an attribute, when called, will have that attribute checked for __call__ itself, and will continue to look until it finds an object without the attribute. This can lead to an infinite recursion.
Closes bug #532646, again. Will be backported.
........
r46808 | brett.cannon | 2006-06-10 00:45:54 +0200 (Sat, 10 Jun 2006) | 2 lines
Fix bug introduced in rev. 46806 by not having variable declaration at the top of a block.
........
r46812 | georg.brandl | 2006-06-10 08:40:50 +0200 (Sat, 10 Jun 2006) | 4 lines
Apply perky's fix for #1503157: "/".join([u"", u""]) raising OverflowError.
Also improve error message on overflow.
........
r46817 | martin.v.loewis | 2006-06-10 10:14:03 +0200 (Sat, 10 Jun 2006) | 2 lines
Port cygwin kill_python changes from 2.4 branch.
........
r46818 | armin.rigo | 2006-06-10 12:57:40 +0200 (Sat, 10 Jun 2006) | 4 lines
SF bug #1503294.
PyThreadState_GET() complains if the tstate is NULL, but only in debug mode.
........
r46819 | martin.v.loewis | 2006-06-10 14:23:46 +0200 (Sat, 10 Jun 2006) | 4 lines
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
........
r46820 | skip.montanaro | 2006-06-10 16:09:11 +0200 (Sat, 10 Jun 2006) | 1 line
document the class, not its initializer
........
r46821 | greg.ward | 2006-06-10 18:40:01 +0200 (Sat, 10 Jun 2006) | 4 lines
Sync with Optik docs (rev 518):
* restore "Extending optparse" section
* document ALWAYS_TYPED_ACTIONS (SF #1449311)
........
r46824 | thomas.heller | 2006-06-10 21:51:46 +0200 (Sat, 10 Jun 2006) | 8 lines
Upgrade to ctypes version 0.9.9.7.
Summary of changes:
- support for 'variable sized' data
- support for anonymous structure/union fields
- fix severe bug with certain arrays or structures containing more than 256 fields
........
r46825 | thomas.heller | 2006-06-10 21:55:36 +0200 (Sat, 10 Jun 2006) | 8 lines
Upgrade to ctypes version 0.9.9.7.
Summary of changes:
- support for 'variable sized' data
- support for anonymous structure/union fields
- fix severe bug with certain arrays or structures containing more than 256 fields
........
r46826 | fred.drake | 2006-06-10 22:01:34 +0200 (Sat, 10 Jun 2006) | 4 lines
SF patch #1303595: improve description of __builtins__, explaining how it
varies between __main__ and other modules, and strongly suggest not touching
it but using __builtin__ if absolutely necessary
........
r46827 | fred.drake | 2006-06-10 22:02:58 +0200 (Sat, 10 Jun 2006) | 1 line
credit for SF patch #1303595
........
r46831 | thomas.heller | 2006-06-10 22:29:34 +0200 (Sat, 10 Jun 2006) | 2 lines
New docs for ctypes.
........
r46834 | thomas.heller | 2006-06-10 23:07:19 +0200 (Sat, 10 Jun 2006) | 1 line
Fix a wrong printf format.
........
r46835 | thomas.heller | 2006-06-10 23:17:58 +0200 (Sat, 10 Jun 2006) | 1 line
Fix the second occurrence of the problematic printf format.
........
r46837 | thomas.heller | 2006-06-10 23:56:03 +0200 (Sat, 10 Jun 2006) | 1 line
Don't use C++ comment.
........
r46838 | thomas.heller | 2006-06-11 00:01:50 +0200 (Sun, 11 Jun 2006) | 1 line
Handle failure of PyMem_Realloc.
........
r46839 | skip.montanaro | 2006-06-11 00:38:13 +0200 (Sun, 11 Jun 2006) | 2 lines
Suppress warning on MacOSX about possible use before set of proc.
........
r46840 | tim.peters | 2006-06-11 00:51:45 +0200 (Sun, 11 Jun 2006) | 8 lines
shuffle() doscstring: Removed warning about sequence length
versus generator period. While this was a real weakness of the
older WH generator for lists with just a few dozen elements,
and so could potentially bite the naive ;-), the Twister should
show excellent behavior up to at least 600 elements.
Module docstring: reflowed some jarringly short lines.
........
r46844 | greg.ward | 2006-06-11 02:40:49 +0200 (Sun, 11 Jun 2006) | 4 lines
Bug #1361643: fix textwrap.dedent() so it handles tabs appropriately,
i.e. do *not* expand tabs, but treat them as whitespace that is not
equivalent to spaces. Add a couple of test cases. Clarify docs.
........
r46850 | neal.norwitz | 2006-06-11 07:44:18 +0200 (Sun, 11 Jun 2006) | 5 lines
Fix Coverity # 146. newDBSequenceObject would deref dbobj, so it can't be NULL.
We know it's not NULL from the ParseTuple and DbObject_Check will verify
it's not NULL.
........
r46851 | neal.norwitz | 2006-06-11 07:45:25 +0200 (Sun, 11 Jun 2006) | 4 lines
Wrap some long lines
Top/Bottom factor out some common expressions
Add a XXX comment about widing offset.
........
r46852 | neal.norwitz | 2006-06-11 07:45:47 +0200 (Sun, 11 Jun 2006) | 1 line
Add versionadded to doc
........
r46853 | neal.norwitz | 2006-06-11 07:47:14 +0200 (Sun, 11 Jun 2006) | 3 lines
Update doc to make it agree with code.
Bottom factor out some common code.
........
r46854 | neal.norwitz | 2006-06-11 07:48:14 +0200 (Sun, 11 Jun 2006) | 3 lines
f_code can't be NULL based on Frame_New and other code that derefs it.
So there doesn't seem to be much point to checking here.
........
r46855 | neal.norwitz | 2006-06-11 09:26:27 +0200 (Sun, 11 Jun 2006) | 1 line
Fix errors found by pychecker
........
r46856 | neal.norwitz | 2006-06-11 09:26:50 +0200 (Sun, 11 Jun 2006) | 1 line
warnings was imported at module scope, no need to import again
........
r46857 | neal.norwitz | 2006-06-11 09:27:56 +0200 (Sun, 11 Jun 2006) | 5 lines
Fix errors found by pychecker.
I think these changes are correct, but I'm not sure. Could someone
who knows how this module works test it? It can at least start on
the cmd line.
........
r46858 | neal.norwitz | 2006-06-11 10:35:14 +0200 (Sun, 11 Jun 2006) | 1 line
Fix errors found by pychecker
........
r46859 | ronald.oussoren | 2006-06-11 16:33:36 +0200 (Sun, 11 Jun 2006) | 4 lines
This patch improves the L&F of IDLE on OSX. The changes are conditionalized on
being in an IDLE.app bundle on darwin. This does a slight reorganisation of the
menus and adds support for file-open events.
........
r46860 | greg.ward | 2006-06-11 16:42:41 +0200 (Sun, 11 Jun 2006) | 1 line
SF #1366250: optparse docs: fix inconsistency in variable name; minor tweaks.
........
r46861 | greg.ward | 2006-06-11 18:24:11 +0200 (Sun, 11 Jun 2006) | 3 lines
Bug #1498146: fix optparse to handle Unicode strings in option help,
description, and epilog.
........
r46862 | thomas.heller | 2006-06-11 19:04:22 +0200 (Sun, 11 Jun 2006) | 2 lines
Release the GIL during COM method calls, to avoid deadlocks in
Python coded COM objects.
........
r46863 | tim.peters | 2006-06-11 21:42:51 +0200 (Sun, 11 Jun 2006) | 2 lines
Whitespace normalization.
........
r46864 | tim.peters | 2006-06-11 21:43:49 +0200 (Sun, 11 Jun 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46865 | ronald.oussoren | 2006-06-11 21:45:57 +0200 (Sun, 11 Jun 2006) | 2 lines
Remove message about using make frameworkinstall, that's no longer necesssary
........
r46866 | ronald.oussoren | 2006-06-11 22:23:29 +0200 (Sun, 11 Jun 2006) | 2 lines
Use configure to substitute the correct prefix instead of hardcoding
........
r46867 | ronald.oussoren | 2006-06-11 22:24:45 +0200 (Sun, 11 Jun 2006) | 4 lines
- Change fixapplepython23.py to ensure that it will run with /usr/bin/python
on intel macs.
- Fix some minor problems in the installer for OSX
........
r46868 | neal.norwitz | 2006-06-11 22:25:56 +0200 (Sun, 11 Jun 2006) | 5 lines
Try to fix several networking tests. The problem is that if hosts have
a search path setup, some of these hosts resolve to the wrong address.
By appending a period to the hostname, the hostname should only resolve
to what we want it to resolve to. Hopefully this doesn't break different bots.
........
r46869 | neal.norwitz | 2006-06-11 22:42:02 +0200 (Sun, 11 Jun 2006) | 7 lines
Try to fix another networking test. The problem is that if hosts have
a search path setup, some of these hosts resolve to the wrong address.
By appending a period to the hostname, the hostname should only resolve
to what we want it to resolve to. Hopefully this doesn't break different bots.
Also add more info to failure message to aid debugging test failure.
........
r46870 | neal.norwitz | 2006-06-11 22:46:46 +0200 (Sun, 11 Jun 2006) | 4 lines
Fix test on PPC64 buildbot. It raised an IOError (really an URLError which
derives from an IOError). That seems valid. Env Error includes both OSError
and IOError, so this seems like a reasonable fix.
........
r46871 | tim.peters | 2006-06-11 22:52:59 +0200 (Sun, 11 Jun 2006) | 10 lines
compare_generic_iter(): Fixed the failure of test_wsgiref's testFileWrapper
when running with -O.
test_simple_validation_error still fails under -O. That appears to be because
wsgiref's validate.py uses `assert` statements all over the place to check
arguments for sanity. That should all be changed (it's not a logical error
in the software if a user passes bogus arguments, so this isn't a reasonable
use for `assert` -- checking external preconditions should generally raise
ValueError or TypeError instead, as appropriate).
........
r46872 | neal.norwitz | 2006-06-11 23:38:38 +0200 (Sun, 11 Jun 2006) | 1 line
Get test to pass on S/390. Shout if you think this change is incorrect.
........
r46873 | neal.norwitz | 2006-06-12 04:05:55 +0200 (Mon, 12 Jun 2006) | 1 line
Cleanup Py_ssize_t a little (get rid of second #ifdef)
........
r46874 | neal.norwitz | 2006-06-12 04:06:17 +0200 (Mon, 12 Jun 2006) | 1 line
Fix some Py_ssize_t issues
........
r46875 | neal.norwitz | 2006-06-12 04:06:42 +0200 (Mon, 12 Jun 2006) | 1 line
Fix some Py_ssize_t issues
........
r46876 | neal.norwitz | 2006-06-12 04:07:24 +0200 (Mon, 12 Jun 2006) | 2 lines
Cleanup: Remove import of types to get StringTypes, we can just use basestring.
........
r46877 | neal.norwitz | 2006-06-12 04:07:57 +0200 (Mon, 12 Jun 2006) | 1 line
Don't truncate if size_t is bigger than uint
........
r46878 | neal.norwitz | 2006-06-12 04:08:41 +0200 (Mon, 12 Jun 2006) | 1 line
Don't leak the list object if there's an error allocating the item storage. Backport candidate
........
r46879 | neal.norwitz | 2006-06-12 04:09:03 +0200 (Mon, 12 Jun 2006) | 1 line
Fix typo. Backport if anyone cares. :-)
........
r46880 | neal.norwitz | 2006-06-12 04:09:34 +0200 (Mon, 12 Jun 2006) | 1 line
Fix indentation of case and a Py_ssize_t issue.
........
r46881 | neal.norwitz | 2006-06-12 04:11:18 +0200 (Mon, 12 Jun 2006) | 3 lines
Get rid of f_restricted too. Doc the other 4 ints that were already removed
at the NeedForSpeed sprint.
........
r46882 | neal.norwitz | 2006-06-12 04:13:21 +0200 (Mon, 12 Jun 2006) | 1 line
Fix the socket tests so they can be run concurrently. Backport candidate
........
r46883 | neal.norwitz | 2006-06-12 04:16:10 +0200 (Mon, 12 Jun 2006) | 1 line
i and j are initialized below when used. No need to do it twice
........
r46884 | neal.norwitz | 2006-06-12 05:05:03 +0200 (Mon, 12 Jun 2006) | 1 line
Remove unused import
........
r46885 | neal.norwitz | 2006-06-12 05:05:40 +0200 (Mon, 12 Jun 2006) | 1 line
Impl ssize_t
........
r46886 | neal.norwitz | 2006-06-12 05:33:09 +0200 (Mon, 12 Jun 2006) | 6 lines
Patch #1503046, Conditional compilation of zlib.(de)compressobj.copy
copy is only in newer versions of zlib. This should allow zlibmodule
to work with older versions like the Tru64 buildbot.
........
r46887 | phillip.eby | 2006-06-12 06:04:32 +0200 (Mon, 12 Jun 2006) | 2 lines
Sync w/external release 0.1.2. Please see PEP 360 before making changes to external packages.
........
r46888 | martin.v.loewis | 2006-06-12 06:26:31 +0200 (Mon, 12 Jun 2006) | 2 lines
Get rid of function pointer cast.
........
r46889 | thomas.heller | 2006-06-12 08:05:57 +0200 (Mon, 12 Jun 2006) | 3 lines
I don't know how that happend, but the entire file contents was
duplicated. Thanks to Simon Percivall for the heads up.
........
r46890 | nick.coghlan | 2006-06-12 10:19:37 +0200 (Mon, 12 Jun 2006) | 1 line
Fix site module docstring to match the code
........
r46891 | nick.coghlan | 2006-06-12 10:23:02 +0200 (Mon, 12 Jun 2006) | 1 line
Fix site module docstring to match the code for Mac OSX, too
........
r46892 | nick.coghlan | 2006-06-12 10:27:13 +0200 (Mon, 12 Jun 2006) | 1 line
The site module documentation also described the Windows behaviour incorrectly.
........
r46893 | nick.coghlan | 2006-06-12 12:17:11 +0200 (Mon, 12 Jun 2006) | 1 line
Make the -m switch conform to the documentation of sys.path by behaving like the -c switch
........
r46894 | kristjan.jonsson | 2006-06-12 17:45:12 +0200 (Mon, 12 Jun 2006) | 2 lines
Fix the CRT argument error handling for VisualStudio .NET 2005. Install a CRT error handler and disable the assertion for debug builds. This causes CRT to set errno to EINVAL.
This update fixes crash cases in the test suite where the default CRT error handler would cause process exit.
........
r46899 | thomas.heller | 2006-06-12 22:56:48 +0200 (Mon, 12 Jun 2006) | 1 line
Add pep-291 compatibility markers.
........
r46901 | ka-ping.yee | 2006-06-13 01:47:52 +0200 (Tue, 13 Jun 2006) | 5 lines
Add the uuid module.
This module has been tested so far on Windows XP (Python 2.4 and 2.5a2),
Mac OS X (Python 2.3, 2.4, and 2.5a2), and Linux (Python 2.4 and 2.5a2).
........
r46902 | tim.peters | 2006-06-13 02:30:01 +0200 (Tue, 13 Jun 2006) | 2 lines
Whitespace normalization.
........
r46903 | tim.peters | 2006-06-13 02:30:50 +0200 (Tue, 13 Jun 2006) | 2 lines
Added missing svn:eol-style property to text files.
........
r46905 | tim.peters | 2006-06-13 05:30:07 +0200 (Tue, 13 Jun 2006) | 5 lines
get_matching_blocks(): rewrote code & comments so they match; added
more comments about why it's this way at all; and removed what looked
like needless expense (sorting (i, j, k) triples directly should give
exactly the same order as sorting (i, (i, j, k)) pairs).
........
r46906 | neal.norwitz | 2006-06-13 06:08:53 +0200 (Tue, 13 Jun 2006) | 1 line
Don't fail if another process is listening on our port.
........
r46908 | neal.norwitz | 2006-06-13 10:28:19 +0200 (Tue, 13 Jun 2006) | 2 lines
Initialize the type object so pychecker can't crash the interpreter.
........
r46909 | neal.norwitz | 2006-06-13 10:41:06 +0200 (Tue, 13 Jun 2006) | 1 line
Verify the crash due to EncodingMap not initialized does not return
........
r46910 | thomas.heller | 2006-06-13 10:56:14 +0200 (Tue, 13 Jun 2006) | 3 lines
Add some windows datatypes that were missing from this file, and add
the aliases defined in windows header files for the structures.
........
r46911 | thomas.heller | 2006-06-13 11:40:14 +0200 (Tue, 13 Jun 2006) | 3 lines
Add back WCHAR, UINT, DOUBLE, _LARGE_INTEGER, _ULARGE_INTEGER.
VARIANT_BOOL is a special _ctypes data type, not c_short.
........
r46912 | ronald.oussoren | 2006-06-13 13:19:56 +0200 (Tue, 13 Jun 2006) | 4 lines
Linecache contains support for PEP302 loaders, but fails to deal with loaders
that return None to indicate that the module is valid but no source is
available. This patch fixes that.
........
r46913 | andrew.kuchling | 2006-06-13 13:57:04 +0200 (Tue, 13 Jun 2006) | 1 line
Mention uuid module
........
r46915 | walter.doerwald | 2006-06-13 14:02:12 +0200 (Tue, 13 Jun 2006) | 2 lines
Fix passing errors to the encoder and decoder functions.
........
r46917 | walter.doerwald | 2006-06-13 14:04:43 +0200 (Tue, 13 Jun 2006) | 3 lines
errors is an attribute in the incremental decoder
not an argument.
........
r46919 | andrew.macintyre | 2006-06-13 17:04:24 +0200 (Tue, 13 Jun 2006) | 11 lines
Patch #1454481: Make thread stack size runtime tunable.
Heavily revised, comprising revisions:
46640 - original trunk revision (backed out in r46655)
46647 - markup fix (backed out in r46655)
46692:46918 merged from branch aimacintyre-sf1454481
branch tested on buildbots (Windows buildbots had problems
not related to these changes).
........
r46920 | brett.cannon | 2006-06-13 18:06:55 +0200 (Tue, 13 Jun 2006) | 2 lines
Remove unused variable.
........
r46921 | andrew.kuchling | 2006-06-13 18:41:41 +0200 (Tue, 13 Jun 2006) | 1 line
Add ability to set stack size
........
r46923 | marc-andre.lemburg | 2006-06-13 19:04:26 +0200 (Tue, 13 Jun 2006) | 2 lines
Update pybench to version 2.0.
........
r46924 | marc-andre.lemburg | 2006-06-13 19:07:14 +0200 (Tue, 13 Jun 2006) | 2 lines
Revert wrong svn copy.
........
r46925 | andrew.macintyre | 2006-06-13 19:14:36 +0200 (Tue, 13 Jun 2006) | 2 lines
fix exception usage
........
r46927 | tim.peters | 2006-06-13 20:37:07 +0200 (Tue, 13 Jun 2006) | 2 lines
Whitespace normalization.
........
r46928 | marc-andre.lemburg | 2006-06-13 20:56:56 +0200 (Tue, 13 Jun 2006) | 9 lines
Updated to pybench 2.0.
See svn.python.org/external/pybench-2.0 for the original import of that
version.
Note that platform.py was not copied over from pybench-2.0 since
it is already part of Python 2.5.
........
r46929 | andrew.macintyre | 2006-06-13 21:02:35 +0200 (Tue, 13 Jun 2006) | 5 lines
Increase the small thread stack size to get the test
to pass reliably on the one buildbot that insists on
more than 32kB of thread stack.
........
r46930 | marc-andre.lemburg | 2006-06-13 21:20:07 +0200 (Tue, 13 Jun 2006) | 2 lines
Whitespace normalization.
........
r46931 | thomas.heller | 2006-06-13 22:18:43 +0200 (Tue, 13 Jun 2006) | 2 lines
More docs for ctypes.
........
r46932 | brett.cannon | 2006-06-13 23:34:24 +0200 (Tue, 13 Jun 2006) | 2 lines
Ignore .pyc and .pyo files in Pybench.
........
r46933 | brett.cannon | 2006-06-13 23:46:41 +0200 (Tue, 13 Jun 2006) | 7 lines
If a classic class defined a __coerce__() method that just returned its two
arguments in reverse, the interpreter would infinitely recourse trying to get a
coercion that worked. So put in a recursion check after a coercion is made and
the next call to attempt to use the coerced values.
Fixes bug #992017 and closes crashers/coerce.py .
........
r46936 | gerhard.haering | 2006-06-14 00:24:47 +0200 (Wed, 14 Jun 2006) | 3 lines
Merged changes from external pysqlite 2.3.0 release. Documentation updates will
follow in a few hours at the latest. Then we should be ready for beta1.
........
r46937 | brett.cannon | 2006-06-14 00:26:13 +0200 (Wed, 14 Jun 2006) | 2 lines
Missed test for rev. 46933; infinite recursion from __coerce__() returning its arguments reversed.
........
r46938 | gerhard.haering | 2006-06-14 00:53:48 +0200 (Wed, 14 Jun 2006) | 2 lines
Updated documentation for pysqlite 2.3.0 API.
........
r46939 | tim.peters | 2006-06-14 06:09:25 +0200 (Wed, 14 Jun 2006) | 10 lines
SequenceMatcher.get_matching_blocks(): This now guarantees that
adjacent triples in the result list describe non-adjacent matching
blocks. That's _nice_ to have, and Guido said he wanted it.
Not a bugfix candidate: Guido or not ;-), this changes visible
endcase semantics (note that some tests had to change), and
nothing about this was documented before. Since it was working
as designed, and behavior was consistent with the docs, it wasn't
"a bug".
........
r46940 | tim.peters | 2006-06-14 06:13:00 +0200 (Wed, 14 Jun 2006) | 2 lines
Repaired typo in new comment.
........
r46941 | tim.peters | 2006-06-14 06:15:27 +0200 (Wed, 14 Jun 2006) | 2 lines
Whitespace normalization.
........
r46942 | fred.drake | 2006-06-14 06:25:02 +0200 (Wed, 14 Jun 2006) | 3 lines
- make some disabled tests run what they intend when enabled
- remove some over-zealous triple-quoting
........
r46943 | fred.drake | 2006-06-14 07:04:47 +0200 (Wed, 14 Jun 2006) | 3 lines
add tests for two cases that are handled correctly in the current code,
but that SF patch 1504676 as written mis-handles
........
r46944 | fred.drake | 2006-06-14 07:15:51 +0200 (Wed, 14 Jun 2006) | 1 line
explain an XXX in more detail
........
r46945 | martin.v.loewis | 2006-06-14 07:21:04 +0200 (Wed, 14 Jun 2006) | 1 line
Patch #1455898: Incremental mode for "mbcs" codec.
........
r46946 | georg.brandl | 2006-06-14 08:08:31 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1339007: Shelf objects now don't raise an exception in their
__del__ method when initialization failed.
........
r46948 | thomas.heller | 2006-06-14 08:18:15 +0200 (Wed, 14 Jun 2006) | 1 line
Fix docstring.
........
r46949 | georg.brandl | 2006-06-14 08:29:07 +0200 (Wed, 14 Jun 2006) | 2 lines
Bug #1501122: mention __gt__ &co in description of comparison order.
........
r46951 | thomas.heller | 2006-06-14 09:08:38 +0200 (Wed, 14 Jun 2006) | 1 line
Write more docs.
........
r46952 | georg.brandl | 2006-06-14 10:31:39 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1153163: describe __add__ vs __radd__ behavior when adding
objects of same type/of subclasses of the other.
........
r46954 | georg.brandl | 2006-06-14 10:42:11 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1202018: add some common mime.types locations.
........
r46955 | georg.brandl | 2006-06-14 10:50:03 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1117556: SimpleHTTPServer now tries to find and use the system's
mime.types file for determining MIME types.
........
r46957 | thomas.heller | 2006-06-14 11:09:08 +0200 (Wed, 14 Jun 2006) | 1 line
Document paramflags.
........
r46958 | thomas.heller | 2006-06-14 11:20:11 +0200 (Wed, 14 Jun 2006) | 1 line
Add an __all__ list, since this module does 'from ctypes import *'.
........
r46959 | andrew.kuchling | 2006-06-14 15:59:15 +0200 (Wed, 14 Jun 2006) | 1 line
Add item
........
r46961 | georg.brandl | 2006-06-14 18:46:43 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #805015: doc error in PyUnicode_FromEncodedObject.
........
r46962 | gerhard.haering | 2006-06-15 00:28:37 +0200 (Thu, 15 Jun 2006) | 10 lines
- Added version checks in C code to make sure we don't trigger bugs in older
SQLite versions.
- Added version checks in test suite so that we don't execute tests that we
know will fail with older (buggy) SQLite versions.
Now, all tests should run against all SQLite versions from 3.0.8 until 3.3.6
(latest one now). The sqlite3 module can be built against all these SQLite
versions and the sqlite3 module does its best to not trigger bugs in SQLite,
but using SQLite 3.3.3 or later is recommended.
........
r46963 | tim.peters | 2006-06-15 00:38:13 +0200 (Thu, 15 Jun 2006) | 2 lines
Whitespace normalization.
........
r46964 | neal.norwitz | 2006-06-15 06:54:29 +0200 (Thu, 15 Jun 2006) | 9 lines
Speculative checkin (requires approval of Gerhard Haering)
This backs out the test changes in 46962 which prevented crashes
by not running the tests via a version check. All the version checks
added in that rev were removed from the tests.
Code was added to the error handler in connection.c that seems
to work with older versions of sqlite including 3.1.3.
........
r46965 | neal.norwitz | 2006-06-15 07:55:49 +0200 (Thu, 15 Jun 2006) | 1 line
Try to narrow window of failure on slow/busy boxes (ppc64 buildbot)
........
r46966 | martin.v.loewis | 2006-06-15 08:45:05 +0200 (Thu, 15 Jun 2006) | 2 lines
Make import/lookup of mbcs fail on non-Windows systems.
........
r46967 | ronald.oussoren | 2006-06-15 10:14:18 +0200 (Thu, 15 Jun 2006) | 2 lines
Patch #1446489 (zipfile: support for ZIP64)
........
r46968 | neal.norwitz | 2006-06-15 10:16:44 +0200 (Thu, 15 Jun 2006) | 6 lines
Re-revert this change. Install the version check and don't run the test
until Gerhard has time to fully debug the issue. This affects versions
before 3.2.1 (possibly only versions earlier than 3.1.3).
Based on discussion on python-checkins.
........
r46969 | gregory.p.smith | 2006-06-15 10:52:32 +0200 (Thu, 15 Jun 2006) | 6 lines
- bsddb: multithreaded DB access using the simple bsddb module interface
now works reliably. It has been updated to use automatic BerkeleyDB
deadlock detection and the bsddb.dbutils.DeadlockWrap wrapper to retry
database calls that would previously deadlock. [SF python bug #775414]
........
r46970 | gregory.p.smith | 2006-06-15 11:23:52 +0200 (Thu, 15 Jun 2006) | 2 lines
minor documentation cleanup. mention the bsddb.db interface explicitly by name.
........
r46971 | neal.norwitz | 2006-06-15 11:57:03 +0200 (Thu, 15 Jun 2006) | 5 lines
Steal the trick from test_compiler to print out a slow msg.
This will hopefully get the buildbots to pass. Not sure this
test will be feasible or even work. But everything is red now,
so it can't get much worse.
........
r46972 | neal.norwitz | 2006-06-15 12:24:49 +0200 (Thu, 15 Jun 2006) | 1 line
Print some more info to get an idea of how much longer the test will last
........
r46981 | tim.peters | 2006-06-15 20:04:40 +0200 (Thu, 15 Jun 2006) | 6 lines
Try to reduce the extreme peak memory and disk-space use
of this test. It probably still requires more disk space
than most buildbots have, and in any case is still so
intrusive that if we don't find another way to test this I'm
taking my buildbot offline permanently ;-)
........
r46982 | tim.peters | 2006-06-15 20:06:29 +0200 (Thu, 15 Jun 2006) | 2 lines
Whitespace normalization.
........
r46983 | tim.peters | 2006-06-15 20:07:28 +0200 (Thu, 15 Jun 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46984 | tim.peters | 2006-06-15 20:38:19 +0200 (Thu, 15 Jun 2006) | 2 lines
Oops -- I introduced an off-by-6436159488 error.
........
r46990 | neal.norwitz | 2006-06-16 06:30:34 +0200 (Fri, 16 Jun 2006) | 1 line
Disable this test until we can determine what to do about it
........
r46991 | neal.norwitz | 2006-06-16 06:31:06 +0200 (Fri, 16 Jun 2006) | 1 line
Param name is dir, not directory. Update docstring. Backport candidate
........
r46992 | neal.norwitz | 2006-06-16 06:31:28 +0200 (Fri, 16 Jun 2006) | 1 line
Add missing period in comment.
........
r46993 | neal.norwitz | 2006-06-16 06:32:43 +0200 (Fri, 16 Jun 2006) | 1 line
Fix whitespace, there are memory leaks in this module.
........
r46995 | fred.drake | 2006-06-17 01:45:06 +0200 (Sat, 17 Jun 2006) | 3 lines
SF patch 1504676: Make sgmllib char and entity references pluggable
(implementation/tests contributed by Sam Ruby)
........
r46996 | fred.drake | 2006-06-17 03:07:54 +0200 (Sat, 17 Jun 2006) | 1 line
fix change that broke the htmllib tests
........
r46998 | martin.v.loewis | 2006-06-17 11:15:14 +0200 (Sat, 17 Jun 2006) | 3 lines
Patch #763580: Add name and value arguments to
Tkinter variable classes.
........
r46999 | martin.v.loewis | 2006-06-17 11:20:41 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #1096231: Add default argument to wm_iconbitmap.
........
r47000 | martin.v.loewis | 2006-06-17 11:25:15 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #1494750: Destroy master after deleting children.
........
r47003 | george.yoshida | 2006-06-17 18:31:52 +0200 (Sat, 17 Jun 2006) | 2 lines
markup fix
........
r47005 | george.yoshida | 2006-06-17 18:39:13 +0200 (Sat, 17 Jun 2006) | 4 lines
Update url.
Old url returned status code:301 Moved permanently.
........
r47007 | martin.v.loewis | 2006-06-17 20:44:27 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #812986: Update the canvas even if not tracing.
........
r47008 | martin.v.loewis | 2006-06-17 21:03:26 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #815924: Restore ability to pass type= and icon=
........
r47009 | neal.norwitz | 2006-06-18 00:37:45 +0200 (Sun, 18 Jun 2006) | 1 line
Fix typo in docstring
........
r47010 | neal.norwitz | 2006-06-18 00:38:15 +0200 (Sun, 18 Jun 2006) | 1 line
Fix memory leak reported by valgrind while running test_subprocess
........
r47011 | fred.drake | 2006-06-18 04:57:35 +0200 (Sun, 18 Jun 2006) | 1 line
remove unnecessary markup
........
r47013 | neal.norwitz | 2006-06-18 21:35:01 +0200 (Sun, 18 Jun 2006) | 7 lines
Prevent spurious leaks when running regrtest.py -R. There may be more
issues that crop up from time to time, but this change seems to have been
pretty stable (no spurious warnings) for about a week.
Other modules which use threads may require similar use of
threading_setup/threading_cleanup from test_support.
........
r47014 | neal.norwitz | 2006-06-18 21:37:40 +0200 (Sun, 18 Jun 2006) | 9 lines
The hppa ubuntu box sometimes hangs forever in these tests. My guess
is that the wait is failing for some reason. Use WNOHANG, so we won't
wait until the buildbot kills the test suite.
I haven't been able to reproduce the failure, so I'm not sure if
this will help or not. Hopefully, this change will cause the test
to fail, rather than hang. That will be better since we will get
the rest of the test results. It may also help us debug the real problem.
........
r47015 | neal.norwitz | 2006-06-18 22:10:24 +0200 (Sun, 18 Jun 2006) | 1 line
Revert 47014 until it is more robust
........
r47016 | thomas.heller | 2006-06-18 23:27:04 +0200 (Sun, 18 Jun 2006) | 6 lines
Fix typos.
Fix doctest example.
Mention in the tutorial that 'errcheck' is explained in the ref manual.
Use better wording in some places.
Remoce code examples that shouldn't be in the tutorial.
Remove some XXX notices.
........
r47017 | georg.brandl | 2006-06-19 00:17:29 +0200 (Mon, 19 Jun 2006) | 3 lines
Patch #1507676: improve exception messages in abstract.c, object.c and typeobject.c.
........
r47018 | neal.norwitz | 2006-06-19 07:40:44 +0200 (Mon, 19 Jun 2006) | 1 line
Use Py_ssize_t
........
r47019 | georg.brandl | 2006-06-19 08:35:54 +0200 (Mon, 19 Jun 2006) | 3 lines
Add news entry about error msg improvement.
........
r47020 | thomas.heller | 2006-06-19 09:07:49 +0200 (Mon, 19 Jun 2006) | 2 lines
Try to repair the failing test on the OpenBSD buildbot. Trial and error...
........
r47021 | tim.peters | 2006-06-19 09:45:16 +0200 (Mon, 19 Jun 2006) | 2 lines
Whitespace normalization.
........
r47022 | walter.doerwald | 2006-06-19 10:07:50 +0200 (Mon, 19 Jun 2006) | 4 lines
Patch #1506645: add Python wrappers for the curses functions
is_term_resized, resize_term and resizeterm. This uses three
separate configure checks (one for each function).
........
r47023 | walter.doerwald | 2006-06-19 10:14:09 +0200 (Mon, 19 Jun 2006) | 2 lines
Make check order match in configure and configure.in.
........
r47024 | tim.peters | 2006-06-19 10:14:28 +0200 (Mon, 19 Jun 2006) | 3 lines
Repair KeyError when running test_threaded_import under -R,
as reported by Neal on python-dev.
........
r47025 | thomas.heller | 2006-06-19 10:32:46 +0200 (Mon, 19 Jun 2006) | 3 lines
Next try to fix the OpenBSD buildbot tests:
Use ctypes.util.find_library to locate the C runtime library
on platforms where is returns useful results.
........
r47026 | tim.peters | 2006-06-19 11:09:44 +0200 (Mon, 19 Jun 2006) | 13 lines
TestHelp.make_parser(): This was making a permanent change to
os.environ (setting envar COLUMNS), which at least caused
test_float_default() to fail if the tests were run more than once.
This repairs the test_optparse -R failures Neal reported on
python-dev. It also explains some seemingly bizarre test_optparse
failures we saw a couple weeks ago on the buildbots, when
test_optparse failed due to test_file failing to clean up after
itself, and then test_optparse failed in an entirely different
way when regrtest's -w option ran test_optparse a second time.
It's now obvious that make_parser() permanently changing os.environ
was responsible for the second half of that.
........
r47027 | anthony.baxter | 2006-06-19 14:04:15 +0200 (Mon, 19 Jun 2006) | 2 lines
Preparing for 2.5b1.
........
r47029 | fred.drake | 2006-06-19 19:31:16 +0200 (Mon, 19 Jun 2006) | 1 line
remove non-working document formats from edist
........
r47030 | gerhard.haering | 2006-06-19 23:17:35 +0200 (Mon, 19 Jun 2006) | 5 lines
Fixed a memory leak that was introduced with incorrect usage of the Python weak
reference API in pysqlite 2.2.1.
Bumbed pysqlite version number to upcoming pysqlite 2.3.1 release.
........
r47032 | ka-ping.yee | 2006-06-20 00:49:36 +0200 (Tue, 20 Jun 2006) | 2 lines
Remove Python 2.3 compatibility comment.
........
r47033 | trent.mick | 2006-06-20 01:21:25 +0200 (Tue, 20 Jun 2006) | 2 lines
Upgrade pyexpat to expat 2.0.0 (http://python.org/sf/1462338).
........
r47034 | trent.mick | 2006-06-20 01:57:41 +0200 (Tue, 20 Jun 2006) | 3 lines
[ 1295808 ] expat symbols should be namespaced in pyexpat
(http://python.org/sf/1295808)
........
r47039 | andrew.kuchling | 2006-06-20 13:52:16 +0200 (Tue, 20 Jun 2006) | 1 line
Uncomment wsgiref section
........
r47040 | andrew.kuchling | 2006-06-20 14:15:09 +0200 (Tue, 20 Jun 2006) | 1 line
Add four library items
........
r47041 | andrew.kuchling | 2006-06-20 14:19:54 +0200 (Tue, 20 Jun 2006) | 1 line
Terminology and typography fixes
........
r47042 | andrew.kuchling | 2006-06-20 15:05:12 +0200 (Tue, 20 Jun 2006) | 1 line
Add introductory paragraphs summarizing the release; minor edits
........
r47043 | andrew.kuchling | 2006-06-20 15:11:29 +0200 (Tue, 20 Jun 2006) | 1 line
Minor edits and rearrangements; markup fix
........
r47044 | andrew.kuchling | 2006-06-20 15:20:30 +0200 (Tue, 20 Jun 2006) | 1 line
[Bug #1504456] Mention xml -> xmlcore change
........
r47047 | brett.cannon | 2006-06-20 19:30:26 +0200 (Tue, 20 Jun 2006) | 2 lines
Raise TestSkipped when the test socket connection is refused.
........
r47049 | brett.cannon | 2006-06-20 21:20:17 +0200 (Tue, 20 Jun 2006) | 2 lines
Fix typo of exception name.
........
r47053 | brett.cannon | 2006-06-21 18:57:57 +0200 (Wed, 21 Jun 2006) | 5 lines
At the C level, tuple arguments are passed in directly to the exception
constructor, meaning it is treated as *args, not as a single argument. This
means using the 'message' attribute won't work (until Py3K comes around),
and so one must grab from 'arg' to get the error number.
........
r47054 | andrew.kuchling | 2006-06-21 19:10:18 +0200 (Wed, 21 Jun 2006) | 1 line
Link to LibRef module documentation
........
r47055 | andrew.kuchling | 2006-06-21 19:17:10 +0200 (Wed, 21 Jun 2006) | 1 line
Note some of Barry's work
........
r47056 | andrew.kuchling | 2006-06-21 19:17:28 +0200 (Wed, 21 Jun 2006) | 1 line
Bump version
........
r47057 | georg.brandl | 2006-06-21 19:45:17 +0200 (Wed, 21 Jun 2006) | 3 lines
fix [ 1509132 ] compiler module builds incorrect AST for TryExceptFinally
........
r47058 | georg.brandl | 2006-06-21 19:52:36 +0200 (Wed, 21 Jun 2006) | 3 lines
Make test_fcntl aware of netbsd3.
........
r47059 | georg.brandl | 2006-06-21 19:53:17 +0200 (Wed, 21 Jun 2006) | 3 lines
Patch #1509001: expected skips for netbsd3.
........
r47060 | gerhard.haering | 2006-06-21 22:55:04 +0200 (Wed, 21 Jun 2006) | 2 lines
Removed call to enable_callback_tracebacks that slipped in by accident.
........
r47061 | armin.rigo | 2006-06-21 23:58:50 +0200 (Wed, 21 Jun 2006) | 13 lines
Fix for an obscure bug introduced by revs 46806 and 46808, with a test.
The problem of checking too eagerly for recursive calls is the
following: if a RuntimeError is caused by recursion, and if code needs
to normalize it immediately (as in the 2nd test), then
PyErr_NormalizeException() needs a call to the RuntimeError class to
instantiate it, and this hits the recursion limit again... causing
PyErr_NormalizeException() to never finish.
Moved this particular recursion check to slot_tp_call(), which is not
involved in instantiating built-in exceptions.
Backport candidate.
........
r47064 | neal.norwitz | 2006-06-22 08:30:50 +0200 (Thu, 22 Jun 2006) | 3 lines
Copy the wsgiref package during make install.
........
r47065 | neal.norwitz | 2006-06-22 08:35:30 +0200 (Thu, 22 Jun 2006) | 1 line
Reset the doc date to today for the automatic doc builds
........
r47067 | andrew.kuchling | 2006-06-22 15:10:23 +0200 (Thu, 22 Jun 2006) | 1 line
Mention how to suppress warnings
........
r47069 | georg.brandl | 2006-06-22 16:46:17 +0200 (Thu, 22 Jun 2006) | 3 lines
Set lineno correctly on list, tuple and dict literals.
........
r47070 | georg.brandl | 2006-06-22 16:46:46 +0200 (Thu, 22 Jun 2006) | 4 lines
Test for correct compilation of try-except-finally stmt.
Test for correct lineno on list, tuple, dict literals.
........
r47071 | fred.drake | 2006-06-22 17:50:08 +0200 (Thu, 22 Jun 2006) | 1 line
fix markup nit
........
r47072 | brett.cannon | 2006-06-22 18:49:14 +0200 (Thu, 22 Jun 2006) | 6 lines
'warning's was improperly requiring that a command-line Warning category be
both a subclass of Warning and a subclass of types.ClassType. The latter is no
longer true thanks to new-style exceptions.
Closes bug #1510580. Thanks to AMK for the test.
........
r47073 | ronald.oussoren | 2006-06-22 20:33:54 +0200 (Thu, 22 Jun 2006) | 3 lines
MacOSX: Add a message to the first screen of the installer that tells
users how to avoid updates to their shell profile.
........
r47074 | georg.brandl | 2006-06-22 21:02:18 +0200 (Thu, 22 Jun 2006) | 3 lines
Fix my name ;)
........
r47075 | thomas.heller | 2006-06-22 21:07:36 +0200 (Thu, 22 Jun 2006) | 2 lines
Small fixes, mostly in the markup.
........
r47076 | peter.astrand | 2006-06-22 22:06:46 +0200 (Thu, 22 Jun 2006) | 1 line
Make it possible to run test_subprocess.py on Python 2.2, which lacks test_support.is_resource_enabled.
........
r47077 | peter.astrand | 2006-06-22 22:21:26 +0200 (Thu, 22 Jun 2006) | 1 line
Applied patch #1506758: Prevent MemoryErrors with large MAXFD.
........
r47079 | neal.norwitz | 2006-06-23 05:32:44 +0200 (Fri, 23 Jun 2006) | 1 line
Fix refleak
........
r47080 | fred.drake | 2006-06-23 08:03:45 +0200 (Fri, 23 Jun 2006) | 9 lines
- SF bug #853506: IP6 address parsing in sgmllib
('[' and ']' were not accepted in unquoted attribute values)
- cleaned up tests of character and entity reference decoding so the
tests cover the documented relationships among handle_charref,
handle_entityref, convert_charref, convert_codepoint, and
convert_entityref, without bringing up Unicode issues that sgmllib
cannot be involved in
........
r47085 | andrew.kuchling | 2006-06-23 21:23:40 +0200 (Fri, 23 Jun 2006) | 11 lines
Fit Makefile for the Python doc environment better; this is a step toward
including the howtos in the build process.
* Put LaTeX output in ../paper-<whatever>/.
* Put HTML output in ../html/
* Explain some of the Makefile variables
* Remove some cruft dating to my environment (e.g. the 'web' target)
This makefile isn't currently invoked by the documentation build process,
so these changes won't destabilize anything.
........
r47086 | hyeshik.chang | 2006-06-23 23:16:18 +0200 (Fri, 23 Jun 2006) | 5 lines
Bug #1511381: codec_getstreamcodec() in codec.c is corrected to
omit a default "error" argument for NULL pointer. This allows
the parser to take a codec from cjkcodecs again.
(Reported by Taewook Kang and reviewed by Walter Doerwald)
........
r47091 | ronald.oussoren | 2006-06-25 22:44:16 +0200 (Sun, 25 Jun 2006) | 6 lines
Workaround for bug #1512124
Without this patch IDLE will get unresponsive when you open the debugger
window on OSX. This is both using the system Tcl/Tk on Tiger as the latest
universal download from tk-components.sf.net.
........
r47092 | ronald.oussoren | 2006-06-25 23:14:19 +0200 (Sun, 25 Jun 2006) | 3 lines
Drop the calldll demo's for macos, calldll isn't present anymore, no need
to keep the demo's around.
........
r47093 | ronald.oussoren | 2006-06-25 23:15:58 +0200 (Sun, 25 Jun 2006) | 3 lines
Use a path without a double slash to compile the .py files after installation
(macosx, binary installer). This fixes bug #1508369 for python 2.5.
........
r47094 | ronald.oussoren | 2006-06-25 23:19:06 +0200 (Sun, 25 Jun 2006) | 3 lines
Also install the .egg-info files in Lib. This will cause wsgiref.egg-info to
be installed.
........
r47097 | andrew.kuchling | 2006-06-26 14:40:02 +0200 (Mon, 26 Jun 2006) | 1 line
[Bug #1511998] Various comments from Nick Coghlan; thanks!
........
r47098 | andrew.kuchling | 2006-06-26 14:43:43 +0200 (Mon, 26 Jun 2006) | 1 line
Describe workaround for PyRange_New()'s removal
........
r47099 | andrew.kuchling | 2006-06-26 15:08:24 +0200 (Mon, 26 Jun 2006) | 5 lines
[Bug #1512163] Fix typo.
This change will probably break tests on FreeBSD buildbots, but I'll check in
a fix for that next.
........
r47100 | andrew.kuchling | 2006-06-26 15:12:16 +0200 (Mon, 26 Jun 2006) | 9 lines
[Bug #1512163] Use one set of locking methods, lockf();
remove the flock() calls.
On FreeBSD, the two methods lockf() and flock() end up using the same
mechanism and the second one fails. A Linux man page claims that the
two methods are orthogonal (so locks acquired one way don't interact
with locks acquired the other way) but that clearly must be false.
........
r47101 | andrew.kuchling | 2006-06-26 15:23:10 +0200 (Mon, 26 Jun 2006) | 5 lines
Add a test for a conflicting lock.
On slow machines, maybe the time intervals (2 sec, 0.5 sec) will be too tight.
I'll see how the buildbots like it.
........
r47103 | andrew.kuchling | 2006-06-26 16:33:24 +0200 (Mon, 26 Jun 2006) | 1 line
Windows doesn't have os.fork(). I'll just disable this test for now
........
r47106 | andrew.kuchling | 2006-06-26 19:00:35 +0200 (Mon, 26 Jun 2006) | 9 lines
Attempt to fix build failure on OS X and Debian alpha; the symptom is
consistent with os.wait() returning immediately because some other
subprocess had previously exited; the test suite then immediately
tries to lock the mailbox and gets an error saying it's already
locked.
To fix this, do a waitpid() so the test suite only continues once
the intended child process has exited.
........
r47113 | neal.norwitz | 2006-06-27 06:06:46 +0200 (Tue, 27 Jun 2006) | 1 line
Ignore some more warnings in the dynamic linker on an older gentoo
........
r47114 | neal.norwitz | 2006-06-27 06:09:13 +0200 (Tue, 27 Jun 2006) | 6 lines
Instead of doing a make test, run the regression tests out of the installed
copy. This will hopefully catch problems where directories are added
under Lib/ but not to Makefile.pre.in. This breaks out the 2 runs
of the test suite with and without -O which is also nicer.
........
r47115 | neal.norwitz | 2006-06-27 06:12:58 +0200 (Tue, 27 Jun 2006) | 5 lines
Fix SF bug #1513032, 'make install' failure on FreeBSD 5.3.
No need to install lib-old, it's empty in 2.5.
........
r47116 | neal.norwitz | 2006-06-27 06:23:06 +0200 (Tue, 27 Jun 2006) | 1 line
Test unimportant change to verify buildbot does not try to build
........
r47117 | neal.norwitz | 2006-06-27 06:26:30 +0200 (Tue, 27 Jun 2006) | 1 line
Try again: test unimportant change to verify buildbot does not try to build
........
r47118 | neal.norwitz | 2006-06-27 06:28:56 +0200 (Tue, 27 Jun 2006) | 1 line
Verify buildbot picks up these changes (really needs testing after last change to Makefile.pre.in)
........
r47121 | vinay.sajip | 2006-06-27 09:34:37 +0200 (Tue, 27 Jun 2006) | 1 line
Removed buggy exception handling in doRollover of rotating file handlers. Exceptions now propagate to caller.
........
r47123 | ronald.oussoren | 2006-06-27 12:08:25 +0200 (Tue, 27 Jun 2006) | 3 lines
MacOSX: fix rather dumb buglet that made it impossible to create extensions on
OSX 10.3 when using a binary distribution build on 10.4.
........
r47125 | tim.peters | 2006-06-27 13:52:49 +0200 (Tue, 27 Jun 2006) | 2 lines
Whitespace normalization.
........
r47128 | ronald.oussoren | 2006-06-27 14:53:52 +0200 (Tue, 27 Jun 2006) | 8 lines
Use staticly build copies of zlib and bzip2 to build the OSX installer, that
way the resulting binaries have a better change of running on 10.3.
This patch also updates the search logic for sleepycat db3/4, without this
patch you cannot use a sleepycat build with a non-standard prefix; with this
you can (at least on OSX) if you add the prefix to CPPFLAGS/LDFLAGS at
configure-time. This change is needed to build the binary installer for OSX.
........
r47131 | ronald.oussoren | 2006-06-27 17:45:32 +0200 (Tue, 27 Jun 2006) | 5 lines
macosx: Install a libpython2.5.a inside the framework as a symlink to the actual
dylib at the root of the framework, that way tools that expect a unix-like
install (python-config, but more importantly external products like
mod_python) work correctly.
........
r47137 | neal.norwitz | 2006-06-28 07:03:22 +0200 (Wed, 28 Jun 2006) | 4 lines
According to the man pages on Gentoo Linux and Tru64, EACCES or EAGAIN
can be returned if fcntl (lockf) fails. This fixes the test failure
on Tru64 by checking for either error rather than just EAGAIN.
........
r47139 | neal.norwitz | 2006-06-28 08:28:31 +0200 (Wed, 28 Jun 2006) | 5 lines
Fix bug #1512695: cPickle.loads could crash if it was interrupted with
a KeyboardInterrupt since PyTuple_Pack was passed a NULL.
Will backport.
........
r47142 | nick.coghlan | 2006-06-28 12:41:47 +0200 (Wed, 28 Jun 2006) | 1 line
Make full module name available as __module_name__ even when __name__ is set to something else (like '__main__')
........
r47143 | armin.rigo | 2006-06-28 12:49:51 +0200 (Wed, 28 Jun 2006) | 2 lines
A couple of crashers of the "won't fix" kind.
........
r47147 | andrew.kuchling | 2006-06-28 16:25:20 +0200 (Wed, 28 Jun 2006) | 1 line
[Bug #1508766] Add docs for uuid module; docs written by George Yoshida, with minor rearrangements by me.
........
r47148 | andrew.kuchling | 2006-06-28 16:27:21 +0200 (Wed, 28 Jun 2006) | 1 line
[Bug #1508766] Add docs for uuid module; this puts the module in the 'Internet Protocols' section. Arguably this module could also have gone in the chapters on strings or encodings, maybe even the crypto chapter. Fred, please move if you see fit.
........
r47151 | georg.brandl | 2006-06-28 22:23:25 +0200 (Wed, 28 Jun 2006) | 3 lines
Fix end_fill().
........
r47153 | trent.mick | 2006-06-28 22:30:41 +0200 (Wed, 28 Jun 2006) | 2 lines
Mention the expat upgrade and pyexpat fix I put in 2.5b1.
........
r47154 | fred.drake | 2006-06-29 02:51:53 +0200 (Thu, 29 Jun 2006) | 6 lines
SF bug #1504333: sgmlib should allow angle brackets in quoted values
(modified patch by Sam Ruby; changed to use separate REs for start and end
tags to reduce matching cost for end tags; extended tests; updated to avoid
breaking previous changes to support IPv6 addresses in unquoted attribute
values)
........
r47156 | fred.drake | 2006-06-29 04:57:48 +0200 (Thu, 29 Jun 2006) | 1 line
document recent bugfixes in sgmllib
........
r47158 | neal.norwitz | 2006-06-29 06:10:08 +0200 (Thu, 29 Jun 2006) | 10 lines
Add new utility function, reap_children(), to test_support. This should
be called at the end of each test that spawns children (perhaps it
should be called from regrtest instead?). This will hopefully prevent
some of the unexplained failures in the buildbots (hppa and alpha)
during tests that spawn children. The problems were not reproducible.
There were many zombies that remained at the end of several tests.
In the worst case, this shouldn't cause any more problems,
though it may not help either. Time will tell.
........
r47159 | neal.norwitz | 2006-06-29 07:48:14 +0200 (Thu, 29 Jun 2006) | 5 lines
This should fix the buildbot failure on s/390 which can't connect to gmail.org.
It makes the error message consistent and always sends to stderr.
It would be much better for all the networking tests to hit only python.org.
........
r47161 | thomas.heller | 2006-06-29 20:34:15 +0200 (Thu, 29 Jun 2006) | 3 lines
Protect the thread api calls in the _ctypes extension module within
#ifdef WITH_THREADS/#endif blocks. Found by Sam Rushing.
........
r47162 | martin.v.loewis | 2006-06-29 20:58:44 +0200 (Thu, 29 Jun 2006) | 2 lines
Patch #1509163: MS Toolkit Compiler no longer available
........
r47163 | skip.montanaro | 2006-06-29 21:20:09 +0200 (Thu, 29 Jun 2006) | 1 line
add string methods to index
........
r47164 | vinay.sajip | 2006-06-30 02:13:08 +0200 (Fri, 30 Jun 2006) | 1 line
Fixed bug in fileConfig() which failed to clear logging._handlerList
........
r47166 | tim.peters | 2006-06-30 08:18:39 +0200 (Fri, 30 Jun 2006) | 2 lines
Whitespace normalization.
........
r47170 | neal.norwitz | 2006-06-30 09:32:16 +0200 (Fri, 30 Jun 2006) | 1 line
Silence compiler warning
........
r47171 | neal.norwitz | 2006-06-30 09:32:46 +0200 (Fri, 30 Jun 2006) | 1 line
Another problem reported by Coverity. Backport candidate.
........
r47175 | thomas.heller | 2006-06-30 19:44:54 +0200 (Fri, 30 Jun 2006) | 2 lines
Revert the use of PY_FORMAT_SIZE_T in PyErr_Format.
........
r47176 | tim.peters | 2006-06-30 20:34:51 +0200 (Fri, 30 Jun 2006) | 2 lines
Remove now-unused fidding with PY_FORMAT_SIZE_T.
........
r47177 | georg.brandl | 2006-06-30 20:47:56 +0200 (Fri, 30 Jun 2006) | 3 lines
Document decorator usage of property.
........
r47181 | fred.drake | 2006-06-30 21:29:25 +0200 (Fri, 30 Jun 2006) | 4 lines
- consistency nit: always include "()" in \function and \method
(*should* be done by the presentation, but that requires changes all over)
- avoid spreading the __name meme
........
r47188 | vinay.sajip | 2006-07-01 12:45:20 +0200 (Sat, 01 Jul 2006) | 1 line
Added entry for fileConfig() bugfix.
........
r47189 | vinay.sajip | 2006-07-01 12:47:20 +0200 (Sat, 01 Jul 2006) | 1 line
Added duplicate call to fileConfig() to ensure that it cleans up after itself correctly.
........
r47190 | martin.v.loewis | 2006-07-01 17:33:37 +0200 (Sat, 01 Jul 2006) | 2 lines
Release all forwarded functions in .close. Fixes #1513223.
........
r47191 | fred.drake | 2006-07-01 18:28:20 +0200 (Sat, 01 Jul 2006) | 7 lines
SF bug #1296433 (Expat bug #1515266): Unchecked calls to character data
handler would cause a segfault. This merges in Expat's lib/xmlparse.c
revisions 1.154 and 1.155, which fix this and a closely related problem
(the later does not affect Python).
Moved the crasher test to the tests for xml.parsers.expat.
........
r47197 | gerhard.haering | 2006-07-02 19:48:30 +0200 (Sun, 02 Jul 2006) | 4 lines
The sqlite3 module did cut off data from the SQLite database at the first null
character before sending it to a custom converter. This has been fixed now.
........
r47198 | martin.v.loewis | 2006-07-02 20:44:00 +0200 (Sun, 02 Jul 2006) | 1 line
Correct arithmetic in access on Win32. Fixes #1513646.
........
r47203 | thomas.heller | 2006-07-03 09:58:09 +0200 (Mon, 03 Jul 2006) | 1 line
Cleanup: Remove commented out code.
........
r47204 | thomas.heller | 2006-07-03 09:59:50 +0200 (Mon, 03 Jul 2006) | 1 line
Don't run the doctests with Python 2.3 because it doesn't have the ELLIPSIS flag.
........
r47205 | thomas.heller | 2006-07-03 10:04:05 +0200 (Mon, 03 Jul 2006) | 7 lines
Fixes so that _ctypes can be compiled with the MingW compiler.
It seems that the definition of '__attribute__(x)' was responsible for
the compiler ignoring the '__fastcall' attribute on the
ffi_closure_SYSV function in libffi_msvc/ffi.c, took me quite some
time to figure this out.
........
r47206 | thomas.heller | 2006-07-03 10:08:14 +0200 (Mon, 03 Jul 2006) | 11 lines
Add a new function uses_seh() to the _ctypes extension module. This
will return True if Windows Structured Exception handling (SEH) is
used when calling functions, False otherwise.
Currently, only MSVC supports SEH.
Fix the test so that it doesn't crash when run with MingW compiled
_ctypes. Note that two tests are still failing when mingw is used, I
suspect structure layout differences and function calling conventions
between MSVC and MingW.
........
r47207 | tim.peters | 2006-07-03 10:23:19 +0200 (Mon, 03 Jul 2006) | 2 lines
Whitespace normalization.
........
r47208 | martin.v.loewis | 2006-07-03 11:44:00 +0200 (Mon, 03 Jul 2006) | 3 lines
Only setup canvas when it is first created.
Fixes #1514703
........
r47209 | martin.v.loewis | 2006-07-03 12:05:30 +0200 (Mon, 03 Jul 2006) | 3 lines
Reimplement turtle.circle using a polyline, to allow correct
filling of arcs. Also fixes #1514693.
........
r47210 | martin.v.loewis | 2006-07-03 12:19:49 +0200 (Mon, 03 Jul 2006) | 3 lines
Bug #1514693: Update turtle's heading when switching between
degrees and radians.
........
r47211 | martin.v.loewis | 2006-07-03 13:12:06 +0200 (Mon, 03 Jul 2006) | 2 lines
Document functions added in 2.3 and 2.5.
........
r47212 | martin.v.loewis | 2006-07-03 14:19:50 +0200 (Mon, 03 Jul 2006) | 3 lines
Bug #1417699: Reject locale-specific decimal point in float()
and atof().
........
r47213 | martin.v.loewis | 2006-07-03 14:28:58 +0200 (Mon, 03 Jul 2006) | 3 lines
Bug #1267547: Put proper recursive setup.py call into the
spec file generated by bdist_rpm.
........
r47215 | martin.v.loewis | 2006-07-03 15:01:35 +0200 (Mon, 03 Jul 2006) | 3 lines
Patch #825417: Fix timeout processing in expect,
read_until. Will backport to 2.4.
........
r47218 | martin.v.loewis | 2006-07-03 15:47:40 +0200 (Mon, 03 Jul 2006) | 2 lines
Put method-wrappers into trashcan. Fixes #927248.
........
r47219 | andrew.kuchling | 2006-07-03 16:07:30 +0200 (Mon, 03 Jul 2006) | 1 line
[Bug #1515932] Clarify description of slice assignment
........
r47220 | andrew.kuchling | 2006-07-03 16:16:09 +0200 (Mon, 03 Jul 2006) | 4 lines
[Bug #1511911] Clarify description of optional arguments to sorted()
by improving the xref to the section on lists, and by
copying the explanations of the arguments (with a slight modification).
........
r47223 | kristjan.jonsson | 2006-07-03 16:59:05 +0200 (Mon, 03 Jul 2006) | 1 line
Fix build problems with the platform SDK on windows. It is not sufficient to test for the C compiler version when determining if we have the secure CRT from microsoft. Must test with an undocumented macro, __STDC_SECURE_LIB__ too.
........
r47224 | ronald.oussoren | 2006-07-04 14:30:22 +0200 (Tue, 04 Jul 2006) | 7 lines
Sync the darwin/x86 port libffi with the copy in PyObjC. This fixes a number
of bugs in that port. The most annoying ones were due to some subtle differences
between the document ABI and the actual implementation :-(
(there are no python unittests that fail without this patch, but without it
some of libffi's unittests fail).
........
r47234 | georg.brandl | 2006-07-05 10:21:00 +0200 (Wed, 05 Jul 2006) | 3 lines
Remove remaining references to OverflowWarning.
........
r47236 | thomas.heller | 2006-07-05 11:13:56 +0200 (Wed, 05 Jul 2006) | 3 lines
Fix the bitfield test when _ctypes is compiled with MingW. Structures
containing bitfields may have different layout on MSVC and MingW .
........
r47237 | thomas.wouters | 2006-07-05 13:03:49 +0200 (Wed, 05 Jul 2006) | 15 lines
Fix bug in passing tuples to string.Template. All other values (with working
str() or repr()) would work, just not multi-value tuples. Probably not a
backport candidate, since it changes the behaviour of passing a
single-element tuple:
>>> string.Template("$foo").substitute(dict(foo=(1,)))
'(1,)'
versus
'1'
........
r47241 | georg.brandl | 2006-07-05 16:18:45 +0200 (Wed, 05 Jul 2006) | 2 lines
Patch #1517490: fix glitches in filter() docs.
........
r47244 | georg.brandl | 2006-07-05 17:50:05 +0200 (Wed, 05 Jul 2006) | 2 lines
no need to elaborate "string".
........
r47251 | neal.norwitz | 2006-07-06 06:28:59 +0200 (Thu, 06 Jul 2006) | 3 lines
Fix refleaks reported by Shane Hathaway in SF patch #1515361. This change
contains only the changes related to leaking the copy variable.
........
r47253 | fred.drake | 2006-07-06 07:13:22 +0200 (Thu, 06 Jul 2006) | 4 lines
- back out Expat change; the final fix to Expat will be different
- change the pyexpat wrapper to not be so sensitive to this detail of the
Expat implementation (the ex-crasher test still passes)
........
r47257 | neal.norwitz | 2006-07-06 08:45:08 +0200 (Thu, 06 Jul 2006) | 1 line
Add a NEWS entry for a recent pyexpat fix
........
r47258 | martin.v.loewis | 2006-07-06 08:55:58 +0200 (Thu, 06 Jul 2006) | 2 lines
Add sqlite3.dll to the DLLs component, not to the TkDLLs component.
Fixes #1517388.
........
r47259 | martin.v.loewis | 2006-07-06 09:05:21 +0200 (Thu, 06 Jul 2006) | 1 line
Properly quote compileall and Lib paths in case TARGETDIR has a space.
........
r47260 | thomas.heller | 2006-07-06 09:50:18 +0200 (Thu, 06 Jul 2006) | 5 lines
Revert the change done in svn revision 47206:
Add a new function uses_seh() to the _ctypes extension module. This
will return True if Windows Structured Exception handling (SEH) is
used when calling functions, False otherwise.
........
r47261 | armin.rigo | 2006-07-06 09:58:18 +0200 (Thu, 06 Jul 2006) | 3 lines
A couple of examples about how to attack the fact that _PyType_Lookup()
returns a borrowed ref. Many of the calls are open to attack.
........
r47262 | thomas.heller | 2006-07-06 10:28:14 +0200 (Thu, 06 Jul 2006) | 2 lines
The test that calls a function with invalid arguments and catches the
resulting Windows access violation will not be run by default.
........
r47263 | thomas.heller | 2006-07-06 10:48:35 +0200 (Thu, 06 Jul 2006) | 5 lines
Patch #1517790: It is now possible to use custom objects in the ctypes
foreign function argtypes sequence as long as they provide a
from_param method, no longer is it required that the object is a
ctypes type.
........
r47264 | thomas.heller | 2006-07-06 10:58:40 +0200 (Thu, 06 Jul 2006) | 2 lines
Document the Struture and Union constructors.
........
r47265 | thomas.heller | 2006-07-06 11:11:22 +0200 (Thu, 06 Jul 2006) | 2 lines
Document the changes in svn revision 47263, from patch #1517790.
........
r47267 | ronald.oussoren | 2006-07-06 12:13:35 +0200 (Thu, 06 Jul 2006) | 7 lines
This patch solves the problem Skip was seeing with zlib, this patch ensures that
configure uses similar compiler flags as setup.py when doing the zlib test.
Without this patch configure would use the first shared library on the linker
path, with this patch it uses the first shared or static library on that path
just like setup.py.
........
r47268 | thomas.wouters | 2006-07-06 12:48:28 +0200 (Thu, 06 Jul 2006) | 4 lines
NEWS entry for r47267: fixing configure's zlib probing.
........
r47269 | fredrik.lundh | 2006-07-06 14:29:24 +0200 (Thu, 06 Jul 2006) | 3 lines
added XMLParser alias for cElementTree compatibility
........
r47271 | nick.coghlan | 2006-07-06 14:53:04 +0200 (Thu, 06 Jul 2006) | 1 line
Revert the __module_name__ changes made in rev 47142. We'll revisit this in Python 2.6
........
r47272 | nick.coghlan | 2006-07-06 15:04:56 +0200 (Thu, 06 Jul 2006) | 1 line
Update the tutorial section on relative imports
........
r47273 | nick.coghlan | 2006-07-06 15:35:27 +0200 (Thu, 06 Jul 2006) | 1 line
Ignore ImportWarning by default
........
r47274 | nick.coghlan | 2006-07-06 15:41:34 +0200 (Thu, 06 Jul 2006) | 1 line
Cover ImportWarning, PendingDeprecationWarning and simplefilter() in the warnings module docs
........
r47275 | nick.coghlan | 2006-07-06 15:47:18 +0200 (Thu, 06 Jul 2006) | 1 line
Add NEWS entries for the ImportWarning change and documentation update
........
r47276 | andrew.kuchling | 2006-07-06 15:57:28 +0200 (Thu, 06 Jul 2006) | 1 line
ImportWarning is now silent by default
........
r47277 | thomas.heller | 2006-07-06 17:06:05 +0200 (Thu, 06 Jul 2006) | 2 lines
Document the correct return type of PyLong_AsUnsignedLongLongMask.
........
r47278 | hyeshik.chang | 2006-07-06 17:21:52 +0200 (Thu, 06 Jul 2006) | 2 lines
Add a testcase for r47086 which fixed a bug in codec_getstreamcodec().
........
r47279 | hyeshik.chang | 2006-07-06 17:39:24 +0200 (Thu, 06 Jul 2006) | 3 lines
Test using all CJK encodings for the testcases which don't require
specific encodings.
........
r47280 | martin.v.loewis | 2006-07-06 21:28:03 +0200 (Thu, 06 Jul 2006) | 2 lines
Properly generate logical file ids. Fixes #1515998.
Also correct typo in Control.mapping.
........
r47287 | neal.norwitz | 2006-07-07 08:03:15 +0200 (Fri, 07 Jul 2006) | 17 lines
Restore rev 47014:
The hppa ubuntu box sometimes hangs forever in these tests. My guess
is that the wait is failing for some reason. Use WNOHANG, so we won't
wait until the buildbot kills the test suite.
I haven't been able to reproduce the failure, so I'm not sure if
this will help or not. Hopefully, this change will cause the test
to fail, rather than hang. That will be better since we will get
the rest of the test results. It may also help us debug the real problem.
*** The reason this originally failed was because there were many
zombie children outstanding before rev 47158 cleaned them up.
There are still hangs in test_subprocess that need to be addressed,
but that will take more work. This should close some holes.
........
r47289 | georg.brandl | 2006-07-07 10:15:12 +0200 (Fri, 07 Jul 2006) | 3 lines
Fix RFC number.
........
r50489 | neal.norwitz | 2006-07-08 07:31:37 +0200 (Sat, 08 Jul 2006) | 1 line
Fix SF bug #1519018: 'as' is now validated properly in import statements
........
r50490 | georg.brandl | 2006-07-08 14:15:27 +0200 (Sat, 08 Jul 2006) | 3 lines
Add an additional test for bug #1519018.
........
r50491 | tim.peters | 2006-07-08 21:55:05 +0200 (Sat, 08 Jul 2006) | 2 lines
Whitespace normalization.
........
r50493 | neil.schemenauer | 2006-07-09 18:16:34 +0200 (Sun, 09 Jul 2006) | 2 lines
Fix AST compiler bug #1501934: incorrect LOAD/STORE_GLOBAL generation.
........
r50495 | neil.schemenauer | 2006-07-09 23:19:29 +0200 (Sun, 09 Jul 2006) | 2 lines
Fix SF bug 1441486: bad unary minus folding in compiler.
........
r50497 | neal.norwitz | 2006-07-10 00:14:42 +0200 (Mon, 10 Jul 2006) | 4 lines
On 64 bit systems, int literals that use less than 64 bits are now ints
rather than longs. This also fixes the test for eval(-sys.maxint - 1).
........
r50500 | neal.norwitz | 2006-07-10 02:04:44 +0200 (Mon, 10 Jul 2006) | 4 lines
Bug #1512814, Fix incorrect lineno's when code at module scope
started after line 256.
........
r50501 | neal.norwitz | 2006-07-10 02:05:34 +0200 (Mon, 10 Jul 2006) | 1 line
Fix doco. Backport candidate.
........
r50503 | neal.norwitz | 2006-07-10 02:23:17 +0200 (Mon, 10 Jul 2006) | 5 lines
Part of SF patch #1484695. This removes dead code. The chksum was
already verified in .frombuf() on the lines above. If there was
a problem an exception is raised, so there was no way this condition
could have been true.
........
r50504 | neal.norwitz | 2006-07-10 03:18:57 +0200 (Mon, 10 Jul 2006) | 3 lines
Patch #1516912: improve Modules support for OpenVMS.
........
r50506 | neal.norwitz | 2006-07-10 04:36:41 +0200 (Mon, 10 Jul 2006) | 7 lines
Patch #1504046: Add documentation for xml.etree.
/F wrote the text docs, Englebert Gruber massaged it to latex and I
did some more massaging to try and improve the consistency and
fix some name mismatches between the declaration and text.
........
r50509 | martin.v.loewis | 2006-07-10 09:23:48 +0200 (Mon, 10 Jul 2006) | 2 lines
Introduce DISTUTILS_USE_SDK as a flag to determine whether the
SDK environment should be used. Fixes #1508010.
........
r50510 | martin.v.loewis | 2006-07-10 09:26:41 +0200 (Mon, 10 Jul 2006) | 1 line
Change error message to indicate that VS2003 is necessary to build extension modules, not the .NET SDK.
........
r50511 | martin.v.loewis | 2006-07-10 09:29:41 +0200 (Mon, 10 Jul 2006) | 1 line
Add svn:ignore.
........
r50512 | anthony.baxter | 2006-07-10 09:41:04 +0200 (Mon, 10 Jul 2006) | 1 line
preparing for 2.5b2
........
r50513 | thomas.heller | 2006-07-10 11:10:28 +0200 (Mon, 10 Jul 2006) | 2 lines
Fix bug #1518190: accept any integer or long value in the
ctypes.c_void_p constructor.
........
r50514 | thomas.heller | 2006-07-10 11:31:06 +0200 (Mon, 10 Jul 2006) | 3 lines
Fixed a segfault when ctypes.wintypes were imported on
non-Windows machines.
........
r50516 | thomas.heller | 2006-07-10 13:11:10 +0200 (Mon, 10 Jul 2006) | 3 lines
Assigning None to pointer type structure fields possible overwrote
wrong fields.
........
r50517 | thomas.heller | 2006-07-10 13:17:37 +0200 (Mon, 10 Jul 2006) | 5 lines
Moved the ctypes news entries from the 'Library' section into the
'Extension Modules' section where they belong, probably.
This destroyes the original order of the news entries, don't know
if that is important or not.
........
r50526 | phillip.eby | 2006-07-10 21:03:29 +0200 (Mon, 10 Jul 2006) | 2 lines
Fix SF#1516184 and add a test to prevent regression.
........
r50528 | phillip.eby | 2006-07-10 21:18:35 +0200 (Mon, 10 Jul 2006) | 2 lines
Fix SF#1457312: bad socket error handling in distutils "upload" command.
........
r50537 | peter.astrand | 2006-07-10 22:39:49 +0200 (Mon, 10 Jul 2006) | 1 line
Make it possible to run test_subprocess.py with Python 2.2, which lacks test_support.reap_children().
........
r50541 | tim.peters | 2006-07-10 23:08:24 +0200 (Mon, 10 Jul 2006) | 5 lines
After approval from Anthony, merge the tim-current_frames
branch into the trunk. This adds a new sys._current_frames()
function, which returns a dict mapping thread id to topmost
thread stack frame.
........
r50542 | tim.peters | 2006-07-10 23:11:49 +0200 (Mon, 10 Jul 2006) | 2 lines
Whitespace normalization.
........
r50553 | martin.v.loewis | 2006-07-11 00:11:28 +0200 (Tue, 11 Jul 2006) | 4 lines
Patch #1519566: Remove unused _tofill member.
Make begin_fill idempotent.
Update demo2 to demonstrate filling of concave shapes.
........
r50567 | anthony.baxter | 2006-07-11 04:04:09 +0200 (Tue, 11 Jul 2006) | 4 lines
#1494314: Fix a regression with high-numbered sockets in 2.4.3. This
means that select() on sockets > FD_SETSIZE (typically 1024) work again.
The patch makes sockets use poll() internally where available.
........
r50568 | tim.peters | 2006-07-11 04:17:48 +0200 (Tue, 11 Jul 2006) | 2 lines
Whitespace normalization.
........
r50575 | thomas.heller | 2006-07-11 18:42:05 +0200 (Tue, 11 Jul 2006) | 1 line
Add missing Py_DECREF.
........
r50576 | thomas.heller | 2006-07-11 18:44:25 +0200 (Tue, 11 Jul 2006) | 1 line
Add missing Py_DECREFs.
........
r50579 | andrew.kuchling | 2006-07-11 19:20:16 +0200 (Tue, 11 Jul 2006) | 1 line
Bump version number; add sys._current_frames
........
r50582 | thomas.heller | 2006-07-11 20:28:35 +0200 (Tue, 11 Jul 2006) | 3 lines
When a foreign function is retrived by calling __getitem__ on a ctypes
library instance, do not set it as attribute.
........
r50583 | thomas.heller | 2006-07-11 20:40:50 +0200 (Tue, 11 Jul 2006) | 2 lines
Change the ctypes version number to 1.0.0.
........
r50597 | neal.norwitz | 2006-07-12 07:26:17 +0200 (Wed, 12 Jul 2006) | 3 lines
Bug #1520864: unpacking singleton tuples in for loop (for x, in) work again.
........
r50598 | neal.norwitz | 2006-07-12 07:26:35 +0200 (Wed, 12 Jul 2006) | 1 line
Fix function name in error msg
........
r50599 | neal.norwitz | 2006-07-12 07:27:46 +0200 (Wed, 12 Jul 2006) | 4 lines
Fix uninitialized memory read reported by Valgrind when running doctest.
This could happen if size == 0.
........
r50600 | neal.norwitz | 2006-07-12 09:28:29 +0200 (Wed, 12 Jul 2006) | 1 line
Actually change the MAGIC #. Create a new section for 2.5c1 and mention the impact of changing the MAGIC #.
........
r50601 | thomas.heller | 2006-07-12 10:43:47 +0200 (Wed, 12 Jul 2006) | 3 lines
Fix #1467450: ctypes now uses RTLD_GLOBAL by default on OSX 10.3 to
load shared libraries.
........
r50604 | thomas.heller | 2006-07-12 16:25:18 +0200 (Wed, 12 Jul 2006) | 3 lines
Fix the wrong description of LibraryLoader.LoadLibrary, and document
the DEFAULT_MODE constant.
........
r50607 | georg.brandl | 2006-07-12 17:31:17 +0200 (Wed, 12 Jul 2006) | 3 lines
Accept long options "--help" and "--version".
........
r50617 | thomas.heller | 2006-07-13 11:53:47 +0200 (Thu, 13 Jul 2006) | 3 lines
A misspelled preprocessor symbol caused ctypes to be always compiled
without thread support. Replaced WITH_THREADS with WITH_THREAD.
........
r50619 | thomas.heller | 2006-07-13 19:01:14 +0200 (Thu, 13 Jul 2006) | 3 lines
Fix #1521375. When running with root priviledges, 'gcc -o /dev/null'
did overwrite /dev/null. Use a temporary file instead of /dev/null.
........
r50620 | thomas.heller | 2006-07-13 19:05:13 +0200 (Thu, 13 Jul 2006) | 2 lines
Fix misleading words.
........
r50622 | andrew.kuchling | 2006-07-13 19:37:26 +0200 (Thu, 13 Jul 2006) | 1 line
Typo fix
........
r50629 | georg.brandl | 2006-07-14 09:12:54 +0200 (Fri, 14 Jul 2006) | 3 lines
Patch #1521874: grammar errors in doanddont.tex.
........
r50630 | neal.norwitz | 2006-07-14 09:20:04 +0200 (Fri, 14 Jul 2006) | 1 line
Try to improve grammar further.
........
r50631 | martin.v.loewis | 2006-07-14 11:58:55 +0200 (Fri, 14 Jul 2006) | 1 line
Extend build_ssl to Win64, using VSExtComp.
........
r50632 | martin.v.loewis | 2006-07-14 14:10:09 +0200 (Fri, 14 Jul 2006) | 1 line
Add debug output to analyse buildbot failure.
........
r50633 | martin.v.loewis | 2006-07-14 14:31:05 +0200 (Fri, 14 Jul 2006) | 1 line
Fix Debug build of _ssl.
........
r50636 | andrew.kuchling | 2006-07-14 15:32:38 +0200 (Fri, 14 Jul 2006) | 1 line
Mention new options
........
r50638 | peter.astrand | 2006-07-14 16:04:45 +0200 (Fri, 14 Jul 2006) | 1 line
Bug #1223937: CalledProcessError.errno -> CalledProcessError.returncode.
........
r50640 | thomas.heller | 2006-07-14 17:01:05 +0200 (Fri, 14 Jul 2006) | 4 lines
Make the prototypes of our private PyUnicode_FromWideChar and
PyUnicode_AsWideChar replacement functions compatible to the official
functions by using Py_ssize_t instead of int.
........
r50643 | thomas.heller | 2006-07-14 19:51:14 +0200 (Fri, 14 Jul 2006) | 3 lines
Patch #1521817: The index range checking on ctypes arrays containing
exactly one element is enabled again.
........
r50647 | thomas.heller | 2006-07-14 20:22:50 +0200 (Fri, 14 Jul 2006) | 2 lines
Updates for the ctypes documentation.
........
r50655 | fredrik.lundh | 2006-07-14 23:45:48 +0200 (Fri, 14 Jul 2006) | 3 lines
typo
........
r50664 | george.yoshida | 2006-07-15 18:03:49 +0200 (Sat, 15 Jul 2006) | 2 lines
Bug #15187702 : ext/win-cookbook.html has a broken link to distutils
........
r50667 | bob.ippolito | 2006-07-15 18:53:15 +0200 (Sat, 15 Jul 2006) | 1 line
Patch #1220874: Update the binhex module for Mach-O.
........
r50671 | fred.drake | 2006-07-16 03:21:20 +0200 (Sun, 16 Jul 2006) | 1 line
clean up some link markup
........
r50673 | neal.norwitz | 2006-07-16 03:50:38 +0200 (Sun, 16 Jul 2006) | 4 lines
Bug #1512814, Fix incorrect lineno's when code within a function
had more than 255 blank lines. Byte codes need to go first, line #s second.
........
r50674 | neal.norwitz | 2006-07-16 04:00:32 +0200 (Sun, 16 Jul 2006) | 5 lines
a & b were dereffed above, so they are known to be valid pointers.
z is known to be NULL, nothing to DECREF.
Reported by Klockwork, #107.
........
r50675 | neal.norwitz | 2006-07-16 04:02:57 +0200 (Sun, 16 Jul 2006) | 5 lines
self is dereffed (and passed as first arg), so it's known to be good.
func is returned from PyArg_ParseTuple and also dereffed.
Reported by Klocwork, #30 (self one at least).
........
r50676 | neal.norwitz | 2006-07-16 04:05:35 +0200 (Sun, 16 Jul 2006) | 4 lines
proto was dereffed above and is known to be good. No need for X.
Reported by Klocwork, #39.
........
r50677 | neal.norwitz | 2006-07-16 04:15:27 +0200 (Sun, 16 Jul 2006) | 5 lines
Fix memory leaks in some conditions.
Reported by Klocwork #152.
........
r50678 | neal.norwitz | 2006-07-16 04:17:36 +0200 (Sun, 16 Jul 2006) | 4 lines
Fix memory leak under some conditions.
Reported by Klocwork, #98.
........
r50679 | neal.norwitz | 2006-07-16 04:22:30 +0200 (Sun, 16 Jul 2006) | 8 lines
Use sizeof(buffer) instead of duplicating the constants to ensure they won't
be wrong.
The real change is to pass (bufsz - 1) to PyOS_ascii_formatd and 1
to strncat. strncat copies n+1 bytes from src (not dest).
Reported by Klocwork #58.
........
r50680 | neal.norwitz | 2006-07-16 04:32:03 +0200 (Sun, 16 Jul 2006) | 5 lines
Handle a NULL name properly.
Reported by Klocwork #67
........
r50681 | neal.norwitz | 2006-07-16 04:35:47 +0200 (Sun, 16 Jul 2006) | 6 lines
PyFunction_SetDefaults() is documented as taking None or a tuple.
A NULL would crash the PyTuple_Check(). Now make NULL return a SystemError.
Reported by Klocwork #73.
........
r50683 | neal.norwitz | 2006-07-17 02:55:45 +0200 (Mon, 17 Jul 2006) | 5 lines
Stop INCREFing name, then checking if it's NULL. name (f_name) should never
be NULL so assert it. Fix one place where we could have passed NULL.
Reported by Klocwork #66.
........
r50684 | neal.norwitz | 2006-07-17 02:57:15 +0200 (Mon, 17 Jul 2006) | 5 lines
otherset is known to be non-NULL based on checks before and DECREF after.
DECREF otherset rather than XDECREF in error conditions too.
Reported by Klockwork #154.
........
r50685 | neal.norwitz | 2006-07-17 02:59:04 +0200 (Mon, 17 Jul 2006) | 7 lines
Reported by Klocwork #151.
v2 can be NULL if exception2 is NULL. I don't think that condition can happen,
but I'm not sure it can't either. Now the code will protect against either
being NULL.
........
r50686 | neal.norwitz | 2006-07-17 03:00:16 +0200 (Mon, 17 Jul 2006) | 1 line
Add NEWS entry for a bunch of fixes due to warnings produced by Klocworks static analysis tool.
........
r50687 | fred.drake | 2006-07-17 07:47:52 +0200 (Mon, 17 Jul 2006) | 3 lines
document xmlcore (still minimal; needs mention in each of the xml.* modules)
SF bug #1504456 (partial)
........
r50688 | georg.brandl | 2006-07-17 15:23:46 +0200 (Mon, 17 Jul 2006) | 3 lines
Remove usage of sets module (patch #1500609).
........
r50689 | georg.brandl | 2006-07-17 15:26:33 +0200 (Mon, 17 Jul 2006) | 3 lines
Add missing NEWS item (#1522771)
........
r50690 | andrew.kuchling | 2006-07-17 18:47:54 +0200 (Mon, 17 Jul 2006) | 1 line
Attribute more features
........
r50692 | kurt.kaiser | 2006-07-17 23:59:27 +0200 (Mon, 17 Jul 2006) | 8 lines
Patch 1479219 - Tal Einat
1. 'as' highlighted as builtin in comment string on import line
2. Comments such as "#False identity" which start with a keyword immediately
after the '#' character aren't colored as comments.
3. u or U beginning unicode string not correctly highlighted
Closes bug 1325071
........
r50693 | barry.warsaw | 2006-07-18 01:07:51 +0200 (Tue, 18 Jul 2006) | 16 lines
decode_rfc2231(): Be more robust against buggy RFC 2231 encodings.
Specifically, instead of raising a ValueError when there is a single tick in
the parameter, simply return that the entire string unquoted, with None for
both the charset and the language. Also, if there are more than 2 ticks in
the parameter, interpret the first three parts as the standard RFC 2231 parts,
then the rest of the parts as the encoded string.
Test cases added.
Original fewer-than-3-parts fix by Tokio Kikuchi.
Resolves SF bug # 1218081. I will back port the fix and tests to Python 2.4
(email 3.0) and Python 2.3 (email 2.5).
Also, bump the version number to email 4.0.1, removing the 'alpha' moniker.
........
r50695 | kurt.kaiser | 2006-07-18 06:03:16 +0200 (Tue, 18 Jul 2006) | 2 lines
Rebinding Tab key was inserting 'tab' instead of 'Tab'. Bug 1179168.
........
r50696 | brett.cannon | 2006-07-18 06:41:36 +0200 (Tue, 18 Jul 2006) | 6 lines
Fix bug #1520914. Starting in 2.4, time.strftime() began to check the bounds
of values in the time tuple passed in. Unfortunately people came to rely on
undocumented behaviour of setting unneeded values to 0, regardless of if it was
within the valid range. Now those values force the value internally to the
minimum value when 0 is passed in.
........
r50697 | facundo.batista | 2006-07-18 14:16:13 +0200 (Tue, 18 Jul 2006) | 1 line
Comments and docs cleanups, and some little fixes, provided by Santiágo Peresón
........
r50704 | martin.v.loewis | 2006-07-18 19:46:31 +0200 (Tue, 18 Jul 2006) | 2 lines
Patch #1524429: Use repr instead of backticks again.
........
r50706 | tim.peters | 2006-07-18 23:55:15 +0200 (Tue, 18 Jul 2006) | 2 lines
Whitespace normalization.
........
r50708 | tim.peters | 2006-07-19 02:03:19 +0200 (Wed, 19 Jul 2006) | 18 lines
SF bug 1524317: configure --without-threads fails to build
Moved the code for _PyThread_CurrentFrames() up, so it's no longer
in a huge "#ifdef WITH_THREAD" block (I didn't realize it /was/ in
one).
Changed test_sys's test_current_frames() so it passes with or without
thread supported compiled in.
Note that test_sys fails when Python is compiled without threads,
but for an unrelated reason (the old test_exit() fails with an
indirect ImportError on the `thread` module). There are also
other unrelated compilation failures without threads, in extension
modules (like ctypes); at least the core compiles again.
Do we really support --without-threads? If so, there are several
problems remaining.
........
r50713 | thomas.heller | 2006-07-19 11:09:32 +0200 (Wed, 19 Jul 2006) | 4 lines
Make sure the _ctypes extension can be compiled when WITH_THREAD is
not defined on Windows, even if that configuration is probably not
supported at all.
........
r50715 | martin.v.loewis | 2006-07-19 19:18:32 +0200 (Wed, 19 Jul 2006) | 4 lines
Revert r50706 (Whitespace normalization) and
r50697: Comments and docs cleanups, and some little fixes
per recommendation from Raymond Hettinger.
........
r50719 | phillip.eby | 2006-07-20 17:54:16 +0200 (Thu, 20 Jul 2006) | 4 lines
Fix SF#1516184 (again) and add a test to prevent regression.
(There was a problem with empty filenames still causing recursion)
........
r50720 | georg.brandl | 2006-07-20 18:28:39 +0200 (Thu, 20 Jul 2006) | 3 lines
Guard for _active being None in __del__ method.
........
r50721 | vinay.sajip | 2006-07-20 18:28:39 +0200 (Thu, 20 Jul 2006) | 1 line
Updated documentation for TimedRotatingFileHandler relating to how rollover files are named. The previous documentation was wrongly the same as for RotatingFileHandler.
........
r50731 | fred.drake | 2006-07-20 22:11:57 +0200 (Thu, 20 Jul 2006) | 1 line
markup fix
........
r50739 | kurt.kaiser | 2006-07-21 00:22:52 +0200 (Fri, 21 Jul 2006) | 7 lines
Avoid occasional failure to detect closing paren properly.
Patch 1407280 Tal Einat
M ParenMatch.py
M NEWS.txt
M CREDITS.txt
........
r50740 | vinay.sajip | 2006-07-21 01:20:12 +0200 (Fri, 21 Jul 2006) | 1 line
Addressed SF#1524081 by using a dictionary to map level names to syslog priority names, rather than a string.lower().
........
r50741 | neal.norwitz | 2006-07-21 07:29:58 +0200 (Fri, 21 Jul 2006) | 1 line
Add some asserts that we got good params passed
........
r50742 | neal.norwitz | 2006-07-21 07:31:02 +0200 (Fri, 21 Jul 2006) | 5 lines
Move the initialization of some pointers earlier. The problem is
that if we call Py_DECREF(frame) like we do if allocating locals fails,
frame_dealloc() will try to use these bogus values and crash.
........
r50743 | neal.norwitz | 2006-07-21 07:32:28 +0200 (Fri, 21 Jul 2006) | 4 lines
Handle allocation failures gracefully. Found with failmalloc.
Many (all?) of these could be backported.
........
r50745 | neal.norwitz | 2006-07-21 09:59:02 +0200 (Fri, 21 Jul 2006) | 1 line
Speel initialise write. Tanks Anthony.
........
r50746 | neal.norwitz | 2006-07-21 09:59:47 +0200 (Fri, 21 Jul 2006) | 2 lines
Handle more memory allocation failures without crashing.
........
r50754 | barry.warsaw | 2006-07-21 16:51:07 +0200 (Fri, 21 Jul 2006) | 23 lines
More RFC 2231 improvements for the email 4.0 package. As Mark Sapiro rightly
points out there are really two types of continued headers defined in this
RFC (i.e. "encoded" parameters with the form "name*0*=" and unencoded
parameters with the form "name*0="), but we were were handling them both the
same way and that isn't correct.
This patch should be much more RFC compliant in that only encoded params are
%-decoded and the charset/language information is only extract if there are
any encoded params in the segments. If there are no encoded params then the
RFC says that there will be no charset/language parts.
Note however that this will change the return value for Message.get_param() in
some cases. For example, whereas before if you had all unencoded param
continuations you would have still gotten a 3-tuple back from this method
(with charset and language == None), you will now get just a string. I don't
believe this is a backward incompatible change though because the
documentation for this method already indicates that either return value is
possible and that you must do an isinstance(val, tuple) check to discriminate
between the two. (Yeah that API kind of sucks but we can't change /that/
without breaking code.)
Test cases, some documentation updates, and a NEWS item accompany this patch.
........
r50759 | georg.brandl | 2006-07-21 19:36:31 +0200 (Fri, 21 Jul 2006) | 3 lines
Fix check for empty list (vs. None).
........
r50771 | brett.cannon | 2006-07-22 00:44:07 +0200 (Sat, 22 Jul 2006) | 2 lines
Remove an XXX marker in a comment.
........
r50773 | neal.norwitz | 2006-07-22 18:20:49 +0200 (Sat, 22 Jul 2006) | 1 line
Fix more memory allocation issues found with failmalloc.
........
r50774 | neal.norwitz | 2006-07-22 19:00:57 +0200 (Sat, 22 Jul 2006) | 1 line
Don't fail if the directory already exists
........
r50775 | greg.ward | 2006-07-23 04:25:53 +0200 (Sun, 23 Jul 2006) | 6 lines
Be a lot smarter about whether this test passes: instead of assuming
that a 2.93 sec audio file will always take 3.1 sec (as it did on the
hardware I had when I first wrote the test), expect that it will take
2.93 sec +/- 10%, and only fail if it's outside of that range.
Compute the expected
........
r50776 | kurt.kaiser | 2006-07-23 06:19:49 +0200 (Sun, 23 Jul 2006) | 2 lines
Tooltips failed on new-syle class __init__ args. Bug 1027566 Loren Guthrie
........
r50777 | neal.norwitz | 2006-07-23 09:50:36 +0200 (Sun, 23 Jul 2006) | 1 line
Handle more mem alloc issues found with failmalloc
........
r50778 | neal.norwitz | 2006-07-23 09:51:58 +0200 (Sun, 23 Jul 2006) | 5 lines
If the for loop isn't entered, entryblock will be NULL. If passed
to stackdepth_walk it will be dereffed.
Not sure if I found with failmalloc or Klockwork #55.
........
r50779 | neal.norwitz | 2006-07-23 09:53:14 +0200 (Sun, 23 Jul 2006) | 4 lines
Move the initialization of size_a down below the check for a being NULL.
Reported by Klocwork #106
........
r50780 | neal.norwitz | 2006-07-23 09:55:55 +0200 (Sun, 23 Jul 2006) | 9 lines
Check the allocation of b_objects and return if there was a failure.
Also fix a few memory leaks in other failure scenarios.
It seems that if b_objects == Py_None, we will have an extra ref to
b_objects. Add XXX comment so hopefully someone documents why the
else isn't necessary or adds it in.
Reported by Klocwork #20
........
r50781 | neal.norwitz | 2006-07-23 09:57:11 +0200 (Sun, 23 Jul 2006) | 2 lines
Fix memory leaks spotted by Klocwork #37.
........
r50782 | neal.norwitz | 2006-07-23 09:59:00 +0200 (Sun, 23 Jul 2006) | 5 lines
nextlink can be NULL if teedataobject_new fails, so use XINCREF.
Ensure that dataobj is never NULL.
Reported by Klocwork #102
........
r50783 | neal.norwitz | 2006-07-23 10:01:43 +0200 (Sun, 23 Jul 2006) | 8 lines
Ensure we don't write beyond errText. I think I got this right, but
it definitely could use some review to ensure I'm not off by one
and there's no possible overflow/wrap-around of bytes_left.
Reported by Klocwork #1.
Fix a problem if there is a failure allocating self->db.
Found with failmalloc.
........
r50784 | ronald.oussoren | 2006-07-23 11:41:09 +0200 (Sun, 23 Jul 2006) | 3 lines
Without this patch CMD-W won't close EditorWindows on MacOS X. This solves
part of bug #1517990.
........
r50785 | ronald.oussoren | 2006-07-23 11:46:11 +0200 (Sun, 23 Jul 2006) | 5 lines
Fix for bug #1517996: Class and Path browsers show Tk menu
This patch replaces the menubar that is used by AquaTk for windows without a
menubar of their own by one that is more appropriate for IDLE.
........
r50786 | andrew.macintyre | 2006-07-23 14:57:02 +0200 (Sun, 23 Jul 2006) | 2 lines
Build updates for OS/2 EMX port
........
r50787 | andrew.macintyre | 2006-07-23 15:00:04 +0200 (Sun, 23 Jul 2006) | 3 lines
bugfix: PyThread_start_new_thread() returns the thread ID, not a flag;
will backport.
........
r50789 | andrew.macintyre | 2006-07-23 15:04:00 +0200 (Sun, 23 Jul 2006) | 2 lines
Get mailbox module working on OS/2 EMX port.
........
r50791 | greg.ward | 2006-07-23 18:05:51 +0200 (Sun, 23 Jul 2006) | 1 line
Resync optparse with Optik 1.5.3: minor tweaks for/to tests.
........
r50794 | martin.v.loewis | 2006-07-24 07:05:22 +0200 (Mon, 24 Jul 2006) | 2 lines
Update list of unsupported systems. Fixes #1510853.
........
r50795 | martin.v.loewis | 2006-07-24 12:26:33 +0200 (Mon, 24 Jul 2006) | 1 line
Patch #1448199: Release GIL around ConnectRegistry.
........
r50796 | martin.v.loewis | 2006-07-24 13:54:53 +0200 (Mon, 24 Jul 2006) | 3 lines
Patch #1232023: Don't include empty path component from registry,
so that the current directory does not get added to sys.path.
Also fixes #1526785.
........
r50797 | martin.v.loewis | 2006-07-24 14:54:17 +0200 (Mon, 24 Jul 2006) | 3 lines
Bug #1524310: Properly report errors from FindNextFile in os.listdir.
Will backport to 2.4.
........
r50800 | georg.brandl | 2006-07-24 15:28:57 +0200 (Mon, 24 Jul 2006) | 7 lines
Patch #1523356: fix determining include dirs in python-config.
Also don't install "python-config" when doing altinstall, but
always install "python-config2.x" and make a link to it like
with the main executable.
........
r50802 | georg.brandl | 2006-07-24 15:46:47 +0200 (Mon, 24 Jul 2006) | 3 lines
Patch #1527744: right order of includes in order to have HAVE_CONIO_H defined properly.
........
r50803 | georg.brandl | 2006-07-24 16:09:56 +0200 (Mon, 24 Jul 2006) | 3 lines
Patch #1515343: Fix printing of deprecated string exceptions with a
value in the traceback module.
........
r50804 | kurt.kaiser | 2006-07-24 19:13:23 +0200 (Mon, 24 Jul 2006) | 7 lines
EditorWindow failed when used stand-alone if sys.ps1 not set.
Bug 1010370 Dave Florek
M EditorWindow.py
M PyShell.py
M NEWS.txt
........
r50805 | kurt.kaiser | 2006-07-24 20:05:51 +0200 (Mon, 24 Jul 2006) | 6 lines
- EditorWindow.test() was failing. Bug 1417598
M EditorWindow.py
M ScriptBinding.py
M NEWS.txt
........
r50808 | georg.brandl | 2006-07-24 22:11:35 +0200 (Mon, 24 Jul 2006) | 3 lines
Repair accidental NameError.
........
r50809 | tim.peters | 2006-07-24 23:02:15 +0200 (Mon, 24 Jul 2006) | 2 lines
Whitespace normalization.
........
r50810 | greg.ward | 2006-07-25 04:11:12 +0200 (Tue, 25 Jul 2006) | 3 lines
Don't use standard assert: want tests to fail even when run with -O.
Delete cruft.
........
r50811 | tim.peters | 2006-07-25 06:07:22 +0200 (Tue, 25 Jul 2006) | 10 lines
current_frames_with_threads(): There's actually no way
to guess /which/ line the spawned thread is in at the time
sys._current_frames() is called: we know it finished
enter_g.set(), but can't know whether the instruction
counter has advanced to the following leave_g.wait().
The latter is overwhelming most likely, but not guaranteed,
and I see that the "x86 Ubuntu dapper (icc) trunk" buildbot
found it on the other line once. Changed the test so it
passes in either case.
........
r50815 | martin.v.loewis | 2006-07-25 11:53:12 +0200 (Tue, 25 Jul 2006) | 2 lines
Bug #1525817: Don't truncate short lines in IDLE's tool tips.
........
r50816 | martin.v.loewis | 2006-07-25 12:05:47 +0200 (Tue, 25 Jul 2006) | 3 lines
Bug #978833: Really close underlying socket in _socketobject.close.
Will backport to 2.4.
........
r50817 | martin.v.loewis | 2006-07-25 12:11:14 +0200 (Tue, 25 Jul 2006) | 1 line
Revert incomplete checkin.
........
r50819 | georg.brandl | 2006-07-25 12:22:34 +0200 (Tue, 25 Jul 2006) | 4 lines
Patch #1525766: correctly pass onerror arg to recursive calls
of pkg.walk_packages. Also improve the docstrings.
........
r50825 | brett.cannon | 2006-07-25 19:32:20 +0200 (Tue, 25 Jul 2006) | 2 lines
Add comment for changes to test_ossaudiodev.
........
r50826 | brett.cannon | 2006-07-25 19:34:36 +0200 (Tue, 25 Jul 2006) | 3 lines
Fix a bug in the messages for an assert failure where not enough arguments to a string
were being converted in the format.
........
r50828 | armin.rigo | 2006-07-25 20:09:57 +0200 (Tue, 25 Jul 2006) | 2 lines
Document why is and is not a good way to fix the gc_inspection crasher.
........
r50829 | armin.rigo | 2006-07-25 20:11:07 +0200 (Tue, 25 Jul 2006) | 5 lines
Added another crasher, which hit me today (I was not intentionally
writing such code, of course, but it took some gdb time to figure out
what my bug was).
........
r50830 | armin.rigo | 2006-07-25 20:38:39 +0200 (Tue, 25 Jul 2006) | 3 lines
Document the crashers that will not go away soon as "won't fix",
and explain why.
........
r50831 | ronald.oussoren | 2006-07-25 21:13:35 +0200 (Tue, 25 Jul 2006) | 3 lines
Install the compatibility symlink to libpython.a on OSX using 'ln -sf' instead
of 'ln -s', this avoid problems when reinstalling python.
........
r50832 | ronald.oussoren | 2006-07-25 21:20:54 +0200 (Tue, 25 Jul 2006) | 7 lines
Fix for bug #1525447 (renaming to MacOSmodule.c would also work, but not
without causing problems for anyone that is on a case-insensitive filesystem).
Setup.py tries to compile the MacOS extension from MacOSmodule.c, while the
actual file is named macosmodule.c. This is no problem on the (default)
case-insensitive filesystem, but doesn't work on case-sensitive filesystems.
........
r50833 | ronald.oussoren | 2006-07-25 22:28:55 +0200 (Tue, 25 Jul 2006) | 7 lines
Fix bug #1517990: IDLE keybindings on OSX
This adds a new key definition for OSX, which is slightly different from the
classic mac definition.
Also add NEWS item for a couple of bugfixes I added recently.
........
r50834 | tim.peters | 2006-07-26 00:30:24 +0200 (Wed, 26 Jul 2006) | 2 lines
Whitespace normalization.
........
r50839 | neal.norwitz | 2006-07-26 06:00:18 +0200 (Wed, 26 Jul 2006) | 1 line
Hmm, only python2.x is installed, not plain python. Did that change recently?
........
r50840 | barry.warsaw | 2006-07-26 07:54:46 +0200 (Wed, 26 Jul 2006) | 6 lines
Forward port some fixes that were in email 2.5 but for some reason didn't make
it into email 4.0. Specifically, in Message.get_content_charset(), handle RFC
2231 headers that contain an encoding not known to Python, or a character in
the data that isn't in the charset encoding. Also forward port the
appropriate unit tests.
........
r50841 | georg.brandl | 2006-07-26 09:23:32 +0200 (Wed, 26 Jul 2006) | 3 lines
NEWS entry for #1525766.
........
r50842 | georg.brandl | 2006-07-26 09:40:17 +0200 (Wed, 26 Jul 2006) | 3 lines
Bug #1459963: properly capitalize HTTP header names.
........
r50843 | georg.brandl | 2006-07-26 10:03:10 +0200 (Wed, 26 Jul 2006) | 6 lines
Part of bug #1523610: fix miscalculation of buffer length.
Also add a guard against NULL in converttuple and add a test case
(that previously would have crashed).
........
r50844 | martin.v.loewis | 2006-07-26 14:12:56 +0200 (Wed, 26 Jul 2006) | 3 lines
Bug #978833: Really close underlying socket in _socketobject.close.
Fix httplib.HTTPConnection.getresponse to not close the
socket if it is still needed for the response.
........
r50845 | andrew.kuchling | 2006-07-26 19:16:52 +0200 (Wed, 26 Jul 2006) | 1 line
[Bug #1471938] Fix build problem on Solaris 8 by conditionalizing the use of mvwgetnstr(); it was conditionalized a few lines below. Fix from Paul Eggert. I also tried out the STRICT_SYSV_CURSES case and am therefore removing the 'untested' comment.
........
r50846 | andrew.kuchling | 2006-07-26 19:18:01 +0200 (Wed, 26 Jul 2006) | 1 line
Correct error message
........
r50847 | andrew.kuchling | 2006-07-26 19:19:39 +0200 (Wed, 26 Jul 2006) | 1 line
Minor grammar fix
........
r50848 | andrew.kuchling | 2006-07-26 19:22:21 +0200 (Wed, 26 Jul 2006) | 1 line
Put news item in right section
........
r50850 | andrew.kuchling | 2006-07-26 20:03:12 +0200 (Wed, 26 Jul 2006) | 1 line
Use sys.exc_info()
........
r50851 | andrew.kuchling | 2006-07-26 20:15:45 +0200 (Wed, 26 Jul 2006) | 1 line
Use sys.exc_info()
........
r50852 | phillip.eby | 2006-07-26 21:48:27 +0200 (Wed, 26 Jul 2006) | 4 lines
Allow the 'onerror' argument to walk_packages() to catch any Exception, not
just ImportError. This allows documentation tools to better skip unimportable
packages.
........
r50854 | tim.peters | 2006-07-27 01:23:15 +0200 (Thu, 27 Jul 2006) | 2 lines
Whitespace normalization.
........
r50855 | tim.peters | 2006-07-27 03:14:53 +0200 (Thu, 27 Jul 2006) | 21 lines
Bug #1521947: possible bug in mystrtol.c with recent gcc.
In general, C doesn't define anything about what happens when
an operation on a signed integral type overflows, and PyOS_strtol()
did several formally undefined things of that nature on signed
longs. Some version of gcc apparently tries to exploit that now,
and PyOS_strtol() could fail to detect overflow then.
Tried to repair all that, although it seems at least as likely to me
that we'll get screwed by bad platform definitions for LONG_MIN
and/or LONG_MAX now. For that reason, I don't recommend backporting
this.
Note that I have no box on which this makes a lick of difference --
can't really test it, except to note that it didn't break anything
on my boxes.
Silent change: PyOS_strtol() used to return the hard-coded 0x7fffffff
in case of overflow. Now it returns LONG_MAX. They're the same only on
32-bit boxes (although C doesn't guarantee that either ...).
........
r50856 | neal.norwitz | 2006-07-27 05:51:58 +0200 (Thu, 27 Jul 2006) | 6 lines
Don't kill a normal instance of python running on windows when checking
to kill a cygwin instance. build\\python.exe was matching a normal windows
instance. Prefix that with a \\ to ensure build is a directory and not
PCbuild. As discussed on python-dev.
........
r50857 | neal.norwitz | 2006-07-27 05:55:39 +0200 (Thu, 27 Jul 2006) | 5 lines
Closure can't be NULL at this point since we know it's a tuple.
Reported by Klocwork # 74.
........
r50858 | neal.norwitz | 2006-07-27 06:04:50 +0200 (Thu, 27 Jul 2006) | 1 line
No functional change. Add comment and assert to describe why there cannot be overflow which was reported by Klocwork. Discussed on python-dev
........
r50859 | martin.v.loewis | 2006-07-27 08:38:16 +0200 (Thu, 27 Jul 2006) | 3 lines
Bump distutils version to 2.5, as several new features
have been introduced since 2.4.
........
r50860 | andrew.kuchling | 2006-07-27 14:18:20 +0200 (Thu, 27 Jul 2006) | 1 line
Reformat docstring; fix typo
........
r50861 | georg.brandl | 2006-07-27 17:05:36 +0200 (Thu, 27 Jul 2006) | 6 lines
Add test_main() methods. These three tests were never run
by regrtest.py.
We really need a simpler testing framework.
........
r50862 | tim.peters | 2006-07-27 17:09:20 +0200 (Thu, 27 Jul 2006) | 2 lines
News for patch #1529686.
........
r50863 | tim.peters | 2006-07-27 17:11:00 +0200 (Thu, 27 Jul 2006) | 2 lines
Whitespace normalization.
........
r50864 | georg.brandl | 2006-07-27 17:38:33 +0200 (Thu, 27 Jul 2006) | 3 lines
Amend news entry.
........
r50865 | georg.brandl | 2006-07-27 18:08:15 +0200 (Thu, 27 Jul 2006) | 3 lines
Make uuid test suite pass on this box by requesting output with LC_ALL=C.
........
r50866 | andrew.kuchling | 2006-07-27 20:37:33 +0200 (Thu, 27 Jul 2006) | 1 line
Add example
........
r50867 | thomas.heller | 2006-07-27 20:39:55 +0200 (Thu, 27 Jul 2006) | 9 lines
Remove code that is no longer used (ctypes.com).
Fix the DllGetClassObject and DllCanUnloadNow so that they forward the
call to the comtypes.server.inprocserver module.
The latter was never documented, never used by published code, and
didn't work anyway, so I think it does not deserve a NEWS entry (but I
might be wrong).
........
r50868 | andrew.kuchling | 2006-07-27 20:41:21 +0200 (Thu, 27 Jul 2006) | 1 line
Typo fix ('publically' is rare, poss. non-standard)
........
r50869 | andrew.kuchling | 2006-07-27 20:42:41 +0200 (Thu, 27 Jul 2006) | 1 line
Add missing word
........
r50870 | andrew.kuchling | 2006-07-27 20:44:10 +0200 (Thu, 27 Jul 2006) | 1 line
Repair typos
........
r50872 | andrew.kuchling | 2006-07-27 20:53:33 +0200 (Thu, 27 Jul 2006) | 1 line
Update URL; add example
........
r50873 | andrew.kuchling | 2006-07-27 21:07:29 +0200 (Thu, 27 Jul 2006) | 1 line
Add punctuation mark; add some examples
........
r50874 | andrew.kuchling | 2006-07-27 21:11:07 +0200 (Thu, 27 Jul 2006) | 1 line
Mention base64 module; rewrite last sentence to be more positive
........
r50875 | andrew.kuchling | 2006-07-27 21:12:49 +0200 (Thu, 27 Jul 2006) | 1 line
If binhex is higher-level than binascii, it should come first in the chapter
........
r50876 | tim.peters | 2006-07-27 22:47:24 +0200 (Thu, 27 Jul 2006) | 28 lines
check_node(): stop spraying mystery output to stderr.
When a node number disagrees, keep track of all sources & the
node numbers they reported, and stick all that in the error message.
Changed all callers to supply a non-empty "source" argument; made
the "source" argument non-optional.
On my box, test_uuid still fails, but with the less confusing output:
AssertionError: different sources disagree on node:
from source 'getnode1', node was 00038a000015
from source 'getnode2', node was 00038a000015
from source 'ipconfig', node was 001111b2b7bf
Only the last one appears to be correct; e.g.,
C:\Code\python\PCbuild>getmac
Physical Address Transport Name
=================== ==========================================================
00-11-11-B2-B7-BF \Device\Tcpip_{190FB163-5AFD-4483-86A1-2FE16AC61FF1}
62-A1-AC-6C-FD-BE \Device\Tcpip_{8F77DF5A-EA3D-4F1D-975E-D472CEE6438A}
E2-1F-01-C6-5D-88 \Device\Tcpip_{CD18F76B-2EF3-409F-9B8A-6481EE70A1E4}
I can't find anything on my box with MAC 00-03-8a-00-00-15, and am
not clear on where that comes from.
........
r50878 | andrew.kuchling | 2006-07-28 00:40:05 +0200 (Fri, 28 Jul 2006) | 1 line
Reword paragraph
........
r50879 | andrew.kuchling | 2006-07-28 00:49:38 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50880 | andrew.kuchling | 2006-07-28 00:49:54 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50881 | barry.warsaw | 2006-07-28 01:43:15 +0200 (Fri, 28 Jul 2006) | 27 lines
Patch #1520294: Support for getset and member descriptors in types.py,
inspect.py, and pydoc.py. Specifically, this allows for querying the type of
an object against these built-in C types and more importantly, for getting
their docstrings printed in the interactive interpreter's help() function.
This patch includes a new built-in module called _types which provides
definitions of getset and member descriptors for use by the types.py module.
These types are exposed as types.GetSetDescriptorType and
types.MemberDescriptorType. Query functions are provided as
inspect.isgetsetdescriptor() and inspect.ismemberdescriptor(). The
implementations of these are robust enough to work with Python implementations
other than CPython, which may not have these fundamental types.
The patch also includes documentation and test suite updates.
I commit these changes now under these guiding principles:
1. Silence is assent. The release manager has not said "no", and of the few
people that cared enough to respond to the thread, the worst vote was "0".
2. It's easier to ask for forgiveness than permission.
3. It's so dang easy to revert stuff in svn, that you could view this as a
forcing function. :)
Windows build patches will follow.
........
r50882 | tim.peters | 2006-07-28 01:44:37 +0200 (Fri, 28 Jul 2006) | 4 lines
Bug #1529297: The rewrite of doctest for Python 2.4 unintentionally
lost that tests are sorted by name before being run. ``DocTestFinder``
has been changed to sort the list of tests it returns.
........
r50883 | tim.peters | 2006-07-28 01:45:48 +0200 (Fri, 28 Jul 2006) | 2 lines
Whitespace normalization.
........
r50884 | tim.peters | 2006-07-28 01:46:36 +0200 (Fri, 28 Jul 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r50885 | barry.warsaw | 2006-07-28 01:50:40 +0200 (Fri, 28 Jul 2006) | 4 lines
Enable the building of the _types module on Windows.
Note that this has only been tested for VS 2003 since that's all I have.
........
r50887 | tim.peters | 2006-07-28 02:23:15 +0200 (Fri, 28 Jul 2006) | 7 lines
defdict_reduce(): Plug leaks.
We didn't notice these before because test_defaultdict didn't
actually do anything before Georg fixed that earlier today.
Neal's next refleak run then showed test_defaultdict leaking
9 references on each run. That's repaired by this checkin.
........
r50888 | tim.peters | 2006-07-28 02:30:00 +0200 (Fri, 28 Jul 2006) | 2 lines
News about the repaired memory leak in defaultdict.
........
r50889 | gregory.p.smith | 2006-07-28 03:35:25 +0200 (Fri, 28 Jul 2006) | 7 lines
- pybsddb Bug #1527939: bsddb module DBEnv dbremove and dbrename
methods now allow their database parameter to be None as the
sleepycat API allows.
Also adds an appropriate test case for DBEnv.dbrename and dbremove.
........
r50895 | neal.norwitz | 2006-07-28 06:22:34 +0200 (Fri, 28 Jul 2006) | 1 line
Ensure the actual number matches the expected count
........
r50896 | tim.peters | 2006-07-28 06:51:59 +0200 (Fri, 28 Jul 2006) | 6 lines
Live with that "the hardware address" is an ill-defined
concept, and that different ways of trying to find "the
hardware address" may return different results. Certainly
true on both of my Windows boxes, and in different ways
(see whining on python-dev).
........
r50897 | neal.norwitz | 2006-07-28 09:21:27 +0200 (Fri, 28 Jul 2006) | 3 lines
Try to find the MAC addr on various flavours of Unix. This seems hopeless.
The reduces the test_uuid failures, but there's still another method failing.
........
r50898 | martin.v.loewis | 2006-07-28 09:45:49 +0200 (Fri, 28 Jul 2006) | 2 lines
Add UUID for upcoming 2.5b3.
........
r50899 | matt.fleming | 2006-07-28 13:27:27 +0200 (Fri, 28 Jul 2006) | 3 lines
Allow socketmodule to compile on NetBSD -current, whose bluetooth API
differs from both Linux and FreeBSD. Accepted by Neal Norwitz.
........
r50900 | andrew.kuchling | 2006-07-28 14:07:12 +0200 (Fri, 28 Jul 2006) | 1 line
[Patch #1529811] Correction to description of r|* mode
........
r50901 | andrew.kuchling | 2006-07-28 14:18:22 +0200 (Fri, 28 Jul 2006) | 1 line
Typo fix
........
r50902 | andrew.kuchling | 2006-07-28 14:32:43 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50903 | andrew.kuchling | 2006-07-28 14:33:19 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50904 | andrew.kuchling | 2006-07-28 14:45:55 +0200 (Fri, 28 Jul 2006) | 1 line
Don't overwrite built-in name; add some blank lines for readability
........
r50905 | andrew.kuchling | 2006-07-28 14:48:07 +0200 (Fri, 28 Jul 2006) | 1 line
Add example. Should I propagate this example to all the other DBM-ish modules, too?
........
r50912 | georg.brandl | 2006-07-28 20:31:39 +0200 (Fri, 28 Jul 2006) | 3 lines
Patch #1529686: also run test_email_codecs with regrtest.py.
........
r50913 | georg.brandl | 2006-07-28 20:36:01 +0200 (Fri, 28 Jul 2006) | 3 lines
Fix spelling.
........
r50915 | thomas.heller | 2006-07-28 21:42:40 +0200 (Fri, 28 Jul 2006) | 3 lines
Remove a useless XXX comment.
Cosmetic changes to the code so that the #ifdef _UNICODE block
doesn't mess emacs code formatting.
........
r50916 | phillip.eby | 2006-07-28 23:12:07 +0200 (Fri, 28 Jul 2006) | 5 lines
Bug #1529871: The speed enhancement patch #921466 broke Python's compliance
with PEP 302. This was fixed by adding an ``imp.NullImporter`` type that is
used in ``sys.path_importer_cache`` to cache non-directory paths and avoid
excessive filesystem operations during imports.
........
r50917 | phillip.eby | 2006-07-28 23:31:54 +0200 (Fri, 28 Jul 2006) | 2 lines
Fix svn merge spew.
........
r50918 | thomas.heller | 2006-07-28 23:43:20 +0200 (Fri, 28 Jul 2006) | 4 lines
Patch #1529514: More openbsd platforms for ctypes.
Regenerated Modules/_ctypes/libffi/configure with autoconf 2.59.
Approved by Neal.
........
r50922 | georg.brandl | 2006-07-29 10:51:21 +0200 (Sat, 29 Jul 2006) | 2 lines
Bug #835255: The "closure" argument to new.function() is now documented.
........
r50924 | georg.brandl | 2006-07-29 11:33:26 +0200 (Sat, 29 Jul 2006) | 3 lines
Bug #1441397: The compiler module now recognizes module and function
docstrings correctly as it did in Python 2.4.
........
r50925 | georg.brandl | 2006-07-29 12:25:46 +0200 (Sat, 29 Jul 2006) | 4 lines
Revert rev 42617, it was introduced to work around bug #1441397.
test_compiler now passes again.
........
r50926 | fred.drake | 2006-07-29 15:22:49 +0200 (Sat, 29 Jul 2006) | 1 line
update target version number
........
r50927 | andrew.kuchling | 2006-07-29 15:56:48 +0200 (Sat, 29 Jul 2006) | 1 line
Add example
........
r50928 | andrew.kuchling | 2006-07-29 16:04:47 +0200 (Sat, 29 Jul 2006) | 1 line
Update URL
........
r50930 | andrew.kuchling | 2006-07-29 16:08:15 +0200 (Sat, 29 Jul 2006) | 1 line
Reword paragraph to match the order of the subsequent sections
........
r50931 | andrew.kuchling | 2006-07-29 16:21:15 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1529157] Mention raw_input() and input(); while I'm at it, reword the description a bit
........
r50932 | andrew.kuchling | 2006-07-29 16:42:48 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1519571] Document some missing functions: setup(), title(), done()
........
r50933 | andrew.kuchling | 2006-07-29 16:43:55 +0200 (Sat, 29 Jul 2006) | 1 line
Fix docstring punctuation
........
r50934 | andrew.kuchling | 2006-07-29 17:10:32 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1414697] Change docstring of set/frozenset types to specify that the contents are unique. Raymond, please feel free to edit or revert.
........
r50935 | andrew.kuchling | 2006-07-29 17:35:21 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1530382] Document SSL.server(), .issuer() methods
........
r50936 | andrew.kuchling | 2006-07-29 17:42:46 +0200 (Sat, 29 Jul 2006) | 1 line
Typo fix
........
r50937 | andrew.kuchling | 2006-07-29 17:43:13 +0200 (Sat, 29 Jul 2006) | 1 line
Tweak wording
........
r50938 | matt.fleming | 2006-07-29 17:55:30 +0200 (Sat, 29 Jul 2006) | 2 lines
Fix typo
........
r50939 | andrew.kuchling | 2006-07-29 17:57:08 +0200 (Sat, 29 Jul 2006) | 6 lines
[Bug #1528258] Mention that the 'data' argument can be None.
The constructor docs referred the reader to the add_data() method's docs,
but they weren't very helpful. I've simply copied an earlier explanation
of 'data' that's more useful.
........
r50940 | andrew.kuchling | 2006-07-29 18:08:40 +0200 (Sat, 29 Jul 2006) | 1 line
Set bug/patch count. Take a bow, everyone!
........
r50941 | fred.drake | 2006-07-29 18:56:15 +0200 (Sat, 29 Jul 2006) | 18 lines
expunge the xmlcore changes:
41667, 41668 - initial switch to xmlcore
47044 - mention of xmlcore in What's New
50687 - mention of xmlcore in the library reference
re-apply xmlcore changes to xml:
41674 - line ending changes (re-applied manually), directory props
41677 - add cElementTree wrapper
41678 - PSF licensing for etree
41812 - whitespace normalization
42724 - fix svn:eol-style settings
43681, 43682 - remove Python version-compatibility cruft from minidom
46773 - fix encoding of \r\n\t in attr values in saxutils
47269 - added XMLParser alias for cElementTree compatibility
additional tests were added in Lib/test/test_sax.py that failed with
the xmlcore changes; these relate to SF bugs #1511497, #1513611
........
r50942 | andrew.kuchling | 2006-07-29 20:14:07 +0200 (Sat, 29 Jul 2006) | 17 lines
Reorganize the docs for 'file' and 'open()' after some discussion with Fred.
We want to encourage users to write open() when opening a file, but
open() was described with a single paragraph and
'file' had lots of explanation of the mode and bufsize arguments.
I've shrunk the description of 'file' to cross-reference to the 'File
objects' section, and to open() for an explanation of the arguments.
open() now has all the paragraphs about the mode string. The bufsize
argument was moved up so that it isn't buried at the end; now there's
1 paragraph on mode, 1 on bufsize, and then 3 more on mode. Various
other edits and rearrangements were made in the process.
It's probably best to read the final text and not to try to make sense
of the diffs.
........
r50943 | fred.drake | 2006-07-29 20:19:19 +0200 (Sat, 29 Jul 2006) | 1 line
restore test un-intentionally removed in the xmlcore purge (revision 50941)
........
r50944 | fred.drake | 2006-07-29 20:33:29 +0200 (Sat, 29 Jul 2006) | 3 lines
make the reference to older versions of the documentation a link
to the right page on python.org
........
r50945 | fred.drake | 2006-07-29 21:09:01 +0200 (Sat, 29 Jul 2006) | 1 line
document the footnote usage pattern
........
r50947 | fred.drake | 2006-07-29 21:14:10 +0200 (Sat, 29 Jul 2006) | 1 line
emphasize and oddball nuance of LaTeX comment syntax
........
r50948 | andrew.kuchling | 2006-07-29 21:24:04 +0200 (Sat, 29 Jul 2006) | 1 line
[Patch #1490989 from Skip Montanaro] Mention debugging builds in the API documentation. I've changed Skip's patch to point to Misc/SpecialBuilds and fiddled with the markup a bit.
........
r50949 | neal.norwitz | 2006-07-29 21:29:35 +0200 (Sat, 29 Jul 2006) | 6 lines
Disable these tests until they are reliable across platforms.
These problems may mask more important, real problems.
One or both methods are known to fail on: Solaris, OpenBSD, Debian, Ubuntu.
They pass on Windows and some Linux boxes.
........
r50950 | andrew.kuchling | 2006-07-29 21:50:37 +0200 (Sat, 29 Jul 2006) | 1 line
[Patch #1068277] Clarify that os.path.exists() can return False depending on permissions. Fred approved committing this patch in December 2004!
........
r50952 | fred.drake | 2006-07-29 22:04:42 +0200 (Sat, 29 Jul 2006) | 6 lines
SF bug #1193966: Weakref types documentation misplaced
The information about supporting weakrefs with types defined in C extensions
is moved to the Extending & Embedding manual. Py_TPFLAGS_HAVE_WEAKREFS is
no longer mentioned since it is part of Py_TPFLAGS_DEFAULT.
........
r50953 | skip.montanaro | 2006-07-29 22:06:05 +0200 (Sat, 29 Jul 2006) | 4 lines
Add a comment to the csv reader documentation that explains why the
treatment of newlines changed in 2.5. Pulled almost verbatim from a comment
by Andrew McNamara in <http://python.org/sf/1465014>.
........
r50954 | neal.norwitz | 2006-07-29 22:20:52 +0200 (Sat, 29 Jul 2006) | 3 lines
If the executable doesn't exist, there's no reason to try to start it.
This prevents garbage about command not found being printed on Solaris.
........
r50955 | fred.drake | 2006-07-29 22:21:25 +0200 (Sat, 29 Jul 2006) | 1 line
fix minor markup error that introduced extra punctuation
........
r50957 | neal.norwitz | 2006-07-29 22:37:08 +0200 (Sat, 29 Jul 2006) | 3 lines
Disable test_getnode too, since this is also unreliable.
........
r50958 | andrew.kuchling | 2006-07-29 23:27:12 +0200 (Sat, 29 Jul 2006) | 1 line
Follow TeX's conventions for hyphens
........
r50959 | andrew.kuchling | 2006-07-29 23:30:21 +0200 (Sat, 29 Jul 2006) | 1 line
Fix case for 'Unix'
........
r50960 | fred.drake | 2006-07-30 01:34:57 +0200 (Sun, 30 Jul 2006) | 1 line
markup cleanups
........
r50961 | andrew.kuchling | 2006-07-30 02:27:34 +0200 (Sun, 30 Jul 2006) | 1 line
Minor typo fixes
........
r50962 | andrew.kuchling | 2006-07-30 02:37:56 +0200 (Sun, 30 Jul 2006) | 1 line
[Bug #793553] Correct description of keyword arguments for SSL authentication
........
r50963 | tim.peters | 2006-07-30 02:58:15 +0200 (Sun, 30 Jul 2006) | 2 lines
Whitespace normalization.
........
r50964 | fred.drake | 2006-07-30 05:03:43 +0200 (Sun, 30 Jul 2006) | 1 line
lots of markup nits, most commonly Unix/unix --> \UNIX
........
r50965 | fred.drake | 2006-07-30 07:41:28 +0200 (Sun, 30 Jul 2006) | 1 line
update information on wxPython, from Robin Dunn
........
r50966 | fred.drake | 2006-07-30 07:49:49 +0200 (Sun, 30 Jul 2006) | 4 lines
remove possibly-outdated comment on what GUI toolkit is most commonly used;
it is hard to know whether this is right, and it does not add valuable reference information
at any rate
........
r50967 | fred.drake | 2006-07-30 07:55:39 +0200 (Sun, 30 Jul 2006) | 3 lines
- remove yet another reference to how commonly Tkinter is (thought to be) used
- fix an internal section reference
........
r50968 | neal.norwitz | 2006-07-30 08:53:31 +0200 (Sun, 30 Jul 2006) | 4 lines
Patch #1531113: Fix augmented assignment with yield expressions.
Also fix a SystemError when trying to assign to yield expressions.
........
r50969 | neal.norwitz | 2006-07-30 08:55:48 +0200 (Sun, 30 Jul 2006) | 5 lines
Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().
This provides the proper warning for struct.pack().
PyErr_Warn() is now deprecated in favor of PyErr_WarnEx().
As mentioned by Tim Peters on python-dev.
........
r50970 | neal.norwitz | 2006-07-30 08:57:04 +0200 (Sun, 30 Jul 2006) | 3 lines
Bug #1515471: string.replace() accepts character buffers again.
Pass the char* and size around rather than PyObject's.
........
r50971 | neal.norwitz | 2006-07-30 08:59:13 +0200 (Sun, 30 Jul 2006) | 1 line
Whitespace normalization
........
r50973 | georg.brandl | 2006-07-30 12:53:32 +0200 (Sun, 30 Jul 2006) | 3 lines
Clarify that __op__ methods must return NotImplemented if they don't support the operation.
........
r50974 | georg.brandl | 2006-07-30 13:07:23 +0200 (Sun, 30 Jul 2006) | 3 lines
Bug #1002398: The documentation for os.path.sameopenfile now correctly
refers to file descriptors, not file objects.
........
r50977 | martin.v.loewis | 2006-07-30 15:00:31 +0200 (Sun, 30 Jul 2006) | 3 lines
Don't copy directory stat times in shutil.copytree on Windows
Fixes #1525866.
........
r50978 | martin.v.loewis | 2006-07-30 15:14:05 +0200 (Sun, 30 Jul 2006) | 3 lines
Base __version__ on sys.version_info, as distutils is
no longer maintained separatedly.
........
r50979 | martin.v.loewis | 2006-07-30 15:27:31 +0200 (Sun, 30 Jul 2006) | 3 lines
Mention Cygwin in distutils error message about a missing VS 2003.
Fixes #1257728.
........
r50982 | martin.v.loewis | 2006-07-30 16:09:47 +0200 (Sun, 30 Jul 2006) | 5 lines
Drop usage of test -e in configure as it is not portable.
Fixes #1439538
Will backport to 2.4
Also regenerate pyconfig.h.in.
........
r50984 | georg.brandl | 2006-07-30 18:20:10 +0200 (Sun, 30 Jul 2006) | 3 lines
Fix makefile changes for python-config.
........
r50985 | george.yoshida | 2006-07-30 18:37:37 +0200 (Sun, 30 Jul 2006) | 2 lines
Rename struct.pack_to to struct.pack_into as changed in revision 46642.
........
r50986 | george.yoshida | 2006-07-30 18:41:30 +0200 (Sun, 30 Jul 2006) | 2 lines
Typo fix
........
r50987 | neal.norwitz | 2006-07-30 21:18:13 +0200 (Sun, 30 Jul 2006) | 1 line
Add some asserts and update comments
........
r50988 | neal.norwitz | 2006-07-30 21:18:38 +0200 (Sun, 30 Jul 2006) | 1 line
Verify that the signal handlers were really called
........
r50989 | neal.norwitz | 2006-07-30 21:20:42 +0200 (Sun, 30 Jul 2006) | 3 lines
Try to prevent hangs on Tru64/Alpha buildbot. I'm not certain this will help
and may need to be reverted if it causes problems.
........
r50990 | georg.brandl | 2006-07-30 22:18:51 +0200 (Sun, 30 Jul 2006) | 2 lines
Bug #1531349: right <-> left glitch in __rop__ description.
........
r50992 | tim.peters | 2006-07-31 03:46:03 +0200 (Mon, 31 Jul 2006) | 2 lines
Whitespace normalization.
........
r50993 | andrew.mcnamara | 2006-07-31 04:27:48 +0200 (Mon, 31 Jul 2006) | 2 lines
Redo the comment about the 2.5 change in quoted-newline handling.
........
r50994 | tim.peters | 2006-07-31 04:40:23 +0200 (Mon, 31 Jul 2006) | 10 lines
ZipFile.close(): Killed one of the struct.pack deprecation
warnings on Win32.
Also added an XXX about the line:
pos3 = self.fp.tell()
`pos3` is never referenced, and I have no idea what the code
intended to do instead.
........
r50996 | tim.peters | 2006-07-31 04:53:03 +0200 (Mon, 31 Jul 2006) | 8 lines
ZipFile.close(): Kill the other struct.pack deprecation
warning on Windows.
Afraid I can't detect a pattern to when the pack formats decide
to use a signed or unsigned format code -- appears nearly
arbitrary to my eyes. So I left all the pack formats alone and
changed the special-case data values instead.
........
r50997 | skip.montanaro | 2006-07-31 05:09:45 +0200 (Mon, 31 Jul 2006) | 1 line
minor tweaks
........
r50998 | skip.montanaro | 2006-07-31 05:11:11 +0200 (Mon, 31 Jul 2006) | 1 line
minor tweaks
........
r50999 | andrew.kuchling | 2006-07-31 14:20:24 +0200 (Mon, 31 Jul 2006) | 1 line
Add refcounts for PyErr_WarnEx
........
r51000 | andrew.kuchling | 2006-07-31 14:39:05 +0200 (Mon, 31 Jul 2006) | 9 lines
Document PyErr_WarnEx. (Bad Neal! No biscuit!)
Is the explanation of the 'stacklevel' parameter clear? Please feel free
to edit it.
I don't have LaTeX installed on this machine, so haven't verified that the
markup is correct. Will check tonight, or maybe the automatic doc build will
tell me.
........
r51001 | andrew.kuchling | 2006-07-31 14:52:26 +0200 (Mon, 31 Jul 2006) | 1 line
Add PyErr_WarnEx()
........
r51002 | andrew.kuchling | 2006-07-31 15:18:27 +0200 (Mon, 31 Jul 2006) | 1 line
Mention csv newline changes
........
r51003 | andrew.kuchling | 2006-07-31 17:22:58 +0200 (Mon, 31 Jul 2006) | 1 line
Typo fix
........
r51004 | andrew.kuchling | 2006-07-31 17:23:43 +0200 (Mon, 31 Jul 2006) | 1 line
Remove reference to notation
........
r51005 | georg.brandl | 2006-07-31 18:00:34 +0200 (Mon, 31 Jul 2006) | 3 lines
Fix function name.
........
r51006 | andrew.kuchling | 2006-07-31 18:10:24 +0200 (Mon, 31 Jul 2006) | 1 line
[Bug #1514540] Instead of putting the standard types in a section, put them in a chapter of their own. This means string methods will now show up in the ToC. (Should the types come before or after the functions+exceptions+constants chapter? I've put them after, for now.)
........
r51007 | andrew.kuchling | 2006-07-31 18:22:05 +0200 (Mon, 31 Jul 2006) | 1 line
[Bug #848556] Remove \d* from second alternative to avoid exponential case when repeating match
........
r51008 | andrew.kuchling | 2006-07-31 18:27:57 +0200 (Mon, 31 Jul 2006) | 1 line
Update list of files; fix a typo
........
r51013 | andrew.kuchling | 2006-08-01 18:24:30 +0200 (Tue, 01 Aug 2006) | 1 line
typo fix
........
r51018 | thomas.heller | 2006-08-01 18:54:43 +0200 (Tue, 01 Aug 2006) | 2 lines
Fix a potential segfault and various potentail refcount leaks
in the cast() function.
........
r51020 | thomas.heller | 2006-08-01 19:46:10 +0200 (Tue, 01 Aug 2006) | 1 line
Minimal useful docstring for CopyComPointer.
........
r51021 | andrew.kuchling | 2006-08-01 20:16:15 +0200 (Tue, 01 Aug 2006) | 8 lines
[Patch #1520905] Attempt to suppress core file created by test_subprocess.py.
Patch by Douglas Greiman.
The test_run_abort() testcase produces a core file on Unix systems,
even though the test is successful. This can be confusing or alarming
to someone who runs 'make test' and then finds that the Python
interpreter apparently crashed.
........
r51023 | georg.brandl | 2006-08-01 20:49:24 +0200 (Tue, 01 Aug 2006) | 3 lines
os.urandom no longer masks unrelated exceptions like SystemExit or
KeyboardInterrupt.
........
r51025 | thomas.heller | 2006-08-01 21:14:15 +0200 (Tue, 01 Aug 2006) | 2 lines
Speed up PyType_stgdict and PyObject_stgdict.
........
r51027 | ronald.oussoren | 2006-08-01 22:30:31 +0200 (Tue, 01 Aug 2006) | 3 lines
Make sure the postinstall action that optionally updates the user's profile
on MacOS X actually works correctly in all cases.
........
r51028 | ronald.oussoren | 2006-08-01 23:00:57 +0200 (Tue, 01 Aug 2006) | 4 lines
This fixes bug #1527397: PythonLauncher runs scripts with the wrong working
directory. It also fixes a bug where PythonLauncher failed to launch scripts
when the scriptname (or the path to the script) contains quotes.
........
r51031 | tim.peters | 2006-08-02 05:27:46 +0200 (Wed, 02 Aug 2006) | 2 lines
Whitespace normalization.
........
r51032 | tim.peters | 2006-08-02 06:12:36 +0200 (Wed, 02 Aug 2006) | 19 lines
Try to squash struct.pack warnings on the "amd64 gentoo trunk"
buildbot (& possibly other 64-bit boxes) during test_gzip.
The native zlib crc32 function returns an unsigned 32-bit integer,
which the Python wrapper implicitly casts to C long. Therefore the
same crc can "look negative" on a 32-bit box but "look positive" on
a 64-bit box. This patch papers over that platform difference when
writing the crc to file.
It may be better to change the Python wrapper, either to make
the result "look positive" on all platforms (which means it may
have to return a Python long at times on a 32-bit box), or to
keep the sign the same across boxes. But that would be a visible
change in what users see, while the current hack changes no
visible behavior (well, apart from stopping the struct deprecation
warning).
Note that the module-level write32() function is no longer used.
........
r51033 | neal.norwitz | 2006-08-02 06:27:11 +0200 (Wed, 02 Aug 2006) | 4 lines
Prevent memory leak on error.
Reported by Klocwork #36
........
r51034 | tim.peters | 2006-08-02 07:20:08 +0200 (Wed, 02 Aug 2006) | 9 lines
_Stream.close(): Try to kill struct.pack() warnings when
writing the crc to file on the "PPC64 Debian trunk" buildbot
when running test_tarfile.
This is again a case where the native zlib crc is an unsigned
32-bit int, but the Python wrapper implicitly casts it to
signed C long, so that "the sign bit looks different" on
different platforms.
........
r51035 | ronald.oussoren | 2006-08-02 08:10:10 +0200 (Wed, 02 Aug 2006) | 2 lines
Updated documentation for the script that builds the OSX installer.
........
r51036 | neal.norwitz | 2006-08-02 08:14:22 +0200 (Wed, 02 Aug 2006) | 2 lines
_PyWeakref_GetWeakrefCount() now returns a Py_ssize_t instead of long.
........
r51037 | neal.norwitz | 2006-08-02 08:15:10 +0200 (Wed, 02 Aug 2006) | 1 line
v is already checked for NULL, so just DECREF it
........
r51038 | neal.norwitz | 2006-08-02 08:19:19 +0200 (Wed, 02 Aug 2006) | 1 line
Let us know when there was a problem and the child had to kill the parent
........
r51039 | neal.norwitz | 2006-08-02 08:46:21 +0200 (Wed, 02 Aug 2006) | 5 lines
Patch #1519025 and bug #926423: If a KeyboardInterrupt occurs during
a socket operation on a socket with a timeout, the exception will be
caught correctly. Previously, the exception was not caught.
........
r51040 | neal.norwitz | 2006-08-02 09:09:32 +0200 (Wed, 02 Aug 2006) | 1 line
Add some explanation about Klocwork and Coverity static analysis
........
r51041 | anthony.baxter | 2006-08-02 09:43:09 +0200 (Wed, 02 Aug 2006) | 1 line
pre-release machinations
........
r51043 | thomas.heller | 2006-08-02 13:35:31 +0200 (Wed, 02 Aug 2006) | 4 lines
A few nore words about what ctypes does.
Document that using the wrong calling convention can also raise
'ValueError: Procedure called with the wrong number of arguments'.
........
r51045 | thomas.heller | 2006-08-02 14:00:13 +0200 (Wed, 02 Aug 2006) | 1 line
Fix a mistake.
........
r51046 | martin.v.loewis | 2006-08-02 15:53:55 +0200 (Wed, 02 Aug 2006) | 3 lines
Correction of patch #1455898: In the mbcs decoder, set final=False
for stream decoder, but final=True for the decode function.
........
r51049 | tim.peters | 2006-08-02 20:19:35 +0200 (Wed, 02 Aug 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r51079 | neal.norwitz | 2006-08-04 06:50:21 +0200 (Fri, 04 Aug 2006) | 3 lines
Bug #1531405, format_exception no longer raises an exception if
str(exception) raised an exception.
........
r51080 | neal.norwitz | 2006-08-04 06:58:47 +0200 (Fri, 04 Aug 2006) | 11 lines
Bug #1191458: tracing over for loops now produces a line event
on each iteration. I'm not positive this is the best way to handle
this. I'm also not sure that there aren't other cases where
the lnotab is generated incorrectly. It would be great if people
that use pdb or tracing could test heavily.
Also:
* Remove dead/duplicated code that wasn't used/necessary
because we already handled the docstring prior to entering the loop.
* add some debugging code into the compiler (#if 0'd out).
........
r51081 | neal.norwitz | 2006-08-04 07:09:28 +0200 (Fri, 04 Aug 2006) | 4 lines
Bug #1333982: string/number constants were inappropriately stored
in the byte code and co_consts even if they were not used, ie
immediately popped off the stack.
........
r51082 | neal.norwitz | 2006-08-04 07:12:19 +0200 (Fri, 04 Aug 2006) | 1 line
There were really two issues
........
r51084 | fred.drake | 2006-08-04 07:17:21 +0200 (Fri, 04 Aug 2006) | 1 line
SF patch #1534048 (bug #1531003): fix typo in error message
........
r51085 | gregory.p.smith | 2006-08-04 07:17:47 +0200 (Fri, 04 Aug 2006) | 3 lines
fix typos
........
r51087 | georg.brandl | 2006-08-04 08:03:53 +0200 (Fri, 04 Aug 2006) | 3 lines
Fix bug caused by first decrefing, then increfing.
........
r51109 | neil.schemenauer | 2006-08-04 18:20:30 +0200 (Fri, 04 Aug 2006) | 5 lines
Fix the 'compiler' package to generate correct code for MAKE_CLOSURE.
In the 2.5 development cycle, MAKE_CLOSURE as changed to take free
variables as a tuple rather than as individual items on the stack.
Closes patch #1534084.
........
r51110 | georg.brandl | 2006-08-04 20:03:37 +0200 (Fri, 04 Aug 2006) | 3 lines
Change fix for segfaulting property(), add a NEWS entry and a test.
........
r51111 | georg.brandl | 2006-08-04 20:07:34 +0200 (Fri, 04 Aug 2006) | 3 lines
Better fix for bug #1531405, not executing str(value) twice.
........
r51112 | thomas.heller | 2006-08-04 20:17:40 +0200 (Fri, 04 Aug 2006) | 1 line
On Windows, make PyErr_Warn an exported function again.
........
r51113 | thomas.heller | 2006-08-04 20:57:34 +0200 (Fri, 04 Aug 2006) | 4 lines
Fix #1530448 - fix ctypes build failure on solaris 10.
The '-mimpure-text' linker flag is required when linking _ctypes.so.
........
r51114 | thomas.heller | 2006-08-04 21:49:31 +0200 (Fri, 04 Aug 2006) | 3 lines
Fix #1534738: win32 debug version of _msi must be _msi_d.pyd, not _msi.pyd.
Fix the name of the pdb file as well.
........
r51115 | andrew.kuchling | 2006-08-04 22:37:43 +0200 (Fri, 04 Aug 2006) | 1 line
Typo fixes
........
r51116 | andrew.kuchling | 2006-08-04 23:10:03 +0200 (Fri, 04 Aug 2006) | 1 line
Fix mangled sentence
........
r51118 | tim.peters | 2006-08-05 00:00:35 +0200 (Sat, 05 Aug 2006) | 2 lines
Whitespace normalization.
........
r51119 | bob.ippolito | 2006-08-05 01:59:21 +0200 (Sat, 05 Aug 2006) | 5 lines
Fix #1530559, struct.pack raises TypeError where it used to convert.
Passing float arguments to struct.pack when integers are expected
now triggers a DeprecationWarning.
........
r51123 | georg.brandl | 2006-08-05 08:10:54 +0200 (Sat, 05 Aug 2006) | 3 lines
Patch #1534922: correct and enhance unittest docs.
........
r51126 | georg.brandl | 2006-08-06 09:06:33 +0200 (Sun, 06 Aug 2006) | 2 lines
Bug #1535182: really test the xreadlines() method of bz2 objects.
........
r51128 | georg.brandl | 2006-08-06 09:26:21 +0200 (Sun, 06 Aug 2006) | 4 lines
Bug #1535081: A leading underscore has been added to the names of
the md5 and sha modules, so add it in Modules/Setup.dist too.
........
r51129 | georg.brandl | 2006-08-06 10:23:54 +0200 (Sun, 06 Aug 2006) | 3 lines
Bug #1535165: fixed a segfault in input() and raw_input() when
sys.stdin is closed.
........
r51131 | georg.brandl | 2006-08-06 11:17:16 +0200 (Sun, 06 Aug 2006) | 2 lines
Don't produce output in test_builtin.
........
r51133 | andrew.macintyre | 2006-08-06 14:37:03 +0200 (Sun, 06 Aug 2006) | 4 lines
test_threading now skips testing alternate thread stack sizes on
platforms that don't support changing thread stack size.
........
r51134 | andrew.kuchling | 2006-08-07 00:07:04 +0200 (Mon, 07 Aug 2006) | 2 lines
[Patch #1464056] Ensure that we use the panelw library when linking with ncursesw.
Once I see how the buildbots react, I'll backport this to 2.4.
........
r51137 | georg.brandl | 2006-08-08 13:52:34 +0200 (Tue, 08 Aug 2006) | 3 lines
webbrowser: Silence stderr output if no gconftool or gnome browser found
........
r51138 | georg.brandl | 2006-08-08 13:56:21 +0200 (Tue, 08 Aug 2006) | 7 lines
Remove "non-mapping" and "non-sequence" from TypeErrors raised by
PyMapping_Size and PySequence_Size.
Because len() tries first sequence, then mapping size, it will always
raise a "non-mapping object has no len" error which is confusing.
........
r51139 | thomas.heller | 2006-08-08 19:37:00 +0200 (Tue, 08 Aug 2006) | 3 lines
memcmp() can return values other than -1, 0, and +1 but tp_compare
must not.
........
r51140 | thomas.heller | 2006-08-08 19:39:20 +0200 (Tue, 08 Aug 2006) | 1 line
Remove accidently committed, duplicated test.
........
r51147 | andrew.kuchling | 2006-08-08 20:50:14 +0200 (Tue, 08 Aug 2006) | 1 line
Reword paragraph to clarify
........
r51148 | andrew.kuchling | 2006-08-08 20:56:08 +0200 (Tue, 08 Aug 2006) | 1 line
Move obmalloc item into C API section
........
r51149 | andrew.kuchling | 2006-08-08 21:00:14 +0200 (Tue, 08 Aug 2006) | 1 line
'Other changes' section now has only one item; move the item elsewhere and remove the section
........
r51150 | andrew.kuchling | 2006-08-08 21:00:34 +0200 (Tue, 08 Aug 2006) | 1 line
Bump version number
........
r51151 | georg.brandl | 2006-08-08 22:11:22 +0200 (Tue, 08 Aug 2006) | 2 lines
Bug #1536828: typo: TypeType should have been StringType.
........
r51153 | georg.brandl | 2006-08-08 22:13:13 +0200 (Tue, 08 Aug 2006) | 2 lines
Bug #1536660: separate two words.
........
r51155 | georg.brandl | 2006-08-08 22:48:10 +0200 (Tue, 08 Aug 2006) | 3 lines
``str`` is now the same object as ``types.StringType``.
........
r51156 | tim.peters | 2006-08-09 02:52:26 +0200 (Wed, 09 Aug 2006) | 2 lines
Whitespace normalization.
........
r51158 | georg.brandl | 2006-08-09 09:03:22 +0200 (Wed, 09 Aug 2006) | 4 lines
Introduce an upper bound on tuple nesting depth in
C argument format strings; fixes rest of #1523610.
........
r51160 | martin.v.loewis | 2006-08-09 09:57:39 +0200 (Wed, 09 Aug 2006) | 4 lines
__hash__ may now return long int; the final hash
value is obtained by invoking hash on the long int.
Fixes #1536021.
........
r51168 | andrew.kuchling | 2006-08-09 15:03:41 +0200 (Wed, 09 Aug 2006) | 1 line
[Bug #1536021] Mention __hash__ change
........
r51169 | andrew.kuchling | 2006-08-09 15:57:05 +0200 (Wed, 09 Aug 2006) | 1 line
[Patch #1534027] Add notes on locale module changes
........
r51170 | andrew.kuchling | 2006-08-09 16:05:35 +0200 (Wed, 09 Aug 2006) | 1 line
Add missing 'self' parameters
........
r51171 | andrew.kuchling | 2006-08-09 16:06:19 +0200 (Wed, 09 Aug 2006) | 1 line
Reindent code
........
r51172 | armin.rigo | 2006-08-09 16:55:26 +0200 (Wed, 09 Aug 2006) | 2 lines
Fix and test for an infinite C recursion.
........
r51173 | ronald.oussoren | 2006-08-09 16:56:33 +0200 (Wed, 09 Aug 2006) | 2 lines
It's unlikely that future versions will require _POSIX_C_SOURCE
........
r51178 | armin.rigo | 2006-08-09 17:37:26 +0200 (Wed, 09 Aug 2006) | 2 lines
Concatenation on a long string breaks (SF #1526585).
........
r51180 | kurt.kaiser | 2006-08-09 18:46:15 +0200 (Wed, 09 Aug 2006) | 8 lines
1. When used w/o subprocess, all exceptions were preceeded by an error
message claiming they were IDLE internal errors (since 1.2a1).
2. Add Ronald Oussoren to CREDITS
M NEWS.txt
M PyShell.py
M CREDITS.txt
........
r51181 | kurt.kaiser | 2006-08-09 19:47:15 +0200 (Wed, 09 Aug 2006) | 4 lines
As a slight enhancement to the previous checkin, improve the
internal error reporting by moving message to IDLE console.
........
r51182 | andrew.kuchling | 2006-08-09 20:23:14 +0200 (Wed, 09 Aug 2006) | 1 line
Typo fix
........
r51183 | kurt.kaiser | 2006-08-09 22:34:46 +0200 (Wed, 09 Aug 2006) | 2 lines
ToggleTab dialog was setting indent to 8 even if cancelled (since 1.2a1).
........
r51184 | martin.v.loewis | 2006-08-10 01:42:18 +0200 (Thu, 10 Aug 2006) | 2 lines
Add some commentary on -mimpure-text.
........
r51185 | tim.peters | 2006-08-10 02:58:49 +0200 (Thu, 10 Aug 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r51186 | kurt.kaiser | 2006-08-10 03:41:17 +0200 (Thu, 10 Aug 2006) | 2 lines
Changing tokenize (39046) to detect dedent broke tabnanny check (since 1.2a1)
........
r51187 | tim.peters | 2006-08-10 05:01:26 +0200 (Thu, 10 Aug 2006) | 13 lines
test_copytree_simple(): This was leaving behind two new temp
directories each time it ran, at least on Windows.
Several changes: explicitly closed all files; wrapped long
lines; stopped suppressing errors when removing a file or
directory fails (removing /shouldn't/ fail!); and changed
what appeared to be incorrect usage of os.removedirs() (that
doesn't remove empty directories at and /under/ the given
path, instead it must be given an empty leaf directory and
then deletes empty directories moving /up/ the path -- could
be that the conceptually simpler shutil.rmtree() was really
actually intended here).
........
2006-08-11 14:57:12 +00:00
|
|
|
#endif /* HAVE_SYS_STAT_H */
|
2001-10-18 19:44:10 +00:00
|
|
|
|
1995-06-14 22:54:23 +00:00
|
|
|
#ifdef HAVE_SYS_WAIT_H
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <sys/wait.h> // WNOHANG
|
1995-06-14 22:54:23 +00:00
|
|
|
#endif
|
2019-11-05 21:58:31 -08:00
|
|
|
#ifdef HAVE_LINUX_WAIT_H
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <linux/wait.h> // P_PIDFD
|
2019-11-05 21:58:31 -08:00
|
|
|
#endif
|
1991-04-08 21:01:03 +00:00
|
|
|
|
Merged revisions 46753-51188 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r46755 | brett.cannon | 2006-06-08 18:23:04 +0200 (Thu, 08 Jun 2006) | 4 lines
Make binascii.hexlify() use s# for its arguments instead of t# to actually
match its documentation stating it accepts any read-only buffer.
........
r46757 | brett.cannon | 2006-06-08 19:00:45 +0200 (Thu, 08 Jun 2006) | 8 lines
Buffer objects would return the read or write buffer for a wrapped object when
the char buffer was requested. Now it actually returns the char buffer if
available or raises a TypeError if it isn't (as is raised for the other buffer
types if they are not present but requested).
Not a backport candidate since it does change semantics of the buffer object
(although it could be argued this is enough of a bug to bother backporting).
........
r46760 | andrew.kuchling | 2006-06-09 03:10:17 +0200 (Fri, 09 Jun 2006) | 1 line
Update functools section
........
r46762 | tim.peters | 2006-06-09 04:11:02 +0200 (Fri, 09 Jun 2006) | 6 lines
Whitespace normalization.
Since test_file is implicated in mysterious test failures
when followed by test_optparse, if I had any brains I'd
look at the checkin that last changed test_file ;-)
........
r46763 | tim.peters | 2006-06-09 05:09:42 +0200 (Fri, 09 Jun 2006) | 5 lines
To boost morale :-), force test_optparse to run immediately
after test_file until we can figure out how to fix it.
(See python-dev; at the moment we don't even know which checkin
caused the problem.)
........
r46764 | tim.peters | 2006-06-09 05:51:41 +0200 (Fri, 09 Jun 2006) | 6 lines
AutoFileTests.tearDown(): Removed mysterious undocumented
try/except. Remove TESTFN.
Throughout: used open() instead of file(), and wrapped
long lines.
........
r46765 | tim.peters | 2006-06-09 06:02:06 +0200 (Fri, 09 Jun 2006) | 8 lines
testUnicodeOpen(): I have no idea why, but making this
test clean up after itself appears to fix the test failures
when test_optparse follows test_file.
test_main(): Get rid of TESTFN no matter what. That's
also enough to fix the mystery failures. Doesn't hurt
to fix them twice :-)
........
r46766 | tim.peters | 2006-06-09 07:12:40 +0200 (Fri, 09 Jun 2006) | 6 lines
Remove the temporary hack to force test_optparse to
run immediately after test_file. At least 8 buildbot
boxes passed since the underlying problem got fixed,
and they all failed before the fix, so there's no point
to this anymore.
........
r46767 | neal.norwitz | 2006-06-09 07:54:18 +0200 (Fri, 09 Jun 2006) | 1 line
Fix grammar and reflow
........
r46769 | andrew.kuchling | 2006-06-09 12:22:35 +0200 (Fri, 09 Jun 2006) | 1 line
Markup fix
........
r46773 | andrew.kuchling | 2006-06-09 15:15:57 +0200 (Fri, 09 Jun 2006) | 1 line
[Bug #1472827] Make saxutils.XMLGenerator handle \r\n\t in attribute values by escaping them properly. 2.4 bugfix candidate.
........
r46778 | kristjan.jonsson | 2006-06-09 18:28:01 +0200 (Fri, 09 Jun 2006) | 2 lines
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.
........
r46779 | phillip.eby | 2006-06-09 18:40:18 +0200 (Fri, 09 Jun 2006) | 2 lines
Import wsgiref into the stdlib, as of the external version 0.1-r2181.
........
r46783 | andrew.kuchling | 2006-06-09 18:44:40 +0200 (Fri, 09 Jun 2006) | 1 line
Add note about XMLGenerator bugfix
........
r46784 | andrew.kuchling | 2006-06-09 18:46:51 +0200 (Fri, 09 Jun 2006) | 1 line
Add note about wsgiref
........
r46785 | brett.cannon | 2006-06-09 19:05:48 +0200 (Fri, 09 Jun 2006) | 2 lines
Fix inconsistency in naming within an enum.
........
r46787 | tim.peters | 2006-06-09 19:47:00 +0200 (Fri, 09 Jun 2006) | 2 lines
Whitespace normalization.
........
r46792 | georg.brandl | 2006-06-09 20:29:52 +0200 (Fri, 09 Jun 2006) | 3 lines
Test file.__exit__.
........
r46794 | brett.cannon | 2006-06-09 20:40:46 +0200 (Fri, 09 Jun 2006) | 2 lines
svn:ignore .pyc and .pyo files.
........
r46795 | georg.brandl | 2006-06-09 20:45:48 +0200 (Fri, 09 Jun 2006) | 3 lines
RFE #1491485: str/unicode.endswith()/startswith() now accept a tuple as first argument.
........
r46798 | andrew.kuchling | 2006-06-09 21:03:16 +0200 (Fri, 09 Jun 2006) | 1 line
Describe startswith()/endswiith() change; add reminder about wsgiref
........
r46799 | tim.peters | 2006-06-09 21:24:44 +0200 (Fri, 09 Jun 2006) | 11 lines
Implementing a happy idea from Georg Brandl: make runtest() try to
clean up files and directories the tests often leave behind by
mistake. This is the first time in history I don't have a bogus
"db_home" directory after running the tests ;-)
Also worked on runtest's docstring, to say something about all the
arguments, and to document the non-obvious return values.
New functions runtest_inner() and cleanup_test_droppings() in
support of the above.
........
r46800 | andrew.kuchling | 2006-06-09 21:43:25 +0200 (Fri, 09 Jun 2006) | 1 line
Remove unused variable
........
r46801 | andrew.kuchling | 2006-06-09 21:56:05 +0200 (Fri, 09 Jun 2006) | 1 line
Add some wsgiref text
........
r46803 | thomas.heller | 2006-06-09 21:59:11 +0200 (Fri, 09 Jun 2006) | 1 line
set eol-style svn property
........
r46804 | thomas.heller | 2006-06-09 22:01:01 +0200 (Fri, 09 Jun 2006) | 1 line
set eol-style svn property
........
r46805 | georg.brandl | 2006-06-09 22:43:48 +0200 (Fri, 09 Jun 2006) | 3 lines
Make use of new str.startswith/endswith semantics.
Occurences in email and compiler were ignored due to backwards compat requirements.
........
r46806 | brett.cannon | 2006-06-10 00:31:23 +0200 (Sat, 10 Jun 2006) | 4 lines
An object with __call__ as an attribute, when called, will have that attribute checked for __call__ itself, and will continue to look until it finds an object without the attribute. This can lead to an infinite recursion.
Closes bug #532646, again. Will be backported.
........
r46808 | brett.cannon | 2006-06-10 00:45:54 +0200 (Sat, 10 Jun 2006) | 2 lines
Fix bug introduced in rev. 46806 by not having variable declaration at the top of a block.
........
r46812 | georg.brandl | 2006-06-10 08:40:50 +0200 (Sat, 10 Jun 2006) | 4 lines
Apply perky's fix for #1503157: "/".join([u"", u""]) raising OverflowError.
Also improve error message on overflow.
........
r46817 | martin.v.loewis | 2006-06-10 10:14:03 +0200 (Sat, 10 Jun 2006) | 2 lines
Port cygwin kill_python changes from 2.4 branch.
........
r46818 | armin.rigo | 2006-06-10 12:57:40 +0200 (Sat, 10 Jun 2006) | 4 lines
SF bug #1503294.
PyThreadState_GET() complains if the tstate is NULL, but only in debug mode.
........
r46819 | martin.v.loewis | 2006-06-10 14:23:46 +0200 (Sat, 10 Jun 2006) | 4 lines
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
........
r46820 | skip.montanaro | 2006-06-10 16:09:11 +0200 (Sat, 10 Jun 2006) | 1 line
document the class, not its initializer
........
r46821 | greg.ward | 2006-06-10 18:40:01 +0200 (Sat, 10 Jun 2006) | 4 lines
Sync with Optik docs (rev 518):
* restore "Extending optparse" section
* document ALWAYS_TYPED_ACTIONS (SF #1449311)
........
r46824 | thomas.heller | 2006-06-10 21:51:46 +0200 (Sat, 10 Jun 2006) | 8 lines
Upgrade to ctypes version 0.9.9.7.
Summary of changes:
- support for 'variable sized' data
- support for anonymous structure/union fields
- fix severe bug with certain arrays or structures containing more than 256 fields
........
r46825 | thomas.heller | 2006-06-10 21:55:36 +0200 (Sat, 10 Jun 2006) | 8 lines
Upgrade to ctypes version 0.9.9.7.
Summary of changes:
- support for 'variable sized' data
- support for anonymous structure/union fields
- fix severe bug with certain arrays or structures containing more than 256 fields
........
r46826 | fred.drake | 2006-06-10 22:01:34 +0200 (Sat, 10 Jun 2006) | 4 lines
SF patch #1303595: improve description of __builtins__, explaining how it
varies between __main__ and other modules, and strongly suggest not touching
it but using __builtin__ if absolutely necessary
........
r46827 | fred.drake | 2006-06-10 22:02:58 +0200 (Sat, 10 Jun 2006) | 1 line
credit for SF patch #1303595
........
r46831 | thomas.heller | 2006-06-10 22:29:34 +0200 (Sat, 10 Jun 2006) | 2 lines
New docs for ctypes.
........
r46834 | thomas.heller | 2006-06-10 23:07:19 +0200 (Sat, 10 Jun 2006) | 1 line
Fix a wrong printf format.
........
r46835 | thomas.heller | 2006-06-10 23:17:58 +0200 (Sat, 10 Jun 2006) | 1 line
Fix the second occurrence of the problematic printf format.
........
r46837 | thomas.heller | 2006-06-10 23:56:03 +0200 (Sat, 10 Jun 2006) | 1 line
Don't use C++ comment.
........
r46838 | thomas.heller | 2006-06-11 00:01:50 +0200 (Sun, 11 Jun 2006) | 1 line
Handle failure of PyMem_Realloc.
........
r46839 | skip.montanaro | 2006-06-11 00:38:13 +0200 (Sun, 11 Jun 2006) | 2 lines
Suppress warning on MacOSX about possible use before set of proc.
........
r46840 | tim.peters | 2006-06-11 00:51:45 +0200 (Sun, 11 Jun 2006) | 8 lines
shuffle() doscstring: Removed warning about sequence length
versus generator period. While this was a real weakness of the
older WH generator for lists with just a few dozen elements,
and so could potentially bite the naive ;-), the Twister should
show excellent behavior up to at least 600 elements.
Module docstring: reflowed some jarringly short lines.
........
r46844 | greg.ward | 2006-06-11 02:40:49 +0200 (Sun, 11 Jun 2006) | 4 lines
Bug #1361643: fix textwrap.dedent() so it handles tabs appropriately,
i.e. do *not* expand tabs, but treat them as whitespace that is not
equivalent to spaces. Add a couple of test cases. Clarify docs.
........
r46850 | neal.norwitz | 2006-06-11 07:44:18 +0200 (Sun, 11 Jun 2006) | 5 lines
Fix Coverity # 146. newDBSequenceObject would deref dbobj, so it can't be NULL.
We know it's not NULL from the ParseTuple and DbObject_Check will verify
it's not NULL.
........
r46851 | neal.norwitz | 2006-06-11 07:45:25 +0200 (Sun, 11 Jun 2006) | 4 lines
Wrap some long lines
Top/Bottom factor out some common expressions
Add a XXX comment about widing offset.
........
r46852 | neal.norwitz | 2006-06-11 07:45:47 +0200 (Sun, 11 Jun 2006) | 1 line
Add versionadded to doc
........
r46853 | neal.norwitz | 2006-06-11 07:47:14 +0200 (Sun, 11 Jun 2006) | 3 lines
Update doc to make it agree with code.
Bottom factor out some common code.
........
r46854 | neal.norwitz | 2006-06-11 07:48:14 +0200 (Sun, 11 Jun 2006) | 3 lines
f_code can't be NULL based on Frame_New and other code that derefs it.
So there doesn't seem to be much point to checking here.
........
r46855 | neal.norwitz | 2006-06-11 09:26:27 +0200 (Sun, 11 Jun 2006) | 1 line
Fix errors found by pychecker
........
r46856 | neal.norwitz | 2006-06-11 09:26:50 +0200 (Sun, 11 Jun 2006) | 1 line
warnings was imported at module scope, no need to import again
........
r46857 | neal.norwitz | 2006-06-11 09:27:56 +0200 (Sun, 11 Jun 2006) | 5 lines
Fix errors found by pychecker.
I think these changes are correct, but I'm not sure. Could someone
who knows how this module works test it? It can at least start on
the cmd line.
........
r46858 | neal.norwitz | 2006-06-11 10:35:14 +0200 (Sun, 11 Jun 2006) | 1 line
Fix errors found by pychecker
........
r46859 | ronald.oussoren | 2006-06-11 16:33:36 +0200 (Sun, 11 Jun 2006) | 4 lines
This patch improves the L&F of IDLE on OSX. The changes are conditionalized on
being in an IDLE.app bundle on darwin. This does a slight reorganisation of the
menus and adds support for file-open events.
........
r46860 | greg.ward | 2006-06-11 16:42:41 +0200 (Sun, 11 Jun 2006) | 1 line
SF #1366250: optparse docs: fix inconsistency in variable name; minor tweaks.
........
r46861 | greg.ward | 2006-06-11 18:24:11 +0200 (Sun, 11 Jun 2006) | 3 lines
Bug #1498146: fix optparse to handle Unicode strings in option help,
description, and epilog.
........
r46862 | thomas.heller | 2006-06-11 19:04:22 +0200 (Sun, 11 Jun 2006) | 2 lines
Release the GIL during COM method calls, to avoid deadlocks in
Python coded COM objects.
........
r46863 | tim.peters | 2006-06-11 21:42:51 +0200 (Sun, 11 Jun 2006) | 2 lines
Whitespace normalization.
........
r46864 | tim.peters | 2006-06-11 21:43:49 +0200 (Sun, 11 Jun 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46865 | ronald.oussoren | 2006-06-11 21:45:57 +0200 (Sun, 11 Jun 2006) | 2 lines
Remove message about using make frameworkinstall, that's no longer necesssary
........
r46866 | ronald.oussoren | 2006-06-11 22:23:29 +0200 (Sun, 11 Jun 2006) | 2 lines
Use configure to substitute the correct prefix instead of hardcoding
........
r46867 | ronald.oussoren | 2006-06-11 22:24:45 +0200 (Sun, 11 Jun 2006) | 4 lines
- Change fixapplepython23.py to ensure that it will run with /usr/bin/python
on intel macs.
- Fix some minor problems in the installer for OSX
........
r46868 | neal.norwitz | 2006-06-11 22:25:56 +0200 (Sun, 11 Jun 2006) | 5 lines
Try to fix several networking tests. The problem is that if hosts have
a search path setup, some of these hosts resolve to the wrong address.
By appending a period to the hostname, the hostname should only resolve
to what we want it to resolve to. Hopefully this doesn't break different bots.
........
r46869 | neal.norwitz | 2006-06-11 22:42:02 +0200 (Sun, 11 Jun 2006) | 7 lines
Try to fix another networking test. The problem is that if hosts have
a search path setup, some of these hosts resolve to the wrong address.
By appending a period to the hostname, the hostname should only resolve
to what we want it to resolve to. Hopefully this doesn't break different bots.
Also add more info to failure message to aid debugging test failure.
........
r46870 | neal.norwitz | 2006-06-11 22:46:46 +0200 (Sun, 11 Jun 2006) | 4 lines
Fix test on PPC64 buildbot. It raised an IOError (really an URLError which
derives from an IOError). That seems valid. Env Error includes both OSError
and IOError, so this seems like a reasonable fix.
........
r46871 | tim.peters | 2006-06-11 22:52:59 +0200 (Sun, 11 Jun 2006) | 10 lines
compare_generic_iter(): Fixed the failure of test_wsgiref's testFileWrapper
when running with -O.
test_simple_validation_error still fails under -O. That appears to be because
wsgiref's validate.py uses `assert` statements all over the place to check
arguments for sanity. That should all be changed (it's not a logical error
in the software if a user passes bogus arguments, so this isn't a reasonable
use for `assert` -- checking external preconditions should generally raise
ValueError or TypeError instead, as appropriate).
........
r46872 | neal.norwitz | 2006-06-11 23:38:38 +0200 (Sun, 11 Jun 2006) | 1 line
Get test to pass on S/390. Shout if you think this change is incorrect.
........
r46873 | neal.norwitz | 2006-06-12 04:05:55 +0200 (Mon, 12 Jun 2006) | 1 line
Cleanup Py_ssize_t a little (get rid of second #ifdef)
........
r46874 | neal.norwitz | 2006-06-12 04:06:17 +0200 (Mon, 12 Jun 2006) | 1 line
Fix some Py_ssize_t issues
........
r46875 | neal.norwitz | 2006-06-12 04:06:42 +0200 (Mon, 12 Jun 2006) | 1 line
Fix some Py_ssize_t issues
........
r46876 | neal.norwitz | 2006-06-12 04:07:24 +0200 (Mon, 12 Jun 2006) | 2 lines
Cleanup: Remove import of types to get StringTypes, we can just use basestring.
........
r46877 | neal.norwitz | 2006-06-12 04:07:57 +0200 (Mon, 12 Jun 2006) | 1 line
Don't truncate if size_t is bigger than uint
........
r46878 | neal.norwitz | 2006-06-12 04:08:41 +0200 (Mon, 12 Jun 2006) | 1 line
Don't leak the list object if there's an error allocating the item storage. Backport candidate
........
r46879 | neal.norwitz | 2006-06-12 04:09:03 +0200 (Mon, 12 Jun 2006) | 1 line
Fix typo. Backport if anyone cares. :-)
........
r46880 | neal.norwitz | 2006-06-12 04:09:34 +0200 (Mon, 12 Jun 2006) | 1 line
Fix indentation of case and a Py_ssize_t issue.
........
r46881 | neal.norwitz | 2006-06-12 04:11:18 +0200 (Mon, 12 Jun 2006) | 3 lines
Get rid of f_restricted too. Doc the other 4 ints that were already removed
at the NeedForSpeed sprint.
........
r46882 | neal.norwitz | 2006-06-12 04:13:21 +0200 (Mon, 12 Jun 2006) | 1 line
Fix the socket tests so they can be run concurrently. Backport candidate
........
r46883 | neal.norwitz | 2006-06-12 04:16:10 +0200 (Mon, 12 Jun 2006) | 1 line
i and j are initialized below when used. No need to do it twice
........
r46884 | neal.norwitz | 2006-06-12 05:05:03 +0200 (Mon, 12 Jun 2006) | 1 line
Remove unused import
........
r46885 | neal.norwitz | 2006-06-12 05:05:40 +0200 (Mon, 12 Jun 2006) | 1 line
Impl ssize_t
........
r46886 | neal.norwitz | 2006-06-12 05:33:09 +0200 (Mon, 12 Jun 2006) | 6 lines
Patch #1503046, Conditional compilation of zlib.(de)compressobj.copy
copy is only in newer versions of zlib. This should allow zlibmodule
to work with older versions like the Tru64 buildbot.
........
r46887 | phillip.eby | 2006-06-12 06:04:32 +0200 (Mon, 12 Jun 2006) | 2 lines
Sync w/external release 0.1.2. Please see PEP 360 before making changes to external packages.
........
r46888 | martin.v.loewis | 2006-06-12 06:26:31 +0200 (Mon, 12 Jun 2006) | 2 lines
Get rid of function pointer cast.
........
r46889 | thomas.heller | 2006-06-12 08:05:57 +0200 (Mon, 12 Jun 2006) | 3 lines
I don't know how that happend, but the entire file contents was
duplicated. Thanks to Simon Percivall for the heads up.
........
r46890 | nick.coghlan | 2006-06-12 10:19:37 +0200 (Mon, 12 Jun 2006) | 1 line
Fix site module docstring to match the code
........
r46891 | nick.coghlan | 2006-06-12 10:23:02 +0200 (Mon, 12 Jun 2006) | 1 line
Fix site module docstring to match the code for Mac OSX, too
........
r46892 | nick.coghlan | 2006-06-12 10:27:13 +0200 (Mon, 12 Jun 2006) | 1 line
The site module documentation also described the Windows behaviour incorrectly.
........
r46893 | nick.coghlan | 2006-06-12 12:17:11 +0200 (Mon, 12 Jun 2006) | 1 line
Make the -m switch conform to the documentation of sys.path by behaving like the -c switch
........
r46894 | kristjan.jonsson | 2006-06-12 17:45:12 +0200 (Mon, 12 Jun 2006) | 2 lines
Fix the CRT argument error handling for VisualStudio .NET 2005. Install a CRT error handler and disable the assertion for debug builds. This causes CRT to set errno to EINVAL.
This update fixes crash cases in the test suite where the default CRT error handler would cause process exit.
........
r46899 | thomas.heller | 2006-06-12 22:56:48 +0200 (Mon, 12 Jun 2006) | 1 line
Add pep-291 compatibility markers.
........
r46901 | ka-ping.yee | 2006-06-13 01:47:52 +0200 (Tue, 13 Jun 2006) | 5 lines
Add the uuid module.
This module has been tested so far on Windows XP (Python 2.4 and 2.5a2),
Mac OS X (Python 2.3, 2.4, and 2.5a2), and Linux (Python 2.4 and 2.5a2).
........
r46902 | tim.peters | 2006-06-13 02:30:01 +0200 (Tue, 13 Jun 2006) | 2 lines
Whitespace normalization.
........
r46903 | tim.peters | 2006-06-13 02:30:50 +0200 (Tue, 13 Jun 2006) | 2 lines
Added missing svn:eol-style property to text files.
........
r46905 | tim.peters | 2006-06-13 05:30:07 +0200 (Tue, 13 Jun 2006) | 5 lines
get_matching_blocks(): rewrote code & comments so they match; added
more comments about why it's this way at all; and removed what looked
like needless expense (sorting (i, j, k) triples directly should give
exactly the same order as sorting (i, (i, j, k)) pairs).
........
r46906 | neal.norwitz | 2006-06-13 06:08:53 +0200 (Tue, 13 Jun 2006) | 1 line
Don't fail if another process is listening on our port.
........
r46908 | neal.norwitz | 2006-06-13 10:28:19 +0200 (Tue, 13 Jun 2006) | 2 lines
Initialize the type object so pychecker can't crash the interpreter.
........
r46909 | neal.norwitz | 2006-06-13 10:41:06 +0200 (Tue, 13 Jun 2006) | 1 line
Verify the crash due to EncodingMap not initialized does not return
........
r46910 | thomas.heller | 2006-06-13 10:56:14 +0200 (Tue, 13 Jun 2006) | 3 lines
Add some windows datatypes that were missing from this file, and add
the aliases defined in windows header files for the structures.
........
r46911 | thomas.heller | 2006-06-13 11:40:14 +0200 (Tue, 13 Jun 2006) | 3 lines
Add back WCHAR, UINT, DOUBLE, _LARGE_INTEGER, _ULARGE_INTEGER.
VARIANT_BOOL is a special _ctypes data type, not c_short.
........
r46912 | ronald.oussoren | 2006-06-13 13:19:56 +0200 (Tue, 13 Jun 2006) | 4 lines
Linecache contains support for PEP302 loaders, but fails to deal with loaders
that return None to indicate that the module is valid but no source is
available. This patch fixes that.
........
r46913 | andrew.kuchling | 2006-06-13 13:57:04 +0200 (Tue, 13 Jun 2006) | 1 line
Mention uuid module
........
r46915 | walter.doerwald | 2006-06-13 14:02:12 +0200 (Tue, 13 Jun 2006) | 2 lines
Fix passing errors to the encoder and decoder functions.
........
r46917 | walter.doerwald | 2006-06-13 14:04:43 +0200 (Tue, 13 Jun 2006) | 3 lines
errors is an attribute in the incremental decoder
not an argument.
........
r46919 | andrew.macintyre | 2006-06-13 17:04:24 +0200 (Tue, 13 Jun 2006) | 11 lines
Patch #1454481: Make thread stack size runtime tunable.
Heavily revised, comprising revisions:
46640 - original trunk revision (backed out in r46655)
46647 - markup fix (backed out in r46655)
46692:46918 merged from branch aimacintyre-sf1454481
branch tested on buildbots (Windows buildbots had problems
not related to these changes).
........
r46920 | brett.cannon | 2006-06-13 18:06:55 +0200 (Tue, 13 Jun 2006) | 2 lines
Remove unused variable.
........
r46921 | andrew.kuchling | 2006-06-13 18:41:41 +0200 (Tue, 13 Jun 2006) | 1 line
Add ability to set stack size
........
r46923 | marc-andre.lemburg | 2006-06-13 19:04:26 +0200 (Tue, 13 Jun 2006) | 2 lines
Update pybench to version 2.0.
........
r46924 | marc-andre.lemburg | 2006-06-13 19:07:14 +0200 (Tue, 13 Jun 2006) | 2 lines
Revert wrong svn copy.
........
r46925 | andrew.macintyre | 2006-06-13 19:14:36 +0200 (Tue, 13 Jun 2006) | 2 lines
fix exception usage
........
r46927 | tim.peters | 2006-06-13 20:37:07 +0200 (Tue, 13 Jun 2006) | 2 lines
Whitespace normalization.
........
r46928 | marc-andre.lemburg | 2006-06-13 20:56:56 +0200 (Tue, 13 Jun 2006) | 9 lines
Updated to pybench 2.0.
See svn.python.org/external/pybench-2.0 for the original import of that
version.
Note that platform.py was not copied over from pybench-2.0 since
it is already part of Python 2.5.
........
r46929 | andrew.macintyre | 2006-06-13 21:02:35 +0200 (Tue, 13 Jun 2006) | 5 lines
Increase the small thread stack size to get the test
to pass reliably on the one buildbot that insists on
more than 32kB of thread stack.
........
r46930 | marc-andre.lemburg | 2006-06-13 21:20:07 +0200 (Tue, 13 Jun 2006) | 2 lines
Whitespace normalization.
........
r46931 | thomas.heller | 2006-06-13 22:18:43 +0200 (Tue, 13 Jun 2006) | 2 lines
More docs for ctypes.
........
r46932 | brett.cannon | 2006-06-13 23:34:24 +0200 (Tue, 13 Jun 2006) | 2 lines
Ignore .pyc and .pyo files in Pybench.
........
r46933 | brett.cannon | 2006-06-13 23:46:41 +0200 (Tue, 13 Jun 2006) | 7 lines
If a classic class defined a __coerce__() method that just returned its two
arguments in reverse, the interpreter would infinitely recourse trying to get a
coercion that worked. So put in a recursion check after a coercion is made and
the next call to attempt to use the coerced values.
Fixes bug #992017 and closes crashers/coerce.py .
........
r46936 | gerhard.haering | 2006-06-14 00:24:47 +0200 (Wed, 14 Jun 2006) | 3 lines
Merged changes from external pysqlite 2.3.0 release. Documentation updates will
follow in a few hours at the latest. Then we should be ready for beta1.
........
r46937 | brett.cannon | 2006-06-14 00:26:13 +0200 (Wed, 14 Jun 2006) | 2 lines
Missed test for rev. 46933; infinite recursion from __coerce__() returning its arguments reversed.
........
r46938 | gerhard.haering | 2006-06-14 00:53:48 +0200 (Wed, 14 Jun 2006) | 2 lines
Updated documentation for pysqlite 2.3.0 API.
........
r46939 | tim.peters | 2006-06-14 06:09:25 +0200 (Wed, 14 Jun 2006) | 10 lines
SequenceMatcher.get_matching_blocks(): This now guarantees that
adjacent triples in the result list describe non-adjacent matching
blocks. That's _nice_ to have, and Guido said he wanted it.
Not a bugfix candidate: Guido or not ;-), this changes visible
endcase semantics (note that some tests had to change), and
nothing about this was documented before. Since it was working
as designed, and behavior was consistent with the docs, it wasn't
"a bug".
........
r46940 | tim.peters | 2006-06-14 06:13:00 +0200 (Wed, 14 Jun 2006) | 2 lines
Repaired typo in new comment.
........
r46941 | tim.peters | 2006-06-14 06:15:27 +0200 (Wed, 14 Jun 2006) | 2 lines
Whitespace normalization.
........
r46942 | fred.drake | 2006-06-14 06:25:02 +0200 (Wed, 14 Jun 2006) | 3 lines
- make some disabled tests run what they intend when enabled
- remove some over-zealous triple-quoting
........
r46943 | fred.drake | 2006-06-14 07:04:47 +0200 (Wed, 14 Jun 2006) | 3 lines
add tests for two cases that are handled correctly in the current code,
but that SF patch 1504676 as written mis-handles
........
r46944 | fred.drake | 2006-06-14 07:15:51 +0200 (Wed, 14 Jun 2006) | 1 line
explain an XXX in more detail
........
r46945 | martin.v.loewis | 2006-06-14 07:21:04 +0200 (Wed, 14 Jun 2006) | 1 line
Patch #1455898: Incremental mode for "mbcs" codec.
........
r46946 | georg.brandl | 2006-06-14 08:08:31 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1339007: Shelf objects now don't raise an exception in their
__del__ method when initialization failed.
........
r46948 | thomas.heller | 2006-06-14 08:18:15 +0200 (Wed, 14 Jun 2006) | 1 line
Fix docstring.
........
r46949 | georg.brandl | 2006-06-14 08:29:07 +0200 (Wed, 14 Jun 2006) | 2 lines
Bug #1501122: mention __gt__ &co in description of comparison order.
........
r46951 | thomas.heller | 2006-06-14 09:08:38 +0200 (Wed, 14 Jun 2006) | 1 line
Write more docs.
........
r46952 | georg.brandl | 2006-06-14 10:31:39 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1153163: describe __add__ vs __radd__ behavior when adding
objects of same type/of subclasses of the other.
........
r46954 | georg.brandl | 2006-06-14 10:42:11 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1202018: add some common mime.types locations.
........
r46955 | georg.brandl | 2006-06-14 10:50:03 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1117556: SimpleHTTPServer now tries to find and use the system's
mime.types file for determining MIME types.
........
r46957 | thomas.heller | 2006-06-14 11:09:08 +0200 (Wed, 14 Jun 2006) | 1 line
Document paramflags.
........
r46958 | thomas.heller | 2006-06-14 11:20:11 +0200 (Wed, 14 Jun 2006) | 1 line
Add an __all__ list, since this module does 'from ctypes import *'.
........
r46959 | andrew.kuchling | 2006-06-14 15:59:15 +0200 (Wed, 14 Jun 2006) | 1 line
Add item
........
r46961 | georg.brandl | 2006-06-14 18:46:43 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #805015: doc error in PyUnicode_FromEncodedObject.
........
r46962 | gerhard.haering | 2006-06-15 00:28:37 +0200 (Thu, 15 Jun 2006) | 10 lines
- Added version checks in C code to make sure we don't trigger bugs in older
SQLite versions.
- Added version checks in test suite so that we don't execute tests that we
know will fail with older (buggy) SQLite versions.
Now, all tests should run against all SQLite versions from 3.0.8 until 3.3.6
(latest one now). The sqlite3 module can be built against all these SQLite
versions and the sqlite3 module does its best to not trigger bugs in SQLite,
but using SQLite 3.3.3 or later is recommended.
........
r46963 | tim.peters | 2006-06-15 00:38:13 +0200 (Thu, 15 Jun 2006) | 2 lines
Whitespace normalization.
........
r46964 | neal.norwitz | 2006-06-15 06:54:29 +0200 (Thu, 15 Jun 2006) | 9 lines
Speculative checkin (requires approval of Gerhard Haering)
This backs out the test changes in 46962 which prevented crashes
by not running the tests via a version check. All the version checks
added in that rev were removed from the tests.
Code was added to the error handler in connection.c that seems
to work with older versions of sqlite including 3.1.3.
........
r46965 | neal.norwitz | 2006-06-15 07:55:49 +0200 (Thu, 15 Jun 2006) | 1 line
Try to narrow window of failure on slow/busy boxes (ppc64 buildbot)
........
r46966 | martin.v.loewis | 2006-06-15 08:45:05 +0200 (Thu, 15 Jun 2006) | 2 lines
Make import/lookup of mbcs fail on non-Windows systems.
........
r46967 | ronald.oussoren | 2006-06-15 10:14:18 +0200 (Thu, 15 Jun 2006) | 2 lines
Patch #1446489 (zipfile: support for ZIP64)
........
r46968 | neal.norwitz | 2006-06-15 10:16:44 +0200 (Thu, 15 Jun 2006) | 6 lines
Re-revert this change. Install the version check and don't run the test
until Gerhard has time to fully debug the issue. This affects versions
before 3.2.1 (possibly only versions earlier than 3.1.3).
Based on discussion on python-checkins.
........
r46969 | gregory.p.smith | 2006-06-15 10:52:32 +0200 (Thu, 15 Jun 2006) | 6 lines
- bsddb: multithreaded DB access using the simple bsddb module interface
now works reliably. It has been updated to use automatic BerkeleyDB
deadlock detection and the bsddb.dbutils.DeadlockWrap wrapper to retry
database calls that would previously deadlock. [SF python bug #775414]
........
r46970 | gregory.p.smith | 2006-06-15 11:23:52 +0200 (Thu, 15 Jun 2006) | 2 lines
minor documentation cleanup. mention the bsddb.db interface explicitly by name.
........
r46971 | neal.norwitz | 2006-06-15 11:57:03 +0200 (Thu, 15 Jun 2006) | 5 lines
Steal the trick from test_compiler to print out a slow msg.
This will hopefully get the buildbots to pass. Not sure this
test will be feasible or even work. But everything is red now,
so it can't get much worse.
........
r46972 | neal.norwitz | 2006-06-15 12:24:49 +0200 (Thu, 15 Jun 2006) | 1 line
Print some more info to get an idea of how much longer the test will last
........
r46981 | tim.peters | 2006-06-15 20:04:40 +0200 (Thu, 15 Jun 2006) | 6 lines
Try to reduce the extreme peak memory and disk-space use
of this test. It probably still requires more disk space
than most buildbots have, and in any case is still so
intrusive that if we don't find another way to test this I'm
taking my buildbot offline permanently ;-)
........
r46982 | tim.peters | 2006-06-15 20:06:29 +0200 (Thu, 15 Jun 2006) | 2 lines
Whitespace normalization.
........
r46983 | tim.peters | 2006-06-15 20:07:28 +0200 (Thu, 15 Jun 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46984 | tim.peters | 2006-06-15 20:38:19 +0200 (Thu, 15 Jun 2006) | 2 lines
Oops -- I introduced an off-by-6436159488 error.
........
r46990 | neal.norwitz | 2006-06-16 06:30:34 +0200 (Fri, 16 Jun 2006) | 1 line
Disable this test until we can determine what to do about it
........
r46991 | neal.norwitz | 2006-06-16 06:31:06 +0200 (Fri, 16 Jun 2006) | 1 line
Param name is dir, not directory. Update docstring. Backport candidate
........
r46992 | neal.norwitz | 2006-06-16 06:31:28 +0200 (Fri, 16 Jun 2006) | 1 line
Add missing period in comment.
........
r46993 | neal.norwitz | 2006-06-16 06:32:43 +0200 (Fri, 16 Jun 2006) | 1 line
Fix whitespace, there are memory leaks in this module.
........
r46995 | fred.drake | 2006-06-17 01:45:06 +0200 (Sat, 17 Jun 2006) | 3 lines
SF patch 1504676: Make sgmllib char and entity references pluggable
(implementation/tests contributed by Sam Ruby)
........
r46996 | fred.drake | 2006-06-17 03:07:54 +0200 (Sat, 17 Jun 2006) | 1 line
fix change that broke the htmllib tests
........
r46998 | martin.v.loewis | 2006-06-17 11:15:14 +0200 (Sat, 17 Jun 2006) | 3 lines
Patch #763580: Add name and value arguments to
Tkinter variable classes.
........
r46999 | martin.v.loewis | 2006-06-17 11:20:41 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #1096231: Add default argument to wm_iconbitmap.
........
r47000 | martin.v.loewis | 2006-06-17 11:25:15 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #1494750: Destroy master after deleting children.
........
r47003 | george.yoshida | 2006-06-17 18:31:52 +0200 (Sat, 17 Jun 2006) | 2 lines
markup fix
........
r47005 | george.yoshida | 2006-06-17 18:39:13 +0200 (Sat, 17 Jun 2006) | 4 lines
Update url.
Old url returned status code:301 Moved permanently.
........
r47007 | martin.v.loewis | 2006-06-17 20:44:27 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #812986: Update the canvas even if not tracing.
........
r47008 | martin.v.loewis | 2006-06-17 21:03:26 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #815924: Restore ability to pass type= and icon=
........
r47009 | neal.norwitz | 2006-06-18 00:37:45 +0200 (Sun, 18 Jun 2006) | 1 line
Fix typo in docstring
........
r47010 | neal.norwitz | 2006-06-18 00:38:15 +0200 (Sun, 18 Jun 2006) | 1 line
Fix memory leak reported by valgrind while running test_subprocess
........
r47011 | fred.drake | 2006-06-18 04:57:35 +0200 (Sun, 18 Jun 2006) | 1 line
remove unnecessary markup
........
r47013 | neal.norwitz | 2006-06-18 21:35:01 +0200 (Sun, 18 Jun 2006) | 7 lines
Prevent spurious leaks when running regrtest.py -R. There may be more
issues that crop up from time to time, but this change seems to have been
pretty stable (no spurious warnings) for about a week.
Other modules which use threads may require similar use of
threading_setup/threading_cleanup from test_support.
........
r47014 | neal.norwitz | 2006-06-18 21:37:40 +0200 (Sun, 18 Jun 2006) | 9 lines
The hppa ubuntu box sometimes hangs forever in these tests. My guess
is that the wait is failing for some reason. Use WNOHANG, so we won't
wait until the buildbot kills the test suite.
I haven't been able to reproduce the failure, so I'm not sure if
this will help or not. Hopefully, this change will cause the test
to fail, rather than hang. That will be better since we will get
the rest of the test results. It may also help us debug the real problem.
........
r47015 | neal.norwitz | 2006-06-18 22:10:24 +0200 (Sun, 18 Jun 2006) | 1 line
Revert 47014 until it is more robust
........
r47016 | thomas.heller | 2006-06-18 23:27:04 +0200 (Sun, 18 Jun 2006) | 6 lines
Fix typos.
Fix doctest example.
Mention in the tutorial that 'errcheck' is explained in the ref manual.
Use better wording in some places.
Remoce code examples that shouldn't be in the tutorial.
Remove some XXX notices.
........
r47017 | georg.brandl | 2006-06-19 00:17:29 +0200 (Mon, 19 Jun 2006) | 3 lines
Patch #1507676: improve exception messages in abstract.c, object.c and typeobject.c.
........
r47018 | neal.norwitz | 2006-06-19 07:40:44 +0200 (Mon, 19 Jun 2006) | 1 line
Use Py_ssize_t
........
r47019 | georg.brandl | 2006-06-19 08:35:54 +0200 (Mon, 19 Jun 2006) | 3 lines
Add news entry about error msg improvement.
........
r47020 | thomas.heller | 2006-06-19 09:07:49 +0200 (Mon, 19 Jun 2006) | 2 lines
Try to repair the failing test on the OpenBSD buildbot. Trial and error...
........
r47021 | tim.peters | 2006-06-19 09:45:16 +0200 (Mon, 19 Jun 2006) | 2 lines
Whitespace normalization.
........
r47022 | walter.doerwald | 2006-06-19 10:07:50 +0200 (Mon, 19 Jun 2006) | 4 lines
Patch #1506645: add Python wrappers for the curses functions
is_term_resized, resize_term and resizeterm. This uses three
separate configure checks (one for each function).
........
r47023 | walter.doerwald | 2006-06-19 10:14:09 +0200 (Mon, 19 Jun 2006) | 2 lines
Make check order match in configure and configure.in.
........
r47024 | tim.peters | 2006-06-19 10:14:28 +0200 (Mon, 19 Jun 2006) | 3 lines
Repair KeyError when running test_threaded_import under -R,
as reported by Neal on python-dev.
........
r47025 | thomas.heller | 2006-06-19 10:32:46 +0200 (Mon, 19 Jun 2006) | 3 lines
Next try to fix the OpenBSD buildbot tests:
Use ctypes.util.find_library to locate the C runtime library
on platforms where is returns useful results.
........
r47026 | tim.peters | 2006-06-19 11:09:44 +0200 (Mon, 19 Jun 2006) | 13 lines
TestHelp.make_parser(): This was making a permanent change to
os.environ (setting envar COLUMNS), which at least caused
test_float_default() to fail if the tests were run more than once.
This repairs the test_optparse -R failures Neal reported on
python-dev. It also explains some seemingly bizarre test_optparse
failures we saw a couple weeks ago on the buildbots, when
test_optparse failed due to test_file failing to clean up after
itself, and then test_optparse failed in an entirely different
way when regrtest's -w option ran test_optparse a second time.
It's now obvious that make_parser() permanently changing os.environ
was responsible for the second half of that.
........
r47027 | anthony.baxter | 2006-06-19 14:04:15 +0200 (Mon, 19 Jun 2006) | 2 lines
Preparing for 2.5b1.
........
r47029 | fred.drake | 2006-06-19 19:31:16 +0200 (Mon, 19 Jun 2006) | 1 line
remove non-working document formats from edist
........
r47030 | gerhard.haering | 2006-06-19 23:17:35 +0200 (Mon, 19 Jun 2006) | 5 lines
Fixed a memory leak that was introduced with incorrect usage of the Python weak
reference API in pysqlite 2.2.1.
Bumbed pysqlite version number to upcoming pysqlite 2.3.1 release.
........
r47032 | ka-ping.yee | 2006-06-20 00:49:36 +0200 (Tue, 20 Jun 2006) | 2 lines
Remove Python 2.3 compatibility comment.
........
r47033 | trent.mick | 2006-06-20 01:21:25 +0200 (Tue, 20 Jun 2006) | 2 lines
Upgrade pyexpat to expat 2.0.0 (http://python.org/sf/1462338).
........
r47034 | trent.mick | 2006-06-20 01:57:41 +0200 (Tue, 20 Jun 2006) | 3 lines
[ 1295808 ] expat symbols should be namespaced in pyexpat
(http://python.org/sf/1295808)
........
r47039 | andrew.kuchling | 2006-06-20 13:52:16 +0200 (Tue, 20 Jun 2006) | 1 line
Uncomment wsgiref section
........
r47040 | andrew.kuchling | 2006-06-20 14:15:09 +0200 (Tue, 20 Jun 2006) | 1 line
Add four library items
........
r47041 | andrew.kuchling | 2006-06-20 14:19:54 +0200 (Tue, 20 Jun 2006) | 1 line
Terminology and typography fixes
........
r47042 | andrew.kuchling | 2006-06-20 15:05:12 +0200 (Tue, 20 Jun 2006) | 1 line
Add introductory paragraphs summarizing the release; minor edits
........
r47043 | andrew.kuchling | 2006-06-20 15:11:29 +0200 (Tue, 20 Jun 2006) | 1 line
Minor edits and rearrangements; markup fix
........
r47044 | andrew.kuchling | 2006-06-20 15:20:30 +0200 (Tue, 20 Jun 2006) | 1 line
[Bug #1504456] Mention xml -> xmlcore change
........
r47047 | brett.cannon | 2006-06-20 19:30:26 +0200 (Tue, 20 Jun 2006) | 2 lines
Raise TestSkipped when the test socket connection is refused.
........
r47049 | brett.cannon | 2006-06-20 21:20:17 +0200 (Tue, 20 Jun 2006) | 2 lines
Fix typo of exception name.
........
r47053 | brett.cannon | 2006-06-21 18:57:57 +0200 (Wed, 21 Jun 2006) | 5 lines
At the C level, tuple arguments are passed in directly to the exception
constructor, meaning it is treated as *args, not as a single argument. This
means using the 'message' attribute won't work (until Py3K comes around),
and so one must grab from 'arg' to get the error number.
........
r47054 | andrew.kuchling | 2006-06-21 19:10:18 +0200 (Wed, 21 Jun 2006) | 1 line
Link to LibRef module documentation
........
r47055 | andrew.kuchling | 2006-06-21 19:17:10 +0200 (Wed, 21 Jun 2006) | 1 line
Note some of Barry's work
........
r47056 | andrew.kuchling | 2006-06-21 19:17:28 +0200 (Wed, 21 Jun 2006) | 1 line
Bump version
........
r47057 | georg.brandl | 2006-06-21 19:45:17 +0200 (Wed, 21 Jun 2006) | 3 lines
fix [ 1509132 ] compiler module builds incorrect AST for TryExceptFinally
........
r47058 | georg.brandl | 2006-06-21 19:52:36 +0200 (Wed, 21 Jun 2006) | 3 lines
Make test_fcntl aware of netbsd3.
........
r47059 | georg.brandl | 2006-06-21 19:53:17 +0200 (Wed, 21 Jun 2006) | 3 lines
Patch #1509001: expected skips for netbsd3.
........
r47060 | gerhard.haering | 2006-06-21 22:55:04 +0200 (Wed, 21 Jun 2006) | 2 lines
Removed call to enable_callback_tracebacks that slipped in by accident.
........
r47061 | armin.rigo | 2006-06-21 23:58:50 +0200 (Wed, 21 Jun 2006) | 13 lines
Fix for an obscure bug introduced by revs 46806 and 46808, with a test.
The problem of checking too eagerly for recursive calls is the
following: if a RuntimeError is caused by recursion, and if code needs
to normalize it immediately (as in the 2nd test), then
PyErr_NormalizeException() needs a call to the RuntimeError class to
instantiate it, and this hits the recursion limit again... causing
PyErr_NormalizeException() to never finish.
Moved this particular recursion check to slot_tp_call(), which is not
involved in instantiating built-in exceptions.
Backport candidate.
........
r47064 | neal.norwitz | 2006-06-22 08:30:50 +0200 (Thu, 22 Jun 2006) | 3 lines
Copy the wsgiref package during make install.
........
r47065 | neal.norwitz | 2006-06-22 08:35:30 +0200 (Thu, 22 Jun 2006) | 1 line
Reset the doc date to today for the automatic doc builds
........
r47067 | andrew.kuchling | 2006-06-22 15:10:23 +0200 (Thu, 22 Jun 2006) | 1 line
Mention how to suppress warnings
........
r47069 | georg.brandl | 2006-06-22 16:46:17 +0200 (Thu, 22 Jun 2006) | 3 lines
Set lineno correctly on list, tuple and dict literals.
........
r47070 | georg.brandl | 2006-06-22 16:46:46 +0200 (Thu, 22 Jun 2006) | 4 lines
Test for correct compilation of try-except-finally stmt.
Test for correct lineno on list, tuple, dict literals.
........
r47071 | fred.drake | 2006-06-22 17:50:08 +0200 (Thu, 22 Jun 2006) | 1 line
fix markup nit
........
r47072 | brett.cannon | 2006-06-22 18:49:14 +0200 (Thu, 22 Jun 2006) | 6 lines
'warning's was improperly requiring that a command-line Warning category be
both a subclass of Warning and a subclass of types.ClassType. The latter is no
longer true thanks to new-style exceptions.
Closes bug #1510580. Thanks to AMK for the test.
........
r47073 | ronald.oussoren | 2006-06-22 20:33:54 +0200 (Thu, 22 Jun 2006) | 3 lines
MacOSX: Add a message to the first screen of the installer that tells
users how to avoid updates to their shell profile.
........
r47074 | georg.brandl | 2006-06-22 21:02:18 +0200 (Thu, 22 Jun 2006) | 3 lines
Fix my name ;)
........
r47075 | thomas.heller | 2006-06-22 21:07:36 +0200 (Thu, 22 Jun 2006) | 2 lines
Small fixes, mostly in the markup.
........
r47076 | peter.astrand | 2006-06-22 22:06:46 +0200 (Thu, 22 Jun 2006) | 1 line
Make it possible to run test_subprocess.py on Python 2.2, which lacks test_support.is_resource_enabled.
........
r47077 | peter.astrand | 2006-06-22 22:21:26 +0200 (Thu, 22 Jun 2006) | 1 line
Applied patch #1506758: Prevent MemoryErrors with large MAXFD.
........
r47079 | neal.norwitz | 2006-06-23 05:32:44 +0200 (Fri, 23 Jun 2006) | 1 line
Fix refleak
........
r47080 | fred.drake | 2006-06-23 08:03:45 +0200 (Fri, 23 Jun 2006) | 9 lines
- SF bug #853506: IP6 address parsing in sgmllib
('[' and ']' were not accepted in unquoted attribute values)
- cleaned up tests of character and entity reference decoding so the
tests cover the documented relationships among handle_charref,
handle_entityref, convert_charref, convert_codepoint, and
convert_entityref, without bringing up Unicode issues that sgmllib
cannot be involved in
........
r47085 | andrew.kuchling | 2006-06-23 21:23:40 +0200 (Fri, 23 Jun 2006) | 11 lines
Fit Makefile for the Python doc environment better; this is a step toward
including the howtos in the build process.
* Put LaTeX output in ../paper-<whatever>/.
* Put HTML output in ../html/
* Explain some of the Makefile variables
* Remove some cruft dating to my environment (e.g. the 'web' target)
This makefile isn't currently invoked by the documentation build process,
so these changes won't destabilize anything.
........
r47086 | hyeshik.chang | 2006-06-23 23:16:18 +0200 (Fri, 23 Jun 2006) | 5 lines
Bug #1511381: codec_getstreamcodec() in codec.c is corrected to
omit a default "error" argument for NULL pointer. This allows
the parser to take a codec from cjkcodecs again.
(Reported by Taewook Kang and reviewed by Walter Doerwald)
........
r47091 | ronald.oussoren | 2006-06-25 22:44:16 +0200 (Sun, 25 Jun 2006) | 6 lines
Workaround for bug #1512124
Without this patch IDLE will get unresponsive when you open the debugger
window on OSX. This is both using the system Tcl/Tk on Tiger as the latest
universal download from tk-components.sf.net.
........
r47092 | ronald.oussoren | 2006-06-25 23:14:19 +0200 (Sun, 25 Jun 2006) | 3 lines
Drop the calldll demo's for macos, calldll isn't present anymore, no need
to keep the demo's around.
........
r47093 | ronald.oussoren | 2006-06-25 23:15:58 +0200 (Sun, 25 Jun 2006) | 3 lines
Use a path without a double slash to compile the .py files after installation
(macosx, binary installer). This fixes bug #1508369 for python 2.5.
........
r47094 | ronald.oussoren | 2006-06-25 23:19:06 +0200 (Sun, 25 Jun 2006) | 3 lines
Also install the .egg-info files in Lib. This will cause wsgiref.egg-info to
be installed.
........
r47097 | andrew.kuchling | 2006-06-26 14:40:02 +0200 (Mon, 26 Jun 2006) | 1 line
[Bug #1511998] Various comments from Nick Coghlan; thanks!
........
r47098 | andrew.kuchling | 2006-06-26 14:43:43 +0200 (Mon, 26 Jun 2006) | 1 line
Describe workaround for PyRange_New()'s removal
........
r47099 | andrew.kuchling | 2006-06-26 15:08:24 +0200 (Mon, 26 Jun 2006) | 5 lines
[Bug #1512163] Fix typo.
This change will probably break tests on FreeBSD buildbots, but I'll check in
a fix for that next.
........
r47100 | andrew.kuchling | 2006-06-26 15:12:16 +0200 (Mon, 26 Jun 2006) | 9 lines
[Bug #1512163] Use one set of locking methods, lockf();
remove the flock() calls.
On FreeBSD, the two methods lockf() and flock() end up using the same
mechanism and the second one fails. A Linux man page claims that the
two methods are orthogonal (so locks acquired one way don't interact
with locks acquired the other way) but that clearly must be false.
........
r47101 | andrew.kuchling | 2006-06-26 15:23:10 +0200 (Mon, 26 Jun 2006) | 5 lines
Add a test for a conflicting lock.
On slow machines, maybe the time intervals (2 sec, 0.5 sec) will be too tight.
I'll see how the buildbots like it.
........
r47103 | andrew.kuchling | 2006-06-26 16:33:24 +0200 (Mon, 26 Jun 2006) | 1 line
Windows doesn't have os.fork(). I'll just disable this test for now
........
r47106 | andrew.kuchling | 2006-06-26 19:00:35 +0200 (Mon, 26 Jun 2006) | 9 lines
Attempt to fix build failure on OS X and Debian alpha; the symptom is
consistent with os.wait() returning immediately because some other
subprocess had previously exited; the test suite then immediately
tries to lock the mailbox and gets an error saying it's already
locked.
To fix this, do a waitpid() so the test suite only continues once
the intended child process has exited.
........
r47113 | neal.norwitz | 2006-06-27 06:06:46 +0200 (Tue, 27 Jun 2006) | 1 line
Ignore some more warnings in the dynamic linker on an older gentoo
........
r47114 | neal.norwitz | 2006-06-27 06:09:13 +0200 (Tue, 27 Jun 2006) | 6 lines
Instead of doing a make test, run the regression tests out of the installed
copy. This will hopefully catch problems where directories are added
under Lib/ but not to Makefile.pre.in. This breaks out the 2 runs
of the test suite with and without -O which is also nicer.
........
r47115 | neal.norwitz | 2006-06-27 06:12:58 +0200 (Tue, 27 Jun 2006) | 5 lines
Fix SF bug #1513032, 'make install' failure on FreeBSD 5.3.
No need to install lib-old, it's empty in 2.5.
........
r47116 | neal.norwitz | 2006-06-27 06:23:06 +0200 (Tue, 27 Jun 2006) | 1 line
Test unimportant change to verify buildbot does not try to build
........
r47117 | neal.norwitz | 2006-06-27 06:26:30 +0200 (Tue, 27 Jun 2006) | 1 line
Try again: test unimportant change to verify buildbot does not try to build
........
r47118 | neal.norwitz | 2006-06-27 06:28:56 +0200 (Tue, 27 Jun 2006) | 1 line
Verify buildbot picks up these changes (really needs testing after last change to Makefile.pre.in)
........
r47121 | vinay.sajip | 2006-06-27 09:34:37 +0200 (Tue, 27 Jun 2006) | 1 line
Removed buggy exception handling in doRollover of rotating file handlers. Exceptions now propagate to caller.
........
r47123 | ronald.oussoren | 2006-06-27 12:08:25 +0200 (Tue, 27 Jun 2006) | 3 lines
MacOSX: fix rather dumb buglet that made it impossible to create extensions on
OSX 10.3 when using a binary distribution build on 10.4.
........
r47125 | tim.peters | 2006-06-27 13:52:49 +0200 (Tue, 27 Jun 2006) | 2 lines
Whitespace normalization.
........
r47128 | ronald.oussoren | 2006-06-27 14:53:52 +0200 (Tue, 27 Jun 2006) | 8 lines
Use staticly build copies of zlib and bzip2 to build the OSX installer, that
way the resulting binaries have a better change of running on 10.3.
This patch also updates the search logic for sleepycat db3/4, without this
patch you cannot use a sleepycat build with a non-standard prefix; with this
you can (at least on OSX) if you add the prefix to CPPFLAGS/LDFLAGS at
configure-time. This change is needed to build the binary installer for OSX.
........
r47131 | ronald.oussoren | 2006-06-27 17:45:32 +0200 (Tue, 27 Jun 2006) | 5 lines
macosx: Install a libpython2.5.a inside the framework as a symlink to the actual
dylib at the root of the framework, that way tools that expect a unix-like
install (python-config, but more importantly external products like
mod_python) work correctly.
........
r47137 | neal.norwitz | 2006-06-28 07:03:22 +0200 (Wed, 28 Jun 2006) | 4 lines
According to the man pages on Gentoo Linux and Tru64, EACCES or EAGAIN
can be returned if fcntl (lockf) fails. This fixes the test failure
on Tru64 by checking for either error rather than just EAGAIN.
........
r47139 | neal.norwitz | 2006-06-28 08:28:31 +0200 (Wed, 28 Jun 2006) | 5 lines
Fix bug #1512695: cPickle.loads could crash if it was interrupted with
a KeyboardInterrupt since PyTuple_Pack was passed a NULL.
Will backport.
........
r47142 | nick.coghlan | 2006-06-28 12:41:47 +0200 (Wed, 28 Jun 2006) | 1 line
Make full module name available as __module_name__ even when __name__ is set to something else (like '__main__')
........
r47143 | armin.rigo | 2006-06-28 12:49:51 +0200 (Wed, 28 Jun 2006) | 2 lines
A couple of crashers of the "won't fix" kind.
........
r47147 | andrew.kuchling | 2006-06-28 16:25:20 +0200 (Wed, 28 Jun 2006) | 1 line
[Bug #1508766] Add docs for uuid module; docs written by George Yoshida, with minor rearrangements by me.
........
r47148 | andrew.kuchling | 2006-06-28 16:27:21 +0200 (Wed, 28 Jun 2006) | 1 line
[Bug #1508766] Add docs for uuid module; this puts the module in the 'Internet Protocols' section. Arguably this module could also have gone in the chapters on strings or encodings, maybe even the crypto chapter. Fred, please move if you see fit.
........
r47151 | georg.brandl | 2006-06-28 22:23:25 +0200 (Wed, 28 Jun 2006) | 3 lines
Fix end_fill().
........
r47153 | trent.mick | 2006-06-28 22:30:41 +0200 (Wed, 28 Jun 2006) | 2 lines
Mention the expat upgrade and pyexpat fix I put in 2.5b1.
........
r47154 | fred.drake | 2006-06-29 02:51:53 +0200 (Thu, 29 Jun 2006) | 6 lines
SF bug #1504333: sgmlib should allow angle brackets in quoted values
(modified patch by Sam Ruby; changed to use separate REs for start and end
tags to reduce matching cost for end tags; extended tests; updated to avoid
breaking previous changes to support IPv6 addresses in unquoted attribute
values)
........
r47156 | fred.drake | 2006-06-29 04:57:48 +0200 (Thu, 29 Jun 2006) | 1 line
document recent bugfixes in sgmllib
........
r47158 | neal.norwitz | 2006-06-29 06:10:08 +0200 (Thu, 29 Jun 2006) | 10 lines
Add new utility function, reap_children(), to test_support. This should
be called at the end of each test that spawns children (perhaps it
should be called from regrtest instead?). This will hopefully prevent
some of the unexplained failures in the buildbots (hppa and alpha)
during tests that spawn children. The problems were not reproducible.
There were many zombies that remained at the end of several tests.
In the worst case, this shouldn't cause any more problems,
though it may not help either. Time will tell.
........
r47159 | neal.norwitz | 2006-06-29 07:48:14 +0200 (Thu, 29 Jun 2006) | 5 lines
This should fix the buildbot failure on s/390 which can't connect to gmail.org.
It makes the error message consistent and always sends to stderr.
It would be much better for all the networking tests to hit only python.org.
........
r47161 | thomas.heller | 2006-06-29 20:34:15 +0200 (Thu, 29 Jun 2006) | 3 lines
Protect the thread api calls in the _ctypes extension module within
#ifdef WITH_THREADS/#endif blocks. Found by Sam Rushing.
........
r47162 | martin.v.loewis | 2006-06-29 20:58:44 +0200 (Thu, 29 Jun 2006) | 2 lines
Patch #1509163: MS Toolkit Compiler no longer available
........
r47163 | skip.montanaro | 2006-06-29 21:20:09 +0200 (Thu, 29 Jun 2006) | 1 line
add string methods to index
........
r47164 | vinay.sajip | 2006-06-30 02:13:08 +0200 (Fri, 30 Jun 2006) | 1 line
Fixed bug in fileConfig() which failed to clear logging._handlerList
........
r47166 | tim.peters | 2006-06-30 08:18:39 +0200 (Fri, 30 Jun 2006) | 2 lines
Whitespace normalization.
........
r47170 | neal.norwitz | 2006-06-30 09:32:16 +0200 (Fri, 30 Jun 2006) | 1 line
Silence compiler warning
........
r47171 | neal.norwitz | 2006-06-30 09:32:46 +0200 (Fri, 30 Jun 2006) | 1 line
Another problem reported by Coverity. Backport candidate.
........
r47175 | thomas.heller | 2006-06-30 19:44:54 +0200 (Fri, 30 Jun 2006) | 2 lines
Revert the use of PY_FORMAT_SIZE_T in PyErr_Format.
........
r47176 | tim.peters | 2006-06-30 20:34:51 +0200 (Fri, 30 Jun 2006) | 2 lines
Remove now-unused fidding with PY_FORMAT_SIZE_T.
........
r47177 | georg.brandl | 2006-06-30 20:47:56 +0200 (Fri, 30 Jun 2006) | 3 lines
Document decorator usage of property.
........
r47181 | fred.drake | 2006-06-30 21:29:25 +0200 (Fri, 30 Jun 2006) | 4 lines
- consistency nit: always include "()" in \function and \method
(*should* be done by the presentation, but that requires changes all over)
- avoid spreading the __name meme
........
r47188 | vinay.sajip | 2006-07-01 12:45:20 +0200 (Sat, 01 Jul 2006) | 1 line
Added entry for fileConfig() bugfix.
........
r47189 | vinay.sajip | 2006-07-01 12:47:20 +0200 (Sat, 01 Jul 2006) | 1 line
Added duplicate call to fileConfig() to ensure that it cleans up after itself correctly.
........
r47190 | martin.v.loewis | 2006-07-01 17:33:37 +0200 (Sat, 01 Jul 2006) | 2 lines
Release all forwarded functions in .close. Fixes #1513223.
........
r47191 | fred.drake | 2006-07-01 18:28:20 +0200 (Sat, 01 Jul 2006) | 7 lines
SF bug #1296433 (Expat bug #1515266): Unchecked calls to character data
handler would cause a segfault. This merges in Expat's lib/xmlparse.c
revisions 1.154 and 1.155, which fix this and a closely related problem
(the later does not affect Python).
Moved the crasher test to the tests for xml.parsers.expat.
........
r47197 | gerhard.haering | 2006-07-02 19:48:30 +0200 (Sun, 02 Jul 2006) | 4 lines
The sqlite3 module did cut off data from the SQLite database at the first null
character before sending it to a custom converter. This has been fixed now.
........
r47198 | martin.v.loewis | 2006-07-02 20:44:00 +0200 (Sun, 02 Jul 2006) | 1 line
Correct arithmetic in access on Win32. Fixes #1513646.
........
r47203 | thomas.heller | 2006-07-03 09:58:09 +0200 (Mon, 03 Jul 2006) | 1 line
Cleanup: Remove commented out code.
........
r47204 | thomas.heller | 2006-07-03 09:59:50 +0200 (Mon, 03 Jul 2006) | 1 line
Don't run the doctests with Python 2.3 because it doesn't have the ELLIPSIS flag.
........
r47205 | thomas.heller | 2006-07-03 10:04:05 +0200 (Mon, 03 Jul 2006) | 7 lines
Fixes so that _ctypes can be compiled with the MingW compiler.
It seems that the definition of '__attribute__(x)' was responsible for
the compiler ignoring the '__fastcall' attribute on the
ffi_closure_SYSV function in libffi_msvc/ffi.c, took me quite some
time to figure this out.
........
r47206 | thomas.heller | 2006-07-03 10:08:14 +0200 (Mon, 03 Jul 2006) | 11 lines
Add a new function uses_seh() to the _ctypes extension module. This
will return True if Windows Structured Exception handling (SEH) is
used when calling functions, False otherwise.
Currently, only MSVC supports SEH.
Fix the test so that it doesn't crash when run with MingW compiled
_ctypes. Note that two tests are still failing when mingw is used, I
suspect structure layout differences and function calling conventions
between MSVC and MingW.
........
r47207 | tim.peters | 2006-07-03 10:23:19 +0200 (Mon, 03 Jul 2006) | 2 lines
Whitespace normalization.
........
r47208 | martin.v.loewis | 2006-07-03 11:44:00 +0200 (Mon, 03 Jul 2006) | 3 lines
Only setup canvas when it is first created.
Fixes #1514703
........
r47209 | martin.v.loewis | 2006-07-03 12:05:30 +0200 (Mon, 03 Jul 2006) | 3 lines
Reimplement turtle.circle using a polyline, to allow correct
filling of arcs. Also fixes #1514693.
........
r47210 | martin.v.loewis | 2006-07-03 12:19:49 +0200 (Mon, 03 Jul 2006) | 3 lines
Bug #1514693: Update turtle's heading when switching between
degrees and radians.
........
r47211 | martin.v.loewis | 2006-07-03 13:12:06 +0200 (Mon, 03 Jul 2006) | 2 lines
Document functions added in 2.3 and 2.5.
........
r47212 | martin.v.loewis | 2006-07-03 14:19:50 +0200 (Mon, 03 Jul 2006) | 3 lines
Bug #1417699: Reject locale-specific decimal point in float()
and atof().
........
r47213 | martin.v.loewis | 2006-07-03 14:28:58 +0200 (Mon, 03 Jul 2006) | 3 lines
Bug #1267547: Put proper recursive setup.py call into the
spec file generated by bdist_rpm.
........
r47215 | martin.v.loewis | 2006-07-03 15:01:35 +0200 (Mon, 03 Jul 2006) | 3 lines
Patch #825417: Fix timeout processing in expect,
read_until. Will backport to 2.4.
........
r47218 | martin.v.loewis | 2006-07-03 15:47:40 +0200 (Mon, 03 Jul 2006) | 2 lines
Put method-wrappers into trashcan. Fixes #927248.
........
r47219 | andrew.kuchling | 2006-07-03 16:07:30 +0200 (Mon, 03 Jul 2006) | 1 line
[Bug #1515932] Clarify description of slice assignment
........
r47220 | andrew.kuchling | 2006-07-03 16:16:09 +0200 (Mon, 03 Jul 2006) | 4 lines
[Bug #1511911] Clarify description of optional arguments to sorted()
by improving the xref to the section on lists, and by
copying the explanations of the arguments (with a slight modification).
........
r47223 | kristjan.jonsson | 2006-07-03 16:59:05 +0200 (Mon, 03 Jul 2006) | 1 line
Fix build problems with the platform SDK on windows. It is not sufficient to test for the C compiler version when determining if we have the secure CRT from microsoft. Must test with an undocumented macro, __STDC_SECURE_LIB__ too.
........
r47224 | ronald.oussoren | 2006-07-04 14:30:22 +0200 (Tue, 04 Jul 2006) | 7 lines
Sync the darwin/x86 port libffi with the copy in PyObjC. This fixes a number
of bugs in that port. The most annoying ones were due to some subtle differences
between the document ABI and the actual implementation :-(
(there are no python unittests that fail without this patch, but without it
some of libffi's unittests fail).
........
r47234 | georg.brandl | 2006-07-05 10:21:00 +0200 (Wed, 05 Jul 2006) | 3 lines
Remove remaining references to OverflowWarning.
........
r47236 | thomas.heller | 2006-07-05 11:13:56 +0200 (Wed, 05 Jul 2006) | 3 lines
Fix the bitfield test when _ctypes is compiled with MingW. Structures
containing bitfields may have different layout on MSVC and MingW .
........
r47237 | thomas.wouters | 2006-07-05 13:03:49 +0200 (Wed, 05 Jul 2006) | 15 lines
Fix bug in passing tuples to string.Template. All other values (with working
str() or repr()) would work, just not multi-value tuples. Probably not a
backport candidate, since it changes the behaviour of passing a
single-element tuple:
>>> string.Template("$foo").substitute(dict(foo=(1,)))
'(1,)'
versus
'1'
........
r47241 | georg.brandl | 2006-07-05 16:18:45 +0200 (Wed, 05 Jul 2006) | 2 lines
Patch #1517490: fix glitches in filter() docs.
........
r47244 | georg.brandl | 2006-07-05 17:50:05 +0200 (Wed, 05 Jul 2006) | 2 lines
no need to elaborate "string".
........
r47251 | neal.norwitz | 2006-07-06 06:28:59 +0200 (Thu, 06 Jul 2006) | 3 lines
Fix refleaks reported by Shane Hathaway in SF patch #1515361. This change
contains only the changes related to leaking the copy variable.
........
r47253 | fred.drake | 2006-07-06 07:13:22 +0200 (Thu, 06 Jul 2006) | 4 lines
- back out Expat change; the final fix to Expat will be different
- change the pyexpat wrapper to not be so sensitive to this detail of the
Expat implementation (the ex-crasher test still passes)
........
r47257 | neal.norwitz | 2006-07-06 08:45:08 +0200 (Thu, 06 Jul 2006) | 1 line
Add a NEWS entry for a recent pyexpat fix
........
r47258 | martin.v.loewis | 2006-07-06 08:55:58 +0200 (Thu, 06 Jul 2006) | 2 lines
Add sqlite3.dll to the DLLs component, not to the TkDLLs component.
Fixes #1517388.
........
r47259 | martin.v.loewis | 2006-07-06 09:05:21 +0200 (Thu, 06 Jul 2006) | 1 line
Properly quote compileall and Lib paths in case TARGETDIR has a space.
........
r47260 | thomas.heller | 2006-07-06 09:50:18 +0200 (Thu, 06 Jul 2006) | 5 lines
Revert the change done in svn revision 47206:
Add a new function uses_seh() to the _ctypes extension module. This
will return True if Windows Structured Exception handling (SEH) is
used when calling functions, False otherwise.
........
r47261 | armin.rigo | 2006-07-06 09:58:18 +0200 (Thu, 06 Jul 2006) | 3 lines
A couple of examples about how to attack the fact that _PyType_Lookup()
returns a borrowed ref. Many of the calls are open to attack.
........
r47262 | thomas.heller | 2006-07-06 10:28:14 +0200 (Thu, 06 Jul 2006) | 2 lines
The test that calls a function with invalid arguments and catches the
resulting Windows access violation will not be run by default.
........
r47263 | thomas.heller | 2006-07-06 10:48:35 +0200 (Thu, 06 Jul 2006) | 5 lines
Patch #1517790: It is now possible to use custom objects in the ctypes
foreign function argtypes sequence as long as they provide a
from_param method, no longer is it required that the object is a
ctypes type.
........
r47264 | thomas.heller | 2006-07-06 10:58:40 +0200 (Thu, 06 Jul 2006) | 2 lines
Document the Struture and Union constructors.
........
r47265 | thomas.heller | 2006-07-06 11:11:22 +0200 (Thu, 06 Jul 2006) | 2 lines
Document the changes in svn revision 47263, from patch #1517790.
........
r47267 | ronald.oussoren | 2006-07-06 12:13:35 +0200 (Thu, 06 Jul 2006) | 7 lines
This patch solves the problem Skip was seeing with zlib, this patch ensures that
configure uses similar compiler flags as setup.py when doing the zlib test.
Without this patch configure would use the first shared library on the linker
path, with this patch it uses the first shared or static library on that path
just like setup.py.
........
r47268 | thomas.wouters | 2006-07-06 12:48:28 +0200 (Thu, 06 Jul 2006) | 4 lines
NEWS entry for r47267: fixing configure's zlib probing.
........
r47269 | fredrik.lundh | 2006-07-06 14:29:24 +0200 (Thu, 06 Jul 2006) | 3 lines
added XMLParser alias for cElementTree compatibility
........
r47271 | nick.coghlan | 2006-07-06 14:53:04 +0200 (Thu, 06 Jul 2006) | 1 line
Revert the __module_name__ changes made in rev 47142. We'll revisit this in Python 2.6
........
r47272 | nick.coghlan | 2006-07-06 15:04:56 +0200 (Thu, 06 Jul 2006) | 1 line
Update the tutorial section on relative imports
........
r47273 | nick.coghlan | 2006-07-06 15:35:27 +0200 (Thu, 06 Jul 2006) | 1 line
Ignore ImportWarning by default
........
r47274 | nick.coghlan | 2006-07-06 15:41:34 +0200 (Thu, 06 Jul 2006) | 1 line
Cover ImportWarning, PendingDeprecationWarning and simplefilter() in the warnings module docs
........
r47275 | nick.coghlan | 2006-07-06 15:47:18 +0200 (Thu, 06 Jul 2006) | 1 line
Add NEWS entries for the ImportWarning change and documentation update
........
r47276 | andrew.kuchling | 2006-07-06 15:57:28 +0200 (Thu, 06 Jul 2006) | 1 line
ImportWarning is now silent by default
........
r47277 | thomas.heller | 2006-07-06 17:06:05 +0200 (Thu, 06 Jul 2006) | 2 lines
Document the correct return type of PyLong_AsUnsignedLongLongMask.
........
r47278 | hyeshik.chang | 2006-07-06 17:21:52 +0200 (Thu, 06 Jul 2006) | 2 lines
Add a testcase for r47086 which fixed a bug in codec_getstreamcodec().
........
r47279 | hyeshik.chang | 2006-07-06 17:39:24 +0200 (Thu, 06 Jul 2006) | 3 lines
Test using all CJK encodings for the testcases which don't require
specific encodings.
........
r47280 | martin.v.loewis | 2006-07-06 21:28:03 +0200 (Thu, 06 Jul 2006) | 2 lines
Properly generate logical file ids. Fixes #1515998.
Also correct typo in Control.mapping.
........
r47287 | neal.norwitz | 2006-07-07 08:03:15 +0200 (Fri, 07 Jul 2006) | 17 lines
Restore rev 47014:
The hppa ubuntu box sometimes hangs forever in these tests. My guess
is that the wait is failing for some reason. Use WNOHANG, so we won't
wait until the buildbot kills the test suite.
I haven't been able to reproduce the failure, so I'm not sure if
this will help or not. Hopefully, this change will cause the test
to fail, rather than hang. That will be better since we will get
the rest of the test results. It may also help us debug the real problem.
*** The reason this originally failed was because there were many
zombie children outstanding before rev 47158 cleaned them up.
There are still hangs in test_subprocess that need to be addressed,
but that will take more work. This should close some holes.
........
r47289 | georg.brandl | 2006-07-07 10:15:12 +0200 (Fri, 07 Jul 2006) | 3 lines
Fix RFC number.
........
r50489 | neal.norwitz | 2006-07-08 07:31:37 +0200 (Sat, 08 Jul 2006) | 1 line
Fix SF bug #1519018: 'as' is now validated properly in import statements
........
r50490 | georg.brandl | 2006-07-08 14:15:27 +0200 (Sat, 08 Jul 2006) | 3 lines
Add an additional test for bug #1519018.
........
r50491 | tim.peters | 2006-07-08 21:55:05 +0200 (Sat, 08 Jul 2006) | 2 lines
Whitespace normalization.
........
r50493 | neil.schemenauer | 2006-07-09 18:16:34 +0200 (Sun, 09 Jul 2006) | 2 lines
Fix AST compiler bug #1501934: incorrect LOAD/STORE_GLOBAL generation.
........
r50495 | neil.schemenauer | 2006-07-09 23:19:29 +0200 (Sun, 09 Jul 2006) | 2 lines
Fix SF bug 1441486: bad unary minus folding in compiler.
........
r50497 | neal.norwitz | 2006-07-10 00:14:42 +0200 (Mon, 10 Jul 2006) | 4 lines
On 64 bit systems, int literals that use less than 64 bits are now ints
rather than longs. This also fixes the test for eval(-sys.maxint - 1).
........
r50500 | neal.norwitz | 2006-07-10 02:04:44 +0200 (Mon, 10 Jul 2006) | 4 lines
Bug #1512814, Fix incorrect lineno's when code at module scope
started after line 256.
........
r50501 | neal.norwitz | 2006-07-10 02:05:34 +0200 (Mon, 10 Jul 2006) | 1 line
Fix doco. Backport candidate.
........
r50503 | neal.norwitz | 2006-07-10 02:23:17 +0200 (Mon, 10 Jul 2006) | 5 lines
Part of SF patch #1484695. This removes dead code. The chksum was
already verified in .frombuf() on the lines above. If there was
a problem an exception is raised, so there was no way this condition
could have been true.
........
r50504 | neal.norwitz | 2006-07-10 03:18:57 +0200 (Mon, 10 Jul 2006) | 3 lines
Patch #1516912: improve Modules support for OpenVMS.
........
r50506 | neal.norwitz | 2006-07-10 04:36:41 +0200 (Mon, 10 Jul 2006) | 7 lines
Patch #1504046: Add documentation for xml.etree.
/F wrote the text docs, Englebert Gruber massaged it to latex and I
did some more massaging to try and improve the consistency and
fix some name mismatches between the declaration and text.
........
r50509 | martin.v.loewis | 2006-07-10 09:23:48 +0200 (Mon, 10 Jul 2006) | 2 lines
Introduce DISTUTILS_USE_SDK as a flag to determine whether the
SDK environment should be used. Fixes #1508010.
........
r50510 | martin.v.loewis | 2006-07-10 09:26:41 +0200 (Mon, 10 Jul 2006) | 1 line
Change error message to indicate that VS2003 is necessary to build extension modules, not the .NET SDK.
........
r50511 | martin.v.loewis | 2006-07-10 09:29:41 +0200 (Mon, 10 Jul 2006) | 1 line
Add svn:ignore.
........
r50512 | anthony.baxter | 2006-07-10 09:41:04 +0200 (Mon, 10 Jul 2006) | 1 line
preparing for 2.5b2
........
r50513 | thomas.heller | 2006-07-10 11:10:28 +0200 (Mon, 10 Jul 2006) | 2 lines
Fix bug #1518190: accept any integer or long value in the
ctypes.c_void_p constructor.
........
r50514 | thomas.heller | 2006-07-10 11:31:06 +0200 (Mon, 10 Jul 2006) | 3 lines
Fixed a segfault when ctypes.wintypes were imported on
non-Windows machines.
........
r50516 | thomas.heller | 2006-07-10 13:11:10 +0200 (Mon, 10 Jul 2006) | 3 lines
Assigning None to pointer type structure fields possible overwrote
wrong fields.
........
r50517 | thomas.heller | 2006-07-10 13:17:37 +0200 (Mon, 10 Jul 2006) | 5 lines
Moved the ctypes news entries from the 'Library' section into the
'Extension Modules' section where they belong, probably.
This destroyes the original order of the news entries, don't know
if that is important or not.
........
r50526 | phillip.eby | 2006-07-10 21:03:29 +0200 (Mon, 10 Jul 2006) | 2 lines
Fix SF#1516184 and add a test to prevent regression.
........
r50528 | phillip.eby | 2006-07-10 21:18:35 +0200 (Mon, 10 Jul 2006) | 2 lines
Fix SF#1457312: bad socket error handling in distutils "upload" command.
........
r50537 | peter.astrand | 2006-07-10 22:39:49 +0200 (Mon, 10 Jul 2006) | 1 line
Make it possible to run test_subprocess.py with Python 2.2, which lacks test_support.reap_children().
........
r50541 | tim.peters | 2006-07-10 23:08:24 +0200 (Mon, 10 Jul 2006) | 5 lines
After approval from Anthony, merge the tim-current_frames
branch into the trunk. This adds a new sys._current_frames()
function, which returns a dict mapping thread id to topmost
thread stack frame.
........
r50542 | tim.peters | 2006-07-10 23:11:49 +0200 (Mon, 10 Jul 2006) | 2 lines
Whitespace normalization.
........
r50553 | martin.v.loewis | 2006-07-11 00:11:28 +0200 (Tue, 11 Jul 2006) | 4 lines
Patch #1519566: Remove unused _tofill member.
Make begin_fill idempotent.
Update demo2 to demonstrate filling of concave shapes.
........
r50567 | anthony.baxter | 2006-07-11 04:04:09 +0200 (Tue, 11 Jul 2006) | 4 lines
#1494314: Fix a regression with high-numbered sockets in 2.4.3. This
means that select() on sockets > FD_SETSIZE (typically 1024) work again.
The patch makes sockets use poll() internally where available.
........
r50568 | tim.peters | 2006-07-11 04:17:48 +0200 (Tue, 11 Jul 2006) | 2 lines
Whitespace normalization.
........
r50575 | thomas.heller | 2006-07-11 18:42:05 +0200 (Tue, 11 Jul 2006) | 1 line
Add missing Py_DECREF.
........
r50576 | thomas.heller | 2006-07-11 18:44:25 +0200 (Tue, 11 Jul 2006) | 1 line
Add missing Py_DECREFs.
........
r50579 | andrew.kuchling | 2006-07-11 19:20:16 +0200 (Tue, 11 Jul 2006) | 1 line
Bump version number; add sys._current_frames
........
r50582 | thomas.heller | 2006-07-11 20:28:35 +0200 (Tue, 11 Jul 2006) | 3 lines
When a foreign function is retrived by calling __getitem__ on a ctypes
library instance, do not set it as attribute.
........
r50583 | thomas.heller | 2006-07-11 20:40:50 +0200 (Tue, 11 Jul 2006) | 2 lines
Change the ctypes version number to 1.0.0.
........
r50597 | neal.norwitz | 2006-07-12 07:26:17 +0200 (Wed, 12 Jul 2006) | 3 lines
Bug #1520864: unpacking singleton tuples in for loop (for x, in) work again.
........
r50598 | neal.norwitz | 2006-07-12 07:26:35 +0200 (Wed, 12 Jul 2006) | 1 line
Fix function name in error msg
........
r50599 | neal.norwitz | 2006-07-12 07:27:46 +0200 (Wed, 12 Jul 2006) | 4 lines
Fix uninitialized memory read reported by Valgrind when running doctest.
This could happen if size == 0.
........
r50600 | neal.norwitz | 2006-07-12 09:28:29 +0200 (Wed, 12 Jul 2006) | 1 line
Actually change the MAGIC #. Create a new section for 2.5c1 and mention the impact of changing the MAGIC #.
........
r50601 | thomas.heller | 2006-07-12 10:43:47 +0200 (Wed, 12 Jul 2006) | 3 lines
Fix #1467450: ctypes now uses RTLD_GLOBAL by default on OSX 10.3 to
load shared libraries.
........
r50604 | thomas.heller | 2006-07-12 16:25:18 +0200 (Wed, 12 Jul 2006) | 3 lines
Fix the wrong description of LibraryLoader.LoadLibrary, and document
the DEFAULT_MODE constant.
........
r50607 | georg.brandl | 2006-07-12 17:31:17 +0200 (Wed, 12 Jul 2006) | 3 lines
Accept long options "--help" and "--version".
........
r50617 | thomas.heller | 2006-07-13 11:53:47 +0200 (Thu, 13 Jul 2006) | 3 lines
A misspelled preprocessor symbol caused ctypes to be always compiled
without thread support. Replaced WITH_THREADS with WITH_THREAD.
........
r50619 | thomas.heller | 2006-07-13 19:01:14 +0200 (Thu, 13 Jul 2006) | 3 lines
Fix #1521375. When running with root priviledges, 'gcc -o /dev/null'
did overwrite /dev/null. Use a temporary file instead of /dev/null.
........
r50620 | thomas.heller | 2006-07-13 19:05:13 +0200 (Thu, 13 Jul 2006) | 2 lines
Fix misleading words.
........
r50622 | andrew.kuchling | 2006-07-13 19:37:26 +0200 (Thu, 13 Jul 2006) | 1 line
Typo fix
........
r50629 | georg.brandl | 2006-07-14 09:12:54 +0200 (Fri, 14 Jul 2006) | 3 lines
Patch #1521874: grammar errors in doanddont.tex.
........
r50630 | neal.norwitz | 2006-07-14 09:20:04 +0200 (Fri, 14 Jul 2006) | 1 line
Try to improve grammar further.
........
r50631 | martin.v.loewis | 2006-07-14 11:58:55 +0200 (Fri, 14 Jul 2006) | 1 line
Extend build_ssl to Win64, using VSExtComp.
........
r50632 | martin.v.loewis | 2006-07-14 14:10:09 +0200 (Fri, 14 Jul 2006) | 1 line
Add debug output to analyse buildbot failure.
........
r50633 | martin.v.loewis | 2006-07-14 14:31:05 +0200 (Fri, 14 Jul 2006) | 1 line
Fix Debug build of _ssl.
........
r50636 | andrew.kuchling | 2006-07-14 15:32:38 +0200 (Fri, 14 Jul 2006) | 1 line
Mention new options
........
r50638 | peter.astrand | 2006-07-14 16:04:45 +0200 (Fri, 14 Jul 2006) | 1 line
Bug #1223937: CalledProcessError.errno -> CalledProcessError.returncode.
........
r50640 | thomas.heller | 2006-07-14 17:01:05 +0200 (Fri, 14 Jul 2006) | 4 lines
Make the prototypes of our private PyUnicode_FromWideChar and
PyUnicode_AsWideChar replacement functions compatible to the official
functions by using Py_ssize_t instead of int.
........
r50643 | thomas.heller | 2006-07-14 19:51:14 +0200 (Fri, 14 Jul 2006) | 3 lines
Patch #1521817: The index range checking on ctypes arrays containing
exactly one element is enabled again.
........
r50647 | thomas.heller | 2006-07-14 20:22:50 +0200 (Fri, 14 Jul 2006) | 2 lines
Updates for the ctypes documentation.
........
r50655 | fredrik.lundh | 2006-07-14 23:45:48 +0200 (Fri, 14 Jul 2006) | 3 lines
typo
........
r50664 | george.yoshida | 2006-07-15 18:03:49 +0200 (Sat, 15 Jul 2006) | 2 lines
Bug #15187702 : ext/win-cookbook.html has a broken link to distutils
........
r50667 | bob.ippolito | 2006-07-15 18:53:15 +0200 (Sat, 15 Jul 2006) | 1 line
Patch #1220874: Update the binhex module for Mach-O.
........
r50671 | fred.drake | 2006-07-16 03:21:20 +0200 (Sun, 16 Jul 2006) | 1 line
clean up some link markup
........
r50673 | neal.norwitz | 2006-07-16 03:50:38 +0200 (Sun, 16 Jul 2006) | 4 lines
Bug #1512814, Fix incorrect lineno's when code within a function
had more than 255 blank lines. Byte codes need to go first, line #s second.
........
r50674 | neal.norwitz | 2006-07-16 04:00:32 +0200 (Sun, 16 Jul 2006) | 5 lines
a & b were dereffed above, so they are known to be valid pointers.
z is known to be NULL, nothing to DECREF.
Reported by Klockwork, #107.
........
r50675 | neal.norwitz | 2006-07-16 04:02:57 +0200 (Sun, 16 Jul 2006) | 5 lines
self is dereffed (and passed as first arg), so it's known to be good.
func is returned from PyArg_ParseTuple and also dereffed.
Reported by Klocwork, #30 (self one at least).
........
r50676 | neal.norwitz | 2006-07-16 04:05:35 +0200 (Sun, 16 Jul 2006) | 4 lines
proto was dereffed above and is known to be good. No need for X.
Reported by Klocwork, #39.
........
r50677 | neal.norwitz | 2006-07-16 04:15:27 +0200 (Sun, 16 Jul 2006) | 5 lines
Fix memory leaks in some conditions.
Reported by Klocwork #152.
........
r50678 | neal.norwitz | 2006-07-16 04:17:36 +0200 (Sun, 16 Jul 2006) | 4 lines
Fix memory leak under some conditions.
Reported by Klocwork, #98.
........
r50679 | neal.norwitz | 2006-07-16 04:22:30 +0200 (Sun, 16 Jul 2006) | 8 lines
Use sizeof(buffer) instead of duplicating the constants to ensure they won't
be wrong.
The real change is to pass (bufsz - 1) to PyOS_ascii_formatd and 1
to strncat. strncat copies n+1 bytes from src (not dest).
Reported by Klocwork #58.
........
r50680 | neal.norwitz | 2006-07-16 04:32:03 +0200 (Sun, 16 Jul 2006) | 5 lines
Handle a NULL name properly.
Reported by Klocwork #67
........
r50681 | neal.norwitz | 2006-07-16 04:35:47 +0200 (Sun, 16 Jul 2006) | 6 lines
PyFunction_SetDefaults() is documented as taking None or a tuple.
A NULL would crash the PyTuple_Check(). Now make NULL return a SystemError.
Reported by Klocwork #73.
........
r50683 | neal.norwitz | 2006-07-17 02:55:45 +0200 (Mon, 17 Jul 2006) | 5 lines
Stop INCREFing name, then checking if it's NULL. name (f_name) should never
be NULL so assert it. Fix one place where we could have passed NULL.
Reported by Klocwork #66.
........
r50684 | neal.norwitz | 2006-07-17 02:57:15 +0200 (Mon, 17 Jul 2006) | 5 lines
otherset is known to be non-NULL based on checks before and DECREF after.
DECREF otherset rather than XDECREF in error conditions too.
Reported by Klockwork #154.
........
r50685 | neal.norwitz | 2006-07-17 02:59:04 +0200 (Mon, 17 Jul 2006) | 7 lines
Reported by Klocwork #151.
v2 can be NULL if exception2 is NULL. I don't think that condition can happen,
but I'm not sure it can't either. Now the code will protect against either
being NULL.
........
r50686 | neal.norwitz | 2006-07-17 03:00:16 +0200 (Mon, 17 Jul 2006) | 1 line
Add NEWS entry for a bunch of fixes due to warnings produced by Klocworks static analysis tool.
........
r50687 | fred.drake | 2006-07-17 07:47:52 +0200 (Mon, 17 Jul 2006) | 3 lines
document xmlcore (still minimal; needs mention in each of the xml.* modules)
SF bug #1504456 (partial)
........
r50688 | georg.brandl | 2006-07-17 15:23:46 +0200 (Mon, 17 Jul 2006) | 3 lines
Remove usage of sets module (patch #1500609).
........
r50689 | georg.brandl | 2006-07-17 15:26:33 +0200 (Mon, 17 Jul 2006) | 3 lines
Add missing NEWS item (#1522771)
........
r50690 | andrew.kuchling | 2006-07-17 18:47:54 +0200 (Mon, 17 Jul 2006) | 1 line
Attribute more features
........
r50692 | kurt.kaiser | 2006-07-17 23:59:27 +0200 (Mon, 17 Jul 2006) | 8 lines
Patch 1479219 - Tal Einat
1. 'as' highlighted as builtin in comment string on import line
2. Comments such as "#False identity" which start with a keyword immediately
after the '#' character aren't colored as comments.
3. u or U beginning unicode string not correctly highlighted
Closes bug 1325071
........
r50693 | barry.warsaw | 2006-07-18 01:07:51 +0200 (Tue, 18 Jul 2006) | 16 lines
decode_rfc2231(): Be more robust against buggy RFC 2231 encodings.
Specifically, instead of raising a ValueError when there is a single tick in
the parameter, simply return that the entire string unquoted, with None for
both the charset and the language. Also, if there are more than 2 ticks in
the parameter, interpret the first three parts as the standard RFC 2231 parts,
then the rest of the parts as the encoded string.
Test cases added.
Original fewer-than-3-parts fix by Tokio Kikuchi.
Resolves SF bug # 1218081. I will back port the fix and tests to Python 2.4
(email 3.0) and Python 2.3 (email 2.5).
Also, bump the version number to email 4.0.1, removing the 'alpha' moniker.
........
r50695 | kurt.kaiser | 2006-07-18 06:03:16 +0200 (Tue, 18 Jul 2006) | 2 lines
Rebinding Tab key was inserting 'tab' instead of 'Tab'. Bug 1179168.
........
r50696 | brett.cannon | 2006-07-18 06:41:36 +0200 (Tue, 18 Jul 2006) | 6 lines
Fix bug #1520914. Starting in 2.4, time.strftime() began to check the bounds
of values in the time tuple passed in. Unfortunately people came to rely on
undocumented behaviour of setting unneeded values to 0, regardless of if it was
within the valid range. Now those values force the value internally to the
minimum value when 0 is passed in.
........
r50697 | facundo.batista | 2006-07-18 14:16:13 +0200 (Tue, 18 Jul 2006) | 1 line
Comments and docs cleanups, and some little fixes, provided by Santiágo Peresón
........
r50704 | martin.v.loewis | 2006-07-18 19:46:31 +0200 (Tue, 18 Jul 2006) | 2 lines
Patch #1524429: Use repr instead of backticks again.
........
r50706 | tim.peters | 2006-07-18 23:55:15 +0200 (Tue, 18 Jul 2006) | 2 lines
Whitespace normalization.
........
r50708 | tim.peters | 2006-07-19 02:03:19 +0200 (Wed, 19 Jul 2006) | 18 lines
SF bug 1524317: configure --without-threads fails to build
Moved the code for _PyThread_CurrentFrames() up, so it's no longer
in a huge "#ifdef WITH_THREAD" block (I didn't realize it /was/ in
one).
Changed test_sys's test_current_frames() so it passes with or without
thread supported compiled in.
Note that test_sys fails when Python is compiled without threads,
but for an unrelated reason (the old test_exit() fails with an
indirect ImportError on the `thread` module). There are also
other unrelated compilation failures without threads, in extension
modules (like ctypes); at least the core compiles again.
Do we really support --without-threads? If so, there are several
problems remaining.
........
r50713 | thomas.heller | 2006-07-19 11:09:32 +0200 (Wed, 19 Jul 2006) | 4 lines
Make sure the _ctypes extension can be compiled when WITH_THREAD is
not defined on Windows, even if that configuration is probably not
supported at all.
........
r50715 | martin.v.loewis | 2006-07-19 19:18:32 +0200 (Wed, 19 Jul 2006) | 4 lines
Revert r50706 (Whitespace normalization) and
r50697: Comments and docs cleanups, and some little fixes
per recommendation from Raymond Hettinger.
........
r50719 | phillip.eby | 2006-07-20 17:54:16 +0200 (Thu, 20 Jul 2006) | 4 lines
Fix SF#1516184 (again) and add a test to prevent regression.
(There was a problem with empty filenames still causing recursion)
........
r50720 | georg.brandl | 2006-07-20 18:28:39 +0200 (Thu, 20 Jul 2006) | 3 lines
Guard for _active being None in __del__ method.
........
r50721 | vinay.sajip | 2006-07-20 18:28:39 +0200 (Thu, 20 Jul 2006) | 1 line
Updated documentation for TimedRotatingFileHandler relating to how rollover files are named. The previous documentation was wrongly the same as for RotatingFileHandler.
........
r50731 | fred.drake | 2006-07-20 22:11:57 +0200 (Thu, 20 Jul 2006) | 1 line
markup fix
........
r50739 | kurt.kaiser | 2006-07-21 00:22:52 +0200 (Fri, 21 Jul 2006) | 7 lines
Avoid occasional failure to detect closing paren properly.
Patch 1407280 Tal Einat
M ParenMatch.py
M NEWS.txt
M CREDITS.txt
........
r50740 | vinay.sajip | 2006-07-21 01:20:12 +0200 (Fri, 21 Jul 2006) | 1 line
Addressed SF#1524081 by using a dictionary to map level names to syslog priority names, rather than a string.lower().
........
r50741 | neal.norwitz | 2006-07-21 07:29:58 +0200 (Fri, 21 Jul 2006) | 1 line
Add some asserts that we got good params passed
........
r50742 | neal.norwitz | 2006-07-21 07:31:02 +0200 (Fri, 21 Jul 2006) | 5 lines
Move the initialization of some pointers earlier. The problem is
that if we call Py_DECREF(frame) like we do if allocating locals fails,
frame_dealloc() will try to use these bogus values and crash.
........
r50743 | neal.norwitz | 2006-07-21 07:32:28 +0200 (Fri, 21 Jul 2006) | 4 lines
Handle allocation failures gracefully. Found with failmalloc.
Many (all?) of these could be backported.
........
r50745 | neal.norwitz | 2006-07-21 09:59:02 +0200 (Fri, 21 Jul 2006) | 1 line
Speel initialise write. Tanks Anthony.
........
r50746 | neal.norwitz | 2006-07-21 09:59:47 +0200 (Fri, 21 Jul 2006) | 2 lines
Handle more memory allocation failures without crashing.
........
r50754 | barry.warsaw | 2006-07-21 16:51:07 +0200 (Fri, 21 Jul 2006) | 23 lines
More RFC 2231 improvements for the email 4.0 package. As Mark Sapiro rightly
points out there are really two types of continued headers defined in this
RFC (i.e. "encoded" parameters with the form "name*0*=" and unencoded
parameters with the form "name*0="), but we were were handling them both the
same way and that isn't correct.
This patch should be much more RFC compliant in that only encoded params are
%-decoded and the charset/language information is only extract if there are
any encoded params in the segments. If there are no encoded params then the
RFC says that there will be no charset/language parts.
Note however that this will change the return value for Message.get_param() in
some cases. For example, whereas before if you had all unencoded param
continuations you would have still gotten a 3-tuple back from this method
(with charset and language == None), you will now get just a string. I don't
believe this is a backward incompatible change though because the
documentation for this method already indicates that either return value is
possible and that you must do an isinstance(val, tuple) check to discriminate
between the two. (Yeah that API kind of sucks but we can't change /that/
without breaking code.)
Test cases, some documentation updates, and a NEWS item accompany this patch.
........
r50759 | georg.brandl | 2006-07-21 19:36:31 +0200 (Fri, 21 Jul 2006) | 3 lines
Fix check for empty list (vs. None).
........
r50771 | brett.cannon | 2006-07-22 00:44:07 +0200 (Sat, 22 Jul 2006) | 2 lines
Remove an XXX marker in a comment.
........
r50773 | neal.norwitz | 2006-07-22 18:20:49 +0200 (Sat, 22 Jul 2006) | 1 line
Fix more memory allocation issues found with failmalloc.
........
r50774 | neal.norwitz | 2006-07-22 19:00:57 +0200 (Sat, 22 Jul 2006) | 1 line
Don't fail if the directory already exists
........
r50775 | greg.ward | 2006-07-23 04:25:53 +0200 (Sun, 23 Jul 2006) | 6 lines
Be a lot smarter about whether this test passes: instead of assuming
that a 2.93 sec audio file will always take 3.1 sec (as it did on the
hardware I had when I first wrote the test), expect that it will take
2.93 sec +/- 10%, and only fail if it's outside of that range.
Compute the expected
........
r50776 | kurt.kaiser | 2006-07-23 06:19:49 +0200 (Sun, 23 Jul 2006) | 2 lines
Tooltips failed on new-syle class __init__ args. Bug 1027566 Loren Guthrie
........
r50777 | neal.norwitz | 2006-07-23 09:50:36 +0200 (Sun, 23 Jul 2006) | 1 line
Handle more mem alloc issues found with failmalloc
........
r50778 | neal.norwitz | 2006-07-23 09:51:58 +0200 (Sun, 23 Jul 2006) | 5 lines
If the for loop isn't entered, entryblock will be NULL. If passed
to stackdepth_walk it will be dereffed.
Not sure if I found with failmalloc or Klockwork #55.
........
r50779 | neal.norwitz | 2006-07-23 09:53:14 +0200 (Sun, 23 Jul 2006) | 4 lines
Move the initialization of size_a down below the check for a being NULL.
Reported by Klocwork #106
........
r50780 | neal.norwitz | 2006-07-23 09:55:55 +0200 (Sun, 23 Jul 2006) | 9 lines
Check the allocation of b_objects and return if there was a failure.
Also fix a few memory leaks in other failure scenarios.
It seems that if b_objects == Py_None, we will have an extra ref to
b_objects. Add XXX comment so hopefully someone documents why the
else isn't necessary or adds it in.
Reported by Klocwork #20
........
r50781 | neal.norwitz | 2006-07-23 09:57:11 +0200 (Sun, 23 Jul 2006) | 2 lines
Fix memory leaks spotted by Klocwork #37.
........
r50782 | neal.norwitz | 2006-07-23 09:59:00 +0200 (Sun, 23 Jul 2006) | 5 lines
nextlink can be NULL if teedataobject_new fails, so use XINCREF.
Ensure that dataobj is never NULL.
Reported by Klocwork #102
........
r50783 | neal.norwitz | 2006-07-23 10:01:43 +0200 (Sun, 23 Jul 2006) | 8 lines
Ensure we don't write beyond errText. I think I got this right, but
it definitely could use some review to ensure I'm not off by one
and there's no possible overflow/wrap-around of bytes_left.
Reported by Klocwork #1.
Fix a problem if there is a failure allocating self->db.
Found with failmalloc.
........
r50784 | ronald.oussoren | 2006-07-23 11:41:09 +0200 (Sun, 23 Jul 2006) | 3 lines
Without this patch CMD-W won't close EditorWindows on MacOS X. This solves
part of bug #1517990.
........
r50785 | ronald.oussoren | 2006-07-23 11:46:11 +0200 (Sun, 23 Jul 2006) | 5 lines
Fix for bug #1517996: Class and Path browsers show Tk menu
This patch replaces the menubar that is used by AquaTk for windows without a
menubar of their own by one that is more appropriate for IDLE.
........
r50786 | andrew.macintyre | 2006-07-23 14:57:02 +0200 (Sun, 23 Jul 2006) | 2 lines
Build updates for OS/2 EMX port
........
r50787 | andrew.macintyre | 2006-07-23 15:00:04 +0200 (Sun, 23 Jul 2006) | 3 lines
bugfix: PyThread_start_new_thread() returns the thread ID, not a flag;
will backport.
........
r50789 | andrew.macintyre | 2006-07-23 15:04:00 +0200 (Sun, 23 Jul 2006) | 2 lines
Get mailbox module working on OS/2 EMX port.
........
r50791 | greg.ward | 2006-07-23 18:05:51 +0200 (Sun, 23 Jul 2006) | 1 line
Resync optparse with Optik 1.5.3: minor tweaks for/to tests.
........
r50794 | martin.v.loewis | 2006-07-24 07:05:22 +0200 (Mon, 24 Jul 2006) | 2 lines
Update list of unsupported systems. Fixes #1510853.
........
r50795 | martin.v.loewis | 2006-07-24 12:26:33 +0200 (Mon, 24 Jul 2006) | 1 line
Patch #1448199: Release GIL around ConnectRegistry.
........
r50796 | martin.v.loewis | 2006-07-24 13:54:53 +0200 (Mon, 24 Jul 2006) | 3 lines
Patch #1232023: Don't include empty path component from registry,
so that the current directory does not get added to sys.path.
Also fixes #1526785.
........
r50797 | martin.v.loewis | 2006-07-24 14:54:17 +0200 (Mon, 24 Jul 2006) | 3 lines
Bug #1524310: Properly report errors from FindNextFile in os.listdir.
Will backport to 2.4.
........
r50800 | georg.brandl | 2006-07-24 15:28:57 +0200 (Mon, 24 Jul 2006) | 7 lines
Patch #1523356: fix determining include dirs in python-config.
Also don't install "python-config" when doing altinstall, but
always install "python-config2.x" and make a link to it like
with the main executable.
........
r50802 | georg.brandl | 2006-07-24 15:46:47 +0200 (Mon, 24 Jul 2006) | 3 lines
Patch #1527744: right order of includes in order to have HAVE_CONIO_H defined properly.
........
r50803 | georg.brandl | 2006-07-24 16:09:56 +0200 (Mon, 24 Jul 2006) | 3 lines
Patch #1515343: Fix printing of deprecated string exceptions with a
value in the traceback module.
........
r50804 | kurt.kaiser | 2006-07-24 19:13:23 +0200 (Mon, 24 Jul 2006) | 7 lines
EditorWindow failed when used stand-alone if sys.ps1 not set.
Bug 1010370 Dave Florek
M EditorWindow.py
M PyShell.py
M NEWS.txt
........
r50805 | kurt.kaiser | 2006-07-24 20:05:51 +0200 (Mon, 24 Jul 2006) | 6 lines
- EditorWindow.test() was failing. Bug 1417598
M EditorWindow.py
M ScriptBinding.py
M NEWS.txt
........
r50808 | georg.brandl | 2006-07-24 22:11:35 +0200 (Mon, 24 Jul 2006) | 3 lines
Repair accidental NameError.
........
r50809 | tim.peters | 2006-07-24 23:02:15 +0200 (Mon, 24 Jul 2006) | 2 lines
Whitespace normalization.
........
r50810 | greg.ward | 2006-07-25 04:11:12 +0200 (Tue, 25 Jul 2006) | 3 lines
Don't use standard assert: want tests to fail even when run with -O.
Delete cruft.
........
r50811 | tim.peters | 2006-07-25 06:07:22 +0200 (Tue, 25 Jul 2006) | 10 lines
current_frames_with_threads(): There's actually no way
to guess /which/ line the spawned thread is in at the time
sys._current_frames() is called: we know it finished
enter_g.set(), but can't know whether the instruction
counter has advanced to the following leave_g.wait().
The latter is overwhelming most likely, but not guaranteed,
and I see that the "x86 Ubuntu dapper (icc) trunk" buildbot
found it on the other line once. Changed the test so it
passes in either case.
........
r50815 | martin.v.loewis | 2006-07-25 11:53:12 +0200 (Tue, 25 Jul 2006) | 2 lines
Bug #1525817: Don't truncate short lines in IDLE's tool tips.
........
r50816 | martin.v.loewis | 2006-07-25 12:05:47 +0200 (Tue, 25 Jul 2006) | 3 lines
Bug #978833: Really close underlying socket in _socketobject.close.
Will backport to 2.4.
........
r50817 | martin.v.loewis | 2006-07-25 12:11:14 +0200 (Tue, 25 Jul 2006) | 1 line
Revert incomplete checkin.
........
r50819 | georg.brandl | 2006-07-25 12:22:34 +0200 (Tue, 25 Jul 2006) | 4 lines
Patch #1525766: correctly pass onerror arg to recursive calls
of pkg.walk_packages. Also improve the docstrings.
........
r50825 | brett.cannon | 2006-07-25 19:32:20 +0200 (Tue, 25 Jul 2006) | 2 lines
Add comment for changes to test_ossaudiodev.
........
r50826 | brett.cannon | 2006-07-25 19:34:36 +0200 (Tue, 25 Jul 2006) | 3 lines
Fix a bug in the messages for an assert failure where not enough arguments to a string
were being converted in the format.
........
r50828 | armin.rigo | 2006-07-25 20:09:57 +0200 (Tue, 25 Jul 2006) | 2 lines
Document why is and is not a good way to fix the gc_inspection crasher.
........
r50829 | armin.rigo | 2006-07-25 20:11:07 +0200 (Tue, 25 Jul 2006) | 5 lines
Added another crasher, which hit me today (I was not intentionally
writing such code, of course, but it took some gdb time to figure out
what my bug was).
........
r50830 | armin.rigo | 2006-07-25 20:38:39 +0200 (Tue, 25 Jul 2006) | 3 lines
Document the crashers that will not go away soon as "won't fix",
and explain why.
........
r50831 | ronald.oussoren | 2006-07-25 21:13:35 +0200 (Tue, 25 Jul 2006) | 3 lines
Install the compatibility symlink to libpython.a on OSX using 'ln -sf' instead
of 'ln -s', this avoid problems when reinstalling python.
........
r50832 | ronald.oussoren | 2006-07-25 21:20:54 +0200 (Tue, 25 Jul 2006) | 7 lines
Fix for bug #1525447 (renaming to MacOSmodule.c would also work, but not
without causing problems for anyone that is on a case-insensitive filesystem).
Setup.py tries to compile the MacOS extension from MacOSmodule.c, while the
actual file is named macosmodule.c. This is no problem on the (default)
case-insensitive filesystem, but doesn't work on case-sensitive filesystems.
........
r50833 | ronald.oussoren | 2006-07-25 22:28:55 +0200 (Tue, 25 Jul 2006) | 7 lines
Fix bug #1517990: IDLE keybindings on OSX
This adds a new key definition for OSX, which is slightly different from the
classic mac definition.
Also add NEWS item for a couple of bugfixes I added recently.
........
r50834 | tim.peters | 2006-07-26 00:30:24 +0200 (Wed, 26 Jul 2006) | 2 lines
Whitespace normalization.
........
r50839 | neal.norwitz | 2006-07-26 06:00:18 +0200 (Wed, 26 Jul 2006) | 1 line
Hmm, only python2.x is installed, not plain python. Did that change recently?
........
r50840 | barry.warsaw | 2006-07-26 07:54:46 +0200 (Wed, 26 Jul 2006) | 6 lines
Forward port some fixes that were in email 2.5 but for some reason didn't make
it into email 4.0. Specifically, in Message.get_content_charset(), handle RFC
2231 headers that contain an encoding not known to Python, or a character in
the data that isn't in the charset encoding. Also forward port the
appropriate unit tests.
........
r50841 | georg.brandl | 2006-07-26 09:23:32 +0200 (Wed, 26 Jul 2006) | 3 lines
NEWS entry for #1525766.
........
r50842 | georg.brandl | 2006-07-26 09:40:17 +0200 (Wed, 26 Jul 2006) | 3 lines
Bug #1459963: properly capitalize HTTP header names.
........
r50843 | georg.brandl | 2006-07-26 10:03:10 +0200 (Wed, 26 Jul 2006) | 6 lines
Part of bug #1523610: fix miscalculation of buffer length.
Also add a guard against NULL in converttuple and add a test case
(that previously would have crashed).
........
r50844 | martin.v.loewis | 2006-07-26 14:12:56 +0200 (Wed, 26 Jul 2006) | 3 lines
Bug #978833: Really close underlying socket in _socketobject.close.
Fix httplib.HTTPConnection.getresponse to not close the
socket if it is still needed for the response.
........
r50845 | andrew.kuchling | 2006-07-26 19:16:52 +0200 (Wed, 26 Jul 2006) | 1 line
[Bug #1471938] Fix build problem on Solaris 8 by conditionalizing the use of mvwgetnstr(); it was conditionalized a few lines below. Fix from Paul Eggert. I also tried out the STRICT_SYSV_CURSES case and am therefore removing the 'untested' comment.
........
r50846 | andrew.kuchling | 2006-07-26 19:18:01 +0200 (Wed, 26 Jul 2006) | 1 line
Correct error message
........
r50847 | andrew.kuchling | 2006-07-26 19:19:39 +0200 (Wed, 26 Jul 2006) | 1 line
Minor grammar fix
........
r50848 | andrew.kuchling | 2006-07-26 19:22:21 +0200 (Wed, 26 Jul 2006) | 1 line
Put news item in right section
........
r50850 | andrew.kuchling | 2006-07-26 20:03:12 +0200 (Wed, 26 Jul 2006) | 1 line
Use sys.exc_info()
........
r50851 | andrew.kuchling | 2006-07-26 20:15:45 +0200 (Wed, 26 Jul 2006) | 1 line
Use sys.exc_info()
........
r50852 | phillip.eby | 2006-07-26 21:48:27 +0200 (Wed, 26 Jul 2006) | 4 lines
Allow the 'onerror' argument to walk_packages() to catch any Exception, not
just ImportError. This allows documentation tools to better skip unimportable
packages.
........
r50854 | tim.peters | 2006-07-27 01:23:15 +0200 (Thu, 27 Jul 2006) | 2 lines
Whitespace normalization.
........
r50855 | tim.peters | 2006-07-27 03:14:53 +0200 (Thu, 27 Jul 2006) | 21 lines
Bug #1521947: possible bug in mystrtol.c with recent gcc.
In general, C doesn't define anything about what happens when
an operation on a signed integral type overflows, and PyOS_strtol()
did several formally undefined things of that nature on signed
longs. Some version of gcc apparently tries to exploit that now,
and PyOS_strtol() could fail to detect overflow then.
Tried to repair all that, although it seems at least as likely to me
that we'll get screwed by bad platform definitions for LONG_MIN
and/or LONG_MAX now. For that reason, I don't recommend backporting
this.
Note that I have no box on which this makes a lick of difference --
can't really test it, except to note that it didn't break anything
on my boxes.
Silent change: PyOS_strtol() used to return the hard-coded 0x7fffffff
in case of overflow. Now it returns LONG_MAX. They're the same only on
32-bit boxes (although C doesn't guarantee that either ...).
........
r50856 | neal.norwitz | 2006-07-27 05:51:58 +0200 (Thu, 27 Jul 2006) | 6 lines
Don't kill a normal instance of python running on windows when checking
to kill a cygwin instance. build\\python.exe was matching a normal windows
instance. Prefix that with a \\ to ensure build is a directory and not
PCbuild. As discussed on python-dev.
........
r50857 | neal.norwitz | 2006-07-27 05:55:39 +0200 (Thu, 27 Jul 2006) | 5 lines
Closure can't be NULL at this point since we know it's a tuple.
Reported by Klocwork # 74.
........
r50858 | neal.norwitz | 2006-07-27 06:04:50 +0200 (Thu, 27 Jul 2006) | 1 line
No functional change. Add comment and assert to describe why there cannot be overflow which was reported by Klocwork. Discussed on python-dev
........
r50859 | martin.v.loewis | 2006-07-27 08:38:16 +0200 (Thu, 27 Jul 2006) | 3 lines
Bump distutils version to 2.5, as several new features
have been introduced since 2.4.
........
r50860 | andrew.kuchling | 2006-07-27 14:18:20 +0200 (Thu, 27 Jul 2006) | 1 line
Reformat docstring; fix typo
........
r50861 | georg.brandl | 2006-07-27 17:05:36 +0200 (Thu, 27 Jul 2006) | 6 lines
Add test_main() methods. These three tests were never run
by regrtest.py.
We really need a simpler testing framework.
........
r50862 | tim.peters | 2006-07-27 17:09:20 +0200 (Thu, 27 Jul 2006) | 2 lines
News for patch #1529686.
........
r50863 | tim.peters | 2006-07-27 17:11:00 +0200 (Thu, 27 Jul 2006) | 2 lines
Whitespace normalization.
........
r50864 | georg.brandl | 2006-07-27 17:38:33 +0200 (Thu, 27 Jul 2006) | 3 lines
Amend news entry.
........
r50865 | georg.brandl | 2006-07-27 18:08:15 +0200 (Thu, 27 Jul 2006) | 3 lines
Make uuid test suite pass on this box by requesting output with LC_ALL=C.
........
r50866 | andrew.kuchling | 2006-07-27 20:37:33 +0200 (Thu, 27 Jul 2006) | 1 line
Add example
........
r50867 | thomas.heller | 2006-07-27 20:39:55 +0200 (Thu, 27 Jul 2006) | 9 lines
Remove code that is no longer used (ctypes.com).
Fix the DllGetClassObject and DllCanUnloadNow so that they forward the
call to the comtypes.server.inprocserver module.
The latter was never documented, never used by published code, and
didn't work anyway, so I think it does not deserve a NEWS entry (but I
might be wrong).
........
r50868 | andrew.kuchling | 2006-07-27 20:41:21 +0200 (Thu, 27 Jul 2006) | 1 line
Typo fix ('publically' is rare, poss. non-standard)
........
r50869 | andrew.kuchling | 2006-07-27 20:42:41 +0200 (Thu, 27 Jul 2006) | 1 line
Add missing word
........
r50870 | andrew.kuchling | 2006-07-27 20:44:10 +0200 (Thu, 27 Jul 2006) | 1 line
Repair typos
........
r50872 | andrew.kuchling | 2006-07-27 20:53:33 +0200 (Thu, 27 Jul 2006) | 1 line
Update URL; add example
........
r50873 | andrew.kuchling | 2006-07-27 21:07:29 +0200 (Thu, 27 Jul 2006) | 1 line
Add punctuation mark; add some examples
........
r50874 | andrew.kuchling | 2006-07-27 21:11:07 +0200 (Thu, 27 Jul 2006) | 1 line
Mention base64 module; rewrite last sentence to be more positive
........
r50875 | andrew.kuchling | 2006-07-27 21:12:49 +0200 (Thu, 27 Jul 2006) | 1 line
If binhex is higher-level than binascii, it should come first in the chapter
........
r50876 | tim.peters | 2006-07-27 22:47:24 +0200 (Thu, 27 Jul 2006) | 28 lines
check_node(): stop spraying mystery output to stderr.
When a node number disagrees, keep track of all sources & the
node numbers they reported, and stick all that in the error message.
Changed all callers to supply a non-empty "source" argument; made
the "source" argument non-optional.
On my box, test_uuid still fails, but with the less confusing output:
AssertionError: different sources disagree on node:
from source 'getnode1', node was 00038a000015
from source 'getnode2', node was 00038a000015
from source 'ipconfig', node was 001111b2b7bf
Only the last one appears to be correct; e.g.,
C:\Code\python\PCbuild>getmac
Physical Address Transport Name
=================== ==========================================================
00-11-11-B2-B7-BF \Device\Tcpip_{190FB163-5AFD-4483-86A1-2FE16AC61FF1}
62-A1-AC-6C-FD-BE \Device\Tcpip_{8F77DF5A-EA3D-4F1D-975E-D472CEE6438A}
E2-1F-01-C6-5D-88 \Device\Tcpip_{CD18F76B-2EF3-409F-9B8A-6481EE70A1E4}
I can't find anything on my box with MAC 00-03-8a-00-00-15, and am
not clear on where that comes from.
........
r50878 | andrew.kuchling | 2006-07-28 00:40:05 +0200 (Fri, 28 Jul 2006) | 1 line
Reword paragraph
........
r50879 | andrew.kuchling | 2006-07-28 00:49:38 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50880 | andrew.kuchling | 2006-07-28 00:49:54 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50881 | barry.warsaw | 2006-07-28 01:43:15 +0200 (Fri, 28 Jul 2006) | 27 lines
Patch #1520294: Support for getset and member descriptors in types.py,
inspect.py, and pydoc.py. Specifically, this allows for querying the type of
an object against these built-in C types and more importantly, for getting
their docstrings printed in the interactive interpreter's help() function.
This patch includes a new built-in module called _types which provides
definitions of getset and member descriptors for use by the types.py module.
These types are exposed as types.GetSetDescriptorType and
types.MemberDescriptorType. Query functions are provided as
inspect.isgetsetdescriptor() and inspect.ismemberdescriptor(). The
implementations of these are robust enough to work with Python implementations
other than CPython, which may not have these fundamental types.
The patch also includes documentation and test suite updates.
I commit these changes now under these guiding principles:
1. Silence is assent. The release manager has not said "no", and of the few
people that cared enough to respond to the thread, the worst vote was "0".
2. It's easier to ask for forgiveness than permission.
3. It's so dang easy to revert stuff in svn, that you could view this as a
forcing function. :)
Windows build patches will follow.
........
r50882 | tim.peters | 2006-07-28 01:44:37 +0200 (Fri, 28 Jul 2006) | 4 lines
Bug #1529297: The rewrite of doctest for Python 2.4 unintentionally
lost that tests are sorted by name before being run. ``DocTestFinder``
has been changed to sort the list of tests it returns.
........
r50883 | tim.peters | 2006-07-28 01:45:48 +0200 (Fri, 28 Jul 2006) | 2 lines
Whitespace normalization.
........
r50884 | tim.peters | 2006-07-28 01:46:36 +0200 (Fri, 28 Jul 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r50885 | barry.warsaw | 2006-07-28 01:50:40 +0200 (Fri, 28 Jul 2006) | 4 lines
Enable the building of the _types module on Windows.
Note that this has only been tested for VS 2003 since that's all I have.
........
r50887 | tim.peters | 2006-07-28 02:23:15 +0200 (Fri, 28 Jul 2006) | 7 lines
defdict_reduce(): Plug leaks.
We didn't notice these before because test_defaultdict didn't
actually do anything before Georg fixed that earlier today.
Neal's next refleak run then showed test_defaultdict leaking
9 references on each run. That's repaired by this checkin.
........
r50888 | tim.peters | 2006-07-28 02:30:00 +0200 (Fri, 28 Jul 2006) | 2 lines
News about the repaired memory leak in defaultdict.
........
r50889 | gregory.p.smith | 2006-07-28 03:35:25 +0200 (Fri, 28 Jul 2006) | 7 lines
- pybsddb Bug #1527939: bsddb module DBEnv dbremove and dbrename
methods now allow their database parameter to be None as the
sleepycat API allows.
Also adds an appropriate test case for DBEnv.dbrename and dbremove.
........
r50895 | neal.norwitz | 2006-07-28 06:22:34 +0200 (Fri, 28 Jul 2006) | 1 line
Ensure the actual number matches the expected count
........
r50896 | tim.peters | 2006-07-28 06:51:59 +0200 (Fri, 28 Jul 2006) | 6 lines
Live with that "the hardware address" is an ill-defined
concept, and that different ways of trying to find "the
hardware address" may return different results. Certainly
true on both of my Windows boxes, and in different ways
(see whining on python-dev).
........
r50897 | neal.norwitz | 2006-07-28 09:21:27 +0200 (Fri, 28 Jul 2006) | 3 lines
Try to find the MAC addr on various flavours of Unix. This seems hopeless.
The reduces the test_uuid failures, but there's still another method failing.
........
r50898 | martin.v.loewis | 2006-07-28 09:45:49 +0200 (Fri, 28 Jul 2006) | 2 lines
Add UUID for upcoming 2.5b3.
........
r50899 | matt.fleming | 2006-07-28 13:27:27 +0200 (Fri, 28 Jul 2006) | 3 lines
Allow socketmodule to compile on NetBSD -current, whose bluetooth API
differs from both Linux and FreeBSD. Accepted by Neal Norwitz.
........
r50900 | andrew.kuchling | 2006-07-28 14:07:12 +0200 (Fri, 28 Jul 2006) | 1 line
[Patch #1529811] Correction to description of r|* mode
........
r50901 | andrew.kuchling | 2006-07-28 14:18:22 +0200 (Fri, 28 Jul 2006) | 1 line
Typo fix
........
r50902 | andrew.kuchling | 2006-07-28 14:32:43 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50903 | andrew.kuchling | 2006-07-28 14:33:19 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50904 | andrew.kuchling | 2006-07-28 14:45:55 +0200 (Fri, 28 Jul 2006) | 1 line
Don't overwrite built-in name; add some blank lines for readability
........
r50905 | andrew.kuchling | 2006-07-28 14:48:07 +0200 (Fri, 28 Jul 2006) | 1 line
Add example. Should I propagate this example to all the other DBM-ish modules, too?
........
r50912 | georg.brandl | 2006-07-28 20:31:39 +0200 (Fri, 28 Jul 2006) | 3 lines
Patch #1529686: also run test_email_codecs with regrtest.py.
........
r50913 | georg.brandl | 2006-07-28 20:36:01 +0200 (Fri, 28 Jul 2006) | 3 lines
Fix spelling.
........
r50915 | thomas.heller | 2006-07-28 21:42:40 +0200 (Fri, 28 Jul 2006) | 3 lines
Remove a useless XXX comment.
Cosmetic changes to the code so that the #ifdef _UNICODE block
doesn't mess emacs code formatting.
........
r50916 | phillip.eby | 2006-07-28 23:12:07 +0200 (Fri, 28 Jul 2006) | 5 lines
Bug #1529871: The speed enhancement patch #921466 broke Python's compliance
with PEP 302. This was fixed by adding an ``imp.NullImporter`` type that is
used in ``sys.path_importer_cache`` to cache non-directory paths and avoid
excessive filesystem operations during imports.
........
r50917 | phillip.eby | 2006-07-28 23:31:54 +0200 (Fri, 28 Jul 2006) | 2 lines
Fix svn merge spew.
........
r50918 | thomas.heller | 2006-07-28 23:43:20 +0200 (Fri, 28 Jul 2006) | 4 lines
Patch #1529514: More openbsd platforms for ctypes.
Regenerated Modules/_ctypes/libffi/configure with autoconf 2.59.
Approved by Neal.
........
r50922 | georg.brandl | 2006-07-29 10:51:21 +0200 (Sat, 29 Jul 2006) | 2 lines
Bug #835255: The "closure" argument to new.function() is now documented.
........
r50924 | georg.brandl | 2006-07-29 11:33:26 +0200 (Sat, 29 Jul 2006) | 3 lines
Bug #1441397: The compiler module now recognizes module and function
docstrings correctly as it did in Python 2.4.
........
r50925 | georg.brandl | 2006-07-29 12:25:46 +0200 (Sat, 29 Jul 2006) | 4 lines
Revert rev 42617, it was introduced to work around bug #1441397.
test_compiler now passes again.
........
r50926 | fred.drake | 2006-07-29 15:22:49 +0200 (Sat, 29 Jul 2006) | 1 line
update target version number
........
r50927 | andrew.kuchling | 2006-07-29 15:56:48 +0200 (Sat, 29 Jul 2006) | 1 line
Add example
........
r50928 | andrew.kuchling | 2006-07-29 16:04:47 +0200 (Sat, 29 Jul 2006) | 1 line
Update URL
........
r50930 | andrew.kuchling | 2006-07-29 16:08:15 +0200 (Sat, 29 Jul 2006) | 1 line
Reword paragraph to match the order of the subsequent sections
........
r50931 | andrew.kuchling | 2006-07-29 16:21:15 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1529157] Mention raw_input() and input(); while I'm at it, reword the description a bit
........
r50932 | andrew.kuchling | 2006-07-29 16:42:48 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1519571] Document some missing functions: setup(), title(), done()
........
r50933 | andrew.kuchling | 2006-07-29 16:43:55 +0200 (Sat, 29 Jul 2006) | 1 line
Fix docstring punctuation
........
r50934 | andrew.kuchling | 2006-07-29 17:10:32 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1414697] Change docstring of set/frozenset types to specify that the contents are unique. Raymond, please feel free to edit or revert.
........
r50935 | andrew.kuchling | 2006-07-29 17:35:21 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1530382] Document SSL.server(), .issuer() methods
........
r50936 | andrew.kuchling | 2006-07-29 17:42:46 +0200 (Sat, 29 Jul 2006) | 1 line
Typo fix
........
r50937 | andrew.kuchling | 2006-07-29 17:43:13 +0200 (Sat, 29 Jul 2006) | 1 line
Tweak wording
........
r50938 | matt.fleming | 2006-07-29 17:55:30 +0200 (Sat, 29 Jul 2006) | 2 lines
Fix typo
........
r50939 | andrew.kuchling | 2006-07-29 17:57:08 +0200 (Sat, 29 Jul 2006) | 6 lines
[Bug #1528258] Mention that the 'data' argument can be None.
The constructor docs referred the reader to the add_data() method's docs,
but they weren't very helpful. I've simply copied an earlier explanation
of 'data' that's more useful.
........
r50940 | andrew.kuchling | 2006-07-29 18:08:40 +0200 (Sat, 29 Jul 2006) | 1 line
Set bug/patch count. Take a bow, everyone!
........
r50941 | fred.drake | 2006-07-29 18:56:15 +0200 (Sat, 29 Jul 2006) | 18 lines
expunge the xmlcore changes:
41667, 41668 - initial switch to xmlcore
47044 - mention of xmlcore in What's New
50687 - mention of xmlcore in the library reference
re-apply xmlcore changes to xml:
41674 - line ending changes (re-applied manually), directory props
41677 - add cElementTree wrapper
41678 - PSF licensing for etree
41812 - whitespace normalization
42724 - fix svn:eol-style settings
43681, 43682 - remove Python version-compatibility cruft from minidom
46773 - fix encoding of \r\n\t in attr values in saxutils
47269 - added XMLParser alias for cElementTree compatibility
additional tests were added in Lib/test/test_sax.py that failed with
the xmlcore changes; these relate to SF bugs #1511497, #1513611
........
r50942 | andrew.kuchling | 2006-07-29 20:14:07 +0200 (Sat, 29 Jul 2006) | 17 lines
Reorganize the docs for 'file' and 'open()' after some discussion with Fred.
We want to encourage users to write open() when opening a file, but
open() was described with a single paragraph and
'file' had lots of explanation of the mode and bufsize arguments.
I've shrunk the description of 'file' to cross-reference to the 'File
objects' section, and to open() for an explanation of the arguments.
open() now has all the paragraphs about the mode string. The bufsize
argument was moved up so that it isn't buried at the end; now there's
1 paragraph on mode, 1 on bufsize, and then 3 more on mode. Various
other edits and rearrangements were made in the process.
It's probably best to read the final text and not to try to make sense
of the diffs.
........
r50943 | fred.drake | 2006-07-29 20:19:19 +0200 (Sat, 29 Jul 2006) | 1 line
restore test un-intentionally removed in the xmlcore purge (revision 50941)
........
r50944 | fred.drake | 2006-07-29 20:33:29 +0200 (Sat, 29 Jul 2006) | 3 lines
make the reference to older versions of the documentation a link
to the right page on python.org
........
r50945 | fred.drake | 2006-07-29 21:09:01 +0200 (Sat, 29 Jul 2006) | 1 line
document the footnote usage pattern
........
r50947 | fred.drake | 2006-07-29 21:14:10 +0200 (Sat, 29 Jul 2006) | 1 line
emphasize and oddball nuance of LaTeX comment syntax
........
r50948 | andrew.kuchling | 2006-07-29 21:24:04 +0200 (Sat, 29 Jul 2006) | 1 line
[Patch #1490989 from Skip Montanaro] Mention debugging builds in the API documentation. I've changed Skip's patch to point to Misc/SpecialBuilds and fiddled with the markup a bit.
........
r50949 | neal.norwitz | 2006-07-29 21:29:35 +0200 (Sat, 29 Jul 2006) | 6 lines
Disable these tests until they are reliable across platforms.
These problems may mask more important, real problems.
One or both methods are known to fail on: Solaris, OpenBSD, Debian, Ubuntu.
They pass on Windows and some Linux boxes.
........
r50950 | andrew.kuchling | 2006-07-29 21:50:37 +0200 (Sat, 29 Jul 2006) | 1 line
[Patch #1068277] Clarify that os.path.exists() can return False depending on permissions. Fred approved committing this patch in December 2004!
........
r50952 | fred.drake | 2006-07-29 22:04:42 +0200 (Sat, 29 Jul 2006) | 6 lines
SF bug #1193966: Weakref types documentation misplaced
The information about supporting weakrefs with types defined in C extensions
is moved to the Extending & Embedding manual. Py_TPFLAGS_HAVE_WEAKREFS is
no longer mentioned since it is part of Py_TPFLAGS_DEFAULT.
........
r50953 | skip.montanaro | 2006-07-29 22:06:05 +0200 (Sat, 29 Jul 2006) | 4 lines
Add a comment to the csv reader documentation that explains why the
treatment of newlines changed in 2.5. Pulled almost verbatim from a comment
by Andrew McNamara in <http://python.org/sf/1465014>.
........
r50954 | neal.norwitz | 2006-07-29 22:20:52 +0200 (Sat, 29 Jul 2006) | 3 lines
If the executable doesn't exist, there's no reason to try to start it.
This prevents garbage about command not found being printed on Solaris.
........
r50955 | fred.drake | 2006-07-29 22:21:25 +0200 (Sat, 29 Jul 2006) | 1 line
fix minor markup error that introduced extra punctuation
........
r50957 | neal.norwitz | 2006-07-29 22:37:08 +0200 (Sat, 29 Jul 2006) | 3 lines
Disable test_getnode too, since this is also unreliable.
........
r50958 | andrew.kuchling | 2006-07-29 23:27:12 +0200 (Sat, 29 Jul 2006) | 1 line
Follow TeX's conventions for hyphens
........
r50959 | andrew.kuchling | 2006-07-29 23:30:21 +0200 (Sat, 29 Jul 2006) | 1 line
Fix case for 'Unix'
........
r50960 | fred.drake | 2006-07-30 01:34:57 +0200 (Sun, 30 Jul 2006) | 1 line
markup cleanups
........
r50961 | andrew.kuchling | 2006-07-30 02:27:34 +0200 (Sun, 30 Jul 2006) | 1 line
Minor typo fixes
........
r50962 | andrew.kuchling | 2006-07-30 02:37:56 +0200 (Sun, 30 Jul 2006) | 1 line
[Bug #793553] Correct description of keyword arguments for SSL authentication
........
r50963 | tim.peters | 2006-07-30 02:58:15 +0200 (Sun, 30 Jul 2006) | 2 lines
Whitespace normalization.
........
r50964 | fred.drake | 2006-07-30 05:03:43 +0200 (Sun, 30 Jul 2006) | 1 line
lots of markup nits, most commonly Unix/unix --> \UNIX
........
r50965 | fred.drake | 2006-07-30 07:41:28 +0200 (Sun, 30 Jul 2006) | 1 line
update information on wxPython, from Robin Dunn
........
r50966 | fred.drake | 2006-07-30 07:49:49 +0200 (Sun, 30 Jul 2006) | 4 lines
remove possibly-outdated comment on what GUI toolkit is most commonly used;
it is hard to know whether this is right, and it does not add valuable reference information
at any rate
........
r50967 | fred.drake | 2006-07-30 07:55:39 +0200 (Sun, 30 Jul 2006) | 3 lines
- remove yet another reference to how commonly Tkinter is (thought to be) used
- fix an internal section reference
........
r50968 | neal.norwitz | 2006-07-30 08:53:31 +0200 (Sun, 30 Jul 2006) | 4 lines
Patch #1531113: Fix augmented assignment with yield expressions.
Also fix a SystemError when trying to assign to yield expressions.
........
r50969 | neal.norwitz | 2006-07-30 08:55:48 +0200 (Sun, 30 Jul 2006) | 5 lines
Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().
This provides the proper warning for struct.pack().
PyErr_Warn() is now deprecated in favor of PyErr_WarnEx().
As mentioned by Tim Peters on python-dev.
........
r50970 | neal.norwitz | 2006-07-30 08:57:04 +0200 (Sun, 30 Jul 2006) | 3 lines
Bug #1515471: string.replace() accepts character buffers again.
Pass the char* and size around rather than PyObject's.
........
r50971 | neal.norwitz | 2006-07-30 08:59:13 +0200 (Sun, 30 Jul 2006) | 1 line
Whitespace normalization
........
r50973 | georg.brandl | 2006-07-30 12:53:32 +0200 (Sun, 30 Jul 2006) | 3 lines
Clarify that __op__ methods must return NotImplemented if they don't support the operation.
........
r50974 | georg.brandl | 2006-07-30 13:07:23 +0200 (Sun, 30 Jul 2006) | 3 lines
Bug #1002398: The documentation for os.path.sameopenfile now correctly
refers to file descriptors, not file objects.
........
r50977 | martin.v.loewis | 2006-07-30 15:00:31 +0200 (Sun, 30 Jul 2006) | 3 lines
Don't copy directory stat times in shutil.copytree on Windows
Fixes #1525866.
........
r50978 | martin.v.loewis | 2006-07-30 15:14:05 +0200 (Sun, 30 Jul 2006) | 3 lines
Base __version__ on sys.version_info, as distutils is
no longer maintained separatedly.
........
r50979 | martin.v.loewis | 2006-07-30 15:27:31 +0200 (Sun, 30 Jul 2006) | 3 lines
Mention Cygwin in distutils error message about a missing VS 2003.
Fixes #1257728.
........
r50982 | martin.v.loewis | 2006-07-30 16:09:47 +0200 (Sun, 30 Jul 2006) | 5 lines
Drop usage of test -e in configure as it is not portable.
Fixes #1439538
Will backport to 2.4
Also regenerate pyconfig.h.in.
........
r50984 | georg.brandl | 2006-07-30 18:20:10 +0200 (Sun, 30 Jul 2006) | 3 lines
Fix makefile changes for python-config.
........
r50985 | george.yoshida | 2006-07-30 18:37:37 +0200 (Sun, 30 Jul 2006) | 2 lines
Rename struct.pack_to to struct.pack_into as changed in revision 46642.
........
r50986 | george.yoshida | 2006-07-30 18:41:30 +0200 (Sun, 30 Jul 2006) | 2 lines
Typo fix
........
r50987 | neal.norwitz | 2006-07-30 21:18:13 +0200 (Sun, 30 Jul 2006) | 1 line
Add some asserts and update comments
........
r50988 | neal.norwitz | 2006-07-30 21:18:38 +0200 (Sun, 30 Jul 2006) | 1 line
Verify that the signal handlers were really called
........
r50989 | neal.norwitz | 2006-07-30 21:20:42 +0200 (Sun, 30 Jul 2006) | 3 lines
Try to prevent hangs on Tru64/Alpha buildbot. I'm not certain this will help
and may need to be reverted if it causes problems.
........
r50990 | georg.brandl | 2006-07-30 22:18:51 +0200 (Sun, 30 Jul 2006) | 2 lines
Bug #1531349: right <-> left glitch in __rop__ description.
........
r50992 | tim.peters | 2006-07-31 03:46:03 +0200 (Mon, 31 Jul 2006) | 2 lines
Whitespace normalization.
........
r50993 | andrew.mcnamara | 2006-07-31 04:27:48 +0200 (Mon, 31 Jul 2006) | 2 lines
Redo the comment about the 2.5 change in quoted-newline handling.
........
r50994 | tim.peters | 2006-07-31 04:40:23 +0200 (Mon, 31 Jul 2006) | 10 lines
ZipFile.close(): Killed one of the struct.pack deprecation
warnings on Win32.
Also added an XXX about the line:
pos3 = self.fp.tell()
`pos3` is never referenced, and I have no idea what the code
intended to do instead.
........
r50996 | tim.peters | 2006-07-31 04:53:03 +0200 (Mon, 31 Jul 2006) | 8 lines
ZipFile.close(): Kill the other struct.pack deprecation
warning on Windows.
Afraid I can't detect a pattern to when the pack formats decide
to use a signed or unsigned format code -- appears nearly
arbitrary to my eyes. So I left all the pack formats alone and
changed the special-case data values instead.
........
r50997 | skip.montanaro | 2006-07-31 05:09:45 +0200 (Mon, 31 Jul 2006) | 1 line
minor tweaks
........
r50998 | skip.montanaro | 2006-07-31 05:11:11 +0200 (Mon, 31 Jul 2006) | 1 line
minor tweaks
........
r50999 | andrew.kuchling | 2006-07-31 14:20:24 +0200 (Mon, 31 Jul 2006) | 1 line
Add refcounts for PyErr_WarnEx
........
r51000 | andrew.kuchling | 2006-07-31 14:39:05 +0200 (Mon, 31 Jul 2006) | 9 lines
Document PyErr_WarnEx. (Bad Neal! No biscuit!)
Is the explanation of the 'stacklevel' parameter clear? Please feel free
to edit it.
I don't have LaTeX installed on this machine, so haven't verified that the
markup is correct. Will check tonight, or maybe the automatic doc build will
tell me.
........
r51001 | andrew.kuchling | 2006-07-31 14:52:26 +0200 (Mon, 31 Jul 2006) | 1 line
Add PyErr_WarnEx()
........
r51002 | andrew.kuchling | 2006-07-31 15:18:27 +0200 (Mon, 31 Jul 2006) | 1 line
Mention csv newline changes
........
r51003 | andrew.kuchling | 2006-07-31 17:22:58 +0200 (Mon, 31 Jul 2006) | 1 line
Typo fix
........
r51004 | andrew.kuchling | 2006-07-31 17:23:43 +0200 (Mon, 31 Jul 2006) | 1 line
Remove reference to notation
........
r51005 | georg.brandl | 2006-07-31 18:00:34 +0200 (Mon, 31 Jul 2006) | 3 lines
Fix function name.
........
r51006 | andrew.kuchling | 2006-07-31 18:10:24 +0200 (Mon, 31 Jul 2006) | 1 line
[Bug #1514540] Instead of putting the standard types in a section, put them in a chapter of their own. This means string methods will now show up in the ToC. (Should the types come before or after the functions+exceptions+constants chapter? I've put them after, for now.)
........
r51007 | andrew.kuchling | 2006-07-31 18:22:05 +0200 (Mon, 31 Jul 2006) | 1 line
[Bug #848556] Remove \d* from second alternative to avoid exponential case when repeating match
........
r51008 | andrew.kuchling | 2006-07-31 18:27:57 +0200 (Mon, 31 Jul 2006) | 1 line
Update list of files; fix a typo
........
r51013 | andrew.kuchling | 2006-08-01 18:24:30 +0200 (Tue, 01 Aug 2006) | 1 line
typo fix
........
r51018 | thomas.heller | 2006-08-01 18:54:43 +0200 (Tue, 01 Aug 2006) | 2 lines
Fix a potential segfault and various potentail refcount leaks
in the cast() function.
........
r51020 | thomas.heller | 2006-08-01 19:46:10 +0200 (Tue, 01 Aug 2006) | 1 line
Minimal useful docstring for CopyComPointer.
........
r51021 | andrew.kuchling | 2006-08-01 20:16:15 +0200 (Tue, 01 Aug 2006) | 8 lines
[Patch #1520905] Attempt to suppress core file created by test_subprocess.py.
Patch by Douglas Greiman.
The test_run_abort() testcase produces a core file on Unix systems,
even though the test is successful. This can be confusing or alarming
to someone who runs 'make test' and then finds that the Python
interpreter apparently crashed.
........
r51023 | georg.brandl | 2006-08-01 20:49:24 +0200 (Tue, 01 Aug 2006) | 3 lines
os.urandom no longer masks unrelated exceptions like SystemExit or
KeyboardInterrupt.
........
r51025 | thomas.heller | 2006-08-01 21:14:15 +0200 (Tue, 01 Aug 2006) | 2 lines
Speed up PyType_stgdict and PyObject_stgdict.
........
r51027 | ronald.oussoren | 2006-08-01 22:30:31 +0200 (Tue, 01 Aug 2006) | 3 lines
Make sure the postinstall action that optionally updates the user's profile
on MacOS X actually works correctly in all cases.
........
r51028 | ronald.oussoren | 2006-08-01 23:00:57 +0200 (Tue, 01 Aug 2006) | 4 lines
This fixes bug #1527397: PythonLauncher runs scripts with the wrong working
directory. It also fixes a bug where PythonLauncher failed to launch scripts
when the scriptname (or the path to the script) contains quotes.
........
r51031 | tim.peters | 2006-08-02 05:27:46 +0200 (Wed, 02 Aug 2006) | 2 lines
Whitespace normalization.
........
r51032 | tim.peters | 2006-08-02 06:12:36 +0200 (Wed, 02 Aug 2006) | 19 lines
Try to squash struct.pack warnings on the "amd64 gentoo trunk"
buildbot (& possibly other 64-bit boxes) during test_gzip.
The native zlib crc32 function returns an unsigned 32-bit integer,
which the Python wrapper implicitly casts to C long. Therefore the
same crc can "look negative" on a 32-bit box but "look positive" on
a 64-bit box. This patch papers over that platform difference when
writing the crc to file.
It may be better to change the Python wrapper, either to make
the result "look positive" on all platforms (which means it may
have to return a Python long at times on a 32-bit box), or to
keep the sign the same across boxes. But that would be a visible
change in what users see, while the current hack changes no
visible behavior (well, apart from stopping the struct deprecation
warning).
Note that the module-level write32() function is no longer used.
........
r51033 | neal.norwitz | 2006-08-02 06:27:11 +0200 (Wed, 02 Aug 2006) | 4 lines
Prevent memory leak on error.
Reported by Klocwork #36
........
r51034 | tim.peters | 2006-08-02 07:20:08 +0200 (Wed, 02 Aug 2006) | 9 lines
_Stream.close(): Try to kill struct.pack() warnings when
writing the crc to file on the "PPC64 Debian trunk" buildbot
when running test_tarfile.
This is again a case where the native zlib crc is an unsigned
32-bit int, but the Python wrapper implicitly casts it to
signed C long, so that "the sign bit looks different" on
different platforms.
........
r51035 | ronald.oussoren | 2006-08-02 08:10:10 +0200 (Wed, 02 Aug 2006) | 2 lines
Updated documentation for the script that builds the OSX installer.
........
r51036 | neal.norwitz | 2006-08-02 08:14:22 +0200 (Wed, 02 Aug 2006) | 2 lines
_PyWeakref_GetWeakrefCount() now returns a Py_ssize_t instead of long.
........
r51037 | neal.norwitz | 2006-08-02 08:15:10 +0200 (Wed, 02 Aug 2006) | 1 line
v is already checked for NULL, so just DECREF it
........
r51038 | neal.norwitz | 2006-08-02 08:19:19 +0200 (Wed, 02 Aug 2006) | 1 line
Let us know when there was a problem and the child had to kill the parent
........
r51039 | neal.norwitz | 2006-08-02 08:46:21 +0200 (Wed, 02 Aug 2006) | 5 lines
Patch #1519025 and bug #926423: If a KeyboardInterrupt occurs during
a socket operation on a socket with a timeout, the exception will be
caught correctly. Previously, the exception was not caught.
........
r51040 | neal.norwitz | 2006-08-02 09:09:32 +0200 (Wed, 02 Aug 2006) | 1 line
Add some explanation about Klocwork and Coverity static analysis
........
r51041 | anthony.baxter | 2006-08-02 09:43:09 +0200 (Wed, 02 Aug 2006) | 1 line
pre-release machinations
........
r51043 | thomas.heller | 2006-08-02 13:35:31 +0200 (Wed, 02 Aug 2006) | 4 lines
A few nore words about what ctypes does.
Document that using the wrong calling convention can also raise
'ValueError: Procedure called with the wrong number of arguments'.
........
r51045 | thomas.heller | 2006-08-02 14:00:13 +0200 (Wed, 02 Aug 2006) | 1 line
Fix a mistake.
........
r51046 | martin.v.loewis | 2006-08-02 15:53:55 +0200 (Wed, 02 Aug 2006) | 3 lines
Correction of patch #1455898: In the mbcs decoder, set final=False
for stream decoder, but final=True for the decode function.
........
r51049 | tim.peters | 2006-08-02 20:19:35 +0200 (Wed, 02 Aug 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r51079 | neal.norwitz | 2006-08-04 06:50:21 +0200 (Fri, 04 Aug 2006) | 3 lines
Bug #1531405, format_exception no longer raises an exception if
str(exception) raised an exception.
........
r51080 | neal.norwitz | 2006-08-04 06:58:47 +0200 (Fri, 04 Aug 2006) | 11 lines
Bug #1191458: tracing over for loops now produces a line event
on each iteration. I'm not positive this is the best way to handle
this. I'm also not sure that there aren't other cases where
the lnotab is generated incorrectly. It would be great if people
that use pdb or tracing could test heavily.
Also:
* Remove dead/duplicated code that wasn't used/necessary
because we already handled the docstring prior to entering the loop.
* add some debugging code into the compiler (#if 0'd out).
........
r51081 | neal.norwitz | 2006-08-04 07:09:28 +0200 (Fri, 04 Aug 2006) | 4 lines
Bug #1333982: string/number constants were inappropriately stored
in the byte code and co_consts even if they were not used, ie
immediately popped off the stack.
........
r51082 | neal.norwitz | 2006-08-04 07:12:19 +0200 (Fri, 04 Aug 2006) | 1 line
There were really two issues
........
r51084 | fred.drake | 2006-08-04 07:17:21 +0200 (Fri, 04 Aug 2006) | 1 line
SF patch #1534048 (bug #1531003): fix typo in error message
........
r51085 | gregory.p.smith | 2006-08-04 07:17:47 +0200 (Fri, 04 Aug 2006) | 3 lines
fix typos
........
r51087 | georg.brandl | 2006-08-04 08:03:53 +0200 (Fri, 04 Aug 2006) | 3 lines
Fix bug caused by first decrefing, then increfing.
........
r51109 | neil.schemenauer | 2006-08-04 18:20:30 +0200 (Fri, 04 Aug 2006) | 5 lines
Fix the 'compiler' package to generate correct code for MAKE_CLOSURE.
In the 2.5 development cycle, MAKE_CLOSURE as changed to take free
variables as a tuple rather than as individual items on the stack.
Closes patch #1534084.
........
r51110 | georg.brandl | 2006-08-04 20:03:37 +0200 (Fri, 04 Aug 2006) | 3 lines
Change fix for segfaulting property(), add a NEWS entry and a test.
........
r51111 | georg.brandl | 2006-08-04 20:07:34 +0200 (Fri, 04 Aug 2006) | 3 lines
Better fix for bug #1531405, not executing str(value) twice.
........
r51112 | thomas.heller | 2006-08-04 20:17:40 +0200 (Fri, 04 Aug 2006) | 1 line
On Windows, make PyErr_Warn an exported function again.
........
r51113 | thomas.heller | 2006-08-04 20:57:34 +0200 (Fri, 04 Aug 2006) | 4 lines
Fix #1530448 - fix ctypes build failure on solaris 10.
The '-mimpure-text' linker flag is required when linking _ctypes.so.
........
r51114 | thomas.heller | 2006-08-04 21:49:31 +0200 (Fri, 04 Aug 2006) | 3 lines
Fix #1534738: win32 debug version of _msi must be _msi_d.pyd, not _msi.pyd.
Fix the name of the pdb file as well.
........
r51115 | andrew.kuchling | 2006-08-04 22:37:43 +0200 (Fri, 04 Aug 2006) | 1 line
Typo fixes
........
r51116 | andrew.kuchling | 2006-08-04 23:10:03 +0200 (Fri, 04 Aug 2006) | 1 line
Fix mangled sentence
........
r51118 | tim.peters | 2006-08-05 00:00:35 +0200 (Sat, 05 Aug 2006) | 2 lines
Whitespace normalization.
........
r51119 | bob.ippolito | 2006-08-05 01:59:21 +0200 (Sat, 05 Aug 2006) | 5 lines
Fix #1530559, struct.pack raises TypeError where it used to convert.
Passing float arguments to struct.pack when integers are expected
now triggers a DeprecationWarning.
........
r51123 | georg.brandl | 2006-08-05 08:10:54 +0200 (Sat, 05 Aug 2006) | 3 lines
Patch #1534922: correct and enhance unittest docs.
........
r51126 | georg.brandl | 2006-08-06 09:06:33 +0200 (Sun, 06 Aug 2006) | 2 lines
Bug #1535182: really test the xreadlines() method of bz2 objects.
........
r51128 | georg.brandl | 2006-08-06 09:26:21 +0200 (Sun, 06 Aug 2006) | 4 lines
Bug #1535081: A leading underscore has been added to the names of
the md5 and sha modules, so add it in Modules/Setup.dist too.
........
r51129 | georg.brandl | 2006-08-06 10:23:54 +0200 (Sun, 06 Aug 2006) | 3 lines
Bug #1535165: fixed a segfault in input() and raw_input() when
sys.stdin is closed.
........
r51131 | georg.brandl | 2006-08-06 11:17:16 +0200 (Sun, 06 Aug 2006) | 2 lines
Don't produce output in test_builtin.
........
r51133 | andrew.macintyre | 2006-08-06 14:37:03 +0200 (Sun, 06 Aug 2006) | 4 lines
test_threading now skips testing alternate thread stack sizes on
platforms that don't support changing thread stack size.
........
r51134 | andrew.kuchling | 2006-08-07 00:07:04 +0200 (Mon, 07 Aug 2006) | 2 lines
[Patch #1464056] Ensure that we use the panelw library when linking with ncursesw.
Once I see how the buildbots react, I'll backport this to 2.4.
........
r51137 | georg.brandl | 2006-08-08 13:52:34 +0200 (Tue, 08 Aug 2006) | 3 lines
webbrowser: Silence stderr output if no gconftool or gnome browser found
........
r51138 | georg.brandl | 2006-08-08 13:56:21 +0200 (Tue, 08 Aug 2006) | 7 lines
Remove "non-mapping" and "non-sequence" from TypeErrors raised by
PyMapping_Size and PySequence_Size.
Because len() tries first sequence, then mapping size, it will always
raise a "non-mapping object has no len" error which is confusing.
........
r51139 | thomas.heller | 2006-08-08 19:37:00 +0200 (Tue, 08 Aug 2006) | 3 lines
memcmp() can return values other than -1, 0, and +1 but tp_compare
must not.
........
r51140 | thomas.heller | 2006-08-08 19:39:20 +0200 (Tue, 08 Aug 2006) | 1 line
Remove accidently committed, duplicated test.
........
r51147 | andrew.kuchling | 2006-08-08 20:50:14 +0200 (Tue, 08 Aug 2006) | 1 line
Reword paragraph to clarify
........
r51148 | andrew.kuchling | 2006-08-08 20:56:08 +0200 (Tue, 08 Aug 2006) | 1 line
Move obmalloc item into C API section
........
r51149 | andrew.kuchling | 2006-08-08 21:00:14 +0200 (Tue, 08 Aug 2006) | 1 line
'Other changes' section now has only one item; move the item elsewhere and remove the section
........
r51150 | andrew.kuchling | 2006-08-08 21:00:34 +0200 (Tue, 08 Aug 2006) | 1 line
Bump version number
........
r51151 | georg.brandl | 2006-08-08 22:11:22 +0200 (Tue, 08 Aug 2006) | 2 lines
Bug #1536828: typo: TypeType should have been StringType.
........
r51153 | georg.brandl | 2006-08-08 22:13:13 +0200 (Tue, 08 Aug 2006) | 2 lines
Bug #1536660: separate two words.
........
r51155 | georg.brandl | 2006-08-08 22:48:10 +0200 (Tue, 08 Aug 2006) | 3 lines
``str`` is now the same object as ``types.StringType``.
........
r51156 | tim.peters | 2006-08-09 02:52:26 +0200 (Wed, 09 Aug 2006) | 2 lines
Whitespace normalization.
........
r51158 | georg.brandl | 2006-08-09 09:03:22 +0200 (Wed, 09 Aug 2006) | 4 lines
Introduce an upper bound on tuple nesting depth in
C argument format strings; fixes rest of #1523610.
........
r51160 | martin.v.loewis | 2006-08-09 09:57:39 +0200 (Wed, 09 Aug 2006) | 4 lines
__hash__ may now return long int; the final hash
value is obtained by invoking hash on the long int.
Fixes #1536021.
........
r51168 | andrew.kuchling | 2006-08-09 15:03:41 +0200 (Wed, 09 Aug 2006) | 1 line
[Bug #1536021] Mention __hash__ change
........
r51169 | andrew.kuchling | 2006-08-09 15:57:05 +0200 (Wed, 09 Aug 2006) | 1 line
[Patch #1534027] Add notes on locale module changes
........
r51170 | andrew.kuchling | 2006-08-09 16:05:35 +0200 (Wed, 09 Aug 2006) | 1 line
Add missing 'self' parameters
........
r51171 | andrew.kuchling | 2006-08-09 16:06:19 +0200 (Wed, 09 Aug 2006) | 1 line
Reindent code
........
r51172 | armin.rigo | 2006-08-09 16:55:26 +0200 (Wed, 09 Aug 2006) | 2 lines
Fix and test for an infinite C recursion.
........
r51173 | ronald.oussoren | 2006-08-09 16:56:33 +0200 (Wed, 09 Aug 2006) | 2 lines
It's unlikely that future versions will require _POSIX_C_SOURCE
........
r51178 | armin.rigo | 2006-08-09 17:37:26 +0200 (Wed, 09 Aug 2006) | 2 lines
Concatenation on a long string breaks (SF #1526585).
........
r51180 | kurt.kaiser | 2006-08-09 18:46:15 +0200 (Wed, 09 Aug 2006) | 8 lines
1. When used w/o subprocess, all exceptions were preceeded by an error
message claiming they were IDLE internal errors (since 1.2a1).
2. Add Ronald Oussoren to CREDITS
M NEWS.txt
M PyShell.py
M CREDITS.txt
........
r51181 | kurt.kaiser | 2006-08-09 19:47:15 +0200 (Wed, 09 Aug 2006) | 4 lines
As a slight enhancement to the previous checkin, improve the
internal error reporting by moving message to IDLE console.
........
r51182 | andrew.kuchling | 2006-08-09 20:23:14 +0200 (Wed, 09 Aug 2006) | 1 line
Typo fix
........
r51183 | kurt.kaiser | 2006-08-09 22:34:46 +0200 (Wed, 09 Aug 2006) | 2 lines
ToggleTab dialog was setting indent to 8 even if cancelled (since 1.2a1).
........
r51184 | martin.v.loewis | 2006-08-10 01:42:18 +0200 (Thu, 10 Aug 2006) | 2 lines
Add some commentary on -mimpure-text.
........
r51185 | tim.peters | 2006-08-10 02:58:49 +0200 (Thu, 10 Aug 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r51186 | kurt.kaiser | 2006-08-10 03:41:17 +0200 (Thu, 10 Aug 2006) | 2 lines
Changing tokenize (39046) to detect dedent broke tabnanny check (since 1.2a1)
........
r51187 | tim.peters | 2006-08-10 05:01:26 +0200 (Thu, 10 Aug 2006) | 13 lines
test_copytree_simple(): This was leaving behind two new temp
directories each time it ran, at least on Windows.
Several changes: explicitly closed all files; wrapped long
lines; stopped suppressing errors when removing a file or
directory fails (removing /shouldn't/ fail!); and changed
what appeared to be incorrect usage of os.removedirs() (that
doesn't remove empty directories at and /under/ the given
path, instead it must be given an empty leaf directory and
then deletes empty directories moving /up/ the path -- could
be that the conceptually simpler shutil.rmtree() was really
actually intended here).
........
2006-08-11 14:57:12 +00:00
|
|
|
#ifdef HAVE_SIGNAL_H
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <signal.h>
|
Merged revisions 46753-51188 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r46755 | brett.cannon | 2006-06-08 18:23:04 +0200 (Thu, 08 Jun 2006) | 4 lines
Make binascii.hexlify() use s# for its arguments instead of t# to actually
match its documentation stating it accepts any read-only buffer.
........
r46757 | brett.cannon | 2006-06-08 19:00:45 +0200 (Thu, 08 Jun 2006) | 8 lines
Buffer objects would return the read or write buffer for a wrapped object when
the char buffer was requested. Now it actually returns the char buffer if
available or raises a TypeError if it isn't (as is raised for the other buffer
types if they are not present but requested).
Not a backport candidate since it does change semantics of the buffer object
(although it could be argued this is enough of a bug to bother backporting).
........
r46760 | andrew.kuchling | 2006-06-09 03:10:17 +0200 (Fri, 09 Jun 2006) | 1 line
Update functools section
........
r46762 | tim.peters | 2006-06-09 04:11:02 +0200 (Fri, 09 Jun 2006) | 6 lines
Whitespace normalization.
Since test_file is implicated in mysterious test failures
when followed by test_optparse, if I had any brains I'd
look at the checkin that last changed test_file ;-)
........
r46763 | tim.peters | 2006-06-09 05:09:42 +0200 (Fri, 09 Jun 2006) | 5 lines
To boost morale :-), force test_optparse to run immediately
after test_file until we can figure out how to fix it.
(See python-dev; at the moment we don't even know which checkin
caused the problem.)
........
r46764 | tim.peters | 2006-06-09 05:51:41 +0200 (Fri, 09 Jun 2006) | 6 lines
AutoFileTests.tearDown(): Removed mysterious undocumented
try/except. Remove TESTFN.
Throughout: used open() instead of file(), and wrapped
long lines.
........
r46765 | tim.peters | 2006-06-09 06:02:06 +0200 (Fri, 09 Jun 2006) | 8 lines
testUnicodeOpen(): I have no idea why, but making this
test clean up after itself appears to fix the test failures
when test_optparse follows test_file.
test_main(): Get rid of TESTFN no matter what. That's
also enough to fix the mystery failures. Doesn't hurt
to fix them twice :-)
........
r46766 | tim.peters | 2006-06-09 07:12:40 +0200 (Fri, 09 Jun 2006) | 6 lines
Remove the temporary hack to force test_optparse to
run immediately after test_file. At least 8 buildbot
boxes passed since the underlying problem got fixed,
and they all failed before the fix, so there's no point
to this anymore.
........
r46767 | neal.norwitz | 2006-06-09 07:54:18 +0200 (Fri, 09 Jun 2006) | 1 line
Fix grammar and reflow
........
r46769 | andrew.kuchling | 2006-06-09 12:22:35 +0200 (Fri, 09 Jun 2006) | 1 line
Markup fix
........
r46773 | andrew.kuchling | 2006-06-09 15:15:57 +0200 (Fri, 09 Jun 2006) | 1 line
[Bug #1472827] Make saxutils.XMLGenerator handle \r\n\t in attribute values by escaping them properly. 2.4 bugfix candidate.
........
r46778 | kristjan.jonsson | 2006-06-09 18:28:01 +0200 (Fri, 09 Jun 2006) | 2 lines
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.
........
r46779 | phillip.eby | 2006-06-09 18:40:18 +0200 (Fri, 09 Jun 2006) | 2 lines
Import wsgiref into the stdlib, as of the external version 0.1-r2181.
........
r46783 | andrew.kuchling | 2006-06-09 18:44:40 +0200 (Fri, 09 Jun 2006) | 1 line
Add note about XMLGenerator bugfix
........
r46784 | andrew.kuchling | 2006-06-09 18:46:51 +0200 (Fri, 09 Jun 2006) | 1 line
Add note about wsgiref
........
r46785 | brett.cannon | 2006-06-09 19:05:48 +0200 (Fri, 09 Jun 2006) | 2 lines
Fix inconsistency in naming within an enum.
........
r46787 | tim.peters | 2006-06-09 19:47:00 +0200 (Fri, 09 Jun 2006) | 2 lines
Whitespace normalization.
........
r46792 | georg.brandl | 2006-06-09 20:29:52 +0200 (Fri, 09 Jun 2006) | 3 lines
Test file.__exit__.
........
r46794 | brett.cannon | 2006-06-09 20:40:46 +0200 (Fri, 09 Jun 2006) | 2 lines
svn:ignore .pyc and .pyo files.
........
r46795 | georg.brandl | 2006-06-09 20:45:48 +0200 (Fri, 09 Jun 2006) | 3 lines
RFE #1491485: str/unicode.endswith()/startswith() now accept a tuple as first argument.
........
r46798 | andrew.kuchling | 2006-06-09 21:03:16 +0200 (Fri, 09 Jun 2006) | 1 line
Describe startswith()/endswiith() change; add reminder about wsgiref
........
r46799 | tim.peters | 2006-06-09 21:24:44 +0200 (Fri, 09 Jun 2006) | 11 lines
Implementing a happy idea from Georg Brandl: make runtest() try to
clean up files and directories the tests often leave behind by
mistake. This is the first time in history I don't have a bogus
"db_home" directory after running the tests ;-)
Also worked on runtest's docstring, to say something about all the
arguments, and to document the non-obvious return values.
New functions runtest_inner() and cleanup_test_droppings() in
support of the above.
........
r46800 | andrew.kuchling | 2006-06-09 21:43:25 +0200 (Fri, 09 Jun 2006) | 1 line
Remove unused variable
........
r46801 | andrew.kuchling | 2006-06-09 21:56:05 +0200 (Fri, 09 Jun 2006) | 1 line
Add some wsgiref text
........
r46803 | thomas.heller | 2006-06-09 21:59:11 +0200 (Fri, 09 Jun 2006) | 1 line
set eol-style svn property
........
r46804 | thomas.heller | 2006-06-09 22:01:01 +0200 (Fri, 09 Jun 2006) | 1 line
set eol-style svn property
........
r46805 | georg.brandl | 2006-06-09 22:43:48 +0200 (Fri, 09 Jun 2006) | 3 lines
Make use of new str.startswith/endswith semantics.
Occurences in email and compiler were ignored due to backwards compat requirements.
........
r46806 | brett.cannon | 2006-06-10 00:31:23 +0200 (Sat, 10 Jun 2006) | 4 lines
An object with __call__ as an attribute, when called, will have that attribute checked for __call__ itself, and will continue to look until it finds an object without the attribute. This can lead to an infinite recursion.
Closes bug #532646, again. Will be backported.
........
r46808 | brett.cannon | 2006-06-10 00:45:54 +0200 (Sat, 10 Jun 2006) | 2 lines
Fix bug introduced in rev. 46806 by not having variable declaration at the top of a block.
........
r46812 | georg.brandl | 2006-06-10 08:40:50 +0200 (Sat, 10 Jun 2006) | 4 lines
Apply perky's fix for #1503157: "/".join([u"", u""]) raising OverflowError.
Also improve error message on overflow.
........
r46817 | martin.v.loewis | 2006-06-10 10:14:03 +0200 (Sat, 10 Jun 2006) | 2 lines
Port cygwin kill_python changes from 2.4 branch.
........
r46818 | armin.rigo | 2006-06-10 12:57:40 +0200 (Sat, 10 Jun 2006) | 4 lines
SF bug #1503294.
PyThreadState_GET() complains if the tstate is NULL, but only in debug mode.
........
r46819 | martin.v.loewis | 2006-06-10 14:23:46 +0200 (Sat, 10 Jun 2006) | 4 lines
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
........
r46820 | skip.montanaro | 2006-06-10 16:09:11 +0200 (Sat, 10 Jun 2006) | 1 line
document the class, not its initializer
........
r46821 | greg.ward | 2006-06-10 18:40:01 +0200 (Sat, 10 Jun 2006) | 4 lines
Sync with Optik docs (rev 518):
* restore "Extending optparse" section
* document ALWAYS_TYPED_ACTIONS (SF #1449311)
........
r46824 | thomas.heller | 2006-06-10 21:51:46 +0200 (Sat, 10 Jun 2006) | 8 lines
Upgrade to ctypes version 0.9.9.7.
Summary of changes:
- support for 'variable sized' data
- support for anonymous structure/union fields
- fix severe bug with certain arrays or structures containing more than 256 fields
........
r46825 | thomas.heller | 2006-06-10 21:55:36 +0200 (Sat, 10 Jun 2006) | 8 lines
Upgrade to ctypes version 0.9.9.7.
Summary of changes:
- support for 'variable sized' data
- support for anonymous structure/union fields
- fix severe bug with certain arrays or structures containing more than 256 fields
........
r46826 | fred.drake | 2006-06-10 22:01:34 +0200 (Sat, 10 Jun 2006) | 4 lines
SF patch #1303595: improve description of __builtins__, explaining how it
varies between __main__ and other modules, and strongly suggest not touching
it but using __builtin__ if absolutely necessary
........
r46827 | fred.drake | 2006-06-10 22:02:58 +0200 (Sat, 10 Jun 2006) | 1 line
credit for SF patch #1303595
........
r46831 | thomas.heller | 2006-06-10 22:29:34 +0200 (Sat, 10 Jun 2006) | 2 lines
New docs for ctypes.
........
r46834 | thomas.heller | 2006-06-10 23:07:19 +0200 (Sat, 10 Jun 2006) | 1 line
Fix a wrong printf format.
........
r46835 | thomas.heller | 2006-06-10 23:17:58 +0200 (Sat, 10 Jun 2006) | 1 line
Fix the second occurrence of the problematic printf format.
........
r46837 | thomas.heller | 2006-06-10 23:56:03 +0200 (Sat, 10 Jun 2006) | 1 line
Don't use C++ comment.
........
r46838 | thomas.heller | 2006-06-11 00:01:50 +0200 (Sun, 11 Jun 2006) | 1 line
Handle failure of PyMem_Realloc.
........
r46839 | skip.montanaro | 2006-06-11 00:38:13 +0200 (Sun, 11 Jun 2006) | 2 lines
Suppress warning on MacOSX about possible use before set of proc.
........
r46840 | tim.peters | 2006-06-11 00:51:45 +0200 (Sun, 11 Jun 2006) | 8 lines
shuffle() doscstring: Removed warning about sequence length
versus generator period. While this was a real weakness of the
older WH generator for lists with just a few dozen elements,
and so could potentially bite the naive ;-), the Twister should
show excellent behavior up to at least 600 elements.
Module docstring: reflowed some jarringly short lines.
........
r46844 | greg.ward | 2006-06-11 02:40:49 +0200 (Sun, 11 Jun 2006) | 4 lines
Bug #1361643: fix textwrap.dedent() so it handles tabs appropriately,
i.e. do *not* expand tabs, but treat them as whitespace that is not
equivalent to spaces. Add a couple of test cases. Clarify docs.
........
r46850 | neal.norwitz | 2006-06-11 07:44:18 +0200 (Sun, 11 Jun 2006) | 5 lines
Fix Coverity # 146. newDBSequenceObject would deref dbobj, so it can't be NULL.
We know it's not NULL from the ParseTuple and DbObject_Check will verify
it's not NULL.
........
r46851 | neal.norwitz | 2006-06-11 07:45:25 +0200 (Sun, 11 Jun 2006) | 4 lines
Wrap some long lines
Top/Bottom factor out some common expressions
Add a XXX comment about widing offset.
........
r46852 | neal.norwitz | 2006-06-11 07:45:47 +0200 (Sun, 11 Jun 2006) | 1 line
Add versionadded to doc
........
r46853 | neal.norwitz | 2006-06-11 07:47:14 +0200 (Sun, 11 Jun 2006) | 3 lines
Update doc to make it agree with code.
Bottom factor out some common code.
........
r46854 | neal.norwitz | 2006-06-11 07:48:14 +0200 (Sun, 11 Jun 2006) | 3 lines
f_code can't be NULL based on Frame_New and other code that derefs it.
So there doesn't seem to be much point to checking here.
........
r46855 | neal.norwitz | 2006-06-11 09:26:27 +0200 (Sun, 11 Jun 2006) | 1 line
Fix errors found by pychecker
........
r46856 | neal.norwitz | 2006-06-11 09:26:50 +0200 (Sun, 11 Jun 2006) | 1 line
warnings was imported at module scope, no need to import again
........
r46857 | neal.norwitz | 2006-06-11 09:27:56 +0200 (Sun, 11 Jun 2006) | 5 lines
Fix errors found by pychecker.
I think these changes are correct, but I'm not sure. Could someone
who knows how this module works test it? It can at least start on
the cmd line.
........
r46858 | neal.norwitz | 2006-06-11 10:35:14 +0200 (Sun, 11 Jun 2006) | 1 line
Fix errors found by pychecker
........
r46859 | ronald.oussoren | 2006-06-11 16:33:36 +0200 (Sun, 11 Jun 2006) | 4 lines
This patch improves the L&F of IDLE on OSX. The changes are conditionalized on
being in an IDLE.app bundle on darwin. This does a slight reorganisation of the
menus and adds support for file-open events.
........
r46860 | greg.ward | 2006-06-11 16:42:41 +0200 (Sun, 11 Jun 2006) | 1 line
SF #1366250: optparse docs: fix inconsistency in variable name; minor tweaks.
........
r46861 | greg.ward | 2006-06-11 18:24:11 +0200 (Sun, 11 Jun 2006) | 3 lines
Bug #1498146: fix optparse to handle Unicode strings in option help,
description, and epilog.
........
r46862 | thomas.heller | 2006-06-11 19:04:22 +0200 (Sun, 11 Jun 2006) | 2 lines
Release the GIL during COM method calls, to avoid deadlocks in
Python coded COM objects.
........
r46863 | tim.peters | 2006-06-11 21:42:51 +0200 (Sun, 11 Jun 2006) | 2 lines
Whitespace normalization.
........
r46864 | tim.peters | 2006-06-11 21:43:49 +0200 (Sun, 11 Jun 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46865 | ronald.oussoren | 2006-06-11 21:45:57 +0200 (Sun, 11 Jun 2006) | 2 lines
Remove message about using make frameworkinstall, that's no longer necesssary
........
r46866 | ronald.oussoren | 2006-06-11 22:23:29 +0200 (Sun, 11 Jun 2006) | 2 lines
Use configure to substitute the correct prefix instead of hardcoding
........
r46867 | ronald.oussoren | 2006-06-11 22:24:45 +0200 (Sun, 11 Jun 2006) | 4 lines
- Change fixapplepython23.py to ensure that it will run with /usr/bin/python
on intel macs.
- Fix some minor problems in the installer for OSX
........
r46868 | neal.norwitz | 2006-06-11 22:25:56 +0200 (Sun, 11 Jun 2006) | 5 lines
Try to fix several networking tests. The problem is that if hosts have
a search path setup, some of these hosts resolve to the wrong address.
By appending a period to the hostname, the hostname should only resolve
to what we want it to resolve to. Hopefully this doesn't break different bots.
........
r46869 | neal.norwitz | 2006-06-11 22:42:02 +0200 (Sun, 11 Jun 2006) | 7 lines
Try to fix another networking test. The problem is that if hosts have
a search path setup, some of these hosts resolve to the wrong address.
By appending a period to the hostname, the hostname should only resolve
to what we want it to resolve to. Hopefully this doesn't break different bots.
Also add more info to failure message to aid debugging test failure.
........
r46870 | neal.norwitz | 2006-06-11 22:46:46 +0200 (Sun, 11 Jun 2006) | 4 lines
Fix test on PPC64 buildbot. It raised an IOError (really an URLError which
derives from an IOError). That seems valid. Env Error includes both OSError
and IOError, so this seems like a reasonable fix.
........
r46871 | tim.peters | 2006-06-11 22:52:59 +0200 (Sun, 11 Jun 2006) | 10 lines
compare_generic_iter(): Fixed the failure of test_wsgiref's testFileWrapper
when running with -O.
test_simple_validation_error still fails under -O. That appears to be because
wsgiref's validate.py uses `assert` statements all over the place to check
arguments for sanity. That should all be changed (it's not a logical error
in the software if a user passes bogus arguments, so this isn't a reasonable
use for `assert` -- checking external preconditions should generally raise
ValueError or TypeError instead, as appropriate).
........
r46872 | neal.norwitz | 2006-06-11 23:38:38 +0200 (Sun, 11 Jun 2006) | 1 line
Get test to pass on S/390. Shout if you think this change is incorrect.
........
r46873 | neal.norwitz | 2006-06-12 04:05:55 +0200 (Mon, 12 Jun 2006) | 1 line
Cleanup Py_ssize_t a little (get rid of second #ifdef)
........
r46874 | neal.norwitz | 2006-06-12 04:06:17 +0200 (Mon, 12 Jun 2006) | 1 line
Fix some Py_ssize_t issues
........
r46875 | neal.norwitz | 2006-06-12 04:06:42 +0200 (Mon, 12 Jun 2006) | 1 line
Fix some Py_ssize_t issues
........
r46876 | neal.norwitz | 2006-06-12 04:07:24 +0200 (Mon, 12 Jun 2006) | 2 lines
Cleanup: Remove import of types to get StringTypes, we can just use basestring.
........
r46877 | neal.norwitz | 2006-06-12 04:07:57 +0200 (Mon, 12 Jun 2006) | 1 line
Don't truncate if size_t is bigger than uint
........
r46878 | neal.norwitz | 2006-06-12 04:08:41 +0200 (Mon, 12 Jun 2006) | 1 line
Don't leak the list object if there's an error allocating the item storage. Backport candidate
........
r46879 | neal.norwitz | 2006-06-12 04:09:03 +0200 (Mon, 12 Jun 2006) | 1 line
Fix typo. Backport if anyone cares. :-)
........
r46880 | neal.norwitz | 2006-06-12 04:09:34 +0200 (Mon, 12 Jun 2006) | 1 line
Fix indentation of case and a Py_ssize_t issue.
........
r46881 | neal.norwitz | 2006-06-12 04:11:18 +0200 (Mon, 12 Jun 2006) | 3 lines
Get rid of f_restricted too. Doc the other 4 ints that were already removed
at the NeedForSpeed sprint.
........
r46882 | neal.norwitz | 2006-06-12 04:13:21 +0200 (Mon, 12 Jun 2006) | 1 line
Fix the socket tests so they can be run concurrently. Backport candidate
........
r46883 | neal.norwitz | 2006-06-12 04:16:10 +0200 (Mon, 12 Jun 2006) | 1 line
i and j are initialized below when used. No need to do it twice
........
r46884 | neal.norwitz | 2006-06-12 05:05:03 +0200 (Mon, 12 Jun 2006) | 1 line
Remove unused import
........
r46885 | neal.norwitz | 2006-06-12 05:05:40 +0200 (Mon, 12 Jun 2006) | 1 line
Impl ssize_t
........
r46886 | neal.norwitz | 2006-06-12 05:33:09 +0200 (Mon, 12 Jun 2006) | 6 lines
Patch #1503046, Conditional compilation of zlib.(de)compressobj.copy
copy is only in newer versions of zlib. This should allow zlibmodule
to work with older versions like the Tru64 buildbot.
........
r46887 | phillip.eby | 2006-06-12 06:04:32 +0200 (Mon, 12 Jun 2006) | 2 lines
Sync w/external release 0.1.2. Please see PEP 360 before making changes to external packages.
........
r46888 | martin.v.loewis | 2006-06-12 06:26:31 +0200 (Mon, 12 Jun 2006) | 2 lines
Get rid of function pointer cast.
........
r46889 | thomas.heller | 2006-06-12 08:05:57 +0200 (Mon, 12 Jun 2006) | 3 lines
I don't know how that happend, but the entire file contents was
duplicated. Thanks to Simon Percivall for the heads up.
........
r46890 | nick.coghlan | 2006-06-12 10:19:37 +0200 (Mon, 12 Jun 2006) | 1 line
Fix site module docstring to match the code
........
r46891 | nick.coghlan | 2006-06-12 10:23:02 +0200 (Mon, 12 Jun 2006) | 1 line
Fix site module docstring to match the code for Mac OSX, too
........
r46892 | nick.coghlan | 2006-06-12 10:27:13 +0200 (Mon, 12 Jun 2006) | 1 line
The site module documentation also described the Windows behaviour incorrectly.
........
r46893 | nick.coghlan | 2006-06-12 12:17:11 +0200 (Mon, 12 Jun 2006) | 1 line
Make the -m switch conform to the documentation of sys.path by behaving like the -c switch
........
r46894 | kristjan.jonsson | 2006-06-12 17:45:12 +0200 (Mon, 12 Jun 2006) | 2 lines
Fix the CRT argument error handling for VisualStudio .NET 2005. Install a CRT error handler and disable the assertion for debug builds. This causes CRT to set errno to EINVAL.
This update fixes crash cases in the test suite where the default CRT error handler would cause process exit.
........
r46899 | thomas.heller | 2006-06-12 22:56:48 +0200 (Mon, 12 Jun 2006) | 1 line
Add pep-291 compatibility markers.
........
r46901 | ka-ping.yee | 2006-06-13 01:47:52 +0200 (Tue, 13 Jun 2006) | 5 lines
Add the uuid module.
This module has been tested so far on Windows XP (Python 2.4 and 2.5a2),
Mac OS X (Python 2.3, 2.4, and 2.5a2), and Linux (Python 2.4 and 2.5a2).
........
r46902 | tim.peters | 2006-06-13 02:30:01 +0200 (Tue, 13 Jun 2006) | 2 lines
Whitespace normalization.
........
r46903 | tim.peters | 2006-06-13 02:30:50 +0200 (Tue, 13 Jun 2006) | 2 lines
Added missing svn:eol-style property to text files.
........
r46905 | tim.peters | 2006-06-13 05:30:07 +0200 (Tue, 13 Jun 2006) | 5 lines
get_matching_blocks(): rewrote code & comments so they match; added
more comments about why it's this way at all; and removed what looked
like needless expense (sorting (i, j, k) triples directly should give
exactly the same order as sorting (i, (i, j, k)) pairs).
........
r46906 | neal.norwitz | 2006-06-13 06:08:53 +0200 (Tue, 13 Jun 2006) | 1 line
Don't fail if another process is listening on our port.
........
r46908 | neal.norwitz | 2006-06-13 10:28:19 +0200 (Tue, 13 Jun 2006) | 2 lines
Initialize the type object so pychecker can't crash the interpreter.
........
r46909 | neal.norwitz | 2006-06-13 10:41:06 +0200 (Tue, 13 Jun 2006) | 1 line
Verify the crash due to EncodingMap not initialized does not return
........
r46910 | thomas.heller | 2006-06-13 10:56:14 +0200 (Tue, 13 Jun 2006) | 3 lines
Add some windows datatypes that were missing from this file, and add
the aliases defined in windows header files for the structures.
........
r46911 | thomas.heller | 2006-06-13 11:40:14 +0200 (Tue, 13 Jun 2006) | 3 lines
Add back WCHAR, UINT, DOUBLE, _LARGE_INTEGER, _ULARGE_INTEGER.
VARIANT_BOOL is a special _ctypes data type, not c_short.
........
r46912 | ronald.oussoren | 2006-06-13 13:19:56 +0200 (Tue, 13 Jun 2006) | 4 lines
Linecache contains support for PEP302 loaders, but fails to deal with loaders
that return None to indicate that the module is valid but no source is
available. This patch fixes that.
........
r46913 | andrew.kuchling | 2006-06-13 13:57:04 +0200 (Tue, 13 Jun 2006) | 1 line
Mention uuid module
........
r46915 | walter.doerwald | 2006-06-13 14:02:12 +0200 (Tue, 13 Jun 2006) | 2 lines
Fix passing errors to the encoder and decoder functions.
........
r46917 | walter.doerwald | 2006-06-13 14:04:43 +0200 (Tue, 13 Jun 2006) | 3 lines
errors is an attribute in the incremental decoder
not an argument.
........
r46919 | andrew.macintyre | 2006-06-13 17:04:24 +0200 (Tue, 13 Jun 2006) | 11 lines
Patch #1454481: Make thread stack size runtime tunable.
Heavily revised, comprising revisions:
46640 - original trunk revision (backed out in r46655)
46647 - markup fix (backed out in r46655)
46692:46918 merged from branch aimacintyre-sf1454481
branch tested on buildbots (Windows buildbots had problems
not related to these changes).
........
r46920 | brett.cannon | 2006-06-13 18:06:55 +0200 (Tue, 13 Jun 2006) | 2 lines
Remove unused variable.
........
r46921 | andrew.kuchling | 2006-06-13 18:41:41 +0200 (Tue, 13 Jun 2006) | 1 line
Add ability to set stack size
........
r46923 | marc-andre.lemburg | 2006-06-13 19:04:26 +0200 (Tue, 13 Jun 2006) | 2 lines
Update pybench to version 2.0.
........
r46924 | marc-andre.lemburg | 2006-06-13 19:07:14 +0200 (Tue, 13 Jun 2006) | 2 lines
Revert wrong svn copy.
........
r46925 | andrew.macintyre | 2006-06-13 19:14:36 +0200 (Tue, 13 Jun 2006) | 2 lines
fix exception usage
........
r46927 | tim.peters | 2006-06-13 20:37:07 +0200 (Tue, 13 Jun 2006) | 2 lines
Whitespace normalization.
........
r46928 | marc-andre.lemburg | 2006-06-13 20:56:56 +0200 (Tue, 13 Jun 2006) | 9 lines
Updated to pybench 2.0.
See svn.python.org/external/pybench-2.0 for the original import of that
version.
Note that platform.py was not copied over from pybench-2.0 since
it is already part of Python 2.5.
........
r46929 | andrew.macintyre | 2006-06-13 21:02:35 +0200 (Tue, 13 Jun 2006) | 5 lines
Increase the small thread stack size to get the test
to pass reliably on the one buildbot that insists on
more than 32kB of thread stack.
........
r46930 | marc-andre.lemburg | 2006-06-13 21:20:07 +0200 (Tue, 13 Jun 2006) | 2 lines
Whitespace normalization.
........
r46931 | thomas.heller | 2006-06-13 22:18:43 +0200 (Tue, 13 Jun 2006) | 2 lines
More docs for ctypes.
........
r46932 | brett.cannon | 2006-06-13 23:34:24 +0200 (Tue, 13 Jun 2006) | 2 lines
Ignore .pyc and .pyo files in Pybench.
........
r46933 | brett.cannon | 2006-06-13 23:46:41 +0200 (Tue, 13 Jun 2006) | 7 lines
If a classic class defined a __coerce__() method that just returned its two
arguments in reverse, the interpreter would infinitely recourse trying to get a
coercion that worked. So put in a recursion check after a coercion is made and
the next call to attempt to use the coerced values.
Fixes bug #992017 and closes crashers/coerce.py .
........
r46936 | gerhard.haering | 2006-06-14 00:24:47 +0200 (Wed, 14 Jun 2006) | 3 lines
Merged changes from external pysqlite 2.3.0 release. Documentation updates will
follow in a few hours at the latest. Then we should be ready for beta1.
........
r46937 | brett.cannon | 2006-06-14 00:26:13 +0200 (Wed, 14 Jun 2006) | 2 lines
Missed test for rev. 46933; infinite recursion from __coerce__() returning its arguments reversed.
........
r46938 | gerhard.haering | 2006-06-14 00:53:48 +0200 (Wed, 14 Jun 2006) | 2 lines
Updated documentation for pysqlite 2.3.0 API.
........
r46939 | tim.peters | 2006-06-14 06:09:25 +0200 (Wed, 14 Jun 2006) | 10 lines
SequenceMatcher.get_matching_blocks(): This now guarantees that
adjacent triples in the result list describe non-adjacent matching
blocks. That's _nice_ to have, and Guido said he wanted it.
Not a bugfix candidate: Guido or not ;-), this changes visible
endcase semantics (note that some tests had to change), and
nothing about this was documented before. Since it was working
as designed, and behavior was consistent with the docs, it wasn't
"a bug".
........
r46940 | tim.peters | 2006-06-14 06:13:00 +0200 (Wed, 14 Jun 2006) | 2 lines
Repaired typo in new comment.
........
r46941 | tim.peters | 2006-06-14 06:15:27 +0200 (Wed, 14 Jun 2006) | 2 lines
Whitespace normalization.
........
r46942 | fred.drake | 2006-06-14 06:25:02 +0200 (Wed, 14 Jun 2006) | 3 lines
- make some disabled tests run what they intend when enabled
- remove some over-zealous triple-quoting
........
r46943 | fred.drake | 2006-06-14 07:04:47 +0200 (Wed, 14 Jun 2006) | 3 lines
add tests for two cases that are handled correctly in the current code,
but that SF patch 1504676 as written mis-handles
........
r46944 | fred.drake | 2006-06-14 07:15:51 +0200 (Wed, 14 Jun 2006) | 1 line
explain an XXX in more detail
........
r46945 | martin.v.loewis | 2006-06-14 07:21:04 +0200 (Wed, 14 Jun 2006) | 1 line
Patch #1455898: Incremental mode for "mbcs" codec.
........
r46946 | georg.brandl | 2006-06-14 08:08:31 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1339007: Shelf objects now don't raise an exception in their
__del__ method when initialization failed.
........
r46948 | thomas.heller | 2006-06-14 08:18:15 +0200 (Wed, 14 Jun 2006) | 1 line
Fix docstring.
........
r46949 | georg.brandl | 2006-06-14 08:29:07 +0200 (Wed, 14 Jun 2006) | 2 lines
Bug #1501122: mention __gt__ &co in description of comparison order.
........
r46951 | thomas.heller | 2006-06-14 09:08:38 +0200 (Wed, 14 Jun 2006) | 1 line
Write more docs.
........
r46952 | georg.brandl | 2006-06-14 10:31:39 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1153163: describe __add__ vs __radd__ behavior when adding
objects of same type/of subclasses of the other.
........
r46954 | georg.brandl | 2006-06-14 10:42:11 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1202018: add some common mime.types locations.
........
r46955 | georg.brandl | 2006-06-14 10:50:03 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1117556: SimpleHTTPServer now tries to find and use the system's
mime.types file for determining MIME types.
........
r46957 | thomas.heller | 2006-06-14 11:09:08 +0200 (Wed, 14 Jun 2006) | 1 line
Document paramflags.
........
r46958 | thomas.heller | 2006-06-14 11:20:11 +0200 (Wed, 14 Jun 2006) | 1 line
Add an __all__ list, since this module does 'from ctypes import *'.
........
r46959 | andrew.kuchling | 2006-06-14 15:59:15 +0200 (Wed, 14 Jun 2006) | 1 line
Add item
........
r46961 | georg.brandl | 2006-06-14 18:46:43 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #805015: doc error in PyUnicode_FromEncodedObject.
........
r46962 | gerhard.haering | 2006-06-15 00:28:37 +0200 (Thu, 15 Jun 2006) | 10 lines
- Added version checks in C code to make sure we don't trigger bugs in older
SQLite versions.
- Added version checks in test suite so that we don't execute tests that we
know will fail with older (buggy) SQLite versions.
Now, all tests should run against all SQLite versions from 3.0.8 until 3.3.6
(latest one now). The sqlite3 module can be built against all these SQLite
versions and the sqlite3 module does its best to not trigger bugs in SQLite,
but using SQLite 3.3.3 or later is recommended.
........
r46963 | tim.peters | 2006-06-15 00:38:13 +0200 (Thu, 15 Jun 2006) | 2 lines
Whitespace normalization.
........
r46964 | neal.norwitz | 2006-06-15 06:54:29 +0200 (Thu, 15 Jun 2006) | 9 lines
Speculative checkin (requires approval of Gerhard Haering)
This backs out the test changes in 46962 which prevented crashes
by not running the tests via a version check. All the version checks
added in that rev were removed from the tests.
Code was added to the error handler in connection.c that seems
to work with older versions of sqlite including 3.1.3.
........
r46965 | neal.norwitz | 2006-06-15 07:55:49 +0200 (Thu, 15 Jun 2006) | 1 line
Try to narrow window of failure on slow/busy boxes (ppc64 buildbot)
........
r46966 | martin.v.loewis | 2006-06-15 08:45:05 +0200 (Thu, 15 Jun 2006) | 2 lines
Make import/lookup of mbcs fail on non-Windows systems.
........
r46967 | ronald.oussoren | 2006-06-15 10:14:18 +0200 (Thu, 15 Jun 2006) | 2 lines
Patch #1446489 (zipfile: support for ZIP64)
........
r46968 | neal.norwitz | 2006-06-15 10:16:44 +0200 (Thu, 15 Jun 2006) | 6 lines
Re-revert this change. Install the version check and don't run the test
until Gerhard has time to fully debug the issue. This affects versions
before 3.2.1 (possibly only versions earlier than 3.1.3).
Based on discussion on python-checkins.
........
r46969 | gregory.p.smith | 2006-06-15 10:52:32 +0200 (Thu, 15 Jun 2006) | 6 lines
- bsddb: multithreaded DB access using the simple bsddb module interface
now works reliably. It has been updated to use automatic BerkeleyDB
deadlock detection and the bsddb.dbutils.DeadlockWrap wrapper to retry
database calls that would previously deadlock. [SF python bug #775414]
........
r46970 | gregory.p.smith | 2006-06-15 11:23:52 +0200 (Thu, 15 Jun 2006) | 2 lines
minor documentation cleanup. mention the bsddb.db interface explicitly by name.
........
r46971 | neal.norwitz | 2006-06-15 11:57:03 +0200 (Thu, 15 Jun 2006) | 5 lines
Steal the trick from test_compiler to print out a slow msg.
This will hopefully get the buildbots to pass. Not sure this
test will be feasible or even work. But everything is red now,
so it can't get much worse.
........
r46972 | neal.norwitz | 2006-06-15 12:24:49 +0200 (Thu, 15 Jun 2006) | 1 line
Print some more info to get an idea of how much longer the test will last
........
r46981 | tim.peters | 2006-06-15 20:04:40 +0200 (Thu, 15 Jun 2006) | 6 lines
Try to reduce the extreme peak memory and disk-space use
of this test. It probably still requires more disk space
than most buildbots have, and in any case is still so
intrusive that if we don't find another way to test this I'm
taking my buildbot offline permanently ;-)
........
r46982 | tim.peters | 2006-06-15 20:06:29 +0200 (Thu, 15 Jun 2006) | 2 lines
Whitespace normalization.
........
r46983 | tim.peters | 2006-06-15 20:07:28 +0200 (Thu, 15 Jun 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46984 | tim.peters | 2006-06-15 20:38:19 +0200 (Thu, 15 Jun 2006) | 2 lines
Oops -- I introduced an off-by-6436159488 error.
........
r46990 | neal.norwitz | 2006-06-16 06:30:34 +0200 (Fri, 16 Jun 2006) | 1 line
Disable this test until we can determine what to do about it
........
r46991 | neal.norwitz | 2006-06-16 06:31:06 +0200 (Fri, 16 Jun 2006) | 1 line
Param name is dir, not directory. Update docstring. Backport candidate
........
r46992 | neal.norwitz | 2006-06-16 06:31:28 +0200 (Fri, 16 Jun 2006) | 1 line
Add missing period in comment.
........
r46993 | neal.norwitz | 2006-06-16 06:32:43 +0200 (Fri, 16 Jun 2006) | 1 line
Fix whitespace, there are memory leaks in this module.
........
r46995 | fred.drake | 2006-06-17 01:45:06 +0200 (Sat, 17 Jun 2006) | 3 lines
SF patch 1504676: Make sgmllib char and entity references pluggable
(implementation/tests contributed by Sam Ruby)
........
r46996 | fred.drake | 2006-06-17 03:07:54 +0200 (Sat, 17 Jun 2006) | 1 line
fix change that broke the htmllib tests
........
r46998 | martin.v.loewis | 2006-06-17 11:15:14 +0200 (Sat, 17 Jun 2006) | 3 lines
Patch #763580: Add name and value arguments to
Tkinter variable classes.
........
r46999 | martin.v.loewis | 2006-06-17 11:20:41 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #1096231: Add default argument to wm_iconbitmap.
........
r47000 | martin.v.loewis | 2006-06-17 11:25:15 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #1494750: Destroy master after deleting children.
........
r47003 | george.yoshida | 2006-06-17 18:31:52 +0200 (Sat, 17 Jun 2006) | 2 lines
markup fix
........
r47005 | george.yoshida | 2006-06-17 18:39:13 +0200 (Sat, 17 Jun 2006) | 4 lines
Update url.
Old url returned status code:301 Moved permanently.
........
r47007 | martin.v.loewis | 2006-06-17 20:44:27 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #812986: Update the canvas even if not tracing.
........
r47008 | martin.v.loewis | 2006-06-17 21:03:26 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #815924: Restore ability to pass type= and icon=
........
r47009 | neal.norwitz | 2006-06-18 00:37:45 +0200 (Sun, 18 Jun 2006) | 1 line
Fix typo in docstring
........
r47010 | neal.norwitz | 2006-06-18 00:38:15 +0200 (Sun, 18 Jun 2006) | 1 line
Fix memory leak reported by valgrind while running test_subprocess
........
r47011 | fred.drake | 2006-06-18 04:57:35 +0200 (Sun, 18 Jun 2006) | 1 line
remove unnecessary markup
........
r47013 | neal.norwitz | 2006-06-18 21:35:01 +0200 (Sun, 18 Jun 2006) | 7 lines
Prevent spurious leaks when running regrtest.py -R. There may be more
issues that crop up from time to time, but this change seems to have been
pretty stable (no spurious warnings) for about a week.
Other modules which use threads may require similar use of
threading_setup/threading_cleanup from test_support.
........
r47014 | neal.norwitz | 2006-06-18 21:37:40 +0200 (Sun, 18 Jun 2006) | 9 lines
The hppa ubuntu box sometimes hangs forever in these tests. My guess
is that the wait is failing for some reason. Use WNOHANG, so we won't
wait until the buildbot kills the test suite.
I haven't been able to reproduce the failure, so I'm not sure if
this will help or not. Hopefully, this change will cause the test
to fail, rather than hang. That will be better since we will get
the rest of the test results. It may also help us debug the real problem.
........
r47015 | neal.norwitz | 2006-06-18 22:10:24 +0200 (Sun, 18 Jun 2006) | 1 line
Revert 47014 until it is more robust
........
r47016 | thomas.heller | 2006-06-18 23:27:04 +0200 (Sun, 18 Jun 2006) | 6 lines
Fix typos.
Fix doctest example.
Mention in the tutorial that 'errcheck' is explained in the ref manual.
Use better wording in some places.
Remoce code examples that shouldn't be in the tutorial.
Remove some XXX notices.
........
r47017 | georg.brandl | 2006-06-19 00:17:29 +0200 (Mon, 19 Jun 2006) | 3 lines
Patch #1507676: improve exception messages in abstract.c, object.c and typeobject.c.
........
r47018 | neal.norwitz | 2006-06-19 07:40:44 +0200 (Mon, 19 Jun 2006) | 1 line
Use Py_ssize_t
........
r47019 | georg.brandl | 2006-06-19 08:35:54 +0200 (Mon, 19 Jun 2006) | 3 lines
Add news entry about error msg improvement.
........
r47020 | thomas.heller | 2006-06-19 09:07:49 +0200 (Mon, 19 Jun 2006) | 2 lines
Try to repair the failing test on the OpenBSD buildbot. Trial and error...
........
r47021 | tim.peters | 2006-06-19 09:45:16 +0200 (Mon, 19 Jun 2006) | 2 lines
Whitespace normalization.
........
r47022 | walter.doerwald | 2006-06-19 10:07:50 +0200 (Mon, 19 Jun 2006) | 4 lines
Patch #1506645: add Python wrappers for the curses functions
is_term_resized, resize_term and resizeterm. This uses three
separate configure checks (one for each function).
........
r47023 | walter.doerwald | 2006-06-19 10:14:09 +0200 (Mon, 19 Jun 2006) | 2 lines
Make check order match in configure and configure.in.
........
r47024 | tim.peters | 2006-06-19 10:14:28 +0200 (Mon, 19 Jun 2006) | 3 lines
Repair KeyError when running test_threaded_import under -R,
as reported by Neal on python-dev.
........
r47025 | thomas.heller | 2006-06-19 10:32:46 +0200 (Mon, 19 Jun 2006) | 3 lines
Next try to fix the OpenBSD buildbot tests:
Use ctypes.util.find_library to locate the C runtime library
on platforms where is returns useful results.
........
r47026 | tim.peters | 2006-06-19 11:09:44 +0200 (Mon, 19 Jun 2006) | 13 lines
TestHelp.make_parser(): This was making a permanent change to
os.environ (setting envar COLUMNS), which at least caused
test_float_default() to fail if the tests were run more than once.
This repairs the test_optparse -R failures Neal reported on
python-dev. It also explains some seemingly bizarre test_optparse
failures we saw a couple weeks ago on the buildbots, when
test_optparse failed due to test_file failing to clean up after
itself, and then test_optparse failed in an entirely different
way when regrtest's -w option ran test_optparse a second time.
It's now obvious that make_parser() permanently changing os.environ
was responsible for the second half of that.
........
r47027 | anthony.baxter | 2006-06-19 14:04:15 +0200 (Mon, 19 Jun 2006) | 2 lines
Preparing for 2.5b1.
........
r47029 | fred.drake | 2006-06-19 19:31:16 +0200 (Mon, 19 Jun 2006) | 1 line
remove non-working document formats from edist
........
r47030 | gerhard.haering | 2006-06-19 23:17:35 +0200 (Mon, 19 Jun 2006) | 5 lines
Fixed a memory leak that was introduced with incorrect usage of the Python weak
reference API in pysqlite 2.2.1.
Bumbed pysqlite version number to upcoming pysqlite 2.3.1 release.
........
r47032 | ka-ping.yee | 2006-06-20 00:49:36 +0200 (Tue, 20 Jun 2006) | 2 lines
Remove Python 2.3 compatibility comment.
........
r47033 | trent.mick | 2006-06-20 01:21:25 +0200 (Tue, 20 Jun 2006) | 2 lines
Upgrade pyexpat to expat 2.0.0 (http://python.org/sf/1462338).
........
r47034 | trent.mick | 2006-06-20 01:57:41 +0200 (Tue, 20 Jun 2006) | 3 lines
[ 1295808 ] expat symbols should be namespaced in pyexpat
(http://python.org/sf/1295808)
........
r47039 | andrew.kuchling | 2006-06-20 13:52:16 +0200 (Tue, 20 Jun 2006) | 1 line
Uncomment wsgiref section
........
r47040 | andrew.kuchling | 2006-06-20 14:15:09 +0200 (Tue, 20 Jun 2006) | 1 line
Add four library items
........
r47041 | andrew.kuchling | 2006-06-20 14:19:54 +0200 (Tue, 20 Jun 2006) | 1 line
Terminology and typography fixes
........
r47042 | andrew.kuchling | 2006-06-20 15:05:12 +0200 (Tue, 20 Jun 2006) | 1 line
Add introductory paragraphs summarizing the release; minor edits
........
r47043 | andrew.kuchling | 2006-06-20 15:11:29 +0200 (Tue, 20 Jun 2006) | 1 line
Minor edits and rearrangements; markup fix
........
r47044 | andrew.kuchling | 2006-06-20 15:20:30 +0200 (Tue, 20 Jun 2006) | 1 line
[Bug #1504456] Mention xml -> xmlcore change
........
r47047 | brett.cannon | 2006-06-20 19:30:26 +0200 (Tue, 20 Jun 2006) | 2 lines
Raise TestSkipped when the test socket connection is refused.
........
r47049 | brett.cannon | 2006-06-20 21:20:17 +0200 (Tue, 20 Jun 2006) | 2 lines
Fix typo of exception name.
........
r47053 | brett.cannon | 2006-06-21 18:57:57 +0200 (Wed, 21 Jun 2006) | 5 lines
At the C level, tuple arguments are passed in directly to the exception
constructor, meaning it is treated as *args, not as a single argument. This
means using the 'message' attribute won't work (until Py3K comes around),
and so one must grab from 'arg' to get the error number.
........
r47054 | andrew.kuchling | 2006-06-21 19:10:18 +0200 (Wed, 21 Jun 2006) | 1 line
Link to LibRef module documentation
........
r47055 | andrew.kuchling | 2006-06-21 19:17:10 +0200 (Wed, 21 Jun 2006) | 1 line
Note some of Barry's work
........
r47056 | andrew.kuchling | 2006-06-21 19:17:28 +0200 (Wed, 21 Jun 2006) | 1 line
Bump version
........
r47057 | georg.brandl | 2006-06-21 19:45:17 +0200 (Wed, 21 Jun 2006) | 3 lines
fix [ 1509132 ] compiler module builds incorrect AST for TryExceptFinally
........
r47058 | georg.brandl | 2006-06-21 19:52:36 +0200 (Wed, 21 Jun 2006) | 3 lines
Make test_fcntl aware of netbsd3.
........
r47059 | georg.brandl | 2006-06-21 19:53:17 +0200 (Wed, 21 Jun 2006) | 3 lines
Patch #1509001: expected skips for netbsd3.
........
r47060 | gerhard.haering | 2006-06-21 22:55:04 +0200 (Wed, 21 Jun 2006) | 2 lines
Removed call to enable_callback_tracebacks that slipped in by accident.
........
r47061 | armin.rigo | 2006-06-21 23:58:50 +0200 (Wed, 21 Jun 2006) | 13 lines
Fix for an obscure bug introduced by revs 46806 and 46808, with a test.
The problem of checking too eagerly for recursive calls is the
following: if a RuntimeError is caused by recursion, and if code needs
to normalize it immediately (as in the 2nd test), then
PyErr_NormalizeException() needs a call to the RuntimeError class to
instantiate it, and this hits the recursion limit again... causing
PyErr_NormalizeException() to never finish.
Moved this particular recursion check to slot_tp_call(), which is not
involved in instantiating built-in exceptions.
Backport candidate.
........
r47064 | neal.norwitz | 2006-06-22 08:30:50 +0200 (Thu, 22 Jun 2006) | 3 lines
Copy the wsgiref package during make install.
........
r47065 | neal.norwitz | 2006-06-22 08:35:30 +0200 (Thu, 22 Jun 2006) | 1 line
Reset the doc date to today for the automatic doc builds
........
r47067 | andrew.kuchling | 2006-06-22 15:10:23 +0200 (Thu, 22 Jun 2006) | 1 line
Mention how to suppress warnings
........
r47069 | georg.brandl | 2006-06-22 16:46:17 +0200 (Thu, 22 Jun 2006) | 3 lines
Set lineno correctly on list, tuple and dict literals.
........
r47070 | georg.brandl | 2006-06-22 16:46:46 +0200 (Thu, 22 Jun 2006) | 4 lines
Test for correct compilation of try-except-finally stmt.
Test for correct lineno on list, tuple, dict literals.
........
r47071 | fred.drake | 2006-06-22 17:50:08 +0200 (Thu, 22 Jun 2006) | 1 line
fix markup nit
........
r47072 | brett.cannon | 2006-06-22 18:49:14 +0200 (Thu, 22 Jun 2006) | 6 lines
'warning's was improperly requiring that a command-line Warning category be
both a subclass of Warning and a subclass of types.ClassType. The latter is no
longer true thanks to new-style exceptions.
Closes bug #1510580. Thanks to AMK for the test.
........
r47073 | ronald.oussoren | 2006-06-22 20:33:54 +0200 (Thu, 22 Jun 2006) | 3 lines
MacOSX: Add a message to the first screen of the installer that tells
users how to avoid updates to their shell profile.
........
r47074 | georg.brandl | 2006-06-22 21:02:18 +0200 (Thu, 22 Jun 2006) | 3 lines
Fix my name ;)
........
r47075 | thomas.heller | 2006-06-22 21:07:36 +0200 (Thu, 22 Jun 2006) | 2 lines
Small fixes, mostly in the markup.
........
r47076 | peter.astrand | 2006-06-22 22:06:46 +0200 (Thu, 22 Jun 2006) | 1 line
Make it possible to run test_subprocess.py on Python 2.2, which lacks test_support.is_resource_enabled.
........
r47077 | peter.astrand | 2006-06-22 22:21:26 +0200 (Thu, 22 Jun 2006) | 1 line
Applied patch #1506758: Prevent MemoryErrors with large MAXFD.
........
r47079 | neal.norwitz | 2006-06-23 05:32:44 +0200 (Fri, 23 Jun 2006) | 1 line
Fix refleak
........
r47080 | fred.drake | 2006-06-23 08:03:45 +0200 (Fri, 23 Jun 2006) | 9 lines
- SF bug #853506: IP6 address parsing in sgmllib
('[' and ']' were not accepted in unquoted attribute values)
- cleaned up tests of character and entity reference decoding so the
tests cover the documented relationships among handle_charref,
handle_entityref, convert_charref, convert_codepoint, and
convert_entityref, without bringing up Unicode issues that sgmllib
cannot be involved in
........
r47085 | andrew.kuchling | 2006-06-23 21:23:40 +0200 (Fri, 23 Jun 2006) | 11 lines
Fit Makefile for the Python doc environment better; this is a step toward
including the howtos in the build process.
* Put LaTeX output in ../paper-<whatever>/.
* Put HTML output in ../html/
* Explain some of the Makefile variables
* Remove some cruft dating to my environment (e.g. the 'web' target)
This makefile isn't currently invoked by the documentation build process,
so these changes won't destabilize anything.
........
r47086 | hyeshik.chang | 2006-06-23 23:16:18 +0200 (Fri, 23 Jun 2006) | 5 lines
Bug #1511381: codec_getstreamcodec() in codec.c is corrected to
omit a default "error" argument for NULL pointer. This allows
the parser to take a codec from cjkcodecs again.
(Reported by Taewook Kang and reviewed by Walter Doerwald)
........
r47091 | ronald.oussoren | 2006-06-25 22:44:16 +0200 (Sun, 25 Jun 2006) | 6 lines
Workaround for bug #1512124
Without this patch IDLE will get unresponsive when you open the debugger
window on OSX. This is both using the system Tcl/Tk on Tiger as the latest
universal download from tk-components.sf.net.
........
r47092 | ronald.oussoren | 2006-06-25 23:14:19 +0200 (Sun, 25 Jun 2006) | 3 lines
Drop the calldll demo's for macos, calldll isn't present anymore, no need
to keep the demo's around.
........
r47093 | ronald.oussoren | 2006-06-25 23:15:58 +0200 (Sun, 25 Jun 2006) | 3 lines
Use a path without a double slash to compile the .py files after installation
(macosx, binary installer). This fixes bug #1508369 for python 2.5.
........
r47094 | ronald.oussoren | 2006-06-25 23:19:06 +0200 (Sun, 25 Jun 2006) | 3 lines
Also install the .egg-info files in Lib. This will cause wsgiref.egg-info to
be installed.
........
r47097 | andrew.kuchling | 2006-06-26 14:40:02 +0200 (Mon, 26 Jun 2006) | 1 line
[Bug #1511998] Various comments from Nick Coghlan; thanks!
........
r47098 | andrew.kuchling | 2006-06-26 14:43:43 +0200 (Mon, 26 Jun 2006) | 1 line
Describe workaround for PyRange_New()'s removal
........
r47099 | andrew.kuchling | 2006-06-26 15:08:24 +0200 (Mon, 26 Jun 2006) | 5 lines
[Bug #1512163] Fix typo.
This change will probably break tests on FreeBSD buildbots, but I'll check in
a fix for that next.
........
r47100 | andrew.kuchling | 2006-06-26 15:12:16 +0200 (Mon, 26 Jun 2006) | 9 lines
[Bug #1512163] Use one set of locking methods, lockf();
remove the flock() calls.
On FreeBSD, the two methods lockf() and flock() end up using the same
mechanism and the second one fails. A Linux man page claims that the
two methods are orthogonal (so locks acquired one way don't interact
with locks acquired the other way) but that clearly must be false.
........
r47101 | andrew.kuchling | 2006-06-26 15:23:10 +0200 (Mon, 26 Jun 2006) | 5 lines
Add a test for a conflicting lock.
On slow machines, maybe the time intervals (2 sec, 0.5 sec) will be too tight.
I'll see how the buildbots like it.
........
r47103 | andrew.kuchling | 2006-06-26 16:33:24 +0200 (Mon, 26 Jun 2006) | 1 line
Windows doesn't have os.fork(). I'll just disable this test for now
........
r47106 | andrew.kuchling | 2006-06-26 19:00:35 +0200 (Mon, 26 Jun 2006) | 9 lines
Attempt to fix build failure on OS X and Debian alpha; the symptom is
consistent with os.wait() returning immediately because some other
subprocess had previously exited; the test suite then immediately
tries to lock the mailbox and gets an error saying it's already
locked.
To fix this, do a waitpid() so the test suite only continues once
the intended child process has exited.
........
r47113 | neal.norwitz | 2006-06-27 06:06:46 +0200 (Tue, 27 Jun 2006) | 1 line
Ignore some more warnings in the dynamic linker on an older gentoo
........
r47114 | neal.norwitz | 2006-06-27 06:09:13 +0200 (Tue, 27 Jun 2006) | 6 lines
Instead of doing a make test, run the regression tests out of the installed
copy. This will hopefully catch problems where directories are added
under Lib/ but not to Makefile.pre.in. This breaks out the 2 runs
of the test suite with and without -O which is also nicer.
........
r47115 | neal.norwitz | 2006-06-27 06:12:58 +0200 (Tue, 27 Jun 2006) | 5 lines
Fix SF bug #1513032, 'make install' failure on FreeBSD 5.3.
No need to install lib-old, it's empty in 2.5.
........
r47116 | neal.norwitz | 2006-06-27 06:23:06 +0200 (Tue, 27 Jun 2006) | 1 line
Test unimportant change to verify buildbot does not try to build
........
r47117 | neal.norwitz | 2006-06-27 06:26:30 +0200 (Tue, 27 Jun 2006) | 1 line
Try again: test unimportant change to verify buildbot does not try to build
........
r47118 | neal.norwitz | 2006-06-27 06:28:56 +0200 (Tue, 27 Jun 2006) | 1 line
Verify buildbot picks up these changes (really needs testing after last change to Makefile.pre.in)
........
r47121 | vinay.sajip | 2006-06-27 09:34:37 +0200 (Tue, 27 Jun 2006) | 1 line
Removed buggy exception handling in doRollover of rotating file handlers. Exceptions now propagate to caller.
........
r47123 | ronald.oussoren | 2006-06-27 12:08:25 +0200 (Tue, 27 Jun 2006) | 3 lines
MacOSX: fix rather dumb buglet that made it impossible to create extensions on
OSX 10.3 when using a binary distribution build on 10.4.
........
r47125 | tim.peters | 2006-06-27 13:52:49 +0200 (Tue, 27 Jun 2006) | 2 lines
Whitespace normalization.
........
r47128 | ronald.oussoren | 2006-06-27 14:53:52 +0200 (Tue, 27 Jun 2006) | 8 lines
Use staticly build copies of zlib and bzip2 to build the OSX installer, that
way the resulting binaries have a better change of running on 10.3.
This patch also updates the search logic for sleepycat db3/4, without this
patch you cannot use a sleepycat build with a non-standard prefix; with this
you can (at least on OSX) if you add the prefix to CPPFLAGS/LDFLAGS at
configure-time. This change is needed to build the binary installer for OSX.
........
r47131 | ronald.oussoren | 2006-06-27 17:45:32 +0200 (Tue, 27 Jun 2006) | 5 lines
macosx: Install a libpython2.5.a inside the framework as a symlink to the actual
dylib at the root of the framework, that way tools that expect a unix-like
install (python-config, but more importantly external products like
mod_python) work correctly.
........
r47137 | neal.norwitz | 2006-06-28 07:03:22 +0200 (Wed, 28 Jun 2006) | 4 lines
According to the man pages on Gentoo Linux and Tru64, EACCES or EAGAIN
can be returned if fcntl (lockf) fails. This fixes the test failure
on Tru64 by checking for either error rather than just EAGAIN.
........
r47139 | neal.norwitz | 2006-06-28 08:28:31 +0200 (Wed, 28 Jun 2006) | 5 lines
Fix bug #1512695: cPickle.loads could crash if it was interrupted with
a KeyboardInterrupt since PyTuple_Pack was passed a NULL.
Will backport.
........
r47142 | nick.coghlan | 2006-06-28 12:41:47 +0200 (Wed, 28 Jun 2006) | 1 line
Make full module name available as __module_name__ even when __name__ is set to something else (like '__main__')
........
r47143 | armin.rigo | 2006-06-28 12:49:51 +0200 (Wed, 28 Jun 2006) | 2 lines
A couple of crashers of the "won't fix" kind.
........
r47147 | andrew.kuchling | 2006-06-28 16:25:20 +0200 (Wed, 28 Jun 2006) | 1 line
[Bug #1508766] Add docs for uuid module; docs written by George Yoshida, with minor rearrangements by me.
........
r47148 | andrew.kuchling | 2006-06-28 16:27:21 +0200 (Wed, 28 Jun 2006) | 1 line
[Bug #1508766] Add docs for uuid module; this puts the module in the 'Internet Protocols' section. Arguably this module could also have gone in the chapters on strings or encodings, maybe even the crypto chapter. Fred, please move if you see fit.
........
r47151 | georg.brandl | 2006-06-28 22:23:25 +0200 (Wed, 28 Jun 2006) | 3 lines
Fix end_fill().
........
r47153 | trent.mick | 2006-06-28 22:30:41 +0200 (Wed, 28 Jun 2006) | 2 lines
Mention the expat upgrade and pyexpat fix I put in 2.5b1.
........
r47154 | fred.drake | 2006-06-29 02:51:53 +0200 (Thu, 29 Jun 2006) | 6 lines
SF bug #1504333: sgmlib should allow angle brackets in quoted values
(modified patch by Sam Ruby; changed to use separate REs for start and end
tags to reduce matching cost for end tags; extended tests; updated to avoid
breaking previous changes to support IPv6 addresses in unquoted attribute
values)
........
r47156 | fred.drake | 2006-06-29 04:57:48 +0200 (Thu, 29 Jun 2006) | 1 line
document recent bugfixes in sgmllib
........
r47158 | neal.norwitz | 2006-06-29 06:10:08 +0200 (Thu, 29 Jun 2006) | 10 lines
Add new utility function, reap_children(), to test_support. This should
be called at the end of each test that spawns children (perhaps it
should be called from regrtest instead?). This will hopefully prevent
some of the unexplained failures in the buildbots (hppa and alpha)
during tests that spawn children. The problems were not reproducible.
There were many zombies that remained at the end of several tests.
In the worst case, this shouldn't cause any more problems,
though it may not help either. Time will tell.
........
r47159 | neal.norwitz | 2006-06-29 07:48:14 +0200 (Thu, 29 Jun 2006) | 5 lines
This should fix the buildbot failure on s/390 which can't connect to gmail.org.
It makes the error message consistent and always sends to stderr.
It would be much better for all the networking tests to hit only python.org.
........
r47161 | thomas.heller | 2006-06-29 20:34:15 +0200 (Thu, 29 Jun 2006) | 3 lines
Protect the thread api calls in the _ctypes extension module within
#ifdef WITH_THREADS/#endif blocks. Found by Sam Rushing.
........
r47162 | martin.v.loewis | 2006-06-29 20:58:44 +0200 (Thu, 29 Jun 2006) | 2 lines
Patch #1509163: MS Toolkit Compiler no longer available
........
r47163 | skip.montanaro | 2006-06-29 21:20:09 +0200 (Thu, 29 Jun 2006) | 1 line
add string methods to index
........
r47164 | vinay.sajip | 2006-06-30 02:13:08 +0200 (Fri, 30 Jun 2006) | 1 line
Fixed bug in fileConfig() which failed to clear logging._handlerList
........
r47166 | tim.peters | 2006-06-30 08:18:39 +0200 (Fri, 30 Jun 2006) | 2 lines
Whitespace normalization.
........
r47170 | neal.norwitz | 2006-06-30 09:32:16 +0200 (Fri, 30 Jun 2006) | 1 line
Silence compiler warning
........
r47171 | neal.norwitz | 2006-06-30 09:32:46 +0200 (Fri, 30 Jun 2006) | 1 line
Another problem reported by Coverity. Backport candidate.
........
r47175 | thomas.heller | 2006-06-30 19:44:54 +0200 (Fri, 30 Jun 2006) | 2 lines
Revert the use of PY_FORMAT_SIZE_T in PyErr_Format.
........
r47176 | tim.peters | 2006-06-30 20:34:51 +0200 (Fri, 30 Jun 2006) | 2 lines
Remove now-unused fidding with PY_FORMAT_SIZE_T.
........
r47177 | georg.brandl | 2006-06-30 20:47:56 +0200 (Fri, 30 Jun 2006) | 3 lines
Document decorator usage of property.
........
r47181 | fred.drake | 2006-06-30 21:29:25 +0200 (Fri, 30 Jun 2006) | 4 lines
- consistency nit: always include "()" in \function and \method
(*should* be done by the presentation, but that requires changes all over)
- avoid spreading the __name meme
........
r47188 | vinay.sajip | 2006-07-01 12:45:20 +0200 (Sat, 01 Jul 2006) | 1 line
Added entry for fileConfig() bugfix.
........
r47189 | vinay.sajip | 2006-07-01 12:47:20 +0200 (Sat, 01 Jul 2006) | 1 line
Added duplicate call to fileConfig() to ensure that it cleans up after itself correctly.
........
r47190 | martin.v.loewis | 2006-07-01 17:33:37 +0200 (Sat, 01 Jul 2006) | 2 lines
Release all forwarded functions in .close. Fixes #1513223.
........
r47191 | fred.drake | 2006-07-01 18:28:20 +0200 (Sat, 01 Jul 2006) | 7 lines
SF bug #1296433 (Expat bug #1515266): Unchecked calls to character data
handler would cause a segfault. This merges in Expat's lib/xmlparse.c
revisions 1.154 and 1.155, which fix this and a closely related problem
(the later does not affect Python).
Moved the crasher test to the tests for xml.parsers.expat.
........
r47197 | gerhard.haering | 2006-07-02 19:48:30 +0200 (Sun, 02 Jul 2006) | 4 lines
The sqlite3 module did cut off data from the SQLite database at the first null
character before sending it to a custom converter. This has been fixed now.
........
r47198 | martin.v.loewis | 2006-07-02 20:44:00 +0200 (Sun, 02 Jul 2006) | 1 line
Correct arithmetic in access on Win32. Fixes #1513646.
........
r47203 | thomas.heller | 2006-07-03 09:58:09 +0200 (Mon, 03 Jul 2006) | 1 line
Cleanup: Remove commented out code.
........
r47204 | thomas.heller | 2006-07-03 09:59:50 +0200 (Mon, 03 Jul 2006) | 1 line
Don't run the doctests with Python 2.3 because it doesn't have the ELLIPSIS flag.
........
r47205 | thomas.heller | 2006-07-03 10:04:05 +0200 (Mon, 03 Jul 2006) | 7 lines
Fixes so that _ctypes can be compiled with the MingW compiler.
It seems that the definition of '__attribute__(x)' was responsible for
the compiler ignoring the '__fastcall' attribute on the
ffi_closure_SYSV function in libffi_msvc/ffi.c, took me quite some
time to figure this out.
........
r47206 | thomas.heller | 2006-07-03 10:08:14 +0200 (Mon, 03 Jul 2006) | 11 lines
Add a new function uses_seh() to the _ctypes extension module. This
will return True if Windows Structured Exception handling (SEH) is
used when calling functions, False otherwise.
Currently, only MSVC supports SEH.
Fix the test so that it doesn't crash when run with MingW compiled
_ctypes. Note that two tests are still failing when mingw is used, I
suspect structure layout differences and function calling conventions
between MSVC and MingW.
........
r47207 | tim.peters | 2006-07-03 10:23:19 +0200 (Mon, 03 Jul 2006) | 2 lines
Whitespace normalization.
........
r47208 | martin.v.loewis | 2006-07-03 11:44:00 +0200 (Mon, 03 Jul 2006) | 3 lines
Only setup canvas when it is first created.
Fixes #1514703
........
r47209 | martin.v.loewis | 2006-07-03 12:05:30 +0200 (Mon, 03 Jul 2006) | 3 lines
Reimplement turtle.circle using a polyline, to allow correct
filling of arcs. Also fixes #1514693.
........
r47210 | martin.v.loewis | 2006-07-03 12:19:49 +0200 (Mon, 03 Jul 2006) | 3 lines
Bug #1514693: Update turtle's heading when switching between
degrees and radians.
........
r47211 | martin.v.loewis | 2006-07-03 13:12:06 +0200 (Mon, 03 Jul 2006) | 2 lines
Document functions added in 2.3 and 2.5.
........
r47212 | martin.v.loewis | 2006-07-03 14:19:50 +0200 (Mon, 03 Jul 2006) | 3 lines
Bug #1417699: Reject locale-specific decimal point in float()
and atof().
........
r47213 | martin.v.loewis | 2006-07-03 14:28:58 +0200 (Mon, 03 Jul 2006) | 3 lines
Bug #1267547: Put proper recursive setup.py call into the
spec file generated by bdist_rpm.
........
r47215 | martin.v.loewis | 2006-07-03 15:01:35 +0200 (Mon, 03 Jul 2006) | 3 lines
Patch #825417: Fix timeout processing in expect,
read_until. Will backport to 2.4.
........
r47218 | martin.v.loewis | 2006-07-03 15:47:40 +0200 (Mon, 03 Jul 2006) | 2 lines
Put method-wrappers into trashcan. Fixes #927248.
........
r47219 | andrew.kuchling | 2006-07-03 16:07:30 +0200 (Mon, 03 Jul 2006) | 1 line
[Bug #1515932] Clarify description of slice assignment
........
r47220 | andrew.kuchling | 2006-07-03 16:16:09 +0200 (Mon, 03 Jul 2006) | 4 lines
[Bug #1511911] Clarify description of optional arguments to sorted()
by improving the xref to the section on lists, and by
copying the explanations of the arguments (with a slight modification).
........
r47223 | kristjan.jonsson | 2006-07-03 16:59:05 +0200 (Mon, 03 Jul 2006) | 1 line
Fix build problems with the platform SDK on windows. It is not sufficient to test for the C compiler version when determining if we have the secure CRT from microsoft. Must test with an undocumented macro, __STDC_SECURE_LIB__ too.
........
r47224 | ronald.oussoren | 2006-07-04 14:30:22 +0200 (Tue, 04 Jul 2006) | 7 lines
Sync the darwin/x86 port libffi with the copy in PyObjC. This fixes a number
of bugs in that port. The most annoying ones were due to some subtle differences
between the document ABI and the actual implementation :-(
(there are no python unittests that fail without this patch, but without it
some of libffi's unittests fail).
........
r47234 | georg.brandl | 2006-07-05 10:21:00 +0200 (Wed, 05 Jul 2006) | 3 lines
Remove remaining references to OverflowWarning.
........
r47236 | thomas.heller | 2006-07-05 11:13:56 +0200 (Wed, 05 Jul 2006) | 3 lines
Fix the bitfield test when _ctypes is compiled with MingW. Structures
containing bitfields may have different layout on MSVC and MingW .
........
r47237 | thomas.wouters | 2006-07-05 13:03:49 +0200 (Wed, 05 Jul 2006) | 15 lines
Fix bug in passing tuples to string.Template. All other values (with working
str() or repr()) would work, just not multi-value tuples. Probably not a
backport candidate, since it changes the behaviour of passing a
single-element tuple:
>>> string.Template("$foo").substitute(dict(foo=(1,)))
'(1,)'
versus
'1'
........
r47241 | georg.brandl | 2006-07-05 16:18:45 +0200 (Wed, 05 Jul 2006) | 2 lines
Patch #1517490: fix glitches in filter() docs.
........
r47244 | georg.brandl | 2006-07-05 17:50:05 +0200 (Wed, 05 Jul 2006) | 2 lines
no need to elaborate "string".
........
r47251 | neal.norwitz | 2006-07-06 06:28:59 +0200 (Thu, 06 Jul 2006) | 3 lines
Fix refleaks reported by Shane Hathaway in SF patch #1515361. This change
contains only the changes related to leaking the copy variable.
........
r47253 | fred.drake | 2006-07-06 07:13:22 +0200 (Thu, 06 Jul 2006) | 4 lines
- back out Expat change; the final fix to Expat will be different
- change the pyexpat wrapper to not be so sensitive to this detail of the
Expat implementation (the ex-crasher test still passes)
........
r47257 | neal.norwitz | 2006-07-06 08:45:08 +0200 (Thu, 06 Jul 2006) | 1 line
Add a NEWS entry for a recent pyexpat fix
........
r47258 | martin.v.loewis | 2006-07-06 08:55:58 +0200 (Thu, 06 Jul 2006) | 2 lines
Add sqlite3.dll to the DLLs component, not to the TkDLLs component.
Fixes #1517388.
........
r47259 | martin.v.loewis | 2006-07-06 09:05:21 +0200 (Thu, 06 Jul 2006) | 1 line
Properly quote compileall and Lib paths in case TARGETDIR has a space.
........
r47260 | thomas.heller | 2006-07-06 09:50:18 +0200 (Thu, 06 Jul 2006) | 5 lines
Revert the change done in svn revision 47206:
Add a new function uses_seh() to the _ctypes extension module. This
will return True if Windows Structured Exception handling (SEH) is
used when calling functions, False otherwise.
........
r47261 | armin.rigo | 2006-07-06 09:58:18 +0200 (Thu, 06 Jul 2006) | 3 lines
A couple of examples about how to attack the fact that _PyType_Lookup()
returns a borrowed ref. Many of the calls are open to attack.
........
r47262 | thomas.heller | 2006-07-06 10:28:14 +0200 (Thu, 06 Jul 2006) | 2 lines
The test that calls a function with invalid arguments and catches the
resulting Windows access violation will not be run by default.
........
r47263 | thomas.heller | 2006-07-06 10:48:35 +0200 (Thu, 06 Jul 2006) | 5 lines
Patch #1517790: It is now possible to use custom objects in the ctypes
foreign function argtypes sequence as long as they provide a
from_param method, no longer is it required that the object is a
ctypes type.
........
r47264 | thomas.heller | 2006-07-06 10:58:40 +0200 (Thu, 06 Jul 2006) | 2 lines
Document the Struture and Union constructors.
........
r47265 | thomas.heller | 2006-07-06 11:11:22 +0200 (Thu, 06 Jul 2006) | 2 lines
Document the changes in svn revision 47263, from patch #1517790.
........
r47267 | ronald.oussoren | 2006-07-06 12:13:35 +0200 (Thu, 06 Jul 2006) | 7 lines
This patch solves the problem Skip was seeing with zlib, this patch ensures that
configure uses similar compiler flags as setup.py when doing the zlib test.
Without this patch configure would use the first shared library on the linker
path, with this patch it uses the first shared or static library on that path
just like setup.py.
........
r47268 | thomas.wouters | 2006-07-06 12:48:28 +0200 (Thu, 06 Jul 2006) | 4 lines
NEWS entry for r47267: fixing configure's zlib probing.
........
r47269 | fredrik.lundh | 2006-07-06 14:29:24 +0200 (Thu, 06 Jul 2006) | 3 lines
added XMLParser alias for cElementTree compatibility
........
r47271 | nick.coghlan | 2006-07-06 14:53:04 +0200 (Thu, 06 Jul 2006) | 1 line
Revert the __module_name__ changes made in rev 47142. We'll revisit this in Python 2.6
........
r47272 | nick.coghlan | 2006-07-06 15:04:56 +0200 (Thu, 06 Jul 2006) | 1 line
Update the tutorial section on relative imports
........
r47273 | nick.coghlan | 2006-07-06 15:35:27 +0200 (Thu, 06 Jul 2006) | 1 line
Ignore ImportWarning by default
........
r47274 | nick.coghlan | 2006-07-06 15:41:34 +0200 (Thu, 06 Jul 2006) | 1 line
Cover ImportWarning, PendingDeprecationWarning and simplefilter() in the warnings module docs
........
r47275 | nick.coghlan | 2006-07-06 15:47:18 +0200 (Thu, 06 Jul 2006) | 1 line
Add NEWS entries for the ImportWarning change and documentation update
........
r47276 | andrew.kuchling | 2006-07-06 15:57:28 +0200 (Thu, 06 Jul 2006) | 1 line
ImportWarning is now silent by default
........
r47277 | thomas.heller | 2006-07-06 17:06:05 +0200 (Thu, 06 Jul 2006) | 2 lines
Document the correct return type of PyLong_AsUnsignedLongLongMask.
........
r47278 | hyeshik.chang | 2006-07-06 17:21:52 +0200 (Thu, 06 Jul 2006) | 2 lines
Add a testcase for r47086 which fixed a bug in codec_getstreamcodec().
........
r47279 | hyeshik.chang | 2006-07-06 17:39:24 +0200 (Thu, 06 Jul 2006) | 3 lines
Test using all CJK encodings for the testcases which don't require
specific encodings.
........
r47280 | martin.v.loewis | 2006-07-06 21:28:03 +0200 (Thu, 06 Jul 2006) | 2 lines
Properly generate logical file ids. Fixes #1515998.
Also correct typo in Control.mapping.
........
r47287 | neal.norwitz | 2006-07-07 08:03:15 +0200 (Fri, 07 Jul 2006) | 17 lines
Restore rev 47014:
The hppa ubuntu box sometimes hangs forever in these tests. My guess
is that the wait is failing for some reason. Use WNOHANG, so we won't
wait until the buildbot kills the test suite.
I haven't been able to reproduce the failure, so I'm not sure if
this will help or not. Hopefully, this change will cause the test
to fail, rather than hang. That will be better since we will get
the rest of the test results. It may also help us debug the real problem.
*** The reason this originally failed was because there were many
zombie children outstanding before rev 47158 cleaned them up.
There are still hangs in test_subprocess that need to be addressed,
but that will take more work. This should close some holes.
........
r47289 | georg.brandl | 2006-07-07 10:15:12 +0200 (Fri, 07 Jul 2006) | 3 lines
Fix RFC number.
........
r50489 | neal.norwitz | 2006-07-08 07:31:37 +0200 (Sat, 08 Jul 2006) | 1 line
Fix SF bug #1519018: 'as' is now validated properly in import statements
........
r50490 | georg.brandl | 2006-07-08 14:15:27 +0200 (Sat, 08 Jul 2006) | 3 lines
Add an additional test for bug #1519018.
........
r50491 | tim.peters | 2006-07-08 21:55:05 +0200 (Sat, 08 Jul 2006) | 2 lines
Whitespace normalization.
........
r50493 | neil.schemenauer | 2006-07-09 18:16:34 +0200 (Sun, 09 Jul 2006) | 2 lines
Fix AST compiler bug #1501934: incorrect LOAD/STORE_GLOBAL generation.
........
r50495 | neil.schemenauer | 2006-07-09 23:19:29 +0200 (Sun, 09 Jul 2006) | 2 lines
Fix SF bug 1441486: bad unary minus folding in compiler.
........
r50497 | neal.norwitz | 2006-07-10 00:14:42 +0200 (Mon, 10 Jul 2006) | 4 lines
On 64 bit systems, int literals that use less than 64 bits are now ints
rather than longs. This also fixes the test for eval(-sys.maxint - 1).
........
r50500 | neal.norwitz | 2006-07-10 02:04:44 +0200 (Mon, 10 Jul 2006) | 4 lines
Bug #1512814, Fix incorrect lineno's when code at module scope
started after line 256.
........
r50501 | neal.norwitz | 2006-07-10 02:05:34 +0200 (Mon, 10 Jul 2006) | 1 line
Fix doco. Backport candidate.
........
r50503 | neal.norwitz | 2006-07-10 02:23:17 +0200 (Mon, 10 Jul 2006) | 5 lines
Part of SF patch #1484695. This removes dead code. The chksum was
already verified in .frombuf() on the lines above. If there was
a problem an exception is raised, so there was no way this condition
could have been true.
........
r50504 | neal.norwitz | 2006-07-10 03:18:57 +0200 (Mon, 10 Jul 2006) | 3 lines
Patch #1516912: improve Modules support for OpenVMS.
........
r50506 | neal.norwitz | 2006-07-10 04:36:41 +0200 (Mon, 10 Jul 2006) | 7 lines
Patch #1504046: Add documentation for xml.etree.
/F wrote the text docs, Englebert Gruber massaged it to latex and I
did some more massaging to try and improve the consistency and
fix some name mismatches between the declaration and text.
........
r50509 | martin.v.loewis | 2006-07-10 09:23:48 +0200 (Mon, 10 Jul 2006) | 2 lines
Introduce DISTUTILS_USE_SDK as a flag to determine whether the
SDK environment should be used. Fixes #1508010.
........
r50510 | martin.v.loewis | 2006-07-10 09:26:41 +0200 (Mon, 10 Jul 2006) | 1 line
Change error message to indicate that VS2003 is necessary to build extension modules, not the .NET SDK.
........
r50511 | martin.v.loewis | 2006-07-10 09:29:41 +0200 (Mon, 10 Jul 2006) | 1 line
Add svn:ignore.
........
r50512 | anthony.baxter | 2006-07-10 09:41:04 +0200 (Mon, 10 Jul 2006) | 1 line
preparing for 2.5b2
........
r50513 | thomas.heller | 2006-07-10 11:10:28 +0200 (Mon, 10 Jul 2006) | 2 lines
Fix bug #1518190: accept any integer or long value in the
ctypes.c_void_p constructor.
........
r50514 | thomas.heller | 2006-07-10 11:31:06 +0200 (Mon, 10 Jul 2006) | 3 lines
Fixed a segfault when ctypes.wintypes were imported on
non-Windows machines.
........
r50516 | thomas.heller | 2006-07-10 13:11:10 +0200 (Mon, 10 Jul 2006) | 3 lines
Assigning None to pointer type structure fields possible overwrote
wrong fields.
........
r50517 | thomas.heller | 2006-07-10 13:17:37 +0200 (Mon, 10 Jul 2006) | 5 lines
Moved the ctypes news entries from the 'Library' section into the
'Extension Modules' section where they belong, probably.
This destroyes the original order of the news entries, don't know
if that is important or not.
........
r50526 | phillip.eby | 2006-07-10 21:03:29 +0200 (Mon, 10 Jul 2006) | 2 lines
Fix SF#1516184 and add a test to prevent regression.
........
r50528 | phillip.eby | 2006-07-10 21:18:35 +0200 (Mon, 10 Jul 2006) | 2 lines
Fix SF#1457312: bad socket error handling in distutils "upload" command.
........
r50537 | peter.astrand | 2006-07-10 22:39:49 +0200 (Mon, 10 Jul 2006) | 1 line
Make it possible to run test_subprocess.py with Python 2.2, which lacks test_support.reap_children().
........
r50541 | tim.peters | 2006-07-10 23:08:24 +0200 (Mon, 10 Jul 2006) | 5 lines
After approval from Anthony, merge the tim-current_frames
branch into the trunk. This adds a new sys._current_frames()
function, which returns a dict mapping thread id to topmost
thread stack frame.
........
r50542 | tim.peters | 2006-07-10 23:11:49 +0200 (Mon, 10 Jul 2006) | 2 lines
Whitespace normalization.
........
r50553 | martin.v.loewis | 2006-07-11 00:11:28 +0200 (Tue, 11 Jul 2006) | 4 lines
Patch #1519566: Remove unused _tofill member.
Make begin_fill idempotent.
Update demo2 to demonstrate filling of concave shapes.
........
r50567 | anthony.baxter | 2006-07-11 04:04:09 +0200 (Tue, 11 Jul 2006) | 4 lines
#1494314: Fix a regression with high-numbered sockets in 2.4.3. This
means that select() on sockets > FD_SETSIZE (typically 1024) work again.
The patch makes sockets use poll() internally where available.
........
r50568 | tim.peters | 2006-07-11 04:17:48 +0200 (Tue, 11 Jul 2006) | 2 lines
Whitespace normalization.
........
r50575 | thomas.heller | 2006-07-11 18:42:05 +0200 (Tue, 11 Jul 2006) | 1 line
Add missing Py_DECREF.
........
r50576 | thomas.heller | 2006-07-11 18:44:25 +0200 (Tue, 11 Jul 2006) | 1 line
Add missing Py_DECREFs.
........
r50579 | andrew.kuchling | 2006-07-11 19:20:16 +0200 (Tue, 11 Jul 2006) | 1 line
Bump version number; add sys._current_frames
........
r50582 | thomas.heller | 2006-07-11 20:28:35 +0200 (Tue, 11 Jul 2006) | 3 lines
When a foreign function is retrived by calling __getitem__ on a ctypes
library instance, do not set it as attribute.
........
r50583 | thomas.heller | 2006-07-11 20:40:50 +0200 (Tue, 11 Jul 2006) | 2 lines
Change the ctypes version number to 1.0.0.
........
r50597 | neal.norwitz | 2006-07-12 07:26:17 +0200 (Wed, 12 Jul 2006) | 3 lines
Bug #1520864: unpacking singleton tuples in for loop (for x, in) work again.
........
r50598 | neal.norwitz | 2006-07-12 07:26:35 +0200 (Wed, 12 Jul 2006) | 1 line
Fix function name in error msg
........
r50599 | neal.norwitz | 2006-07-12 07:27:46 +0200 (Wed, 12 Jul 2006) | 4 lines
Fix uninitialized memory read reported by Valgrind when running doctest.
This could happen if size == 0.
........
r50600 | neal.norwitz | 2006-07-12 09:28:29 +0200 (Wed, 12 Jul 2006) | 1 line
Actually change the MAGIC #. Create a new section for 2.5c1 and mention the impact of changing the MAGIC #.
........
r50601 | thomas.heller | 2006-07-12 10:43:47 +0200 (Wed, 12 Jul 2006) | 3 lines
Fix #1467450: ctypes now uses RTLD_GLOBAL by default on OSX 10.3 to
load shared libraries.
........
r50604 | thomas.heller | 2006-07-12 16:25:18 +0200 (Wed, 12 Jul 2006) | 3 lines
Fix the wrong description of LibraryLoader.LoadLibrary, and document
the DEFAULT_MODE constant.
........
r50607 | georg.brandl | 2006-07-12 17:31:17 +0200 (Wed, 12 Jul 2006) | 3 lines
Accept long options "--help" and "--version".
........
r50617 | thomas.heller | 2006-07-13 11:53:47 +0200 (Thu, 13 Jul 2006) | 3 lines
A misspelled preprocessor symbol caused ctypes to be always compiled
without thread support. Replaced WITH_THREADS with WITH_THREAD.
........
r50619 | thomas.heller | 2006-07-13 19:01:14 +0200 (Thu, 13 Jul 2006) | 3 lines
Fix #1521375. When running with root priviledges, 'gcc -o /dev/null'
did overwrite /dev/null. Use a temporary file instead of /dev/null.
........
r50620 | thomas.heller | 2006-07-13 19:05:13 +0200 (Thu, 13 Jul 2006) | 2 lines
Fix misleading words.
........
r50622 | andrew.kuchling | 2006-07-13 19:37:26 +0200 (Thu, 13 Jul 2006) | 1 line
Typo fix
........
r50629 | georg.brandl | 2006-07-14 09:12:54 +0200 (Fri, 14 Jul 2006) | 3 lines
Patch #1521874: grammar errors in doanddont.tex.
........
r50630 | neal.norwitz | 2006-07-14 09:20:04 +0200 (Fri, 14 Jul 2006) | 1 line
Try to improve grammar further.
........
r50631 | martin.v.loewis | 2006-07-14 11:58:55 +0200 (Fri, 14 Jul 2006) | 1 line
Extend build_ssl to Win64, using VSExtComp.
........
r50632 | martin.v.loewis | 2006-07-14 14:10:09 +0200 (Fri, 14 Jul 2006) | 1 line
Add debug output to analyse buildbot failure.
........
r50633 | martin.v.loewis | 2006-07-14 14:31:05 +0200 (Fri, 14 Jul 2006) | 1 line
Fix Debug build of _ssl.
........
r50636 | andrew.kuchling | 2006-07-14 15:32:38 +0200 (Fri, 14 Jul 2006) | 1 line
Mention new options
........
r50638 | peter.astrand | 2006-07-14 16:04:45 +0200 (Fri, 14 Jul 2006) | 1 line
Bug #1223937: CalledProcessError.errno -> CalledProcessError.returncode.
........
r50640 | thomas.heller | 2006-07-14 17:01:05 +0200 (Fri, 14 Jul 2006) | 4 lines
Make the prototypes of our private PyUnicode_FromWideChar and
PyUnicode_AsWideChar replacement functions compatible to the official
functions by using Py_ssize_t instead of int.
........
r50643 | thomas.heller | 2006-07-14 19:51:14 +0200 (Fri, 14 Jul 2006) | 3 lines
Patch #1521817: The index range checking on ctypes arrays containing
exactly one element is enabled again.
........
r50647 | thomas.heller | 2006-07-14 20:22:50 +0200 (Fri, 14 Jul 2006) | 2 lines
Updates for the ctypes documentation.
........
r50655 | fredrik.lundh | 2006-07-14 23:45:48 +0200 (Fri, 14 Jul 2006) | 3 lines
typo
........
r50664 | george.yoshida | 2006-07-15 18:03:49 +0200 (Sat, 15 Jul 2006) | 2 lines
Bug #15187702 : ext/win-cookbook.html has a broken link to distutils
........
r50667 | bob.ippolito | 2006-07-15 18:53:15 +0200 (Sat, 15 Jul 2006) | 1 line
Patch #1220874: Update the binhex module for Mach-O.
........
r50671 | fred.drake | 2006-07-16 03:21:20 +0200 (Sun, 16 Jul 2006) | 1 line
clean up some link markup
........
r50673 | neal.norwitz | 2006-07-16 03:50:38 +0200 (Sun, 16 Jul 2006) | 4 lines
Bug #1512814, Fix incorrect lineno's when code within a function
had more than 255 blank lines. Byte codes need to go first, line #s second.
........
r50674 | neal.norwitz | 2006-07-16 04:00:32 +0200 (Sun, 16 Jul 2006) | 5 lines
a & b were dereffed above, so they are known to be valid pointers.
z is known to be NULL, nothing to DECREF.
Reported by Klockwork, #107.
........
r50675 | neal.norwitz | 2006-07-16 04:02:57 +0200 (Sun, 16 Jul 2006) | 5 lines
self is dereffed (and passed as first arg), so it's known to be good.
func is returned from PyArg_ParseTuple and also dereffed.
Reported by Klocwork, #30 (self one at least).
........
r50676 | neal.norwitz | 2006-07-16 04:05:35 +0200 (Sun, 16 Jul 2006) | 4 lines
proto was dereffed above and is known to be good. No need for X.
Reported by Klocwork, #39.
........
r50677 | neal.norwitz | 2006-07-16 04:15:27 +0200 (Sun, 16 Jul 2006) | 5 lines
Fix memory leaks in some conditions.
Reported by Klocwork #152.
........
r50678 | neal.norwitz | 2006-07-16 04:17:36 +0200 (Sun, 16 Jul 2006) | 4 lines
Fix memory leak under some conditions.
Reported by Klocwork, #98.
........
r50679 | neal.norwitz | 2006-07-16 04:22:30 +0200 (Sun, 16 Jul 2006) | 8 lines
Use sizeof(buffer) instead of duplicating the constants to ensure they won't
be wrong.
The real change is to pass (bufsz - 1) to PyOS_ascii_formatd and 1
to strncat. strncat copies n+1 bytes from src (not dest).
Reported by Klocwork #58.
........
r50680 | neal.norwitz | 2006-07-16 04:32:03 +0200 (Sun, 16 Jul 2006) | 5 lines
Handle a NULL name properly.
Reported by Klocwork #67
........
r50681 | neal.norwitz | 2006-07-16 04:35:47 +0200 (Sun, 16 Jul 2006) | 6 lines
PyFunction_SetDefaults() is documented as taking None or a tuple.
A NULL would crash the PyTuple_Check(). Now make NULL return a SystemError.
Reported by Klocwork #73.
........
r50683 | neal.norwitz | 2006-07-17 02:55:45 +0200 (Mon, 17 Jul 2006) | 5 lines
Stop INCREFing name, then checking if it's NULL. name (f_name) should never
be NULL so assert it. Fix one place where we could have passed NULL.
Reported by Klocwork #66.
........
r50684 | neal.norwitz | 2006-07-17 02:57:15 +0200 (Mon, 17 Jul 2006) | 5 lines
otherset is known to be non-NULL based on checks before and DECREF after.
DECREF otherset rather than XDECREF in error conditions too.
Reported by Klockwork #154.
........
r50685 | neal.norwitz | 2006-07-17 02:59:04 +0200 (Mon, 17 Jul 2006) | 7 lines
Reported by Klocwork #151.
v2 can be NULL if exception2 is NULL. I don't think that condition can happen,
but I'm not sure it can't either. Now the code will protect against either
being NULL.
........
r50686 | neal.norwitz | 2006-07-17 03:00:16 +0200 (Mon, 17 Jul 2006) | 1 line
Add NEWS entry for a bunch of fixes due to warnings produced by Klocworks static analysis tool.
........
r50687 | fred.drake | 2006-07-17 07:47:52 +0200 (Mon, 17 Jul 2006) | 3 lines
document xmlcore (still minimal; needs mention in each of the xml.* modules)
SF bug #1504456 (partial)
........
r50688 | georg.brandl | 2006-07-17 15:23:46 +0200 (Mon, 17 Jul 2006) | 3 lines
Remove usage of sets module (patch #1500609).
........
r50689 | georg.brandl | 2006-07-17 15:26:33 +0200 (Mon, 17 Jul 2006) | 3 lines
Add missing NEWS item (#1522771)
........
r50690 | andrew.kuchling | 2006-07-17 18:47:54 +0200 (Mon, 17 Jul 2006) | 1 line
Attribute more features
........
r50692 | kurt.kaiser | 2006-07-17 23:59:27 +0200 (Mon, 17 Jul 2006) | 8 lines
Patch 1479219 - Tal Einat
1. 'as' highlighted as builtin in comment string on import line
2. Comments such as "#False identity" which start with a keyword immediately
after the '#' character aren't colored as comments.
3. u or U beginning unicode string not correctly highlighted
Closes bug 1325071
........
r50693 | barry.warsaw | 2006-07-18 01:07:51 +0200 (Tue, 18 Jul 2006) | 16 lines
decode_rfc2231(): Be more robust against buggy RFC 2231 encodings.
Specifically, instead of raising a ValueError when there is a single tick in
the parameter, simply return that the entire string unquoted, with None for
both the charset and the language. Also, if there are more than 2 ticks in
the parameter, interpret the first three parts as the standard RFC 2231 parts,
then the rest of the parts as the encoded string.
Test cases added.
Original fewer-than-3-parts fix by Tokio Kikuchi.
Resolves SF bug # 1218081. I will back port the fix and tests to Python 2.4
(email 3.0) and Python 2.3 (email 2.5).
Also, bump the version number to email 4.0.1, removing the 'alpha' moniker.
........
r50695 | kurt.kaiser | 2006-07-18 06:03:16 +0200 (Tue, 18 Jul 2006) | 2 lines
Rebinding Tab key was inserting 'tab' instead of 'Tab'. Bug 1179168.
........
r50696 | brett.cannon | 2006-07-18 06:41:36 +0200 (Tue, 18 Jul 2006) | 6 lines
Fix bug #1520914. Starting in 2.4, time.strftime() began to check the bounds
of values in the time tuple passed in. Unfortunately people came to rely on
undocumented behaviour of setting unneeded values to 0, regardless of if it was
within the valid range. Now those values force the value internally to the
minimum value when 0 is passed in.
........
r50697 | facundo.batista | 2006-07-18 14:16:13 +0200 (Tue, 18 Jul 2006) | 1 line
Comments and docs cleanups, and some little fixes, provided by Santiágo Peresón
........
r50704 | martin.v.loewis | 2006-07-18 19:46:31 +0200 (Tue, 18 Jul 2006) | 2 lines
Patch #1524429: Use repr instead of backticks again.
........
r50706 | tim.peters | 2006-07-18 23:55:15 +0200 (Tue, 18 Jul 2006) | 2 lines
Whitespace normalization.
........
r50708 | tim.peters | 2006-07-19 02:03:19 +0200 (Wed, 19 Jul 2006) | 18 lines
SF bug 1524317: configure --without-threads fails to build
Moved the code for _PyThread_CurrentFrames() up, so it's no longer
in a huge "#ifdef WITH_THREAD" block (I didn't realize it /was/ in
one).
Changed test_sys's test_current_frames() so it passes with or without
thread supported compiled in.
Note that test_sys fails when Python is compiled without threads,
but for an unrelated reason (the old test_exit() fails with an
indirect ImportError on the `thread` module). There are also
other unrelated compilation failures without threads, in extension
modules (like ctypes); at least the core compiles again.
Do we really support --without-threads? If so, there are several
problems remaining.
........
r50713 | thomas.heller | 2006-07-19 11:09:32 +0200 (Wed, 19 Jul 2006) | 4 lines
Make sure the _ctypes extension can be compiled when WITH_THREAD is
not defined on Windows, even if that configuration is probably not
supported at all.
........
r50715 | martin.v.loewis | 2006-07-19 19:18:32 +0200 (Wed, 19 Jul 2006) | 4 lines
Revert r50706 (Whitespace normalization) and
r50697: Comments and docs cleanups, and some little fixes
per recommendation from Raymond Hettinger.
........
r50719 | phillip.eby | 2006-07-20 17:54:16 +0200 (Thu, 20 Jul 2006) | 4 lines
Fix SF#1516184 (again) and add a test to prevent regression.
(There was a problem with empty filenames still causing recursion)
........
r50720 | georg.brandl | 2006-07-20 18:28:39 +0200 (Thu, 20 Jul 2006) | 3 lines
Guard for _active being None in __del__ method.
........
r50721 | vinay.sajip | 2006-07-20 18:28:39 +0200 (Thu, 20 Jul 2006) | 1 line
Updated documentation for TimedRotatingFileHandler relating to how rollover files are named. The previous documentation was wrongly the same as for RotatingFileHandler.
........
r50731 | fred.drake | 2006-07-20 22:11:57 +0200 (Thu, 20 Jul 2006) | 1 line
markup fix
........
r50739 | kurt.kaiser | 2006-07-21 00:22:52 +0200 (Fri, 21 Jul 2006) | 7 lines
Avoid occasional failure to detect closing paren properly.
Patch 1407280 Tal Einat
M ParenMatch.py
M NEWS.txt
M CREDITS.txt
........
r50740 | vinay.sajip | 2006-07-21 01:20:12 +0200 (Fri, 21 Jul 2006) | 1 line
Addressed SF#1524081 by using a dictionary to map level names to syslog priority names, rather than a string.lower().
........
r50741 | neal.norwitz | 2006-07-21 07:29:58 +0200 (Fri, 21 Jul 2006) | 1 line
Add some asserts that we got good params passed
........
r50742 | neal.norwitz | 2006-07-21 07:31:02 +0200 (Fri, 21 Jul 2006) | 5 lines
Move the initialization of some pointers earlier. The problem is
that if we call Py_DECREF(frame) like we do if allocating locals fails,
frame_dealloc() will try to use these bogus values and crash.
........
r50743 | neal.norwitz | 2006-07-21 07:32:28 +0200 (Fri, 21 Jul 2006) | 4 lines
Handle allocation failures gracefully. Found with failmalloc.
Many (all?) of these could be backported.
........
r50745 | neal.norwitz | 2006-07-21 09:59:02 +0200 (Fri, 21 Jul 2006) | 1 line
Speel initialise write. Tanks Anthony.
........
r50746 | neal.norwitz | 2006-07-21 09:59:47 +0200 (Fri, 21 Jul 2006) | 2 lines
Handle more memory allocation failures without crashing.
........
r50754 | barry.warsaw | 2006-07-21 16:51:07 +0200 (Fri, 21 Jul 2006) | 23 lines
More RFC 2231 improvements for the email 4.0 package. As Mark Sapiro rightly
points out there are really two types of continued headers defined in this
RFC (i.e. "encoded" parameters with the form "name*0*=" and unencoded
parameters with the form "name*0="), but we were were handling them both the
same way and that isn't correct.
This patch should be much more RFC compliant in that only encoded params are
%-decoded and the charset/language information is only extract if there are
any encoded params in the segments. If there are no encoded params then the
RFC says that there will be no charset/language parts.
Note however that this will change the return value for Message.get_param() in
some cases. For example, whereas before if you had all unencoded param
continuations you would have still gotten a 3-tuple back from this method
(with charset and language == None), you will now get just a string. I don't
believe this is a backward incompatible change though because the
documentation for this method already indicates that either return value is
possible and that you must do an isinstance(val, tuple) check to discriminate
between the two. (Yeah that API kind of sucks but we can't change /that/
without breaking code.)
Test cases, some documentation updates, and a NEWS item accompany this patch.
........
r50759 | georg.brandl | 2006-07-21 19:36:31 +0200 (Fri, 21 Jul 2006) | 3 lines
Fix check for empty list (vs. None).
........
r50771 | brett.cannon | 2006-07-22 00:44:07 +0200 (Sat, 22 Jul 2006) | 2 lines
Remove an XXX marker in a comment.
........
r50773 | neal.norwitz | 2006-07-22 18:20:49 +0200 (Sat, 22 Jul 2006) | 1 line
Fix more memory allocation issues found with failmalloc.
........
r50774 | neal.norwitz | 2006-07-22 19:00:57 +0200 (Sat, 22 Jul 2006) | 1 line
Don't fail if the directory already exists
........
r50775 | greg.ward | 2006-07-23 04:25:53 +0200 (Sun, 23 Jul 2006) | 6 lines
Be a lot smarter about whether this test passes: instead of assuming
that a 2.93 sec audio file will always take 3.1 sec (as it did on the
hardware I had when I first wrote the test), expect that it will take
2.93 sec +/- 10%, and only fail if it's outside of that range.
Compute the expected
........
r50776 | kurt.kaiser | 2006-07-23 06:19:49 +0200 (Sun, 23 Jul 2006) | 2 lines
Tooltips failed on new-syle class __init__ args. Bug 1027566 Loren Guthrie
........
r50777 | neal.norwitz | 2006-07-23 09:50:36 +0200 (Sun, 23 Jul 2006) | 1 line
Handle more mem alloc issues found with failmalloc
........
r50778 | neal.norwitz | 2006-07-23 09:51:58 +0200 (Sun, 23 Jul 2006) | 5 lines
If the for loop isn't entered, entryblock will be NULL. If passed
to stackdepth_walk it will be dereffed.
Not sure if I found with failmalloc or Klockwork #55.
........
r50779 | neal.norwitz | 2006-07-23 09:53:14 +0200 (Sun, 23 Jul 2006) | 4 lines
Move the initialization of size_a down below the check for a being NULL.
Reported by Klocwork #106
........
r50780 | neal.norwitz | 2006-07-23 09:55:55 +0200 (Sun, 23 Jul 2006) | 9 lines
Check the allocation of b_objects and return if there was a failure.
Also fix a few memory leaks in other failure scenarios.
It seems that if b_objects == Py_None, we will have an extra ref to
b_objects. Add XXX comment so hopefully someone documents why the
else isn't necessary or adds it in.
Reported by Klocwork #20
........
r50781 | neal.norwitz | 2006-07-23 09:57:11 +0200 (Sun, 23 Jul 2006) | 2 lines
Fix memory leaks spotted by Klocwork #37.
........
r50782 | neal.norwitz | 2006-07-23 09:59:00 +0200 (Sun, 23 Jul 2006) | 5 lines
nextlink can be NULL if teedataobject_new fails, so use XINCREF.
Ensure that dataobj is never NULL.
Reported by Klocwork #102
........
r50783 | neal.norwitz | 2006-07-23 10:01:43 +0200 (Sun, 23 Jul 2006) | 8 lines
Ensure we don't write beyond errText. I think I got this right, but
it definitely could use some review to ensure I'm not off by one
and there's no possible overflow/wrap-around of bytes_left.
Reported by Klocwork #1.
Fix a problem if there is a failure allocating self->db.
Found with failmalloc.
........
r50784 | ronald.oussoren | 2006-07-23 11:41:09 +0200 (Sun, 23 Jul 2006) | 3 lines
Without this patch CMD-W won't close EditorWindows on MacOS X. This solves
part of bug #1517990.
........
r50785 | ronald.oussoren | 2006-07-23 11:46:11 +0200 (Sun, 23 Jul 2006) | 5 lines
Fix for bug #1517996: Class and Path browsers show Tk menu
This patch replaces the menubar that is used by AquaTk for windows without a
menubar of their own by one that is more appropriate for IDLE.
........
r50786 | andrew.macintyre | 2006-07-23 14:57:02 +0200 (Sun, 23 Jul 2006) | 2 lines
Build updates for OS/2 EMX port
........
r50787 | andrew.macintyre | 2006-07-23 15:00:04 +0200 (Sun, 23 Jul 2006) | 3 lines
bugfix: PyThread_start_new_thread() returns the thread ID, not a flag;
will backport.
........
r50789 | andrew.macintyre | 2006-07-23 15:04:00 +0200 (Sun, 23 Jul 2006) | 2 lines
Get mailbox module working on OS/2 EMX port.
........
r50791 | greg.ward | 2006-07-23 18:05:51 +0200 (Sun, 23 Jul 2006) | 1 line
Resync optparse with Optik 1.5.3: minor tweaks for/to tests.
........
r50794 | martin.v.loewis | 2006-07-24 07:05:22 +0200 (Mon, 24 Jul 2006) | 2 lines
Update list of unsupported systems. Fixes #1510853.
........
r50795 | martin.v.loewis | 2006-07-24 12:26:33 +0200 (Mon, 24 Jul 2006) | 1 line
Patch #1448199: Release GIL around ConnectRegistry.
........
r50796 | martin.v.loewis | 2006-07-24 13:54:53 +0200 (Mon, 24 Jul 2006) | 3 lines
Patch #1232023: Don't include empty path component from registry,
so that the current directory does not get added to sys.path.
Also fixes #1526785.
........
r50797 | martin.v.loewis | 2006-07-24 14:54:17 +0200 (Mon, 24 Jul 2006) | 3 lines
Bug #1524310: Properly report errors from FindNextFile in os.listdir.
Will backport to 2.4.
........
r50800 | georg.brandl | 2006-07-24 15:28:57 +0200 (Mon, 24 Jul 2006) | 7 lines
Patch #1523356: fix determining include dirs in python-config.
Also don't install "python-config" when doing altinstall, but
always install "python-config2.x" and make a link to it like
with the main executable.
........
r50802 | georg.brandl | 2006-07-24 15:46:47 +0200 (Mon, 24 Jul 2006) | 3 lines
Patch #1527744: right order of includes in order to have HAVE_CONIO_H defined properly.
........
r50803 | georg.brandl | 2006-07-24 16:09:56 +0200 (Mon, 24 Jul 2006) | 3 lines
Patch #1515343: Fix printing of deprecated string exceptions with a
value in the traceback module.
........
r50804 | kurt.kaiser | 2006-07-24 19:13:23 +0200 (Mon, 24 Jul 2006) | 7 lines
EditorWindow failed when used stand-alone if sys.ps1 not set.
Bug 1010370 Dave Florek
M EditorWindow.py
M PyShell.py
M NEWS.txt
........
r50805 | kurt.kaiser | 2006-07-24 20:05:51 +0200 (Mon, 24 Jul 2006) | 6 lines
- EditorWindow.test() was failing. Bug 1417598
M EditorWindow.py
M ScriptBinding.py
M NEWS.txt
........
r50808 | georg.brandl | 2006-07-24 22:11:35 +0200 (Mon, 24 Jul 2006) | 3 lines
Repair accidental NameError.
........
r50809 | tim.peters | 2006-07-24 23:02:15 +0200 (Mon, 24 Jul 2006) | 2 lines
Whitespace normalization.
........
r50810 | greg.ward | 2006-07-25 04:11:12 +0200 (Tue, 25 Jul 2006) | 3 lines
Don't use standard assert: want tests to fail even when run with -O.
Delete cruft.
........
r50811 | tim.peters | 2006-07-25 06:07:22 +0200 (Tue, 25 Jul 2006) | 10 lines
current_frames_with_threads(): There's actually no way
to guess /which/ line the spawned thread is in at the time
sys._current_frames() is called: we know it finished
enter_g.set(), but can't know whether the instruction
counter has advanced to the following leave_g.wait().
The latter is overwhelming most likely, but not guaranteed,
and I see that the "x86 Ubuntu dapper (icc) trunk" buildbot
found it on the other line once. Changed the test so it
passes in either case.
........
r50815 | martin.v.loewis | 2006-07-25 11:53:12 +0200 (Tue, 25 Jul 2006) | 2 lines
Bug #1525817: Don't truncate short lines in IDLE's tool tips.
........
r50816 | martin.v.loewis | 2006-07-25 12:05:47 +0200 (Tue, 25 Jul 2006) | 3 lines
Bug #978833: Really close underlying socket in _socketobject.close.
Will backport to 2.4.
........
r50817 | martin.v.loewis | 2006-07-25 12:11:14 +0200 (Tue, 25 Jul 2006) | 1 line
Revert incomplete checkin.
........
r50819 | georg.brandl | 2006-07-25 12:22:34 +0200 (Tue, 25 Jul 2006) | 4 lines
Patch #1525766: correctly pass onerror arg to recursive calls
of pkg.walk_packages. Also improve the docstrings.
........
r50825 | brett.cannon | 2006-07-25 19:32:20 +0200 (Tue, 25 Jul 2006) | 2 lines
Add comment for changes to test_ossaudiodev.
........
r50826 | brett.cannon | 2006-07-25 19:34:36 +0200 (Tue, 25 Jul 2006) | 3 lines
Fix a bug in the messages for an assert failure where not enough arguments to a string
were being converted in the format.
........
r50828 | armin.rigo | 2006-07-25 20:09:57 +0200 (Tue, 25 Jul 2006) | 2 lines
Document why is and is not a good way to fix the gc_inspection crasher.
........
r50829 | armin.rigo | 2006-07-25 20:11:07 +0200 (Tue, 25 Jul 2006) | 5 lines
Added another crasher, which hit me today (I was not intentionally
writing such code, of course, but it took some gdb time to figure out
what my bug was).
........
r50830 | armin.rigo | 2006-07-25 20:38:39 +0200 (Tue, 25 Jul 2006) | 3 lines
Document the crashers that will not go away soon as "won't fix",
and explain why.
........
r50831 | ronald.oussoren | 2006-07-25 21:13:35 +0200 (Tue, 25 Jul 2006) | 3 lines
Install the compatibility symlink to libpython.a on OSX using 'ln -sf' instead
of 'ln -s', this avoid problems when reinstalling python.
........
r50832 | ronald.oussoren | 2006-07-25 21:20:54 +0200 (Tue, 25 Jul 2006) | 7 lines
Fix for bug #1525447 (renaming to MacOSmodule.c would also work, but not
without causing problems for anyone that is on a case-insensitive filesystem).
Setup.py tries to compile the MacOS extension from MacOSmodule.c, while the
actual file is named macosmodule.c. This is no problem on the (default)
case-insensitive filesystem, but doesn't work on case-sensitive filesystems.
........
r50833 | ronald.oussoren | 2006-07-25 22:28:55 +0200 (Tue, 25 Jul 2006) | 7 lines
Fix bug #1517990: IDLE keybindings on OSX
This adds a new key definition for OSX, which is slightly different from the
classic mac definition.
Also add NEWS item for a couple of bugfixes I added recently.
........
r50834 | tim.peters | 2006-07-26 00:30:24 +0200 (Wed, 26 Jul 2006) | 2 lines
Whitespace normalization.
........
r50839 | neal.norwitz | 2006-07-26 06:00:18 +0200 (Wed, 26 Jul 2006) | 1 line
Hmm, only python2.x is installed, not plain python. Did that change recently?
........
r50840 | barry.warsaw | 2006-07-26 07:54:46 +0200 (Wed, 26 Jul 2006) | 6 lines
Forward port some fixes that were in email 2.5 but for some reason didn't make
it into email 4.0. Specifically, in Message.get_content_charset(), handle RFC
2231 headers that contain an encoding not known to Python, or a character in
the data that isn't in the charset encoding. Also forward port the
appropriate unit tests.
........
r50841 | georg.brandl | 2006-07-26 09:23:32 +0200 (Wed, 26 Jul 2006) | 3 lines
NEWS entry for #1525766.
........
r50842 | georg.brandl | 2006-07-26 09:40:17 +0200 (Wed, 26 Jul 2006) | 3 lines
Bug #1459963: properly capitalize HTTP header names.
........
r50843 | georg.brandl | 2006-07-26 10:03:10 +0200 (Wed, 26 Jul 2006) | 6 lines
Part of bug #1523610: fix miscalculation of buffer length.
Also add a guard against NULL in converttuple and add a test case
(that previously would have crashed).
........
r50844 | martin.v.loewis | 2006-07-26 14:12:56 +0200 (Wed, 26 Jul 2006) | 3 lines
Bug #978833: Really close underlying socket in _socketobject.close.
Fix httplib.HTTPConnection.getresponse to not close the
socket if it is still needed for the response.
........
r50845 | andrew.kuchling | 2006-07-26 19:16:52 +0200 (Wed, 26 Jul 2006) | 1 line
[Bug #1471938] Fix build problem on Solaris 8 by conditionalizing the use of mvwgetnstr(); it was conditionalized a few lines below. Fix from Paul Eggert. I also tried out the STRICT_SYSV_CURSES case and am therefore removing the 'untested' comment.
........
r50846 | andrew.kuchling | 2006-07-26 19:18:01 +0200 (Wed, 26 Jul 2006) | 1 line
Correct error message
........
r50847 | andrew.kuchling | 2006-07-26 19:19:39 +0200 (Wed, 26 Jul 2006) | 1 line
Minor grammar fix
........
r50848 | andrew.kuchling | 2006-07-26 19:22:21 +0200 (Wed, 26 Jul 2006) | 1 line
Put news item in right section
........
r50850 | andrew.kuchling | 2006-07-26 20:03:12 +0200 (Wed, 26 Jul 2006) | 1 line
Use sys.exc_info()
........
r50851 | andrew.kuchling | 2006-07-26 20:15:45 +0200 (Wed, 26 Jul 2006) | 1 line
Use sys.exc_info()
........
r50852 | phillip.eby | 2006-07-26 21:48:27 +0200 (Wed, 26 Jul 2006) | 4 lines
Allow the 'onerror' argument to walk_packages() to catch any Exception, not
just ImportError. This allows documentation tools to better skip unimportable
packages.
........
r50854 | tim.peters | 2006-07-27 01:23:15 +0200 (Thu, 27 Jul 2006) | 2 lines
Whitespace normalization.
........
r50855 | tim.peters | 2006-07-27 03:14:53 +0200 (Thu, 27 Jul 2006) | 21 lines
Bug #1521947: possible bug in mystrtol.c with recent gcc.
In general, C doesn't define anything about what happens when
an operation on a signed integral type overflows, and PyOS_strtol()
did several formally undefined things of that nature on signed
longs. Some version of gcc apparently tries to exploit that now,
and PyOS_strtol() could fail to detect overflow then.
Tried to repair all that, although it seems at least as likely to me
that we'll get screwed by bad platform definitions for LONG_MIN
and/or LONG_MAX now. For that reason, I don't recommend backporting
this.
Note that I have no box on which this makes a lick of difference --
can't really test it, except to note that it didn't break anything
on my boxes.
Silent change: PyOS_strtol() used to return the hard-coded 0x7fffffff
in case of overflow. Now it returns LONG_MAX. They're the same only on
32-bit boxes (although C doesn't guarantee that either ...).
........
r50856 | neal.norwitz | 2006-07-27 05:51:58 +0200 (Thu, 27 Jul 2006) | 6 lines
Don't kill a normal instance of python running on windows when checking
to kill a cygwin instance. build\\python.exe was matching a normal windows
instance. Prefix that with a \\ to ensure build is a directory and not
PCbuild. As discussed on python-dev.
........
r50857 | neal.norwitz | 2006-07-27 05:55:39 +0200 (Thu, 27 Jul 2006) | 5 lines
Closure can't be NULL at this point since we know it's a tuple.
Reported by Klocwork # 74.
........
r50858 | neal.norwitz | 2006-07-27 06:04:50 +0200 (Thu, 27 Jul 2006) | 1 line
No functional change. Add comment and assert to describe why there cannot be overflow which was reported by Klocwork. Discussed on python-dev
........
r50859 | martin.v.loewis | 2006-07-27 08:38:16 +0200 (Thu, 27 Jul 2006) | 3 lines
Bump distutils version to 2.5, as several new features
have been introduced since 2.4.
........
r50860 | andrew.kuchling | 2006-07-27 14:18:20 +0200 (Thu, 27 Jul 2006) | 1 line
Reformat docstring; fix typo
........
r50861 | georg.brandl | 2006-07-27 17:05:36 +0200 (Thu, 27 Jul 2006) | 6 lines
Add test_main() methods. These three tests were never run
by regrtest.py.
We really need a simpler testing framework.
........
r50862 | tim.peters | 2006-07-27 17:09:20 +0200 (Thu, 27 Jul 2006) | 2 lines
News for patch #1529686.
........
r50863 | tim.peters | 2006-07-27 17:11:00 +0200 (Thu, 27 Jul 2006) | 2 lines
Whitespace normalization.
........
r50864 | georg.brandl | 2006-07-27 17:38:33 +0200 (Thu, 27 Jul 2006) | 3 lines
Amend news entry.
........
r50865 | georg.brandl | 2006-07-27 18:08:15 +0200 (Thu, 27 Jul 2006) | 3 lines
Make uuid test suite pass on this box by requesting output with LC_ALL=C.
........
r50866 | andrew.kuchling | 2006-07-27 20:37:33 +0200 (Thu, 27 Jul 2006) | 1 line
Add example
........
r50867 | thomas.heller | 2006-07-27 20:39:55 +0200 (Thu, 27 Jul 2006) | 9 lines
Remove code that is no longer used (ctypes.com).
Fix the DllGetClassObject and DllCanUnloadNow so that they forward the
call to the comtypes.server.inprocserver module.
The latter was never documented, never used by published code, and
didn't work anyway, so I think it does not deserve a NEWS entry (but I
might be wrong).
........
r50868 | andrew.kuchling | 2006-07-27 20:41:21 +0200 (Thu, 27 Jul 2006) | 1 line
Typo fix ('publically' is rare, poss. non-standard)
........
r50869 | andrew.kuchling | 2006-07-27 20:42:41 +0200 (Thu, 27 Jul 2006) | 1 line
Add missing word
........
r50870 | andrew.kuchling | 2006-07-27 20:44:10 +0200 (Thu, 27 Jul 2006) | 1 line
Repair typos
........
r50872 | andrew.kuchling | 2006-07-27 20:53:33 +0200 (Thu, 27 Jul 2006) | 1 line
Update URL; add example
........
r50873 | andrew.kuchling | 2006-07-27 21:07:29 +0200 (Thu, 27 Jul 2006) | 1 line
Add punctuation mark; add some examples
........
r50874 | andrew.kuchling | 2006-07-27 21:11:07 +0200 (Thu, 27 Jul 2006) | 1 line
Mention base64 module; rewrite last sentence to be more positive
........
r50875 | andrew.kuchling | 2006-07-27 21:12:49 +0200 (Thu, 27 Jul 2006) | 1 line
If binhex is higher-level than binascii, it should come first in the chapter
........
r50876 | tim.peters | 2006-07-27 22:47:24 +0200 (Thu, 27 Jul 2006) | 28 lines
check_node(): stop spraying mystery output to stderr.
When a node number disagrees, keep track of all sources & the
node numbers they reported, and stick all that in the error message.
Changed all callers to supply a non-empty "source" argument; made
the "source" argument non-optional.
On my box, test_uuid still fails, but with the less confusing output:
AssertionError: different sources disagree on node:
from source 'getnode1', node was 00038a000015
from source 'getnode2', node was 00038a000015
from source 'ipconfig', node was 001111b2b7bf
Only the last one appears to be correct; e.g.,
C:\Code\python\PCbuild>getmac
Physical Address Transport Name
=================== ==========================================================
00-11-11-B2-B7-BF \Device\Tcpip_{190FB163-5AFD-4483-86A1-2FE16AC61FF1}
62-A1-AC-6C-FD-BE \Device\Tcpip_{8F77DF5A-EA3D-4F1D-975E-D472CEE6438A}
E2-1F-01-C6-5D-88 \Device\Tcpip_{CD18F76B-2EF3-409F-9B8A-6481EE70A1E4}
I can't find anything on my box with MAC 00-03-8a-00-00-15, and am
not clear on where that comes from.
........
r50878 | andrew.kuchling | 2006-07-28 00:40:05 +0200 (Fri, 28 Jul 2006) | 1 line
Reword paragraph
........
r50879 | andrew.kuchling | 2006-07-28 00:49:38 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50880 | andrew.kuchling | 2006-07-28 00:49:54 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50881 | barry.warsaw | 2006-07-28 01:43:15 +0200 (Fri, 28 Jul 2006) | 27 lines
Patch #1520294: Support for getset and member descriptors in types.py,
inspect.py, and pydoc.py. Specifically, this allows for querying the type of
an object against these built-in C types and more importantly, for getting
their docstrings printed in the interactive interpreter's help() function.
This patch includes a new built-in module called _types which provides
definitions of getset and member descriptors for use by the types.py module.
These types are exposed as types.GetSetDescriptorType and
types.MemberDescriptorType. Query functions are provided as
inspect.isgetsetdescriptor() and inspect.ismemberdescriptor(). The
implementations of these are robust enough to work with Python implementations
other than CPython, which may not have these fundamental types.
The patch also includes documentation and test suite updates.
I commit these changes now under these guiding principles:
1. Silence is assent. The release manager has not said "no", and of the few
people that cared enough to respond to the thread, the worst vote was "0".
2. It's easier to ask for forgiveness than permission.
3. It's so dang easy to revert stuff in svn, that you could view this as a
forcing function. :)
Windows build patches will follow.
........
r50882 | tim.peters | 2006-07-28 01:44:37 +0200 (Fri, 28 Jul 2006) | 4 lines
Bug #1529297: The rewrite of doctest for Python 2.4 unintentionally
lost that tests are sorted by name before being run. ``DocTestFinder``
has been changed to sort the list of tests it returns.
........
r50883 | tim.peters | 2006-07-28 01:45:48 +0200 (Fri, 28 Jul 2006) | 2 lines
Whitespace normalization.
........
r50884 | tim.peters | 2006-07-28 01:46:36 +0200 (Fri, 28 Jul 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r50885 | barry.warsaw | 2006-07-28 01:50:40 +0200 (Fri, 28 Jul 2006) | 4 lines
Enable the building of the _types module on Windows.
Note that this has only been tested for VS 2003 since that's all I have.
........
r50887 | tim.peters | 2006-07-28 02:23:15 +0200 (Fri, 28 Jul 2006) | 7 lines
defdict_reduce(): Plug leaks.
We didn't notice these before because test_defaultdict didn't
actually do anything before Georg fixed that earlier today.
Neal's next refleak run then showed test_defaultdict leaking
9 references on each run. That's repaired by this checkin.
........
r50888 | tim.peters | 2006-07-28 02:30:00 +0200 (Fri, 28 Jul 2006) | 2 lines
News about the repaired memory leak in defaultdict.
........
r50889 | gregory.p.smith | 2006-07-28 03:35:25 +0200 (Fri, 28 Jul 2006) | 7 lines
- pybsddb Bug #1527939: bsddb module DBEnv dbremove and dbrename
methods now allow their database parameter to be None as the
sleepycat API allows.
Also adds an appropriate test case for DBEnv.dbrename and dbremove.
........
r50895 | neal.norwitz | 2006-07-28 06:22:34 +0200 (Fri, 28 Jul 2006) | 1 line
Ensure the actual number matches the expected count
........
r50896 | tim.peters | 2006-07-28 06:51:59 +0200 (Fri, 28 Jul 2006) | 6 lines
Live with that "the hardware address" is an ill-defined
concept, and that different ways of trying to find "the
hardware address" may return different results. Certainly
true on both of my Windows boxes, and in different ways
(see whining on python-dev).
........
r50897 | neal.norwitz | 2006-07-28 09:21:27 +0200 (Fri, 28 Jul 2006) | 3 lines
Try to find the MAC addr on various flavours of Unix. This seems hopeless.
The reduces the test_uuid failures, but there's still another method failing.
........
r50898 | martin.v.loewis | 2006-07-28 09:45:49 +0200 (Fri, 28 Jul 2006) | 2 lines
Add UUID for upcoming 2.5b3.
........
r50899 | matt.fleming | 2006-07-28 13:27:27 +0200 (Fri, 28 Jul 2006) | 3 lines
Allow socketmodule to compile on NetBSD -current, whose bluetooth API
differs from both Linux and FreeBSD. Accepted by Neal Norwitz.
........
r50900 | andrew.kuchling | 2006-07-28 14:07:12 +0200 (Fri, 28 Jul 2006) | 1 line
[Patch #1529811] Correction to description of r|* mode
........
r50901 | andrew.kuchling | 2006-07-28 14:18:22 +0200 (Fri, 28 Jul 2006) | 1 line
Typo fix
........
r50902 | andrew.kuchling | 2006-07-28 14:32:43 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50903 | andrew.kuchling | 2006-07-28 14:33:19 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50904 | andrew.kuchling | 2006-07-28 14:45:55 +0200 (Fri, 28 Jul 2006) | 1 line
Don't overwrite built-in name; add some blank lines for readability
........
r50905 | andrew.kuchling | 2006-07-28 14:48:07 +0200 (Fri, 28 Jul 2006) | 1 line
Add example. Should I propagate this example to all the other DBM-ish modules, too?
........
r50912 | georg.brandl | 2006-07-28 20:31:39 +0200 (Fri, 28 Jul 2006) | 3 lines
Patch #1529686: also run test_email_codecs with regrtest.py.
........
r50913 | georg.brandl | 2006-07-28 20:36:01 +0200 (Fri, 28 Jul 2006) | 3 lines
Fix spelling.
........
r50915 | thomas.heller | 2006-07-28 21:42:40 +0200 (Fri, 28 Jul 2006) | 3 lines
Remove a useless XXX comment.
Cosmetic changes to the code so that the #ifdef _UNICODE block
doesn't mess emacs code formatting.
........
r50916 | phillip.eby | 2006-07-28 23:12:07 +0200 (Fri, 28 Jul 2006) | 5 lines
Bug #1529871: The speed enhancement patch #921466 broke Python's compliance
with PEP 302. This was fixed by adding an ``imp.NullImporter`` type that is
used in ``sys.path_importer_cache`` to cache non-directory paths and avoid
excessive filesystem operations during imports.
........
r50917 | phillip.eby | 2006-07-28 23:31:54 +0200 (Fri, 28 Jul 2006) | 2 lines
Fix svn merge spew.
........
r50918 | thomas.heller | 2006-07-28 23:43:20 +0200 (Fri, 28 Jul 2006) | 4 lines
Patch #1529514: More openbsd platforms for ctypes.
Regenerated Modules/_ctypes/libffi/configure with autoconf 2.59.
Approved by Neal.
........
r50922 | georg.brandl | 2006-07-29 10:51:21 +0200 (Sat, 29 Jul 2006) | 2 lines
Bug #835255: The "closure" argument to new.function() is now documented.
........
r50924 | georg.brandl | 2006-07-29 11:33:26 +0200 (Sat, 29 Jul 2006) | 3 lines
Bug #1441397: The compiler module now recognizes module and function
docstrings correctly as it did in Python 2.4.
........
r50925 | georg.brandl | 2006-07-29 12:25:46 +0200 (Sat, 29 Jul 2006) | 4 lines
Revert rev 42617, it was introduced to work around bug #1441397.
test_compiler now passes again.
........
r50926 | fred.drake | 2006-07-29 15:22:49 +0200 (Sat, 29 Jul 2006) | 1 line
update target version number
........
r50927 | andrew.kuchling | 2006-07-29 15:56:48 +0200 (Sat, 29 Jul 2006) | 1 line
Add example
........
r50928 | andrew.kuchling | 2006-07-29 16:04:47 +0200 (Sat, 29 Jul 2006) | 1 line
Update URL
........
r50930 | andrew.kuchling | 2006-07-29 16:08:15 +0200 (Sat, 29 Jul 2006) | 1 line
Reword paragraph to match the order of the subsequent sections
........
r50931 | andrew.kuchling | 2006-07-29 16:21:15 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1529157] Mention raw_input() and input(); while I'm at it, reword the description a bit
........
r50932 | andrew.kuchling | 2006-07-29 16:42:48 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1519571] Document some missing functions: setup(), title(), done()
........
r50933 | andrew.kuchling | 2006-07-29 16:43:55 +0200 (Sat, 29 Jul 2006) | 1 line
Fix docstring punctuation
........
r50934 | andrew.kuchling | 2006-07-29 17:10:32 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1414697] Change docstring of set/frozenset types to specify that the contents are unique. Raymond, please feel free to edit or revert.
........
r50935 | andrew.kuchling | 2006-07-29 17:35:21 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1530382] Document SSL.server(), .issuer() methods
........
r50936 | andrew.kuchling | 2006-07-29 17:42:46 +0200 (Sat, 29 Jul 2006) | 1 line
Typo fix
........
r50937 | andrew.kuchling | 2006-07-29 17:43:13 +0200 (Sat, 29 Jul 2006) | 1 line
Tweak wording
........
r50938 | matt.fleming | 2006-07-29 17:55:30 +0200 (Sat, 29 Jul 2006) | 2 lines
Fix typo
........
r50939 | andrew.kuchling | 2006-07-29 17:57:08 +0200 (Sat, 29 Jul 2006) | 6 lines
[Bug #1528258] Mention that the 'data' argument can be None.
The constructor docs referred the reader to the add_data() method's docs,
but they weren't very helpful. I've simply copied an earlier explanation
of 'data' that's more useful.
........
r50940 | andrew.kuchling | 2006-07-29 18:08:40 +0200 (Sat, 29 Jul 2006) | 1 line
Set bug/patch count. Take a bow, everyone!
........
r50941 | fred.drake | 2006-07-29 18:56:15 +0200 (Sat, 29 Jul 2006) | 18 lines
expunge the xmlcore changes:
41667, 41668 - initial switch to xmlcore
47044 - mention of xmlcore in What's New
50687 - mention of xmlcore in the library reference
re-apply xmlcore changes to xml:
41674 - line ending changes (re-applied manually), directory props
41677 - add cElementTree wrapper
41678 - PSF licensing for etree
41812 - whitespace normalization
42724 - fix svn:eol-style settings
43681, 43682 - remove Python version-compatibility cruft from minidom
46773 - fix encoding of \r\n\t in attr values in saxutils
47269 - added XMLParser alias for cElementTree compatibility
additional tests were added in Lib/test/test_sax.py that failed with
the xmlcore changes; these relate to SF bugs #1511497, #1513611
........
r50942 | andrew.kuchling | 2006-07-29 20:14:07 +0200 (Sat, 29 Jul 2006) | 17 lines
Reorganize the docs for 'file' and 'open()' after some discussion with Fred.
We want to encourage users to write open() when opening a file, but
open() was described with a single paragraph and
'file' had lots of explanation of the mode and bufsize arguments.
I've shrunk the description of 'file' to cross-reference to the 'File
objects' section, and to open() for an explanation of the arguments.
open() now has all the paragraphs about the mode string. The bufsize
argument was moved up so that it isn't buried at the end; now there's
1 paragraph on mode, 1 on bufsize, and then 3 more on mode. Various
other edits and rearrangements were made in the process.
It's probably best to read the final text and not to try to make sense
of the diffs.
........
r50943 | fred.drake | 2006-07-29 20:19:19 +0200 (Sat, 29 Jul 2006) | 1 line
restore test un-intentionally removed in the xmlcore purge (revision 50941)
........
r50944 | fred.drake | 2006-07-29 20:33:29 +0200 (Sat, 29 Jul 2006) | 3 lines
make the reference to older versions of the documentation a link
to the right page on python.org
........
r50945 | fred.drake | 2006-07-29 21:09:01 +0200 (Sat, 29 Jul 2006) | 1 line
document the footnote usage pattern
........
r50947 | fred.drake | 2006-07-29 21:14:10 +0200 (Sat, 29 Jul 2006) | 1 line
emphasize and oddball nuance of LaTeX comment syntax
........
r50948 | andrew.kuchling | 2006-07-29 21:24:04 +0200 (Sat, 29 Jul 2006) | 1 line
[Patch #1490989 from Skip Montanaro] Mention debugging builds in the API documentation. I've changed Skip's patch to point to Misc/SpecialBuilds and fiddled with the markup a bit.
........
r50949 | neal.norwitz | 2006-07-29 21:29:35 +0200 (Sat, 29 Jul 2006) | 6 lines
Disable these tests until they are reliable across platforms.
These problems may mask more important, real problems.
One or both methods are known to fail on: Solaris, OpenBSD, Debian, Ubuntu.
They pass on Windows and some Linux boxes.
........
r50950 | andrew.kuchling | 2006-07-29 21:50:37 +0200 (Sat, 29 Jul 2006) | 1 line
[Patch #1068277] Clarify that os.path.exists() can return False depending on permissions. Fred approved committing this patch in December 2004!
........
r50952 | fred.drake | 2006-07-29 22:04:42 +0200 (Sat, 29 Jul 2006) | 6 lines
SF bug #1193966: Weakref types documentation misplaced
The information about supporting weakrefs with types defined in C extensions
is moved to the Extending & Embedding manual. Py_TPFLAGS_HAVE_WEAKREFS is
no longer mentioned since it is part of Py_TPFLAGS_DEFAULT.
........
r50953 | skip.montanaro | 2006-07-29 22:06:05 +0200 (Sat, 29 Jul 2006) | 4 lines
Add a comment to the csv reader documentation that explains why the
treatment of newlines changed in 2.5. Pulled almost verbatim from a comment
by Andrew McNamara in <http://python.org/sf/1465014>.
........
r50954 | neal.norwitz | 2006-07-29 22:20:52 +0200 (Sat, 29 Jul 2006) | 3 lines
If the executable doesn't exist, there's no reason to try to start it.
This prevents garbage about command not found being printed on Solaris.
........
r50955 | fred.drake | 2006-07-29 22:21:25 +0200 (Sat, 29 Jul 2006) | 1 line
fix minor markup error that introduced extra punctuation
........
r50957 | neal.norwitz | 2006-07-29 22:37:08 +0200 (Sat, 29 Jul 2006) | 3 lines
Disable test_getnode too, since this is also unreliable.
........
r50958 | andrew.kuchling | 2006-07-29 23:27:12 +0200 (Sat, 29 Jul 2006) | 1 line
Follow TeX's conventions for hyphens
........
r50959 | andrew.kuchling | 2006-07-29 23:30:21 +0200 (Sat, 29 Jul 2006) | 1 line
Fix case for 'Unix'
........
r50960 | fred.drake | 2006-07-30 01:34:57 +0200 (Sun, 30 Jul 2006) | 1 line
markup cleanups
........
r50961 | andrew.kuchling | 2006-07-30 02:27:34 +0200 (Sun, 30 Jul 2006) | 1 line
Minor typo fixes
........
r50962 | andrew.kuchling | 2006-07-30 02:37:56 +0200 (Sun, 30 Jul 2006) | 1 line
[Bug #793553] Correct description of keyword arguments for SSL authentication
........
r50963 | tim.peters | 2006-07-30 02:58:15 +0200 (Sun, 30 Jul 2006) | 2 lines
Whitespace normalization.
........
r50964 | fred.drake | 2006-07-30 05:03:43 +0200 (Sun, 30 Jul 2006) | 1 line
lots of markup nits, most commonly Unix/unix --> \UNIX
........
r50965 | fred.drake | 2006-07-30 07:41:28 +0200 (Sun, 30 Jul 2006) | 1 line
update information on wxPython, from Robin Dunn
........
r50966 | fred.drake | 2006-07-30 07:49:49 +0200 (Sun, 30 Jul 2006) | 4 lines
remove possibly-outdated comment on what GUI toolkit is most commonly used;
it is hard to know whether this is right, and it does not add valuable reference information
at any rate
........
r50967 | fred.drake | 2006-07-30 07:55:39 +0200 (Sun, 30 Jul 2006) | 3 lines
- remove yet another reference to how commonly Tkinter is (thought to be) used
- fix an internal section reference
........
r50968 | neal.norwitz | 2006-07-30 08:53:31 +0200 (Sun, 30 Jul 2006) | 4 lines
Patch #1531113: Fix augmented assignment with yield expressions.
Also fix a SystemError when trying to assign to yield expressions.
........
r50969 | neal.norwitz | 2006-07-30 08:55:48 +0200 (Sun, 30 Jul 2006) | 5 lines
Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().
This provides the proper warning for struct.pack().
PyErr_Warn() is now deprecated in favor of PyErr_WarnEx().
As mentioned by Tim Peters on python-dev.
........
r50970 | neal.norwitz | 2006-07-30 08:57:04 +0200 (Sun, 30 Jul 2006) | 3 lines
Bug #1515471: string.replace() accepts character buffers again.
Pass the char* and size around rather than PyObject's.
........
r50971 | neal.norwitz | 2006-07-30 08:59:13 +0200 (Sun, 30 Jul 2006) | 1 line
Whitespace normalization
........
r50973 | georg.brandl | 2006-07-30 12:53:32 +0200 (Sun, 30 Jul 2006) | 3 lines
Clarify that __op__ methods must return NotImplemented if they don't support the operation.
........
r50974 | georg.brandl | 2006-07-30 13:07:23 +0200 (Sun, 30 Jul 2006) | 3 lines
Bug #1002398: The documentation for os.path.sameopenfile now correctly
refers to file descriptors, not file objects.
........
r50977 | martin.v.loewis | 2006-07-30 15:00:31 +0200 (Sun, 30 Jul 2006) | 3 lines
Don't copy directory stat times in shutil.copytree on Windows
Fixes #1525866.
........
r50978 | martin.v.loewis | 2006-07-30 15:14:05 +0200 (Sun, 30 Jul 2006) | 3 lines
Base __version__ on sys.version_info, as distutils is
no longer maintained separatedly.
........
r50979 | martin.v.loewis | 2006-07-30 15:27:31 +0200 (Sun, 30 Jul 2006) | 3 lines
Mention Cygwin in distutils error message about a missing VS 2003.
Fixes #1257728.
........
r50982 | martin.v.loewis | 2006-07-30 16:09:47 +0200 (Sun, 30 Jul 2006) | 5 lines
Drop usage of test -e in configure as it is not portable.
Fixes #1439538
Will backport to 2.4
Also regenerate pyconfig.h.in.
........
r50984 | georg.brandl | 2006-07-30 18:20:10 +0200 (Sun, 30 Jul 2006) | 3 lines
Fix makefile changes for python-config.
........
r50985 | george.yoshida | 2006-07-30 18:37:37 +0200 (Sun, 30 Jul 2006) | 2 lines
Rename struct.pack_to to struct.pack_into as changed in revision 46642.
........
r50986 | george.yoshida | 2006-07-30 18:41:30 +0200 (Sun, 30 Jul 2006) | 2 lines
Typo fix
........
r50987 | neal.norwitz | 2006-07-30 21:18:13 +0200 (Sun, 30 Jul 2006) | 1 line
Add some asserts and update comments
........
r50988 | neal.norwitz | 2006-07-30 21:18:38 +0200 (Sun, 30 Jul 2006) | 1 line
Verify that the signal handlers were really called
........
r50989 | neal.norwitz | 2006-07-30 21:20:42 +0200 (Sun, 30 Jul 2006) | 3 lines
Try to prevent hangs on Tru64/Alpha buildbot. I'm not certain this will help
and may need to be reverted if it causes problems.
........
r50990 | georg.brandl | 2006-07-30 22:18:51 +0200 (Sun, 30 Jul 2006) | 2 lines
Bug #1531349: right <-> left glitch in __rop__ description.
........
r50992 | tim.peters | 2006-07-31 03:46:03 +0200 (Mon, 31 Jul 2006) | 2 lines
Whitespace normalization.
........
r50993 | andrew.mcnamara | 2006-07-31 04:27:48 +0200 (Mon, 31 Jul 2006) | 2 lines
Redo the comment about the 2.5 change in quoted-newline handling.
........
r50994 | tim.peters | 2006-07-31 04:40:23 +0200 (Mon, 31 Jul 2006) | 10 lines
ZipFile.close(): Killed one of the struct.pack deprecation
warnings on Win32.
Also added an XXX about the line:
pos3 = self.fp.tell()
`pos3` is never referenced, and I have no idea what the code
intended to do instead.
........
r50996 | tim.peters | 2006-07-31 04:53:03 +0200 (Mon, 31 Jul 2006) | 8 lines
ZipFile.close(): Kill the other struct.pack deprecation
warning on Windows.
Afraid I can't detect a pattern to when the pack formats decide
to use a signed or unsigned format code -- appears nearly
arbitrary to my eyes. So I left all the pack formats alone and
changed the special-case data values instead.
........
r50997 | skip.montanaro | 2006-07-31 05:09:45 +0200 (Mon, 31 Jul 2006) | 1 line
minor tweaks
........
r50998 | skip.montanaro | 2006-07-31 05:11:11 +0200 (Mon, 31 Jul 2006) | 1 line
minor tweaks
........
r50999 | andrew.kuchling | 2006-07-31 14:20:24 +0200 (Mon, 31 Jul 2006) | 1 line
Add refcounts for PyErr_WarnEx
........
r51000 | andrew.kuchling | 2006-07-31 14:39:05 +0200 (Mon, 31 Jul 2006) | 9 lines
Document PyErr_WarnEx. (Bad Neal! No biscuit!)
Is the explanation of the 'stacklevel' parameter clear? Please feel free
to edit it.
I don't have LaTeX installed on this machine, so haven't verified that the
markup is correct. Will check tonight, or maybe the automatic doc build will
tell me.
........
r51001 | andrew.kuchling | 2006-07-31 14:52:26 +0200 (Mon, 31 Jul 2006) | 1 line
Add PyErr_WarnEx()
........
r51002 | andrew.kuchling | 2006-07-31 15:18:27 +0200 (Mon, 31 Jul 2006) | 1 line
Mention csv newline changes
........
r51003 | andrew.kuchling | 2006-07-31 17:22:58 +0200 (Mon, 31 Jul 2006) | 1 line
Typo fix
........
r51004 | andrew.kuchling | 2006-07-31 17:23:43 +0200 (Mon, 31 Jul 2006) | 1 line
Remove reference to notation
........
r51005 | georg.brandl | 2006-07-31 18:00:34 +0200 (Mon, 31 Jul 2006) | 3 lines
Fix function name.
........
r51006 | andrew.kuchling | 2006-07-31 18:10:24 +0200 (Mon, 31 Jul 2006) | 1 line
[Bug #1514540] Instead of putting the standard types in a section, put them in a chapter of their own. This means string methods will now show up in the ToC. (Should the types come before or after the functions+exceptions+constants chapter? I've put them after, for now.)
........
r51007 | andrew.kuchling | 2006-07-31 18:22:05 +0200 (Mon, 31 Jul 2006) | 1 line
[Bug #848556] Remove \d* from second alternative to avoid exponential case when repeating match
........
r51008 | andrew.kuchling | 2006-07-31 18:27:57 +0200 (Mon, 31 Jul 2006) | 1 line
Update list of files; fix a typo
........
r51013 | andrew.kuchling | 2006-08-01 18:24:30 +0200 (Tue, 01 Aug 2006) | 1 line
typo fix
........
r51018 | thomas.heller | 2006-08-01 18:54:43 +0200 (Tue, 01 Aug 2006) | 2 lines
Fix a potential segfault and various potentail refcount leaks
in the cast() function.
........
r51020 | thomas.heller | 2006-08-01 19:46:10 +0200 (Tue, 01 Aug 2006) | 1 line
Minimal useful docstring for CopyComPointer.
........
r51021 | andrew.kuchling | 2006-08-01 20:16:15 +0200 (Tue, 01 Aug 2006) | 8 lines
[Patch #1520905] Attempt to suppress core file created by test_subprocess.py.
Patch by Douglas Greiman.
The test_run_abort() testcase produces a core file on Unix systems,
even though the test is successful. This can be confusing or alarming
to someone who runs 'make test' and then finds that the Python
interpreter apparently crashed.
........
r51023 | georg.brandl | 2006-08-01 20:49:24 +0200 (Tue, 01 Aug 2006) | 3 lines
os.urandom no longer masks unrelated exceptions like SystemExit or
KeyboardInterrupt.
........
r51025 | thomas.heller | 2006-08-01 21:14:15 +0200 (Tue, 01 Aug 2006) | 2 lines
Speed up PyType_stgdict and PyObject_stgdict.
........
r51027 | ronald.oussoren | 2006-08-01 22:30:31 +0200 (Tue, 01 Aug 2006) | 3 lines
Make sure the postinstall action that optionally updates the user's profile
on MacOS X actually works correctly in all cases.
........
r51028 | ronald.oussoren | 2006-08-01 23:00:57 +0200 (Tue, 01 Aug 2006) | 4 lines
This fixes bug #1527397: PythonLauncher runs scripts with the wrong working
directory. It also fixes a bug where PythonLauncher failed to launch scripts
when the scriptname (or the path to the script) contains quotes.
........
r51031 | tim.peters | 2006-08-02 05:27:46 +0200 (Wed, 02 Aug 2006) | 2 lines
Whitespace normalization.
........
r51032 | tim.peters | 2006-08-02 06:12:36 +0200 (Wed, 02 Aug 2006) | 19 lines
Try to squash struct.pack warnings on the "amd64 gentoo trunk"
buildbot (& possibly other 64-bit boxes) during test_gzip.
The native zlib crc32 function returns an unsigned 32-bit integer,
which the Python wrapper implicitly casts to C long. Therefore the
same crc can "look negative" on a 32-bit box but "look positive" on
a 64-bit box. This patch papers over that platform difference when
writing the crc to file.
It may be better to change the Python wrapper, either to make
the result "look positive" on all platforms (which means it may
have to return a Python long at times on a 32-bit box), or to
keep the sign the same across boxes. But that would be a visible
change in what users see, while the current hack changes no
visible behavior (well, apart from stopping the struct deprecation
warning).
Note that the module-level write32() function is no longer used.
........
r51033 | neal.norwitz | 2006-08-02 06:27:11 +0200 (Wed, 02 Aug 2006) | 4 lines
Prevent memory leak on error.
Reported by Klocwork #36
........
r51034 | tim.peters | 2006-08-02 07:20:08 +0200 (Wed, 02 Aug 2006) | 9 lines
_Stream.close(): Try to kill struct.pack() warnings when
writing the crc to file on the "PPC64 Debian trunk" buildbot
when running test_tarfile.
This is again a case where the native zlib crc is an unsigned
32-bit int, but the Python wrapper implicitly casts it to
signed C long, so that "the sign bit looks different" on
different platforms.
........
r51035 | ronald.oussoren | 2006-08-02 08:10:10 +0200 (Wed, 02 Aug 2006) | 2 lines
Updated documentation for the script that builds the OSX installer.
........
r51036 | neal.norwitz | 2006-08-02 08:14:22 +0200 (Wed, 02 Aug 2006) | 2 lines
_PyWeakref_GetWeakrefCount() now returns a Py_ssize_t instead of long.
........
r51037 | neal.norwitz | 2006-08-02 08:15:10 +0200 (Wed, 02 Aug 2006) | 1 line
v is already checked for NULL, so just DECREF it
........
r51038 | neal.norwitz | 2006-08-02 08:19:19 +0200 (Wed, 02 Aug 2006) | 1 line
Let us know when there was a problem and the child had to kill the parent
........
r51039 | neal.norwitz | 2006-08-02 08:46:21 +0200 (Wed, 02 Aug 2006) | 5 lines
Patch #1519025 and bug #926423: If a KeyboardInterrupt occurs during
a socket operation on a socket with a timeout, the exception will be
caught correctly. Previously, the exception was not caught.
........
r51040 | neal.norwitz | 2006-08-02 09:09:32 +0200 (Wed, 02 Aug 2006) | 1 line
Add some explanation about Klocwork and Coverity static analysis
........
r51041 | anthony.baxter | 2006-08-02 09:43:09 +0200 (Wed, 02 Aug 2006) | 1 line
pre-release machinations
........
r51043 | thomas.heller | 2006-08-02 13:35:31 +0200 (Wed, 02 Aug 2006) | 4 lines
A few nore words about what ctypes does.
Document that using the wrong calling convention can also raise
'ValueError: Procedure called with the wrong number of arguments'.
........
r51045 | thomas.heller | 2006-08-02 14:00:13 +0200 (Wed, 02 Aug 2006) | 1 line
Fix a mistake.
........
r51046 | martin.v.loewis | 2006-08-02 15:53:55 +0200 (Wed, 02 Aug 2006) | 3 lines
Correction of patch #1455898: In the mbcs decoder, set final=False
for stream decoder, but final=True for the decode function.
........
r51049 | tim.peters | 2006-08-02 20:19:35 +0200 (Wed, 02 Aug 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r51079 | neal.norwitz | 2006-08-04 06:50:21 +0200 (Fri, 04 Aug 2006) | 3 lines
Bug #1531405, format_exception no longer raises an exception if
str(exception) raised an exception.
........
r51080 | neal.norwitz | 2006-08-04 06:58:47 +0200 (Fri, 04 Aug 2006) | 11 lines
Bug #1191458: tracing over for loops now produces a line event
on each iteration. I'm not positive this is the best way to handle
this. I'm also not sure that there aren't other cases where
the lnotab is generated incorrectly. It would be great if people
that use pdb or tracing could test heavily.
Also:
* Remove dead/duplicated code that wasn't used/necessary
because we already handled the docstring prior to entering the loop.
* add some debugging code into the compiler (#if 0'd out).
........
r51081 | neal.norwitz | 2006-08-04 07:09:28 +0200 (Fri, 04 Aug 2006) | 4 lines
Bug #1333982: string/number constants were inappropriately stored
in the byte code and co_consts even if they were not used, ie
immediately popped off the stack.
........
r51082 | neal.norwitz | 2006-08-04 07:12:19 +0200 (Fri, 04 Aug 2006) | 1 line
There were really two issues
........
r51084 | fred.drake | 2006-08-04 07:17:21 +0200 (Fri, 04 Aug 2006) | 1 line
SF patch #1534048 (bug #1531003): fix typo in error message
........
r51085 | gregory.p.smith | 2006-08-04 07:17:47 +0200 (Fri, 04 Aug 2006) | 3 lines
fix typos
........
r51087 | georg.brandl | 2006-08-04 08:03:53 +0200 (Fri, 04 Aug 2006) | 3 lines
Fix bug caused by first decrefing, then increfing.
........
r51109 | neil.schemenauer | 2006-08-04 18:20:30 +0200 (Fri, 04 Aug 2006) | 5 lines
Fix the 'compiler' package to generate correct code for MAKE_CLOSURE.
In the 2.5 development cycle, MAKE_CLOSURE as changed to take free
variables as a tuple rather than as individual items on the stack.
Closes patch #1534084.
........
r51110 | georg.brandl | 2006-08-04 20:03:37 +0200 (Fri, 04 Aug 2006) | 3 lines
Change fix for segfaulting property(), add a NEWS entry and a test.
........
r51111 | georg.brandl | 2006-08-04 20:07:34 +0200 (Fri, 04 Aug 2006) | 3 lines
Better fix for bug #1531405, not executing str(value) twice.
........
r51112 | thomas.heller | 2006-08-04 20:17:40 +0200 (Fri, 04 Aug 2006) | 1 line
On Windows, make PyErr_Warn an exported function again.
........
r51113 | thomas.heller | 2006-08-04 20:57:34 +0200 (Fri, 04 Aug 2006) | 4 lines
Fix #1530448 - fix ctypes build failure on solaris 10.
The '-mimpure-text' linker flag is required when linking _ctypes.so.
........
r51114 | thomas.heller | 2006-08-04 21:49:31 +0200 (Fri, 04 Aug 2006) | 3 lines
Fix #1534738: win32 debug version of _msi must be _msi_d.pyd, not _msi.pyd.
Fix the name of the pdb file as well.
........
r51115 | andrew.kuchling | 2006-08-04 22:37:43 +0200 (Fri, 04 Aug 2006) | 1 line
Typo fixes
........
r51116 | andrew.kuchling | 2006-08-04 23:10:03 +0200 (Fri, 04 Aug 2006) | 1 line
Fix mangled sentence
........
r51118 | tim.peters | 2006-08-05 00:00:35 +0200 (Sat, 05 Aug 2006) | 2 lines
Whitespace normalization.
........
r51119 | bob.ippolito | 2006-08-05 01:59:21 +0200 (Sat, 05 Aug 2006) | 5 lines
Fix #1530559, struct.pack raises TypeError where it used to convert.
Passing float arguments to struct.pack when integers are expected
now triggers a DeprecationWarning.
........
r51123 | georg.brandl | 2006-08-05 08:10:54 +0200 (Sat, 05 Aug 2006) | 3 lines
Patch #1534922: correct and enhance unittest docs.
........
r51126 | georg.brandl | 2006-08-06 09:06:33 +0200 (Sun, 06 Aug 2006) | 2 lines
Bug #1535182: really test the xreadlines() method of bz2 objects.
........
r51128 | georg.brandl | 2006-08-06 09:26:21 +0200 (Sun, 06 Aug 2006) | 4 lines
Bug #1535081: A leading underscore has been added to the names of
the md5 and sha modules, so add it in Modules/Setup.dist too.
........
r51129 | georg.brandl | 2006-08-06 10:23:54 +0200 (Sun, 06 Aug 2006) | 3 lines
Bug #1535165: fixed a segfault in input() and raw_input() when
sys.stdin is closed.
........
r51131 | georg.brandl | 2006-08-06 11:17:16 +0200 (Sun, 06 Aug 2006) | 2 lines
Don't produce output in test_builtin.
........
r51133 | andrew.macintyre | 2006-08-06 14:37:03 +0200 (Sun, 06 Aug 2006) | 4 lines
test_threading now skips testing alternate thread stack sizes on
platforms that don't support changing thread stack size.
........
r51134 | andrew.kuchling | 2006-08-07 00:07:04 +0200 (Mon, 07 Aug 2006) | 2 lines
[Patch #1464056] Ensure that we use the panelw library when linking with ncursesw.
Once I see how the buildbots react, I'll backport this to 2.4.
........
r51137 | georg.brandl | 2006-08-08 13:52:34 +0200 (Tue, 08 Aug 2006) | 3 lines
webbrowser: Silence stderr output if no gconftool or gnome browser found
........
r51138 | georg.brandl | 2006-08-08 13:56:21 +0200 (Tue, 08 Aug 2006) | 7 lines
Remove "non-mapping" and "non-sequence" from TypeErrors raised by
PyMapping_Size and PySequence_Size.
Because len() tries first sequence, then mapping size, it will always
raise a "non-mapping object has no len" error which is confusing.
........
r51139 | thomas.heller | 2006-08-08 19:37:00 +0200 (Tue, 08 Aug 2006) | 3 lines
memcmp() can return values other than -1, 0, and +1 but tp_compare
must not.
........
r51140 | thomas.heller | 2006-08-08 19:39:20 +0200 (Tue, 08 Aug 2006) | 1 line
Remove accidently committed, duplicated test.
........
r51147 | andrew.kuchling | 2006-08-08 20:50:14 +0200 (Tue, 08 Aug 2006) | 1 line
Reword paragraph to clarify
........
r51148 | andrew.kuchling | 2006-08-08 20:56:08 +0200 (Tue, 08 Aug 2006) | 1 line
Move obmalloc item into C API section
........
r51149 | andrew.kuchling | 2006-08-08 21:00:14 +0200 (Tue, 08 Aug 2006) | 1 line
'Other changes' section now has only one item; move the item elsewhere and remove the section
........
r51150 | andrew.kuchling | 2006-08-08 21:00:34 +0200 (Tue, 08 Aug 2006) | 1 line
Bump version number
........
r51151 | georg.brandl | 2006-08-08 22:11:22 +0200 (Tue, 08 Aug 2006) | 2 lines
Bug #1536828: typo: TypeType should have been StringType.
........
r51153 | georg.brandl | 2006-08-08 22:13:13 +0200 (Tue, 08 Aug 2006) | 2 lines
Bug #1536660: separate two words.
........
r51155 | georg.brandl | 2006-08-08 22:48:10 +0200 (Tue, 08 Aug 2006) | 3 lines
``str`` is now the same object as ``types.StringType``.
........
r51156 | tim.peters | 2006-08-09 02:52:26 +0200 (Wed, 09 Aug 2006) | 2 lines
Whitespace normalization.
........
r51158 | georg.brandl | 2006-08-09 09:03:22 +0200 (Wed, 09 Aug 2006) | 4 lines
Introduce an upper bound on tuple nesting depth in
C argument format strings; fixes rest of #1523610.
........
r51160 | martin.v.loewis | 2006-08-09 09:57:39 +0200 (Wed, 09 Aug 2006) | 4 lines
__hash__ may now return long int; the final hash
value is obtained by invoking hash on the long int.
Fixes #1536021.
........
r51168 | andrew.kuchling | 2006-08-09 15:03:41 +0200 (Wed, 09 Aug 2006) | 1 line
[Bug #1536021] Mention __hash__ change
........
r51169 | andrew.kuchling | 2006-08-09 15:57:05 +0200 (Wed, 09 Aug 2006) | 1 line
[Patch #1534027] Add notes on locale module changes
........
r51170 | andrew.kuchling | 2006-08-09 16:05:35 +0200 (Wed, 09 Aug 2006) | 1 line
Add missing 'self' parameters
........
r51171 | andrew.kuchling | 2006-08-09 16:06:19 +0200 (Wed, 09 Aug 2006) | 1 line
Reindent code
........
r51172 | armin.rigo | 2006-08-09 16:55:26 +0200 (Wed, 09 Aug 2006) | 2 lines
Fix and test for an infinite C recursion.
........
r51173 | ronald.oussoren | 2006-08-09 16:56:33 +0200 (Wed, 09 Aug 2006) | 2 lines
It's unlikely that future versions will require _POSIX_C_SOURCE
........
r51178 | armin.rigo | 2006-08-09 17:37:26 +0200 (Wed, 09 Aug 2006) | 2 lines
Concatenation on a long string breaks (SF #1526585).
........
r51180 | kurt.kaiser | 2006-08-09 18:46:15 +0200 (Wed, 09 Aug 2006) | 8 lines
1. When used w/o subprocess, all exceptions were preceeded by an error
message claiming they were IDLE internal errors (since 1.2a1).
2. Add Ronald Oussoren to CREDITS
M NEWS.txt
M PyShell.py
M CREDITS.txt
........
r51181 | kurt.kaiser | 2006-08-09 19:47:15 +0200 (Wed, 09 Aug 2006) | 4 lines
As a slight enhancement to the previous checkin, improve the
internal error reporting by moving message to IDLE console.
........
r51182 | andrew.kuchling | 2006-08-09 20:23:14 +0200 (Wed, 09 Aug 2006) | 1 line
Typo fix
........
r51183 | kurt.kaiser | 2006-08-09 22:34:46 +0200 (Wed, 09 Aug 2006) | 2 lines
ToggleTab dialog was setting indent to 8 even if cancelled (since 1.2a1).
........
r51184 | martin.v.loewis | 2006-08-10 01:42:18 +0200 (Thu, 10 Aug 2006) | 2 lines
Add some commentary on -mimpure-text.
........
r51185 | tim.peters | 2006-08-10 02:58:49 +0200 (Thu, 10 Aug 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r51186 | kurt.kaiser | 2006-08-10 03:41:17 +0200 (Thu, 10 Aug 2006) | 2 lines
Changing tokenize (39046) to detect dedent broke tabnanny check (since 1.2a1)
........
r51187 | tim.peters | 2006-08-10 05:01:26 +0200 (Thu, 10 Aug 2006) | 13 lines
test_copytree_simple(): This was leaving behind two new temp
directories each time it ran, at least on Windows.
Several changes: explicitly closed all files; wrapped long
lines; stopped suppressing errors when removing a file or
directory fails (removing /shouldn't/ fail!); and changed
what appeared to be incorrect usage of os.removedirs() (that
doesn't remove empty directories at and /under/ the given
path, instead it must be given an empty leaf directory and
then deletes empty directories moving /up/ the path -- could
be that the conceptually simpler shutil.rmtree() was really
actually intended here).
........
2006-08-11 14:57:12 +00:00
|
|
|
#endif
|
1996-12-05 23:43:35 +00:00
|
|
|
|
1994-08-01 11:34:53 +00:00
|
|
|
#ifdef HAVE_FCNTL_H
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <fcntl.h>
|
|
|
|
|
#endif
|
1992-03-27 17:22:31 +00:00
|
|
|
|
2001-10-18 19:44:10 +00:00
|
|
|
#ifdef HAVE_GRP_H
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <grp.h>
|
2001-10-18 19:44:10 +00:00
|
|
|
#endif
|
|
|
|
|
|
2003-01-07 20:57:09 +00:00
|
|
|
#ifdef HAVE_SYSEXITS_H
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <sysexits.h>
|
|
|
|
|
#endif
|
2003-01-07 20:57:09 +00:00
|
|
|
|
2004-10-13 15:30:56 +00:00
|
|
|
#ifdef HAVE_SYS_LOADAVG_H
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <sys/loadavg.h>
|
2004-10-13 15:30:56 +00:00
|
|
|
#endif
|
|
|
|
|
|
2011-02-25 14:39:16 +00:00
|
|
|
#ifdef HAVE_SYS_SENDFILE_H
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <sys/sendfile.h>
|
2011-02-25 14:39:16 +00:00
|
|
|
#endif
|
|
|
|
|
|
2018-06-12 23:04:50 +02:00
|
|
|
#if defined(__APPLE__)
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <copyfile.h>
|
2018-06-12 23:04:50 +02:00
|
|
|
#endif
|
|
|
|
|
|
2011-08-02 17:30:04 -05:00
|
|
|
#ifdef HAVE_SCHED_H
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <sched.h>
|
2011-08-02 17:30:04 -05:00
|
|
|
#endif
|
|
|
|
|
|
2019-05-31 19:39:47 +01:00
|
|
|
#ifdef HAVE_COPY_FILE_RANGE
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <unistd.h>
|
2019-05-31 19:39:47 +01:00
|
|
|
#endif
|
|
|
|
|
|
2012-03-16 10:12:55 -05:00
|
|
|
#if !defined(CPU_ALLOC) && defined(HAVE_SCHED_SETAFFINITY)
|
2020-04-15 15:07:31 +02:00
|
|
|
# undef HAVE_SCHED_SETAFFINITY
|
2012-03-14 22:28:25 -05:00
|
|
|
#endif
|
|
|
|
|
|
2014-04-17 19:47:16 +02:00
|
|
|
#if defined(HAVE_SYS_XATTR_H) && defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
|
2020-04-15 15:07:31 +02:00
|
|
|
# define USE_XATTRS
|
2011-09-14 11:45:52 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef USE_XATTRS
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <sys/xattr.h>
|
2011-08-31 22:15:17 -04:00
|
|
|
#endif
|
|
|
|
|
|
2011-02-25 14:39:16 +00:00
|
|
|
#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__APPLE__)
|
2020-04-15 15:07:31 +02:00
|
|
|
# ifdef HAVE_SYS_SOCKET_H
|
|
|
|
|
# include <sys/socket.h>
|
|
|
|
|
# endif
|
2011-02-25 14:39:16 +00:00
|
|
|
#endif
|
|
|
|
|
|
2011-10-25 13:34:04 +02:00
|
|
|
#ifdef HAVE_DLFCN_H
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <dlfcn.h>
|
2011-10-25 13:34:04 +02:00
|
|
|
#endif
|
|
|
|
|
|
2013-05-20 14:40:46 +02:00
|
|
|
#ifdef __hpux
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <sys/mpctl.h>
|
2013-05-20 14:40:46 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if defined(__DragonFly__) || \
|
|
|
|
|
defined(__OpenBSD__) || \
|
|
|
|
|
defined(__FreeBSD__) || \
|
|
|
|
|
defined(__NetBSD__) || \
|
|
|
|
|
defined(__APPLE__)
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <sys/sysctl.h>
|
2013-05-20 14:40:46 +02:00
|
|
|
#endif
|
|
|
|
|
|
2016-09-06 16:18:52 -07:00
|
|
|
#ifdef HAVE_LINUX_RANDOM_H
|
|
|
|
|
# include <linux/random.h>
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_GETRANDOM_SYSCALL
|
|
|
|
|
# include <sys/syscall.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2012-02-08 23:28:36 +01:00
|
|
|
#if defined(MS_WINDOWS)
|
|
|
|
|
# define TERMSIZE_USE_CONIO
|
|
|
|
|
#elif defined(HAVE_SYS_IOCTL_H)
|
|
|
|
|
# include <sys/ioctl.h>
|
|
|
|
|
# if defined(HAVE_TERMIOS_H)
|
|
|
|
|
# include <termios.h>
|
|
|
|
|
# endif
|
|
|
|
|
# if defined(TIOCGWINSZ)
|
|
|
|
|
# define TERMSIZE_USE_IOCTL
|
|
|
|
|
# endif
|
|
|
|
|
#endif /* MS_WINDOWS */
|
|
|
|
|
|
1996-05-23 22:58:55 +00:00
|
|
|
/* Various compilers have only certain posix functions */
|
2001-07-26 13:41:06 +00:00
|
|
|
/* XXX Gosh I wish these were all moved into pyconfig.h */
|
2010-05-06 00:08:46 +00:00
|
|
|
#if defined(__WATCOMC__) && !defined(__QNX__) /* Watcom compiler */
|
2020-04-15 15:07:31 +02:00
|
|
|
# define HAVE_OPENDIR 1
|
|
|
|
|
# define HAVE_SYSTEM 1
|
|
|
|
|
# include <process.h>
|
1996-05-23 22:58:55 +00:00
|
|
|
#else
|
2020-04-15 15:07:31 +02:00
|
|
|
# ifdef _MSC_VER
|
|
|
|
|
/* Microsoft compiler */
|
|
|
|
|
# define HAVE_GETPPID 1
|
|
|
|
|
# define HAVE_GETLOGIN 1
|
|
|
|
|
# define HAVE_SPAWNV 1
|
|
|
|
|
# define HAVE_EXECV 1
|
|
|
|
|
# define HAVE_WSPAWNV 1
|
|
|
|
|
# define HAVE_WEXECV 1
|
|
|
|
|
# define HAVE_PIPE 1
|
|
|
|
|
# define HAVE_SYSTEM 1
|
|
|
|
|
# define HAVE_CWAIT 1
|
|
|
|
|
# define HAVE_FSYNC 1
|
|
|
|
|
# define fsync _commit
|
|
|
|
|
# else
|
|
|
|
|
/* Unix functions that the configure script doesn't check for */
|
|
|
|
|
# ifndef __VXWORKS__
|
|
|
|
|
# define HAVE_EXECV 1
|
|
|
|
|
# define HAVE_FORK 1
|
|
|
|
|
# if defined(__USLC__) && defined(__SCO_VERSION__) /* SCO UDK Compiler */
|
|
|
|
|
# define HAVE_FORK1 1
|
|
|
|
|
# endif
|
|
|
|
|
# endif
|
|
|
|
|
# define HAVE_GETEGID 1
|
|
|
|
|
# define HAVE_GETEUID 1
|
|
|
|
|
# define HAVE_GETGID 1
|
|
|
|
|
# define HAVE_GETPPID 1
|
|
|
|
|
# define HAVE_GETUID 1
|
|
|
|
|
# define HAVE_KILL 1
|
|
|
|
|
# define HAVE_OPENDIR 1
|
|
|
|
|
# define HAVE_PIPE 1
|
|
|
|
|
# define HAVE_SYSTEM 1
|
|
|
|
|
# define HAVE_WAIT 1
|
|
|
|
|
# define HAVE_TTYNAME 1
|
|
|
|
|
# endif /* _MSC_VER */
|
1997-12-02 20:36:02 +00:00
|
|
|
#endif /* ! __WATCOMC__ || __QNX__ */
|
1996-05-23 22:58:55 +00:00
|
|
|
|
2019-11-05 07:16:14 -08:00
|
|
|
_Py_IDENTIFIER(__fspath__);
|
2012-02-08 03:36:25 +01:00
|
|
|
|
2014-01-07 12:41:53 -08:00
|
|
|
/*[clinic input]
|
2014-08-05 14:04:04 +10:00
|
|
|
# one of the few times we lie about this name!
|
2013-11-23 15:37:55 -08:00
|
|
|
module os
|
2014-01-07 12:41:53 -08:00
|
|
|
[clinic start generated code]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=94a0f0f978acae17]*/
|
2012-02-08 03:36:25 +01:00
|
|
|
|
1996-05-23 22:58:55 +00:00
|
|
|
#ifndef _MSC_VER
|
1995-06-14 22:54:23 +00:00
|
|
|
|
2002-09-19 08:03:21 +00:00
|
|
|
#if defined(__sgi)&&_COMPILER_VERSION>=700
|
|
|
|
|
/* declare ctermid_r if compiling with MIPSPro 7.x in ANSI C mode
|
|
|
|
|
(default) */
|
|
|
|
|
extern char *ctermid_r(char *);
|
|
|
|
|
#endif
|
|
|
|
|
|
1996-05-23 22:58:55 +00:00
|
|
|
#endif /* !_MSC_VER */
|
1994-08-01 11:34:53 +00:00
|
|
|
|
2019-05-21 18:46:37 +08:00
|
|
|
#if defined(__VXWORKS__)
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <vxCpuLib.h>
|
|
|
|
|
# include <rtpLib.h>
|
|
|
|
|
# include <wait.h>
|
|
|
|
|
# include <taskLib.h>
|
|
|
|
|
# ifndef _P_WAIT
|
|
|
|
|
# define _P_WAIT 0
|
|
|
|
|
# define _P_NOWAIT 1
|
|
|
|
|
# define _P_NOWAITO 1
|
|
|
|
|
# endif
|
2019-05-21 18:46:37 +08:00
|
|
|
#endif /* __VXWORKS__ */
|
|
|
|
|
|
2018-01-29 01:56:10 +00:00
|
|
|
#ifdef HAVE_POSIX_SPAWN
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <spawn.h>
|
2018-01-29 01:56:10 +00:00
|
|
|
#endif
|
|
|
|
|
|
1994-08-01 11:34:53 +00:00
|
|
|
#ifdef HAVE_UTIME_H
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <utime.h>
|
1994-08-18 15:42:46 +00:00
|
|
|
#endif /* HAVE_UTIME_H */
|
1994-08-01 11:34:53 +00:00
|
|
|
|
1994-09-29 09:50:09 +00:00
|
|
|
#ifdef HAVE_SYS_UTIME_H
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <sys/utime.h>
|
|
|
|
|
# define HAVE_UTIME_H /* pretend we do for the rest of this file */
|
1994-09-29 09:50:09 +00:00
|
|
|
#endif /* HAVE_SYS_UTIME_H */
|
|
|
|
|
|
1994-08-01 11:34:53 +00:00
|
|
|
#ifdef HAVE_SYS_TIMES_H
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <sys/times.h>
|
1994-08-18 15:42:46 +00:00
|
|
|
#endif /* HAVE_SYS_TIMES_H */
|
1994-08-01 11:34:53 +00:00
|
|
|
|
|
|
|
|
#ifdef HAVE_SYS_PARAM_H
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <sys/param.h>
|
1994-08-18 15:42:46 +00:00
|
|
|
#endif /* HAVE_SYS_PARAM_H */
|
1994-08-01 11:34:53 +00:00
|
|
|
|
|
|
|
|
#ifdef HAVE_SYS_UTSNAME_H
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <sys/utsname.h>
|
1994-08-18 15:42:46 +00:00
|
|
|
#endif /* HAVE_SYS_UTSNAME_H */
|
1994-08-01 11:34:53 +00:00
|
|
|
|
1995-01-02 19:30:30 +00:00
|
|
|
#ifdef HAVE_DIRENT_H
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <dirent.h>
|
|
|
|
|
# define NAMLEN(dirent) strlen((dirent)->d_name)
|
1995-01-02 19:30:30 +00:00
|
|
|
#else
|
2020-04-15 15:07:31 +02:00
|
|
|
# if defined(__WATCOMC__) && !defined(__QNX__)
|
|
|
|
|
# include <direct.h>
|
|
|
|
|
# define NAMLEN(dirent) strlen((dirent)->d_name)
|
|
|
|
|
# else
|
|
|
|
|
# define dirent direct
|
|
|
|
|
# define NAMLEN(dirent) (dirent)->d_namlen
|
|
|
|
|
# endif
|
|
|
|
|
# ifdef HAVE_SYS_NDIR_H
|
|
|
|
|
# include <sys/ndir.h>
|
|
|
|
|
# endif
|
|
|
|
|
# ifdef HAVE_SYS_DIR_H
|
|
|
|
|
# include <sys/dir.h>
|
|
|
|
|
# endif
|
|
|
|
|
# ifdef HAVE_NDIR_H
|
|
|
|
|
# include <ndir.h>
|
|
|
|
|
# endif
|
1995-01-02 19:30:30 +00:00
|
|
|
#endif
|
1994-08-01 11:34:53 +00:00
|
|
|
|
1996-05-23 22:58:55 +00:00
|
|
|
#ifdef _MSC_VER
|
2020-04-15 15:07:31 +02:00
|
|
|
# ifdef HAVE_DIRECT_H
|
|
|
|
|
# include <direct.h>
|
|
|
|
|
# endif
|
|
|
|
|
# ifdef HAVE_IO_H
|
|
|
|
|
# include <io.h>
|
|
|
|
|
# endif
|
|
|
|
|
# ifdef HAVE_PROCESS_H
|
|
|
|
|
# include <process.h>
|
|
|
|
|
# endif
|
|
|
|
|
# ifndef IO_REPARSE_TAG_SYMLINK
|
|
|
|
|
# define IO_REPARSE_TAG_SYMLINK (0xA000000CL)
|
|
|
|
|
# endif
|
|
|
|
|
# ifndef IO_REPARSE_TAG_MOUNT_POINT
|
|
|
|
|
# define IO_REPARSE_TAG_MOUNT_POINT (0xA0000003L)
|
|
|
|
|
# endif
|
|
|
|
|
# include "osdefs.h" // SEP
|
|
|
|
|
# include <malloc.h>
|
|
|
|
|
# include <windows.h>
|
|
|
|
|
# include <shellapi.h> // ShellExecute()
|
|
|
|
|
# include <lmcons.h> // UNLEN
|
|
|
|
|
# define HAVE_SYMLINK
|
1996-05-23 22:58:55 +00:00
|
|
|
#endif /* _MSC_VER */
|
1994-08-01 11:34:53 +00:00
|
|
|
|
2002-03-03 23:17:02 +00:00
|
|
|
#ifndef MAXPATHLEN
|
2020-04-15 15:07:31 +02:00
|
|
|
# if defined(PATH_MAX) && PATH_MAX > 1024
|
|
|
|
|
# define MAXPATHLEN PATH_MAX
|
|
|
|
|
# else
|
|
|
|
|
# define MAXPATHLEN 1024
|
|
|
|
|
# endif
|
2002-03-03 23:17:02 +00:00
|
|
|
#endif /* MAXPATHLEN */
|
|
|
|
|
|
1999-01-27 17:53:11 +00:00
|
|
|
#ifdef UNION_WAIT
|
2020-04-15 15:07:31 +02:00
|
|
|
/* Emulate some macros on systems that have a union instead of macros */
|
|
|
|
|
# ifndef WIFEXITED
|
|
|
|
|
# define WIFEXITED(u_wait) (!(u_wait).w_termsig && !(u_wait).w_coredump)
|
|
|
|
|
# endif
|
|
|
|
|
# ifndef WEXITSTATUS
|
|
|
|
|
# define WEXITSTATUS(u_wait) (WIFEXITED(u_wait)?((u_wait).w_retcode):-1)
|
|
|
|
|
# endif
|
|
|
|
|
# ifndef WTERMSIG
|
|
|
|
|
# define WTERMSIG(u_wait) ((u_wait).w_termsig)
|
|
|
|
|
# endif
|
|
|
|
|
# define WAIT_TYPE union wait
|
|
|
|
|
# define WAIT_STATUS_INT(s) (s.w_status)
|
|
|
|
|
#else
|
|
|
|
|
/* !UNION_WAIT */
|
|
|
|
|
# define WAIT_TYPE int
|
|
|
|
|
# define WAIT_STATUS_INT(s) (s)
|
1999-01-27 17:53:11 +00:00
|
|
|
#endif /* UNION_WAIT */
|
|
|
|
|
|
2000-03-01 21:51:56 +00:00
|
|
|
/* Don't use the "_r" form if we don't need it (also, won't have a
|
|
|
|
|
prototype for it, at least on Solaris -- maybe others as well?). */
|
2017-09-07 18:56:24 +02:00
|
|
|
#if defined(HAVE_CTERMID_R)
|
2020-04-15 15:07:31 +02:00
|
|
|
# define USE_CTERMID_R
|
2000-03-01 21:51:56 +00:00
|
|
|
#endif
|
|
|
|
|
|
2000-06-29 21:12:41 +00:00
|
|
|
/* choose the appropriate stat and fstat functions and return structs */
|
2000-06-30 22:45:12 +00:00
|
|
|
#undef STAT
|
2011-01-19 15:21:35 +00:00
|
|
|
#undef FSTAT
|
|
|
|
|
#undef STRUCT_STAT
|
2013-06-25 00:37:25 +02:00
|
|
|
#ifdef MS_WINDOWS
|
2020-04-15 15:07:31 +02:00
|
|
|
# define STAT win32_stat
|
|
|
|
|
# define LSTAT win32_lstat
|
|
|
|
|
# define FSTAT _Py_fstat_noraise
|
|
|
|
|
# define STRUCT_STAT struct _Py_stat_struct
|
2000-06-29 21:12:41 +00:00
|
|
|
#else
|
2020-04-15 15:07:31 +02:00
|
|
|
# define STAT stat
|
|
|
|
|
# define LSTAT lstat
|
|
|
|
|
# define FSTAT fstat
|
|
|
|
|
# define STRUCT_STAT struct stat
|
2000-06-29 21:12:41 +00:00
|
|
|
#endif
|
|
|
|
|
|
2003-04-23 02:39:17 +00:00
|
|
|
#if defined(MAJOR_IN_MKDEV)
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <sys/mkdev.h>
|
2002-10-10 14:27:30 +00:00
|
|
|
#else
|
2020-04-15 15:07:31 +02:00
|
|
|
# if defined(MAJOR_IN_SYSMACROS)
|
|
|
|
|
# include <sys/sysmacros.h>
|
|
|
|
|
# endif
|
|
|
|
|
# if defined(HAVE_MKNOD) && defined(HAVE_SYS_MKDEV_H)
|
|
|
|
|
# include <sys/mkdev.h>
|
|
|
|
|
# endif
|
2002-10-10 14:27:30 +00:00
|
|
|
#endif
|
2000-06-29 21:12:41 +00:00
|
|
|
|
2015-03-08 01:58:04 +01:00
|
|
|
#ifdef MS_WINDOWS
|
2020-04-15 15:07:31 +02:00
|
|
|
# define INITFUNC PyInit_nt
|
|
|
|
|
# define MODNAME "nt"
|
2015-03-08 01:58:04 +01:00
|
|
|
#else
|
2020-04-15 15:07:31 +02:00
|
|
|
# define INITFUNC PyInit_posix
|
|
|
|
|
# define MODNAME "posix"
|
2015-03-08 01:58:04 +01:00
|
|
|
#endif
|
|
|
|
|
|
2018-01-28 14:00:08 +01:00
|
|
|
#if defined(__sun)
|
|
|
|
|
/* Something to implement in autoconf, not present in autoconf 2.69 */
|
2020-04-15 15:07:31 +02:00
|
|
|
# define HAVE_STRUCT_STAT_ST_FSTYPE 1
|
2018-01-28 14:00:08 +01:00
|
|
|
#endif
|
2017-05-27 17:50:54 +02:00
|
|
|
|
2019-05-29 13:57:07 -06:00
|
|
|
/* memfd_create is either defined in sys/mman.h or sys/memfd.h
|
|
|
|
|
* linux/memfd.h defines additional flags
|
|
|
|
|
*/
|
|
|
|
|
#ifdef HAVE_SYS_MMAN_H
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <sys/mman.h>
|
2019-05-29 13:57:07 -06:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_SYS_MEMFD_H
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <sys/memfd.h>
|
2019-05-29 13:57:07 -06:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_LINUX_MEMFD_H
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <linux/memfd.h>
|
2019-05-29 13:57:07 -06:00
|
|
|
#endif
|
|
|
|
|
|
2018-12-30 21:13:02 -08:00
|
|
|
#ifdef _Py_MEMORY_SANITIZER
|
2020-04-15 15:07:31 +02:00
|
|
|
# include <sanitizer/msan_interface.h>
|
2018-12-30 21:13:02 -08:00
|
|
|
#endif
|
|
|
|
|
|
2017-05-27 17:50:54 +02:00
|
|
|
#ifdef HAVE_FORK
|
|
|
|
|
static void
|
|
|
|
|
run_at_forkers(PyObject *lst, int reverse)
|
|
|
|
|
{
|
|
|
|
|
Py_ssize_t i;
|
|
|
|
|
PyObject *cpy;
|
|
|
|
|
|
|
|
|
|
if (lst != NULL) {
|
|
|
|
|
assert(PyList_CheckExact(lst));
|
|
|
|
|
|
|
|
|
|
/* Use a list copy in case register_at_fork() is called from
|
|
|
|
|
* one of the callbacks.
|
|
|
|
|
*/
|
|
|
|
|
cpy = PyList_GetSlice(lst, 0, PyList_GET_SIZE(lst));
|
|
|
|
|
if (cpy == NULL)
|
|
|
|
|
PyErr_WriteUnraisable(lst);
|
|
|
|
|
else {
|
|
|
|
|
if (reverse)
|
|
|
|
|
PyList_Reverse(cpy);
|
|
|
|
|
for (i = 0; i < PyList_GET_SIZE(cpy); i++) {
|
|
|
|
|
PyObject *func, *res;
|
|
|
|
|
func = PyList_GET_ITEM(cpy, i);
|
2019-07-04 12:35:31 +02:00
|
|
|
res = _PyObject_CallNoArg(func);
|
2017-05-27 17:50:54 +02:00
|
|
|
if (res == NULL)
|
|
|
|
|
PyErr_WriteUnraisable(func);
|
|
|
|
|
else
|
|
|
|
|
Py_DECREF(res);
|
|
|
|
|
}
|
|
|
|
|
Py_DECREF(cpy);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
PyOS_BeforeFork(void)
|
|
|
|
|
{
|
2020-04-14 15:14:01 +02:00
|
|
|
run_at_forkers(_PyInterpreterState_GET()->before_forkers, 1);
|
2017-05-27 17:50:54 +02:00
|
|
|
|
|
|
|
|
_PyImport_AcquireLock();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
PyOS_AfterFork_Parent(void)
|
|
|
|
|
{
|
|
|
|
|
if (_PyImport_ReleaseLock() <= 0)
|
|
|
|
|
Py_FatalError("failed releasing import lock after fork");
|
|
|
|
|
|
2020-04-14 15:14:01 +02:00
|
|
|
run_at_forkers(_PyInterpreterState_GET()->after_forkers_parent, 0);
|
2017-05-27 17:50:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
PyOS_AfterFork_Child(void)
|
|
|
|
|
{
|
2019-04-24 17:14:33 +02:00
|
|
|
_PyRuntimeState *runtime = &_PyRuntime;
|
|
|
|
|
_PyGILState_Reinit(runtime);
|
2019-05-13 12:35:37 +02:00
|
|
|
_PyEval_ReInitThreads(runtime);
|
2017-05-27 17:50:54 +02:00
|
|
|
_PyImport_ReInitLock();
|
|
|
|
|
_PySignal_AfterFork();
|
2019-04-24 17:14:33 +02:00
|
|
|
_PyRuntimeState_ReInitThreads(runtime);
|
2019-05-24 15:20:23 +02:00
|
|
|
_PyInterpreterState_DeleteExceptMain(runtime);
|
2017-05-27 17:50:54 +02:00
|
|
|
|
2020-04-14 15:14:01 +02:00
|
|
|
run_at_forkers(_PyInterpreterState_GET()->after_forkers_child, 0);
|
2017-05-27 17:50:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
register_at_forker(PyObject **lst, PyObject *func)
|
|
|
|
|
{
|
2017-05-29 10:03:41 -07:00
|
|
|
if (func == NULL) /* nothing to register? do nothing. */
|
|
|
|
|
return 0;
|
2017-05-27 17:50:54 +02:00
|
|
|
if (*lst == NULL) {
|
|
|
|
|
*lst = PyList_New(0);
|
|
|
|
|
if (*lst == NULL)
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
return PyList_Append(*lst, func);
|
|
|
|
|
}
|
2020-04-07 23:11:49 +02:00
|
|
|
#endif /* HAVE_FORK */
|
|
|
|
|
|
2017-05-27 17:50:54 +02:00
|
|
|
|
|
|
|
|
/* Legacy wrapper */
|
|
|
|
|
void
|
|
|
|
|
PyOS_AfterFork(void)
|
|
|
|
|
{
|
|
|
|
|
#ifdef HAVE_FORK
|
|
|
|
|
PyOS_AfterFork_Child();
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2015-02-22 21:34:54 +02:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
/* defined in fileutils.c */
|
2018-09-12 12:06:42 -07:00
|
|
|
void _Py_time_t_to_FILE_TIME(time_t, int, FILETIME *);
|
|
|
|
|
void _Py_attribute_data_to_stat(BY_HANDLE_FILE_INFORMATION *,
|
2015-02-22 21:34:54 +02:00
|
|
|
ULONG, struct _Py_stat_struct *);
|
|
|
|
|
#endif
|
2012-06-22 16:30:09 -07:00
|
|
|
|
|
|
|
|
|
2013-02-10 21:56:49 +02:00
|
|
|
#ifndef MS_WINDOWS
|
|
|
|
|
PyObject *
|
|
|
|
|
_PyLong_FromUid(uid_t uid)
|
|
|
|
|
{
|
|
|
|
|
if (uid == (uid_t)-1)
|
|
|
|
|
return PyLong_FromLong(-1);
|
|
|
|
|
return PyLong_FromUnsignedLong(uid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PyObject *
|
|
|
|
|
_PyLong_FromGid(gid_t gid)
|
|
|
|
|
{
|
|
|
|
|
if (gid == (gid_t)-1)
|
|
|
|
|
return PyLong_FromLong(-1);
|
|
|
|
|
return PyLong_FromUnsignedLong(gid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int
|
2020-12-29 05:22:13 -08:00
|
|
|
_Py_Uid_Converter(PyObject *obj, uid_t *p)
|
2013-02-10 21:56:49 +02:00
|
|
|
{
|
2013-08-08 00:19:50 -07:00
|
|
|
uid_t uid;
|
|
|
|
|
PyObject *index;
|
2013-02-10 21:56:49 +02:00
|
|
|
int overflow;
|
2013-02-10 23:28:02 +02:00
|
|
|
long result;
|
2013-08-08 00:19:50 -07:00
|
|
|
unsigned long uresult;
|
|
|
|
|
|
|
|
|
|
index = PyNumber_Index(obj);
|
|
|
|
|
if (index == NULL) {
|
|
|
|
|
PyErr_Format(PyExc_TypeError,
|
|
|
|
|
"uid should be integer, not %.200s",
|
2019-11-05 07:16:14 -08:00
|
|
|
_PyType_Name(Py_TYPE(obj)));
|
2013-02-10 23:28:02 +02:00
|
|
|
return 0;
|
|
|
|
|
}
|
2013-08-08 00:19:50 -07:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Handling uid_t is complicated for two reasons:
|
|
|
|
|
* * Although uid_t is (always?) unsigned, it still
|
|
|
|
|
* accepts -1.
|
|
|
|
|
* * We don't know its size in advance--it may be
|
|
|
|
|
* bigger than an int, or it may be smaller than
|
|
|
|
|
* a long.
|
|
|
|
|
*
|
|
|
|
|
* So a bit of defensive programming is in order.
|
|
|
|
|
* Start with interpreting the value passed
|
|
|
|
|
* in as a signed long and see if it works.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
result = PyLong_AsLongAndOverflow(index, &overflow);
|
|
|
|
|
|
|
|
|
|
if (!overflow) {
|
|
|
|
|
uid = (uid_t)result;
|
|
|
|
|
|
|
|
|
|
if (result == -1) {
|
|
|
|
|
if (PyErr_Occurred())
|
|
|
|
|
goto fail;
|
|
|
|
|
/* It's a legitimate -1, we're done. */
|
|
|
|
|
goto success;
|
2013-02-10 21:56:49 +02:00
|
|
|
}
|
2013-08-08 00:19:50 -07:00
|
|
|
|
|
|
|
|
/* Any other negative number is disallowed. */
|
|
|
|
|
if (result < 0)
|
|
|
|
|
goto underflow;
|
|
|
|
|
|
|
|
|
|
/* Ensure the value wasn't truncated. */
|
2013-02-10 21:56:49 +02:00
|
|
|
if (sizeof(uid_t) < sizeof(long) &&
|
2013-08-08 00:19:50 -07:00
|
|
|
(long)uid != result)
|
|
|
|
|
goto underflow;
|
|
|
|
|
goto success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (overflow < 0)
|
|
|
|
|
goto underflow;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Okay, the value overflowed a signed long. If it
|
|
|
|
|
* fits in an *unsigned* long, it may still be okay,
|
|
|
|
|
* as uid_t may be unsigned long on this platform.
|
|
|
|
|
*/
|
|
|
|
|
uresult = PyLong_AsUnsignedLong(index);
|
|
|
|
|
if (PyErr_Occurred()) {
|
|
|
|
|
if (PyErr_ExceptionMatches(PyExc_OverflowError))
|
|
|
|
|
goto overflow;
|
|
|
|
|
goto fail;
|
2013-02-10 21:56:49 +02:00
|
|
|
}
|
2013-08-08 00:19:50 -07:00
|
|
|
|
|
|
|
|
uid = (uid_t)uresult;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* If uid == (uid_t)-1, the user actually passed in ULONG_MAX,
|
|
|
|
|
* but this value would get interpreted as (uid_t)-1 by chown
|
|
|
|
|
* and its siblings. That's not what the user meant! So we
|
|
|
|
|
* throw an overflow exception instead. (We already
|
2013-10-25 11:22:37 +01:00
|
|
|
* handled a real -1 with PyLong_AsLongAndOverflow() above.)
|
2013-08-08 00:19:50 -07:00
|
|
|
*/
|
|
|
|
|
if (uid == (uid_t)-1)
|
|
|
|
|
goto overflow;
|
|
|
|
|
|
|
|
|
|
/* Ensure the value wasn't truncated. */
|
|
|
|
|
if (sizeof(uid_t) < sizeof(long) &&
|
|
|
|
|
(unsigned long)uid != uresult)
|
|
|
|
|
goto overflow;
|
|
|
|
|
/* fallthrough */
|
|
|
|
|
|
|
|
|
|
success:
|
|
|
|
|
Py_DECREF(index);
|
2020-12-29 05:22:13 -08:00
|
|
|
*p = uid;
|
2013-02-10 21:56:49 +02:00
|
|
|
return 1;
|
|
|
|
|
|
2013-08-08 00:19:50 -07:00
|
|
|
underflow:
|
2013-02-10 21:56:49 +02:00
|
|
|
PyErr_SetString(PyExc_OverflowError,
|
2013-08-08 00:19:50 -07:00
|
|
|
"uid is less than minimum");
|
|
|
|
|
goto fail;
|
2013-02-10 21:56:49 +02:00
|
|
|
|
2013-08-08 00:19:50 -07:00
|
|
|
overflow:
|
2013-02-10 21:56:49 +02:00
|
|
|
PyErr_SetString(PyExc_OverflowError,
|
2013-08-08 00:19:50 -07:00
|
|
|
"uid is greater than maximum");
|
|
|
|
|
/* fallthrough */
|
|
|
|
|
|
|
|
|
|
fail:
|
|
|
|
|
Py_DECREF(index);
|
2013-02-10 21:56:49 +02:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int
|
2020-12-29 05:22:13 -08:00
|
|
|
_Py_Gid_Converter(PyObject *obj, gid_t *p)
|
2013-02-10 21:56:49 +02:00
|
|
|
{
|
2013-08-08 00:19:50 -07:00
|
|
|
gid_t gid;
|
|
|
|
|
PyObject *index;
|
2013-02-10 21:56:49 +02:00
|
|
|
int overflow;
|
2013-02-10 23:28:02 +02:00
|
|
|
long result;
|
2013-08-08 00:19:50 -07:00
|
|
|
unsigned long uresult;
|
|
|
|
|
|
|
|
|
|
index = PyNumber_Index(obj);
|
|
|
|
|
if (index == NULL) {
|
|
|
|
|
PyErr_Format(PyExc_TypeError,
|
|
|
|
|
"gid should be integer, not %.200s",
|
2019-11-05 07:16:14 -08:00
|
|
|
_PyType_Name(Py_TYPE(obj)));
|
2013-02-10 23:28:02 +02:00
|
|
|
return 0;
|
|
|
|
|
}
|
2013-08-08 00:19:50 -07:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Handling gid_t is complicated for two reasons:
|
|
|
|
|
* * Although gid_t is (always?) unsigned, it still
|
|
|
|
|
* accepts -1.
|
|
|
|
|
* * We don't know its size in advance--it may be
|
|
|
|
|
* bigger than an int, or it may be smaller than
|
|
|
|
|
* a long.
|
|
|
|
|
*
|
|
|
|
|
* So a bit of defensive programming is in order.
|
|
|
|
|
* Start with interpreting the value passed
|
|
|
|
|
* in as a signed long and see if it works.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
result = PyLong_AsLongAndOverflow(index, &overflow);
|
|
|
|
|
|
|
|
|
|
if (!overflow) {
|
|
|
|
|
gid = (gid_t)result;
|
|
|
|
|
|
|
|
|
|
if (result == -1) {
|
|
|
|
|
if (PyErr_Occurred())
|
|
|
|
|
goto fail;
|
|
|
|
|
/* It's a legitimate -1, we're done. */
|
|
|
|
|
goto success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Any other negative number is disallowed. */
|
|
|
|
|
if (result < 0) {
|
|
|
|
|
goto underflow;
|
2013-02-10 21:56:49 +02:00
|
|
|
}
|
2013-08-08 00:19:50 -07:00
|
|
|
|
|
|
|
|
/* Ensure the value wasn't truncated. */
|
2013-02-10 21:56:49 +02:00
|
|
|
if (sizeof(gid_t) < sizeof(long) &&
|
2013-08-08 00:19:50 -07:00
|
|
|
(long)gid != result)
|
|
|
|
|
goto underflow;
|
|
|
|
|
goto success;
|
2013-02-10 21:56:49 +02:00
|
|
|
}
|
2013-08-08 00:19:50 -07:00
|
|
|
|
|
|
|
|
if (overflow < 0)
|
|
|
|
|
goto underflow;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Okay, the value overflowed a signed long. If it
|
|
|
|
|
* fits in an *unsigned* long, it may still be okay,
|
|
|
|
|
* as gid_t may be unsigned long on this platform.
|
|
|
|
|
*/
|
|
|
|
|
uresult = PyLong_AsUnsignedLong(index);
|
|
|
|
|
if (PyErr_Occurred()) {
|
|
|
|
|
if (PyErr_ExceptionMatches(PyExc_OverflowError))
|
|
|
|
|
goto overflow;
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gid = (gid_t)uresult;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* If gid == (gid_t)-1, the user actually passed in ULONG_MAX,
|
|
|
|
|
* but this value would get interpreted as (gid_t)-1 by chown
|
|
|
|
|
* and its siblings. That's not what the user meant! So we
|
|
|
|
|
* throw an overflow exception instead. (We already
|
2013-10-25 11:22:37 +01:00
|
|
|
* handled a real -1 with PyLong_AsLongAndOverflow() above.)
|
2013-08-08 00:19:50 -07:00
|
|
|
*/
|
|
|
|
|
if (gid == (gid_t)-1)
|
|
|
|
|
goto overflow;
|
|
|
|
|
|
|
|
|
|
/* Ensure the value wasn't truncated. */
|
|
|
|
|
if (sizeof(gid_t) < sizeof(long) &&
|
|
|
|
|
(unsigned long)gid != uresult)
|
|
|
|
|
goto overflow;
|
|
|
|
|
/* fallthrough */
|
|
|
|
|
|
|
|
|
|
success:
|
|
|
|
|
Py_DECREF(index);
|
2020-12-29 05:22:13 -08:00
|
|
|
*p = gid;
|
2013-02-10 21:56:49 +02:00
|
|
|
return 1;
|
|
|
|
|
|
2013-08-08 00:19:50 -07:00
|
|
|
underflow:
|
2013-02-10 21:56:49 +02:00
|
|
|
PyErr_SetString(PyExc_OverflowError,
|
2013-08-08 00:19:50 -07:00
|
|
|
"gid is less than minimum");
|
|
|
|
|
goto fail;
|
2013-02-10 21:56:49 +02:00
|
|
|
|
2013-08-08 00:19:50 -07:00
|
|
|
overflow:
|
2013-02-10 21:56:49 +02:00
|
|
|
PyErr_SetString(PyExc_OverflowError,
|
2013-08-08 00:19:50 -07:00
|
|
|
"gid is greater than maximum");
|
|
|
|
|
/* fallthrough */
|
|
|
|
|
|
|
|
|
|
fail:
|
|
|
|
|
Py_DECREF(index);
|
2013-02-10 21:56:49 +02:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
#endif /* MS_WINDOWS */
|
|
|
|
|
|
|
|
|
|
|
2016-09-05 17:44:18 -07:00
|
|
|
#define _PyLong_FromDev PyLong_FromLongLong
|
2015-01-28 16:07:52 -08:00
|
|
|
|
|
|
|
|
|
2015-01-18 11:12:11 +02:00
|
|
|
#if defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV)
|
|
|
|
|
static int
|
|
|
|
|
_Py_Dev_Converter(PyObject *obj, void *p)
|
|
|
|
|
{
|
|
|
|
|
*((dev_t *)p) = PyLong_AsUnsignedLongLong(obj);
|
|
|
|
|
if (PyErr_Occurred())
|
|
|
|
|
return 0;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2015-01-28 16:07:52 -08:00
|
|
|
#endif /* HAVE_MKNOD && HAVE_MAKEDEV */
|
2015-01-18 11:12:11 +02:00
|
|
|
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef AT_FDCWD
|
2012-09-18 21:50:06 -04:00
|
|
|
/*
|
|
|
|
|
* Why the (int) cast? Solaris 10 defines AT_FDCWD as 0xffd19553 (-3041965);
|
|
|
|
|
* without the int cast, the value gets interpreted as uint (4291925331),
|
|
|
|
|
* which doesn't play nicely with all the initializer lines in this file that
|
|
|
|
|
* look like this:
|
|
|
|
|
* int dir_fd = DEFAULT_DIR_FD;
|
|
|
|
|
*/
|
|
|
|
|
#define DEFAULT_DIR_FD (int)AT_FDCWD
|
2012-06-22 16:30:09 -07:00
|
|
|
#else
|
|
|
|
|
#define DEFAULT_DIR_FD (-100)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
static int
|
2016-04-06 22:17:52 +03:00
|
|
|
_fd_converter(PyObject *o, int *p)
|
2013-01-07 23:13:46 +02:00
|
|
|
{
|
|
|
|
|
int overflow;
|
2013-08-08 00:19:50 -07:00
|
|
|
long long_value;
|
|
|
|
|
|
|
|
|
|
PyObject *index = PyNumber_Index(o);
|
|
|
|
|
if (index == NULL) {
|
2012-06-22 16:30:09 -07:00
|
|
|
return 0;
|
|
|
|
|
}
|
2013-08-08 00:19:50 -07:00
|
|
|
|
2016-04-06 22:17:52 +03:00
|
|
|
assert(PyLong_Check(index));
|
2013-08-08 00:19:50 -07:00
|
|
|
long_value = PyLong_AsLongAndOverflow(index, &overflow);
|
|
|
|
|
Py_DECREF(index);
|
2016-04-06 22:17:52 +03:00
|
|
|
assert(!PyErr_Occurred());
|
2013-01-07 23:13:46 +02:00
|
|
|
if (overflow > 0 || long_value > INT_MAX) {
|
2012-06-22 16:30:09 -07:00
|
|
|
PyErr_SetString(PyExc_OverflowError,
|
2013-08-08 00:19:50 -07:00
|
|
|
"fd is greater than maximum");
|
2012-06-22 16:30:09 -07:00
|
|
|
return 0;
|
|
|
|
|
}
|
2013-01-07 23:13:46 +02:00
|
|
|
if (overflow < 0 || long_value < INT_MIN) {
|
2012-06-22 16:30:09 -07:00
|
|
|
PyErr_SetString(PyExc_OverflowError,
|
2013-08-08 00:19:50 -07:00
|
|
|
"fd is less than minimum");
|
2012-06-22 16:30:09 -07:00
|
|
|
return 0;
|
|
|
|
|
}
|
2013-08-08 00:19:50 -07:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
*p = (int)long_value;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
2013-01-07 23:13:46 +02:00
|
|
|
dir_fd_converter(PyObject *o, void *p)
|
|
|
|
|
{
|
|
|
|
|
if (o == Py_None) {
|
|
|
|
|
*(int *)p = DEFAULT_DIR_FD;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2016-04-06 22:17:52 +03:00
|
|
|
else if (PyIndex_Check(o)) {
|
|
|
|
|
return _fd_converter(o, (int *)p);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
PyErr_Format(PyExc_TypeError,
|
|
|
|
|
"argument should be integer or None, not %.200s",
|
2019-11-05 07:16:14 -08:00
|
|
|
_PyType_Name(Py_TYPE(o)));
|
2016-04-06 22:17:52 +03:00
|
|
|
return 0;
|
|
|
|
|
}
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
|
2019-11-05 07:16:14 -08:00
|
|
|
typedef struct {
|
|
|
|
|
PyObject *billion;
|
|
|
|
|
PyObject *DirEntryType;
|
|
|
|
|
PyObject *ScandirIteratorType;
|
|
|
|
|
#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM)
|
|
|
|
|
PyObject *SchedParamType;
|
|
|
|
|
#endif
|
|
|
|
|
PyObject *StatResultType;
|
|
|
|
|
PyObject *StatVFSResultType;
|
|
|
|
|
PyObject *TerminalSizeType;
|
|
|
|
|
PyObject *TimesResultType;
|
|
|
|
|
PyObject *UnameResultType;
|
|
|
|
|
#if defined(HAVE_WAITID) && !defined(__APPLE__)
|
|
|
|
|
PyObject *WaitidResultType;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined(HAVE_WAIT3) || defined(HAVE_WAIT4)
|
|
|
|
|
PyObject *struct_rusage;
|
|
|
|
|
#endif
|
|
|
|
|
PyObject *st_mode;
|
|
|
|
|
} _posixstate;
|
|
|
|
|
|
|
|
|
|
|
2020-03-16 21:15:01 +08:00
|
|
|
static inline _posixstate*
|
|
|
|
|
get_posix_state(PyObject *module)
|
|
|
|
|
{
|
|
|
|
|
void *state = PyModule_GetState(module);
|
|
|
|
|
assert(state != NULL);
|
|
|
|
|
return (_posixstate *)state;
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
/*
|
|
|
|
|
* A PyArg_ParseTuple "converter" function
|
|
|
|
|
* that handles filesystem paths in the manner
|
|
|
|
|
* preferred by the os module.
|
|
|
|
|
*
|
|
|
|
|
* path_converter accepts (Unicode) strings and their
|
|
|
|
|
* subclasses, and bytes and their subclasses. What
|
|
|
|
|
* it does with the argument depends on the platform:
|
|
|
|
|
*
|
|
|
|
|
* * On Windows, if we get a (Unicode) string we
|
|
|
|
|
* extract the wchar_t * and return it; if we get
|
2016-09-08 10:35:16 -07:00
|
|
|
* bytes we decode to wchar_t * and return that.
|
2012-06-22 16:30:09 -07:00
|
|
|
*
|
|
|
|
|
* * On all other platforms, strings are encoded
|
|
|
|
|
* to bytes using PyUnicode_FSConverter, then we
|
|
|
|
|
* extract the char * from the bytes object and
|
|
|
|
|
* return that.
|
|
|
|
|
*
|
|
|
|
|
* path_converter also optionally accepts signed
|
|
|
|
|
* integers (representing open file descriptors) instead
|
|
|
|
|
* of path strings.
|
|
|
|
|
*
|
|
|
|
|
* Input fields:
|
|
|
|
|
* path.nullable
|
|
|
|
|
* If nonzero, the path is permitted to be None.
|
|
|
|
|
* path.allow_fd
|
|
|
|
|
* If nonzero, the path is permitted to be a file handle
|
|
|
|
|
* (a signed int) instead of a string.
|
|
|
|
|
* path.function_name
|
|
|
|
|
* If non-NULL, path_converter will use that as the name
|
|
|
|
|
* of the function in error messages.
|
2013-10-19 00:09:25 -07:00
|
|
|
* (If path.function_name is NULL it omits the function name.)
|
2012-06-22 16:30:09 -07:00
|
|
|
* path.argument_name
|
|
|
|
|
* If non-NULL, path_converter will use that as the name
|
|
|
|
|
* of the parameter in error messages.
|
|
|
|
|
* (If path.argument_name is NULL it uses "path".)
|
|
|
|
|
*
|
|
|
|
|
* Output fields:
|
|
|
|
|
* path.wide
|
|
|
|
|
* Points to the path if it was expressed as Unicode
|
|
|
|
|
* and was not encoded. (Only used on Windows.)
|
|
|
|
|
* path.narrow
|
|
|
|
|
* Points to the path if it was expressed as bytes,
|
2016-09-08 10:35:16 -07:00
|
|
|
* or it was Unicode and was encoded to bytes. (On Windows,
|
2016-10-10 00:38:21 +00:00
|
|
|
* is a non-zero integer if the path was expressed as bytes.
|
2016-09-08 10:35:16 -07:00
|
|
|
* The type is deliberately incompatible to prevent misuse.)
|
2012-06-22 16:30:09 -07:00
|
|
|
* path.fd
|
|
|
|
|
* Contains a file descriptor if path.accept_fd was true
|
|
|
|
|
* and the caller provided a signed integer instead of any
|
|
|
|
|
* sort of string.
|
|
|
|
|
*
|
|
|
|
|
* WARNING: if your "path" parameter is optional, and is
|
|
|
|
|
* unspecified, path_converter will never get called.
|
|
|
|
|
* So if you set allow_fd, you *MUST* initialize path.fd = -1
|
|
|
|
|
* yourself!
|
|
|
|
|
* path.length
|
|
|
|
|
* The length of the path in characters, if specified as
|
|
|
|
|
* a string.
|
|
|
|
|
* path.object
|
2017-01-08 23:26:57 +08:00
|
|
|
* The original object passed in (if get a PathLike object,
|
|
|
|
|
* the result of PyOS_FSPath() is treated as the original object).
|
|
|
|
|
* Own a reference to the object.
|
2012-06-22 16:30:09 -07:00
|
|
|
* path.cleanup
|
|
|
|
|
* For internal use only. May point to a temporary object.
|
|
|
|
|
* (Pay no attention to the man behind the curtain.)
|
|
|
|
|
*
|
|
|
|
|
* At most one of path.wide or path.narrow will be non-NULL.
|
|
|
|
|
* If path was None and path.nullable was set,
|
|
|
|
|
* or if path was an integer and path.allow_fd was set,
|
|
|
|
|
* both path.wide and path.narrow will be NULL
|
|
|
|
|
* and path.length will be 0.
|
2012-06-24 13:58:31 +02:00
|
|
|
*
|
2012-06-22 16:30:09 -07:00
|
|
|
* path_converter takes care to not write to the path_t
|
|
|
|
|
* unless it's successful. However it must reset the
|
|
|
|
|
* "cleanup" field each time it's called.
|
|
|
|
|
*
|
|
|
|
|
* Use as follows:
|
|
|
|
|
* path_t path;
|
|
|
|
|
* memset(&path, 0, sizeof(path));
|
|
|
|
|
* PyArg_ParseTuple(args, "O&", path_converter, &path);
|
|
|
|
|
* // ... use values from path ...
|
|
|
|
|
* path_cleanup(&path);
|
|
|
|
|
*
|
|
|
|
|
* (Note that if PyArg_Parse fails you don't need to call
|
|
|
|
|
* path_cleanup(). However it is safe to do so.)
|
|
|
|
|
*/
|
|
|
|
|
typedef struct {
|
2012-10-30 02:17:38 +01:00
|
|
|
const char *function_name;
|
|
|
|
|
const char *argument_name;
|
2012-06-22 16:30:09 -07:00
|
|
|
int nullable;
|
|
|
|
|
int allow_fd;
|
2016-05-07 16:45:18 +03:00
|
|
|
const wchar_t *wide;
|
2016-09-08 10:35:16 -07:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
BOOL narrow;
|
|
|
|
|
#else
|
2016-05-07 16:45:18 +03:00
|
|
|
const char *narrow;
|
2016-09-08 10:35:16 -07:00
|
|
|
#endif
|
2012-06-22 16:30:09 -07:00
|
|
|
int fd;
|
|
|
|
|
Py_ssize_t length;
|
|
|
|
|
PyObject *object;
|
|
|
|
|
PyObject *cleanup;
|
|
|
|
|
} path_t;
|
|
|
|
|
|
2016-09-08 10:35:16 -07:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
#define PATH_T_INITIALIZE(function_name, argument_name, nullable, allow_fd) \
|
|
|
|
|
{function_name, argument_name, nullable, allow_fd, NULL, FALSE, -1, 0, NULL, NULL}
|
|
|
|
|
#else
|
2014-08-05 14:04:04 +10:00
|
|
|
#define PATH_T_INITIALIZE(function_name, argument_name, nullable, allow_fd) \
|
|
|
|
|
{function_name, argument_name, nullable, allow_fd, NULL, NULL, -1, 0, NULL, NULL}
|
2016-09-08 10:35:16 -07:00
|
|
|
#endif
|
2013-10-19 00:09:25 -07:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
static void
|
2017-01-08 23:26:57 +08:00
|
|
|
path_cleanup(path_t *path)
|
|
|
|
|
{
|
|
|
|
|
Py_CLEAR(path->object);
|
|
|
|
|
Py_CLEAR(path->cleanup);
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
2016-04-06 22:17:52 +03:00
|
|
|
path_converter(PyObject *o, void *p)
|
|
|
|
|
{
|
2012-06-22 16:30:09 -07:00
|
|
|
path_t *path = (path_t *)p;
|
2017-01-08 23:26:57 +08:00
|
|
|
PyObject *bytes = NULL;
|
|
|
|
|
Py_ssize_t length = 0;
|
2016-08-26 14:44:48 -07:00
|
|
|
int is_index, is_buffer, is_bytes, is_unicode;
|
2016-05-07 16:45:18 +03:00
|
|
|
const char *narrow;
|
2016-09-08 10:35:16 -07:00
|
|
|
#ifdef MS_WINDOWS
|
2017-01-08 23:26:57 +08:00
|
|
|
PyObject *wo = NULL;
|
2016-09-08 10:35:16 -07:00
|
|
|
const wchar_t *wide;
|
|
|
|
|
#endif
|
2012-06-22 16:30:09 -07:00
|
|
|
|
|
|
|
|
#define FORMAT_EXCEPTION(exc, fmt) \
|
|
|
|
|
PyErr_Format(exc, "%s%s" fmt, \
|
|
|
|
|
path->function_name ? path->function_name : "", \
|
|
|
|
|
path->function_name ? ": " : "", \
|
|
|
|
|
path->argument_name ? path->argument_name : "path")
|
|
|
|
|
|
|
|
|
|
/* Py_CLEANUP_SUPPORTED support */
|
|
|
|
|
if (o == NULL) {
|
|
|
|
|
path_cleanup(path);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2016-08-26 14:44:48 -07:00
|
|
|
/* Ensure it's always safe to call path_cleanup(). */
|
2017-01-08 23:26:57 +08:00
|
|
|
path->object = path->cleanup = NULL;
|
|
|
|
|
/* path->object owns a reference to the original object */
|
|
|
|
|
Py_INCREF(o);
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2016-04-06 22:17:52 +03:00
|
|
|
if ((o == Py_None) && path->nullable) {
|
2012-06-22 16:30:09 -07:00
|
|
|
path->wide = NULL;
|
2016-09-08 10:35:16 -07:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
path->narrow = FALSE;
|
|
|
|
|
#else
|
2012-06-22 16:30:09 -07:00
|
|
|
path->narrow = NULL;
|
2016-09-08 10:35:16 -07:00
|
|
|
#endif
|
2012-06-22 16:30:09 -07:00
|
|
|
path->fd = -1;
|
2017-01-08 23:26:57 +08:00
|
|
|
goto success_exit;
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
|
2016-08-26 14:44:48 -07:00
|
|
|
/* Only call this here so that we don't treat the return value of
|
|
|
|
|
os.fspath() as an fd or buffer. */
|
|
|
|
|
is_index = path->allow_fd && PyIndex_Check(o);
|
|
|
|
|
is_buffer = PyObject_CheckBuffer(o);
|
|
|
|
|
is_bytes = PyBytes_Check(o);
|
|
|
|
|
is_unicode = PyUnicode_Check(o);
|
|
|
|
|
|
|
|
|
|
if (!is_index && !is_buffer && !is_unicode && !is_bytes) {
|
|
|
|
|
/* Inline PyOS_FSPath() for better error messages. */
|
2019-02-18 10:46:34 +00:00
|
|
|
PyObject *func, *res;
|
2016-08-26 14:44:48 -07:00
|
|
|
|
|
|
|
|
func = _PyObject_LookupSpecial(o, &PyId___fspath__);
|
|
|
|
|
if (NULL == func) {
|
2017-01-08 23:26:57 +08:00
|
|
|
goto error_format;
|
2016-08-26 14:44:48 -07:00
|
|
|
}
|
2019-02-18 10:46:34 +00:00
|
|
|
res = _PyObject_CallNoArg(func);
|
2016-08-26 14:44:48 -07:00
|
|
|
Py_DECREF(func);
|
2019-02-18 10:46:34 +00:00
|
|
|
if (NULL == res) {
|
2016-08-26 14:44:48 -07:00
|
|
|
goto error_exit;
|
|
|
|
|
}
|
2019-02-18 10:46:34 +00:00
|
|
|
else if (PyUnicode_Check(res)) {
|
2016-08-26 14:44:48 -07:00
|
|
|
is_unicode = 1;
|
|
|
|
|
}
|
2019-02-18 10:46:34 +00:00
|
|
|
else if (PyBytes_Check(res)) {
|
2016-08-26 14:44:48 -07:00
|
|
|
is_bytes = 1;
|
|
|
|
|
}
|
|
|
|
|
else {
|
2019-02-18 10:46:34 +00:00
|
|
|
PyErr_Format(PyExc_TypeError,
|
|
|
|
|
"expected %.200s.__fspath__() to return str or bytes, "
|
2019-11-05 07:16:14 -08:00
|
|
|
"not %.200s", _PyType_Name(Py_TYPE(o)),
|
|
|
|
|
_PyType_Name(Py_TYPE(res)));
|
2019-02-18 10:46:34 +00:00
|
|
|
Py_DECREF(res);
|
|
|
|
|
goto error_exit;
|
2016-08-26 14:44:48 -07:00
|
|
|
}
|
2019-02-18 10:46:34 +00:00
|
|
|
|
|
|
|
|
/* still owns a reference to the original object */
|
|
|
|
|
Py_DECREF(o);
|
|
|
|
|
o = res;
|
2016-08-26 14:44:48 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (is_unicode) {
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef MS_WINDOWS
|
2021-03-16 08:03:37 +02:00
|
|
|
_Py_COMP_DIAG_PUSH
|
|
|
|
|
_Py_COMP_DIAG_IGNORE_DEPR_DECLS
|
2016-09-19 11:55:44 +02:00
|
|
|
wide = PyUnicode_AsUnicodeAndSize(o, &length);
|
2021-03-16 08:03:37 +02:00
|
|
|
_Py_COMP_DIAG_POP
|
2013-11-13 14:17:30 +01:00
|
|
|
if (!wide) {
|
2017-01-08 23:26:57 +08:00
|
|
|
goto error_exit;
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
2013-11-13 14:17:30 +01:00
|
|
|
if (length > 32767) {
|
|
|
|
|
FORMAT_EXCEPTION(PyExc_ValueError, "%s too long for Windows");
|
2017-01-08 23:26:57 +08:00
|
|
|
goto error_exit;
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
2015-04-20 09:53:58 +03:00
|
|
|
if (wcslen(wide) != length) {
|
2016-04-06 22:17:52 +03:00
|
|
|
FORMAT_EXCEPTION(PyExc_ValueError, "embedded null character in %s");
|
2017-01-08 23:26:57 +08:00
|
|
|
goto error_exit;
|
2015-04-20 09:53:58 +03:00
|
|
|
}
|
2012-06-22 16:30:09 -07:00
|
|
|
|
|
|
|
|
path->wide = wide;
|
2017-01-08 23:26:57 +08:00
|
|
|
path->narrow = FALSE;
|
2012-06-22 16:30:09 -07:00
|
|
|
path->fd = -1;
|
2017-01-08 23:26:57 +08:00
|
|
|
goto success_exit;
|
2012-06-22 16:30:09 -07:00
|
|
|
#else
|
2016-04-06 22:17:52 +03:00
|
|
|
if (!PyUnicode_FSConverter(o, &bytes)) {
|
2017-01-08 23:26:57 +08:00
|
|
|
goto error_exit;
|
2016-04-06 22:17:52 +03:00
|
|
|
}
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
}
|
2016-08-26 14:44:48 -07:00
|
|
|
else if (is_bytes) {
|
2016-08-06 23:22:08 +03:00
|
|
|
bytes = o;
|
|
|
|
|
Py_INCREF(bytes);
|
|
|
|
|
}
|
2016-08-26 14:44:48 -07:00
|
|
|
else if (is_buffer) {
|
2017-07-11 06:36:46 +03:00
|
|
|
/* XXX Replace PyObject_CheckBuffer with PyBytes_Check in other code
|
2017-08-03 09:00:59 +03:00
|
|
|
after removing support of non-bytes buffer objects. */
|
2016-08-06 23:22:08 +03:00
|
|
|
if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
|
|
|
|
|
"%s%s%s should be %s, not %.200s",
|
|
|
|
|
path->function_name ? path->function_name : "",
|
|
|
|
|
path->function_name ? ": " : "",
|
|
|
|
|
path->argument_name ? path->argument_name : "path",
|
2016-08-26 14:44:48 -07:00
|
|
|
path->allow_fd && path->nullable ? "string, bytes, os.PathLike, "
|
|
|
|
|
"integer or None" :
|
|
|
|
|
path->allow_fd ? "string, bytes, os.PathLike or integer" :
|
|
|
|
|
path->nullable ? "string, bytes, os.PathLike or None" :
|
|
|
|
|
"string, bytes or os.PathLike",
|
2019-11-05 07:16:14 -08:00
|
|
|
_PyType_Name(Py_TYPE(o)))) {
|
2017-01-08 23:26:57 +08:00
|
|
|
goto error_exit;
|
2016-08-06 23:22:08 +03:00
|
|
|
}
|
2016-04-06 22:17:52 +03:00
|
|
|
bytes = PyBytes_FromObject(o);
|
2012-06-22 16:30:09 -07:00
|
|
|
if (!bytes) {
|
2017-01-08 23:26:57 +08:00
|
|
|
goto error_exit;
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
}
|
2016-09-08 10:35:16 -07:00
|
|
|
else if (is_index) {
|
2016-04-06 22:17:52 +03:00
|
|
|
if (!_fd_converter(o, &path->fd)) {
|
2017-01-08 23:26:57 +08:00
|
|
|
goto error_exit;
|
2016-04-06 22:17:52 +03:00
|
|
|
}
|
|
|
|
|
path->wide = NULL;
|
2016-09-08 10:35:16 -07:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
path->narrow = FALSE;
|
|
|
|
|
#else
|
2016-04-06 22:17:52 +03:00
|
|
|
path->narrow = NULL;
|
2016-09-08 10:35:16 -07:00
|
|
|
#endif
|
2017-01-08 23:26:57 +08:00
|
|
|
goto success_exit;
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
2016-04-06 22:17:52 +03:00
|
|
|
else {
|
2017-01-08 23:26:57 +08:00
|
|
|
error_format:
|
2016-04-06 22:17:52 +03:00
|
|
|
PyErr_Format(PyExc_TypeError, "%s%s%s should be %s, not %.200s",
|
|
|
|
|
path->function_name ? path->function_name : "",
|
|
|
|
|
path->function_name ? ": " : "",
|
|
|
|
|
path->argument_name ? path->argument_name : "path",
|
2016-08-26 14:44:48 -07:00
|
|
|
path->allow_fd && path->nullable ? "string, bytes, os.PathLike, "
|
|
|
|
|
"integer or None" :
|
|
|
|
|
path->allow_fd ? "string, bytes, os.PathLike or integer" :
|
|
|
|
|
path->nullable ? "string, bytes, os.PathLike or None" :
|
|
|
|
|
"string, bytes or os.PathLike",
|
2019-11-05 07:16:14 -08:00
|
|
|
_PyType_Name(Py_TYPE(o)));
|
2017-01-08 23:26:57 +08:00
|
|
|
goto error_exit;
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
length = PyBytes_GET_SIZE(bytes);
|
|
|
|
|
narrow = PyBytes_AS_STRING(bytes);
|
2014-08-16 01:03:39 +02:00
|
|
|
if ((size_t)length != strlen(narrow)) {
|
2014-09-06 20:07:17 +03:00
|
|
|
FORMAT_EXCEPTION(PyExc_ValueError, "embedded null character in %s");
|
2017-01-08 23:26:57 +08:00
|
|
|
goto error_exit;
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
|
2016-09-08 10:35:16 -07:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
wo = PyUnicode_DecodeFSDefaultAndSize(
|
|
|
|
|
narrow,
|
|
|
|
|
length
|
|
|
|
|
);
|
|
|
|
|
if (!wo) {
|
2017-01-08 23:26:57 +08:00
|
|
|
goto error_exit;
|
2016-09-08 10:35:16 -07:00
|
|
|
}
|
|
|
|
|
|
2021-03-16 08:03:37 +02:00
|
|
|
_Py_COMP_DIAG_PUSH
|
|
|
|
|
_Py_COMP_DIAG_IGNORE_DEPR_DECLS
|
2017-01-08 23:26:57 +08:00
|
|
|
wide = PyUnicode_AsUnicodeAndSize(wo, &length);
|
2021-03-16 08:03:37 +02:00
|
|
|
_Py_COMP_DIAG_POP
|
2016-09-08 10:35:16 -07:00
|
|
|
if (!wide) {
|
2017-01-08 23:26:57 +08:00
|
|
|
goto error_exit;
|
2016-09-08 10:35:16 -07:00
|
|
|
}
|
|
|
|
|
if (length > 32767) {
|
|
|
|
|
FORMAT_EXCEPTION(PyExc_ValueError, "%s too long for Windows");
|
2017-01-08 23:26:57 +08:00
|
|
|
goto error_exit;
|
2016-09-08 10:35:16 -07:00
|
|
|
}
|
|
|
|
|
if (wcslen(wide) != length) {
|
|
|
|
|
FORMAT_EXCEPTION(PyExc_ValueError, "embedded null character in %s");
|
2017-01-08 23:26:57 +08:00
|
|
|
goto error_exit;
|
2016-09-08 10:35:16 -07:00
|
|
|
}
|
|
|
|
|
path->wide = wide;
|
|
|
|
|
path->narrow = TRUE;
|
2017-01-08 23:26:57 +08:00
|
|
|
path->cleanup = wo;
|
|
|
|
|
Py_DECREF(bytes);
|
2016-09-08 10:35:16 -07:00
|
|
|
#else
|
2012-06-22 16:30:09 -07:00
|
|
|
path->wide = NULL;
|
|
|
|
|
path->narrow = narrow;
|
2016-08-06 23:22:08 +03:00
|
|
|
if (bytes == o) {
|
2017-01-08 23:26:57 +08:00
|
|
|
/* Still a reference owned by path->object, don't have to
|
|
|
|
|
worry about path->narrow is used after free. */
|
2016-08-06 23:22:08 +03:00
|
|
|
Py_DECREF(bytes);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
path->cleanup = bytes;
|
|
|
|
|
}
|
2017-01-08 23:26:57 +08:00
|
|
|
#endif
|
|
|
|
|
path->fd = -1;
|
|
|
|
|
|
|
|
|
|
success_exit:
|
|
|
|
|
path->length = length;
|
|
|
|
|
path->object = o;
|
|
|
|
|
return Py_CLEANUP_SUPPORTED;
|
|
|
|
|
|
|
|
|
|
error_exit:
|
|
|
|
|
Py_XDECREF(o);
|
|
|
|
|
Py_XDECREF(bytes);
|
|
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
Py_XDECREF(wo);
|
|
|
|
|
#endif
|
|
|
|
|
return 0;
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2015-12-25 20:01:53 +02:00
|
|
|
argument_unavailable_error(const char *function_name, const char *argument_name)
|
|
|
|
|
{
|
2012-06-22 16:30:09 -07:00
|
|
|
PyErr_Format(PyExc_NotImplementedError,
|
|
|
|
|
"%s%s%s unavailable on this platform",
|
|
|
|
|
(function_name != NULL) ? function_name : "",
|
|
|
|
|
(function_name != NULL) ? ": ": "",
|
|
|
|
|
argument_name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
2013-01-07 23:13:46 +02:00
|
|
|
dir_fd_unavailable(PyObject *o, void *p)
|
|
|
|
|
{
|
|
|
|
|
int dir_fd;
|
|
|
|
|
if (!dir_fd_converter(o, &dir_fd))
|
2012-06-22 16:30:09 -07:00
|
|
|
return 0;
|
2013-01-07 23:13:46 +02:00
|
|
|
if (dir_fd != DEFAULT_DIR_FD) {
|
|
|
|
|
argument_unavailable_error(NULL, "dir_fd");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
*(int *)p = dir_fd;
|
|
|
|
|
return 1;
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
2015-12-25 20:01:53 +02:00
|
|
|
fd_specified(const char *function_name, int fd)
|
|
|
|
|
{
|
2012-06-22 16:30:09 -07:00
|
|
|
if (fd == -1)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
argument_unavailable_error(function_name, "fd");
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
2015-12-25 20:01:53 +02:00
|
|
|
follow_symlinks_specified(const char *function_name, int follow_symlinks)
|
|
|
|
|
{
|
2012-06-22 16:30:09 -07:00
|
|
|
if (follow_symlinks)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
argument_unavailable_error(function_name, "follow_symlinks");
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
2015-12-25 20:01:53 +02:00
|
|
|
path_and_dir_fd_invalid(const char *function_name, path_t *path, int dir_fd)
|
|
|
|
|
{
|
2016-09-08 10:35:16 -07:00
|
|
|
if (!path->wide && (dir_fd != DEFAULT_DIR_FD)
|
|
|
|
|
#ifndef MS_WINDOWS
|
|
|
|
|
&& !path->narrow
|
|
|
|
|
#endif
|
|
|
|
|
) {
|
2012-06-22 16:30:09 -07:00
|
|
|
PyErr_Format(PyExc_ValueError,
|
|
|
|
|
"%s: can't specify dir_fd without matching path",
|
|
|
|
|
function_name);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
2015-12-25 20:01:53 +02:00
|
|
|
dir_fd_and_fd_invalid(const char *function_name, int dir_fd, int fd)
|
|
|
|
|
{
|
2012-06-22 16:30:09 -07:00
|
|
|
if ((dir_fd != DEFAULT_DIR_FD) && (fd != -1)) {
|
|
|
|
|
PyErr_Format(PyExc_ValueError,
|
|
|
|
|
"%s: can't specify both dir_fd and fd",
|
|
|
|
|
function_name);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
2015-12-25 20:01:53 +02:00
|
|
|
fd_and_follow_symlinks_invalid(const char *function_name, int fd,
|
|
|
|
|
int follow_symlinks)
|
|
|
|
|
{
|
2012-06-22 16:30:09 -07:00
|
|
|
if ((fd > 0) && (!follow_symlinks)) {
|
|
|
|
|
PyErr_Format(PyExc_ValueError,
|
|
|
|
|
"%s: cannot use fd and follow_symlinks together",
|
|
|
|
|
function_name);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
2015-12-25 20:01:53 +02:00
|
|
|
dir_fd_and_follow_symlinks_invalid(const char *function_name, int dir_fd,
|
|
|
|
|
int follow_symlinks)
|
|
|
|
|
{
|
2012-06-22 16:30:09 -07:00
|
|
|
if ((dir_fd != DEFAULT_DIR_FD) && (!follow_symlinks)) {
|
|
|
|
|
PyErr_Format(PyExc_ValueError,
|
|
|
|
|
"%s: cannot use dir_fd and follow_symlinks together",
|
|
|
|
|
function_name);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
#ifdef MS_WINDOWS
|
2016-09-06 10:46:49 -07:00
|
|
|
typedef long long Py_off_t;
|
2014-08-05 14:04:04 +10:00
|
|
|
#else
|
|
|
|
|
typedef off_t Py_off_t;
|
|
|
|
|
#endif
|
|
|
|
|
|
2011-02-25 15:23:18 +00:00
|
|
|
static int
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_off_t_converter(PyObject *arg, void *addr)
|
2011-02-25 14:39:16 +00:00
|
|
|
{
|
2014-08-05 14:04:04 +10:00
|
|
|
#ifdef HAVE_LARGEFILE_SUPPORT
|
|
|
|
|
*((Py_off_t *)addr) = PyLong_AsLongLong(arg);
|
2011-02-25 14:39:16 +00:00
|
|
|
#else
|
2014-08-05 14:04:04 +10:00
|
|
|
*((Py_off_t *)addr) = PyLong_AsLong(arg);
|
2011-02-25 14:39:16 +00:00
|
|
|
#endif
|
|
|
|
|
if (PyErr_Occurred())
|
|
|
|
|
return 0;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
PyLong_FromPy_off_t(Py_off_t offset)
|
|
|
|
|
{
|
|
|
|
|
#ifdef HAVE_LARGEFILE_SUPPORT
|
|
|
|
|
return PyLong_FromLongLong(offset);
|
|
|
|
|
#else
|
|
|
|
|
return PyLong_FromLong(offset);
|
2011-09-19 08:30:43 +02:00
|
|
|
#endif
|
2014-08-05 14:04:04 +10:00
|
|
|
}
|
|
|
|
|
|
2018-05-08 07:48:50 +03:00
|
|
|
#ifdef HAVE_SIGSET_T
|
|
|
|
|
/* Convert an iterable of integers to a sigset.
|
|
|
|
|
Return 1 on success, return 0 and raise an exception on error. */
|
|
|
|
|
int
|
|
|
|
|
_Py_Sigset_Converter(PyObject *obj, void *addr)
|
|
|
|
|
{
|
|
|
|
|
sigset_t *mask = (sigset_t *)addr;
|
|
|
|
|
PyObject *iterator, *item;
|
|
|
|
|
long signum;
|
|
|
|
|
int overflow;
|
|
|
|
|
|
2019-05-04 01:30:53 +02:00
|
|
|
// The extra parens suppress the unreachable-code warning with clang on MacOS
|
|
|
|
|
if (sigemptyset(mask) < (0)) {
|
2018-05-08 07:48:50 +03:00
|
|
|
/* Probably only if mask == NULL. */
|
|
|
|
|
PyErr_SetFromErrno(PyExc_OSError);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
iterator = PyObject_GetIter(obj);
|
|
|
|
|
if (iterator == NULL) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while ((item = PyIter_Next(iterator)) != NULL) {
|
|
|
|
|
signum = PyLong_AsLongAndOverflow(item, &overflow);
|
|
|
|
|
Py_DECREF(item);
|
|
|
|
|
if (signum <= 0 || signum >= NSIG) {
|
|
|
|
|
if (overflow || signum != -1 || !PyErr_Occurred()) {
|
|
|
|
|
PyErr_Format(PyExc_ValueError,
|
|
|
|
|
"signal number %ld out of range", signum);
|
|
|
|
|
}
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
if (sigaddset(mask, (int)signum)) {
|
|
|
|
|
if (errno != EINVAL) {
|
|
|
|
|
/* Probably impossible */
|
|
|
|
|
PyErr_SetFromErrno(PyExc_OSError);
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
/* For backwards compatibility, allow idioms such as
|
|
|
|
|
* `range(1, NSIG)` but warn about invalid signal numbers
|
|
|
|
|
*/
|
|
|
|
|
const char msg[] =
|
|
|
|
|
"invalid signal number %ld, please use valid_signals()";
|
|
|
|
|
if (PyErr_WarnFormat(PyExc_RuntimeWarning, 1, msg, signum)) {
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!PyErr_Occurred()) {
|
|
|
|
|
Py_DECREF(iterator);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
Py_DECREF(iterator);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_SIGSET_T */
|
|
|
|
|
|
2010-11-24 13:23:18 +00:00
|
|
|
#ifdef MS_WINDOWS
|
2010-11-24 13:14:05 +00:00
|
|
|
|
|
|
|
|
static int
|
2011-06-13 15:16:04 -05:00
|
|
|
win32_get_reparse_tag(HANDLE reparse_point_handle, ULONG *reparse_tag)
|
2010-11-24 13:14:05 +00:00
|
|
|
{
|
2016-08-04 02:38:59 +00:00
|
|
|
char target_buffer[_Py_MAXIMUM_REPARSE_DATA_BUFFER_SIZE];
|
|
|
|
|
_Py_REPARSE_DATA_BUFFER *rdb = (_Py_REPARSE_DATA_BUFFER *)target_buffer;
|
2010-11-24 13:14:05 +00:00
|
|
|
DWORD n_bytes_returned;
|
|
|
|
|
|
|
|
|
|
if (0 == DeviceIoControl(
|
|
|
|
|
reparse_point_handle,
|
|
|
|
|
FSCTL_GET_REPARSE_POINT,
|
|
|
|
|
NULL, 0, /* in buffer */
|
|
|
|
|
target_buffer, sizeof(target_buffer),
|
|
|
|
|
&n_bytes_returned,
|
|
|
|
|
NULL)) /* we're not using OVERLAPPED_IO */
|
2011-06-13 15:16:04 -05:00
|
|
|
return FALSE;
|
2010-11-24 13:14:05 +00:00
|
|
|
|
|
|
|
|
if (reparse_tag)
|
|
|
|
|
*reparse_tag = rdb->ReparseTag;
|
|
|
|
|
|
2011-06-13 15:16:04 -05:00
|
|
|
return TRUE;
|
2010-11-24 13:14:05 +00:00
|
|
|
}
|
2011-11-15 22:27:41 +01:00
|
|
|
|
2010-11-24 13:23:18 +00:00
|
|
|
#endif /* MS_WINDOWS */
|
2010-11-24 13:14:05 +00:00
|
|
|
|
1990-10-14 12:07:46 +00:00
|
|
|
/* Return a dictionary corresponding to the POSIX environment table */
|
2013-01-25 17:57:13 +01:00
|
|
|
#if defined(WITH_NEXT_FRAMEWORK) || (defined(__APPLE__) && defined(Py_ENABLE_SHARED))
|
2002-08-01 21:57:49 +00:00
|
|
|
/* On Darwin/MacOSX a shared library or framework has no access to
|
2013-01-25 17:57:13 +01:00
|
|
|
** environ directly, we must obtain it with _NSGetEnviron(). See also
|
|
|
|
|
** man environ(7).
|
2002-08-01 21:57:49 +00:00
|
|
|
*/
|
|
|
|
|
#include <crt_externs.h>
|
2019-05-21 18:46:37 +08:00
|
|
|
#elif !defined(_MSC_VER) && (!defined(__WATCOMC__) || defined(__QNX__) || defined(__VXWORKS__))
|
1990-10-14 12:07:46 +00:00
|
|
|
extern char **environ;
|
1996-05-23 22:58:55 +00:00
|
|
|
#endif /* !_MSC_VER */
|
1990-10-14 12:07:46 +00:00
|
|
|
|
1996-12-10 23:23:01 +00:00
|
|
|
static PyObject *
|
2000-07-21 06:00:07 +00:00
|
|
|
convertenviron(void)
|
1990-10-14 12:07:46 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
PyObject *d;
|
2007-11-08 19:33:05 +00:00
|
|
|
#ifdef MS_WINDOWS
|
2010-05-06 00:08:46 +00:00
|
|
|
wchar_t **e;
|
2007-11-08 19:33:05 +00:00
|
|
|
#else
|
2010-05-06 00:08:46 +00:00
|
|
|
char **e;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
d = PyDict_New();
|
|
|
|
|
if (d == NULL)
|
|
|
|
|
return NULL;
|
2007-11-08 19:33:05 +00:00
|
|
|
#ifdef MS_WINDOWS
|
2010-05-06 00:08:46 +00:00
|
|
|
/* _wenviron must be initialized in this way if the program is started
|
|
|
|
|
through main() instead of wmain(). */
|
|
|
|
|
_wgetenv(L"");
|
2018-12-10 12:10:56 +02:00
|
|
|
e = _wenviron;
|
2019-12-06 14:15:03 -05:00
|
|
|
#elif defined(WITH_NEXT_FRAMEWORK) || (defined(__APPLE__) && defined(Py_ENABLE_SHARED))
|
|
|
|
|
/* environ is not accessible as an extern in a shared object on OSX; use
|
|
|
|
|
_NSGetEnviron to resolve it. The value changes if you add environment
|
|
|
|
|
variables between calls to Py_Initialize, so don't cache the value. */
|
|
|
|
|
e = *_NSGetEnviron();
|
2018-12-10 12:10:56 +02:00
|
|
|
#else
|
|
|
|
|
e = environ;
|
|
|
|
|
#endif
|
|
|
|
|
if (e == NULL)
|
2010-05-06 00:08:46 +00:00
|
|
|
return d;
|
2018-12-10 12:10:56 +02:00
|
|
|
for (; *e != NULL; e++) {
|
2010-05-06 00:08:46 +00:00
|
|
|
PyObject *k;
|
|
|
|
|
PyObject *v;
|
2018-12-10 12:10:56 +02:00
|
|
|
#ifdef MS_WINDOWS
|
2016-05-07 16:45:18 +03:00
|
|
|
const wchar_t *p = wcschr(*e, L'=');
|
2007-11-08 19:33:05 +00:00
|
|
|
#else
|
2016-05-07 16:45:18 +03:00
|
|
|
const char *p = strchr(*e, '=');
|
2018-12-10 12:10:56 +02:00
|
|
|
#endif
|
2010-05-06 00:08:46 +00:00
|
|
|
if (p == NULL)
|
|
|
|
|
continue;
|
2018-12-10 12:10:56 +02:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
k = PyUnicode_FromWideChar(*e, (Py_ssize_t)(p-*e));
|
|
|
|
|
#else
|
2010-05-06 22:05:07 +00:00
|
|
|
k = PyBytes_FromStringAndSize(*e, (int)(p-*e));
|
2018-12-10 12:10:56 +02:00
|
|
|
#endif
|
2010-05-06 00:08:46 +00:00
|
|
|
if (k == NULL) {
|
2018-12-10 12:10:56 +02:00
|
|
|
Py_DECREF(d);
|
|
|
|
|
return NULL;
|
1997-12-05 22:19:34 +00:00
|
|
|
}
|
2018-12-10 12:10:56 +02:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
v = PyUnicode_FromWideChar(p+1, wcslen(p+1));
|
|
|
|
|
#else
|
2010-05-06 22:05:07 +00:00
|
|
|
v = PyBytes_FromStringAndSize(p+1, strlen(p+1));
|
2018-12-10 12:10:56 +02:00
|
|
|
#endif
|
2010-05-06 00:08:46 +00:00
|
|
|
if (v == NULL) {
|
|
|
|
|
Py_DECREF(k);
|
2018-12-10 12:10:56 +02:00
|
|
|
Py_DECREF(d);
|
|
|
|
|
return NULL;
|
1997-12-05 22:19:34 +00:00
|
|
|
}
|
2018-12-10 12:10:56 +02:00
|
|
|
if (PyDict_GetItemWithError(d, k) == NULL) {
|
|
|
|
|
if (PyErr_Occurred() || PyDict_SetItem(d, k, v) != 0) {
|
|
|
|
|
Py_DECREF(v);
|
|
|
|
|
Py_DECREF(k);
|
|
|
|
|
Py_DECREF(d);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
|
|
|
|
Py_DECREF(k);
|
|
|
|
|
Py_DECREF(v);
|
|
|
|
|
}
|
|
|
|
|
return d;
|
1990-10-14 12:07:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Set a POSIX-specific error from errno, and return NULL */
|
|
|
|
|
|
1998-07-23 16:14:40 +00:00
|
|
|
static PyObject *
|
2000-07-21 06:00:07 +00:00
|
|
|
posix_error(void)
|
1995-03-01 10:34:45 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
return PyErr_SetFromErrno(PyExc_OSError);
|
1990-10-14 12:07:46 +00:00
|
|
|
}
|
2001-05-13 08:04:26 +00:00
|
|
|
|
2002-06-30 15:26:10 +00:00
|
|
|
#ifdef MS_WINDOWS
|
2000-07-09 14:49:51 +00:00
|
|
|
static PyObject *
|
2015-12-25 20:01:53 +02:00
|
|
|
win32_error(const char* function, const char* filename)
|
2000-07-09 14:49:51 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
/* XXX We should pass the function name along in the future.
|
|
|
|
|
(winreg.c also wants to pass the function name.)
|
|
|
|
|
This would however require an additional param to the
|
|
|
|
|
Windows error object, which is non-trivial.
|
|
|
|
|
*/
|
|
|
|
|
errno = GetLastError();
|
|
|
|
|
if (filename)
|
|
|
|
|
return PyErr_SetFromWindowsErrWithFilename(errno, filename);
|
|
|
|
|
else
|
|
|
|
|
return PyErr_SetFromWindowsErr(errno);
|
2000-07-09 14:49:51 +00:00
|
|
|
}
|
2002-10-03 05:10:39 +00:00
|
|
|
|
2011-09-30 01:44:27 +02:00
|
|
|
static PyObject *
|
2019-03-29 16:37:16 -07:00
|
|
|
win32_error_object_err(const char* function, PyObject* filename, DWORD err)
|
2011-09-30 01:44:27 +02:00
|
|
|
{
|
|
|
|
|
/* XXX - see win32_error for comments on 'function' */
|
|
|
|
|
if (filename)
|
|
|
|
|
return PyErr_SetExcFromWindowsErrWithFilenameObject(
|
2012-12-19 14:33:35 +02:00
|
|
|
PyExc_OSError,
|
2019-03-29 16:37:16 -07:00
|
|
|
err,
|
2011-09-30 01:44:27 +02:00
|
|
|
filename);
|
|
|
|
|
else
|
2019-03-29 16:37:16 -07:00
|
|
|
return PyErr_SetFromWindowsErr(err);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
win32_error_object(const char* function, PyObject* filename)
|
|
|
|
|
{
|
|
|
|
|
errno = GetLastError();
|
|
|
|
|
return win32_error_object_err(function, filename, errno);
|
2011-09-30 01:44:27 +02:00
|
|
|
}
|
|
|
|
|
|
2009-05-17 04:21:53 +00:00
|
|
|
#endif /* MS_WINDOWS */
|
1990-10-14 12:07:46 +00:00
|
|
|
|
2018-10-20 03:28:22 +03:00
|
|
|
static PyObject *
|
|
|
|
|
posix_path_object_error(PyObject *path)
|
|
|
|
|
{
|
|
|
|
|
return PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path);
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
static PyObject *
|
2016-10-08 20:16:57 +03:00
|
|
|
path_object_error(PyObject *path)
|
2012-06-22 16:30:09 -07:00
|
|
|
{
|
|
|
|
|
#ifdef MS_WINDOWS
|
2016-10-08 20:16:57 +03:00
|
|
|
return PyErr_SetExcFromWindowsErrWithFilenameObject(
|
|
|
|
|
PyExc_OSError, 0, path);
|
2012-06-22 16:30:09 -07:00
|
|
|
#else
|
2018-10-20 03:28:22 +03:00
|
|
|
return posix_path_object_error(path);
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2014-02-09 22:05:19 -08:00
|
|
|
static PyObject *
|
2016-10-08 20:16:57 +03:00
|
|
|
path_object_error2(PyObject *path, PyObject *path2)
|
2014-02-09 22:05:19 -08:00
|
|
|
{
|
|
|
|
|
#ifdef MS_WINDOWS
|
2016-10-08 20:16:57 +03:00
|
|
|
return PyErr_SetExcFromWindowsErrWithFilenameObjects(
|
|
|
|
|
PyExc_OSError, 0, path, path2);
|
2014-02-09 22:05:19 -08:00
|
|
|
#else
|
2016-10-08 20:16:57 +03:00
|
|
|
return PyErr_SetFromErrnoWithFilenameObjects(PyExc_OSError, path, path2);
|
2014-02-09 22:05:19 -08:00
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-08 20:16:57 +03:00
|
|
|
static PyObject *
|
|
|
|
|
path_error(path_t *path)
|
|
|
|
|
{
|
|
|
|
|
return path_object_error(path->object);
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-20 03:28:22 +03:00
|
|
|
static PyObject *
|
|
|
|
|
posix_path_error(path_t *path)
|
|
|
|
|
{
|
|
|
|
|
return posix_path_object_error(path->object);
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-08 20:16:57 +03:00
|
|
|
static PyObject *
|
|
|
|
|
path_error2(path_t *path, path_t *path2)
|
|
|
|
|
{
|
|
|
|
|
return path_object_error2(path->object, path2->object);
|
|
|
|
|
}
|
|
|
|
|
|
2014-02-09 22:05:19 -08:00
|
|
|
|
1990-10-14 12:07:46 +00:00
|
|
|
/* POSIX generic methods */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
static int
|
|
|
|
|
fildes_converter(PyObject *o, void *p)
|
2002-04-15 19:40:07 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
int fd;
|
2014-08-05 14:04:04 +10:00
|
|
|
int *pointer = (int *)p;
|
|
|
|
|
fd = PyObject_AsFileDescriptor(o);
|
2010-05-06 00:08:46 +00:00
|
|
|
if (fd < 0)
|
2014-08-05 14:04:04 +10:00
|
|
|
return 0;
|
|
|
|
|
*pointer = fd;
|
|
|
|
|
return 1;
|
2002-04-15 19:40:07 +00:00
|
|
|
}
|
1999-01-08 21:05:37 +00:00
|
|
|
|
1996-12-10 23:23:01 +00:00
|
|
|
static PyObject *
|
2014-08-05 14:04:04 +10:00
|
|
|
posix_fildes_fd(int fd, int (*func)(int))
|
1990-10-14 12:07:46 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
int res;
|
2015-02-07 13:27:50 +00:00
|
|
|
int async_err = 0;
|
|
|
|
|
|
|
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
2015-02-07 13:27:50 +00:00
|
|
|
res = (*func)(fd);
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_END_SUPPRESS_IPH
|
2015-02-07 13:27:50 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (res != 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
|
|
|
|
if (res != 0)
|
|
|
|
|
return (!async_err) ? posix_error() : NULL;
|
|
|
|
|
Py_RETURN_NONE;
|
1990-10-14 12:07:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2009-05-17 04:21:53 +00:00
|
|
|
#ifdef MS_WINDOWS
|
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Inherits test_gzip/test_tarfile failures on 64-bit platforms from the trunk,
but I don't want the merge to hang around too long (even though the regular
p3yk-contributors are/have been busy with other things.)
Merged revisions 45621-46490 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r45621 | george.yoshida | 2006-04-21 18:34:17 +0200 (Fri, 21 Apr 2006) | 2 lines
Correct the grammar
........
r45622 | tim.peters | 2006-04-21 18:34:54 +0200 (Fri, 21 Apr 2006) | 2 lines
Whitespace normalization.
........
r45624 | thomas.heller | 2006-04-21 18:48:56 +0200 (Fri, 21 Apr 2006) | 1 line
Merge in changes from ctypes 0.9.9.6 upstream version.
........
r45625 | thomas.heller | 2006-04-21 18:51:04 +0200 (Fri, 21 Apr 2006) | 1 line
Merge in changes from ctypes 0.9.9.6 upstream version.
........
r45630 | thomas.heller | 2006-04-21 20:29:17 +0200 (Fri, 21 Apr 2006) | 8 lines
Documentation for ctypes.
I think that 'generic operating system services' is the best category.
Note that the Doc/lib/libctypes.latex file is generated from reST sources.
You are welcome to make typo fixes, and I'll try to keep the reST sources
in sync, but markup changes would be lost - they should be fixed in the tool
that creates the latex file.
The conversion script is external/ctypes/docs/manual/mkpydoc.py.
........
r45631 | tim.peters | 2006-04-21 23:18:10 +0200 (Fri, 21 Apr 2006) | 24 lines
SF bug #1473760 TempFile can hang on Windows.
Python 2.4 changed ntpath.abspath to do an import
inside the function. As a result, due to Python's
import lock, anything calling abspath on Windows
(directly, or indirectly like tempfile.TemporaryFile)
hung when it was called from a thread spawned as a
side effect of importing a module.
This is a depressingly frequent problem, and
deserves a more general fix. I'm settling for
a micro-fix here because this specific one accounts
for a report of Zope Corp's ZEO hanging on Windows,
and it was an odd way to change abspath to begin
with (ntpath needs a different implementation
depending on whether we're actually running on
Windows, and the _obvious_ way to arrange for that
is not to bury a possibly-failing import _inside_
the function).
Note that if/when other micro-fixes of this kind
get made, the new Lib/test/threaded_import_hangers.py
is a convenient place to add tests for them.
........
r45634 | phillip.eby | 2006-04-21 23:53:37 +0200 (Fri, 21 Apr 2006) | 2 lines
Guido wrote contextlib, not me, but thanks anyway. ;)
........
r45636 | andrew.kuchling | 2006-04-22 03:51:41 +0200 (Sat, 22 Apr 2006) | 1 line
Typo fixes
........
r45638 | andrew.kuchling | 2006-04-22 03:58:40 +0200 (Sat, 22 Apr 2006) | 1 line
Fix comment typo
........
r45639 | andrew.kuchling | 2006-04-22 04:06:03 +0200 (Sat, 22 Apr 2006) | 8 lines
Make copy of test_mailbox.py. We'll still want to check the backward
compatibility classes in the new mailbox.py that I'll be committing in
a few minutes.
One change has been made: the tests use len(mbox) instead of len(mbox.boxes).
The 'boxes' attribute was never documented and contains some internal state
that seems unlikely to have been useful.
........
r45640 | andrew.kuchling | 2006-04-22 04:32:43 +0200 (Sat, 22 Apr 2006) | 16 lines
Add Gregory K. Johnson's revised version of mailbox.py (funded by
the 2005 Summer of Code).
The revision adds a number of new mailbox classes that support adding
and removing messages; these classes also support mailbox locking and
default to using email.Message instead of rfc822.Message.
The old mailbox classes are largely left alone for backward compatibility.
The exception is the Maildir class, which was present in the old module
and now inherits from the new classes. The Maildir class's interface
is pretty simple, though, so I think it'll be compatible with existing
code.
(The change to the NEWS file also adds a missing word to a different
news item, which unfortunately required rewrapping the line.)
........
r45641 | tim.peters | 2006-04-22 07:52:59 +0200 (Sat, 22 Apr 2006) | 2 lines
Whitespace normalization.
........
r45642 | neal.norwitz | 2006-04-22 08:07:46 +0200 (Sat, 22 Apr 2006) | 1 line
Add libctypes as a dep
........
r45643 | martin.v.loewis | 2006-04-22 13:15:41 +0200 (Sat, 22 Apr 2006) | 1 line
Fix more ssize_t problems.
........
r45644 | martin.v.loewis | 2006-04-22 13:40:03 +0200 (Sat, 22 Apr 2006) | 1 line
Fix more ssize_t issues.
........
r45645 | george.yoshida | 2006-04-22 17:10:49 +0200 (Sat, 22 Apr 2006) | 2 lines
Typo fixes
........
r45647 | martin.v.loewis | 2006-04-22 17:19:54 +0200 (Sat, 22 Apr 2006) | 1 line
Port to Python 2.5. Drop .DEF file. Change output file names to .pyd.
........
r45648 | george.yoshida | 2006-04-22 17:27:14 +0200 (Sat, 22 Apr 2006) | 3 lines
- add versionadded tag
- make arbitrary arguments come last
........
r45649 | hyeshik.chang | 2006-04-22 17:48:15 +0200 (Sat, 22 Apr 2006) | 3 lines
Remove $CJKCodecs$ RCS tags. The CJKCodecs isn't maintained outside
anymore.
........
r45654 | greg.ward | 2006-04-23 05:47:58 +0200 (Sun, 23 Apr 2006) | 2 lines
Update optparse to Optik 1.5.1.
........
r45658 | george.yoshida | 2006-04-23 11:27:10 +0200 (Sun, 23 Apr 2006) | 2 lines
wrap SyntaxError with \exception{}
........
r45660 | ronald.oussoren | 2006-04-23 13:59:25 +0200 (Sun, 23 Apr 2006) | 6 lines
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.
........
r45661 | ronald.oussoren | 2006-04-23 14:36:23 +0200 (Sun, 23 Apr 2006) | 5 lines
Patch 1471761 - test for broken poll at runtime
This patch checks if poll is broken when the select module is loaded instead
of doing so at configure-time. This functionality is only active on Mac OS X.
........
r45662 | nick.coghlan | 2006-04-23 17:13:32 +0200 (Sun, 23 Apr 2006) | 1 line
Add a Context Types section to parallel the Iterator Types section (uses the same terminology as the 2.5a1 implementation)
........
r45663 | nick.coghlan | 2006-04-23 17:14:37 +0200 (Sun, 23 Apr 2006) | 1 line
Update contextlib documentation to use the same terminology as the module implementation
........
r45664 | gerhard.haering | 2006-04-23 17:24:26 +0200 (Sun, 23 Apr 2006) | 2 lines
Updated the sqlite3 module to the external pysqlite 2.2.2 version.
........
r45666 | nick.coghlan | 2006-04-23 17:39:16 +0200 (Sun, 23 Apr 2006) | 1 line
Update with statement documentation to use same terminology as 2.5a1 implementation
........
r45667 | nick.coghlan | 2006-04-23 18:05:04 +0200 (Sun, 23 Apr 2006) | 1 line
Add a (very) brief mention of the with statement to the end of chapter 8
........
r45668 | nick.coghlan | 2006-04-23 18:35:19 +0200 (Sun, 23 Apr 2006) | 1 line
Take 2 on mentioning the with statement, this time without inadvertently killing the Unicode examples
........
r45669 | nick.coghlan | 2006-04-23 19:04:07 +0200 (Sun, 23 Apr 2006) | 1 line
Backdated NEWS entry to record the implementation of PEP 338 for alpha 1
........
r45670 | tim.peters | 2006-04-23 20:13:45 +0200 (Sun, 23 Apr 2006) | 2 lines
Whitespace normalization.
........
r45671 | skip.montanaro | 2006-04-23 21:14:27 +0200 (Sun, 23 Apr 2006) | 1 line
first cut at trace module doc
........
r45672 | skip.montanaro | 2006-04-23 21:26:33 +0200 (Sun, 23 Apr 2006) | 1 line
minor tweak
........
r45673 | skip.montanaro | 2006-04-23 21:30:50 +0200 (Sun, 23 Apr 2006) | 1 line
it's always helpful if the example works...
........
r45674 | skip.montanaro | 2006-04-23 21:32:14 +0200 (Sun, 23 Apr 2006) | 1 line
correct example
........
r45675 | andrew.kuchling | 2006-04-23 23:01:04 +0200 (Sun, 23 Apr 2006) | 1 line
Edits to the PEP 343 section
........
r45676 | andrew.kuchling | 2006-04-23 23:51:10 +0200 (Sun, 23 Apr 2006) | 1 line
Add two items
........
r45677 | tim.peters | 2006-04-24 04:03:16 +0200 (Mon, 24 Apr 2006) | 5 lines
Bug #1337990: clarified that `doctest` does not support examples
requiring both expected output and an exception.
I'll backport to 2.4 next.
........
r45679 | nick.coghlan | 2006-04-24 05:04:43 +0200 (Mon, 24 Apr 2006) | 1 line
Note changes made to PEP 343 related documentation
........
r45681 | nick.coghlan | 2006-04-24 06:17:02 +0200 (Mon, 24 Apr 2006) | 1 line
Change PEP 343 related documentation to use the term context specifier instead of context object
........
r45682 | nick.coghlan | 2006-04-24 06:32:47 +0200 (Mon, 24 Apr 2006) | 1 line
Add unit tests for the -m and -c command line switches
........
r45683 | nick.coghlan | 2006-04-24 06:37:15 +0200 (Mon, 24 Apr 2006) | 1 line
Fix contextlib.nested to cope with exit methods raising and handling exceptions
........
r45685 | nick.coghlan | 2006-04-24 06:59:28 +0200 (Mon, 24 Apr 2006) | 1 line
Fix broken contextlib test from last checkin (I'd've sworn I tested that before checking it in. . .)
........
r45686 | nick.coghlan | 2006-04-24 07:24:26 +0200 (Mon, 24 Apr 2006) | 1 line
Back out new command line tests (broke buildbot)
........
r45687 | nick.coghlan | 2006-04-24 07:52:15 +0200 (Mon, 24 Apr 2006) | 1 line
More reliable version of new command line tests that just checks the exit codes
........
r45688 | thomas.wouters | 2006-04-24 13:37:13 +0200 (Mon, 24 Apr 2006) | 4 lines
Stop test_tcl's testLoadTk from leaking the Tk commands 'loadtk' registers.
........
r45690 | andrew.kuchling | 2006-04-24 16:30:47 +0200 (Mon, 24 Apr 2006) | 2 lines
Edits, using the new term
'context specifier' in a few places
........
r45697 | phillip.eby | 2006-04-24 22:53:13 +0200 (Mon, 24 Apr 2006) | 2 lines
Revert addition of setuptools
........
r45698 | tim.peters | 2006-04-25 00:45:13 +0200 (Tue, 25 Apr 2006) | 2 lines
Whitespace normalization.
........
r45700 | trent.mick | 2006-04-25 02:34:50 +0200 (Tue, 25 Apr 2006) | 4 lines
Put break at correct level so *all* root HKEYs acutally get checked for
an installed VC6. Otherwise only the first such tree gets checked and this
warning doesn't get displayed.
........
r45701 | tim.peters | 2006-04-25 05:31:36 +0200 (Tue, 25 Apr 2006) | 3 lines
Patch #1475231: add a new SKIP doctest option, thanks to
Edward Loper.
........
r45702 | neal.norwitz | 2006-04-25 07:04:35 +0200 (Tue, 25 Apr 2006) | 1 line
versionadded for SKIP
........
r45703 | neal.norwitz | 2006-04-25 07:05:03 +0200 (Tue, 25 Apr 2006) | 1 line
Restore Walters name
........
r45704 | neal.norwitz | 2006-04-25 07:49:42 +0200 (Tue, 25 Apr 2006) | 1 line
Revert previous change, SKIP had a versionadded elsewhere
........
r45706 | nick.coghlan | 2006-04-25 12:56:51 +0200 (Tue, 25 Apr 2006) | 31 lines
Move the PEP 343 documentation and implementation closer to the
terminology in the alpha 1 documentation.
- "context manager" reverts to its alpha 1 definition
- the term "context specifier" goes away entirely
- contextlib.GeneratorContextManager is renamed GeneratorContext
There are still a number of changes relative to alpha 1:
- the expression in the with statement is explicitly called the
"context expression" in the language reference
- the terms 'with statement context', 'context object' or 'with
statement context' are used in several places instead of a bare
'context'. The aim of this is to avoid ambiguity in relation to the
runtime context set up when the block is executed, and the context
objects that already exist in various application domains (such as
decimal.Context)
- contextlib.contextmanager is renamed to contextfactory
This best reflects the nature of the function resulting from the
use of that decorator
- decimal.ContextManager is renamed to WithStatementContext
Simple dropping the 'Manager' part wasn't possible due to the
fact that decimal.Context already exists and means something
different. WithStatementContext is ugly but workable.
A technically unrelated change snuck into this commit:
contextlib.closing now avoids the overhead of creating a
generator, since it's trivial to implement that particular
context manager directly.
........
r45707 | nick.coghlan | 2006-04-25 13:05:56 +0200 (Tue, 25 Apr 2006) | 1 line
Fix latex typo
........
r45708 | thomas.wouters | 2006-04-25 14:28:56 +0200 (Tue, 25 Apr 2006) | 4 lines
Fix markup glitch in unittest docs. Will backport.
........
r45710 | andrew.kuchling | 2006-04-25 14:31:38 +0200 (Tue, 25 Apr 2006) | 1 line
Add two items; easy_install is now off the table, though pkgutil still is
........
r45711 | andrew.kuchling | 2006-04-25 14:47:25 +0200 (Tue, 25 Apr 2006) | 1 line
Rework context terminology
........
r45712 | thomas.wouters | 2006-04-25 15:53:23 +0200 (Tue, 25 Apr 2006) | 9 lines
SF bug/patch #1433877: string parameter to ioctl not null terminated
The new char-array used in ioctl calls wasn't explicitly NUL-terminated;
quite probably the cause for the test_pty failures on Solaris that we
circumvented earlier. (I wasn't able to reproduce it with this patch, but it
has been somewhat elusive to start with.)
........
r45713 | george.yoshida | 2006-04-25 16:09:58 +0200 (Tue, 25 Apr 2006) | 2 lines
minor tweak
........
r45714 | thomas.wouters | 2006-04-25 17:08:10 +0200 (Tue, 25 Apr 2006) | 7 lines
Fix SF bug #1476111: SystemError in socket sendto. The AF_INET6 and
AF_PACKET cases in getsockaddrarg were missing their own checks for
tuple-ness of the address argument, which means a confusing SystemError was
raised by PyArg_ParseTuple instead.
........
r45715 | thomas.wouters | 2006-04-25 17:29:46 +0200 (Tue, 25 Apr 2006) | 10 lines
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.
........
r45717 | thomas.heller | 2006-04-25 20:26:08 +0200 (Tue, 25 Apr 2006) | 3 lines
Fix compiler warnings on Darwin.
Patch by Brett Canon, see
https://sourceforge.net/tracker/?func=detail&atid=532156&aid=1475959&group_id=71702
........
r45718 | guido.van.rossum | 2006-04-25 22:12:45 +0200 (Tue, 25 Apr 2006) | 4 lines
Implement MvL's improvement on __context__ in Condition;
this can just call __context__ on the underlying lock.
(The same change for Semaphore does *not* work!)
........
r45721 | tim.peters | 2006-04-26 03:15:53 +0200 (Wed, 26 Apr 2006) | 13 lines
Rev 45706 renamed stuff in contextlib.py, but didn't rename
uses of it in test_with.py. As a result, test_with has been skipped
(due to failing imports) on all buildbot boxes since. Alas, that's
not a test failure -- you have to pay attention to the
1 skip unexpected on PLATFORM:
test_with
kinds of output at the ends of test runs to notice that this got
broken.
It's likely that more renaming in test_with.py would be desirable.
........
r45722 | fred.drake | 2006-04-26 07:15:41 +0200 (Wed, 26 Apr 2006) | 1 line
markup fixes, cleanup
........
r45723 | fred.drake | 2006-04-26 07:19:39 +0200 (Wed, 26 Apr 2006) | 1 line
minor adjustment suggested by Peter Gephardt
........
r45724 | neal.norwitz | 2006-04-26 07:34:03 +0200 (Wed, 26 Apr 2006) | 10 lines
Patch from Aldo Cortesi (OpenBSD buildbot owner).
After the patch (45590) to add extra debug stats to the gc module, Python
was crashing on OpenBSD due to:
Fatal Python error: Interpreter not initialized (version mismatch?)
This seems to occur due to calling collect() when initialized (in pythonrun.c)
is set to 0. Now, the import will occur in the init function which
shouldn't suffer this problem.
........
r45725 | neal.norwitz | 2006-04-26 08:26:12 +0200 (Wed, 26 Apr 2006) | 3 lines
Fix this test on Solaris. There can be embedded \r, so don't just replace
the one at the end.
........
r45727 | nick.coghlan | 2006-04-26 13:50:04 +0200 (Wed, 26 Apr 2006) | 1 line
Fix an error in the last contextlib.closing example
........
r45728 | andrew.kuchling | 2006-04-26 14:21:06 +0200 (Wed, 26 Apr 2006) | 1 line
[Bug #1475080] Fix example
........
r45729 | andrew.kuchling | 2006-04-26 14:23:39 +0200 (Wed, 26 Apr 2006) | 1 line
Add labels to all sections
........
r45730 | thomas.wouters | 2006-04-26 17:53:30 +0200 (Wed, 26 Apr 2006) | 7 lines
The result of SF patch #1471578: big-memory tests for strings, lists and
tuples. Lots to be added, still, but this will give big-memory people
something to play with in 2.5 alpha 2, and hopefully get more people to
write these tests.
........
r45731 | tim.peters | 2006-04-26 19:11:16 +0200 (Wed, 26 Apr 2006) | 2 lines
Whitespace normalization.
........
r45732 | martin.v.loewis | 2006-04-26 19:19:44 +0200 (Wed, 26 Apr 2006) | 1 line
Use GS- and bufferoverlowU.lib where appropriate, for AMD64.
........
r45733 | thomas.wouters | 2006-04-26 20:46:01 +0200 (Wed, 26 Apr 2006) | 5 lines
Add tests for += and *= on strings, and fix the memory-use estimate for the
list.extend tests (they were estimating half the actual use.)
........
r45734 | thomas.wouters | 2006-04-26 21:14:46 +0200 (Wed, 26 Apr 2006) | 5 lines
Some more test-size-estimate fixes: test_append and test_insert trigger a
list resize, which overallocates.
........
r45735 | hyeshik.chang | 2006-04-26 21:20:26 +0200 (Wed, 26 Apr 2006) | 3 lines
Fix build on MIPS for libffi. I haven't tested this yet because I
don't have an access on MIPS machines. Will be tested by buildbot. :)
........
r45737 | fred.drake | 2006-04-27 01:40:32 +0200 (Thu, 27 Apr 2006) | 1 line
one more place to use the current Python version
........
r45738 | fred.drake | 2006-04-27 02:02:24 +0200 (Thu, 27 Apr 2006) | 3 lines
- update version numbers in file names again, until we have a better way
- elaborate instructions for Cygwin support (closes SF #839709)
........
r45739 | fred.drake | 2006-04-27 02:20:14 +0200 (Thu, 27 Apr 2006) | 1 line
add missing word
........
r45740 | anthony.baxter | 2006-04-27 04:11:24 +0200 (Thu, 27 Apr 2006) | 2 lines
2.5a2
........
r45741 | anthony.baxter | 2006-04-27 04:13:13 +0200 (Thu, 27 Apr 2006) | 1 line
2.5a2
........
r45749 | andrew.kuchling | 2006-04-27 14:22:37 +0200 (Thu, 27 Apr 2006) | 1 line
Now that 2.5a2 is out, revert to the current date
........
r45750 | andrew.kuchling | 2006-04-27 14:23:07 +0200 (Thu, 27 Apr 2006) | 1 line
Bump document version
........
r45751 | andrew.kuchling | 2006-04-27 14:34:39 +0200 (Thu, 27 Apr 2006) | 6 lines
[Bug #1477102] Add necessary import to example
This may be a useful style question for the docs -- should examples show
the necessary imports, or should it be assumed that the reader will
figure it out? In the What's New, I'm not consistent but usually opt
for omitting the imports.
........
r45753 | andrew.kuchling | 2006-04-27 14:38:35 +0200 (Thu, 27 Apr 2006) | 1 line
[Bug #1477140] Import Error base class
........
r45754 | andrew.kuchling | 2006-04-27 14:42:54 +0200 (Thu, 27 Apr 2006) | 1 line
Mention the xmlrpclib.Error base class, which is used in one of the examples
........
r45756 | george.yoshida | 2006-04-27 15:41:07 +0200 (Thu, 27 Apr 2006) | 2 lines
markup fix
........
r45757 | thomas.wouters | 2006-04-27 15:46:59 +0200 (Thu, 27 Apr 2006) | 4 lines
Some more size-estimate fixes, for large-list-tests.
........
r45758 | thomas.heller | 2006-04-27 17:50:42 +0200 (Thu, 27 Apr 2006) | 3 lines
Rerun the libffi configuration if any of the files used for that
are newer then fficonfig.py.
........
r45766 | thomas.wouters | 2006-04-28 00:37:50 +0200 (Fri, 28 Apr 2006) | 6 lines
Some style fixes and size-calculation fixes. Also do the small-memory run
using a prime number, rather than a convenient power-of-2-and-multiple-of-5,
so incorrect testing algorithms fail more easily.
........
r45767 | thomas.wouters | 2006-04-28 00:38:32 +0200 (Fri, 28 Apr 2006) | 6 lines
Do the small-memory run of big-meormy tests using a prime number, rather
than a convenient power-of-2-and-multiple-of-5, so incorrect testing
algorithms fail more easily.
........
r45768 | david.goodger | 2006-04-28 00:53:05 +0200 (Fri, 28 Apr 2006) | 1 line
Added SVN access for Steven Bethard and Talin, for PEP updating.
........
r45770 | thomas.wouters | 2006-04-28 01:13:20 +0200 (Fri, 28 Apr 2006) | 16 lines
- Add new Warning class, ImportWarning
- Warn-raise ImportWarning when importing would have picked up a directory
as package, if only it'd had an __init__.py. This swaps two tests (for
case-ness and __init__-ness), but case-test is not really more expensive,
and it's not in a speed-critical section.
- Test for the new warning by importing a common non-package directory on
sys.path: site-packages
- In regrtest.py, silence warnings generated by the build-environment
because Modules/ (which is added to sys.path for Setup-created modules)
has 'zlib' and '_ctypes' directories without __init__.py's.
........
r45771 | thomas.wouters | 2006-04-28 01:41:27 +0200 (Fri, 28 Apr 2006) | 6 lines
Add more ignores of ImportWarnings; these are all just potential triggers
(since they won't trigger if zlib is already sucessfully imported); they
were found by grepping .py files, instead of looking at warning output :)
........
r45773 | neal.norwitz | 2006-04-28 06:32:20 +0200 (Fri, 28 Apr 2006) | 1 line
Add some whitespace to be more consistent.
........
r45774 | neal.norwitz | 2006-04-28 06:34:43 +0200 (Fri, 28 Apr 2006) | 5 lines
Try to really fix the slow buildbots this time.
Printing to stdout, doesn't mean the data was actually written.
It depends on the buffering, so we need to flush. This will hopefully
really fix the buildbots getting killed due to no output on the slow bots.
........
r45775 | neal.norwitz | 2006-04-28 07:28:05 +0200 (Fri, 28 Apr 2006) | 1 line
Fix some warnings on Mac OS X 10.4
........
r45776 | neal.norwitz | 2006-04-28 07:28:30 +0200 (Fri, 28 Apr 2006) | 1 line
Fix a warning on alpha
........
r45777 | neal.norwitz | 2006-04-28 07:28:54 +0200 (Fri, 28 Apr 2006) | 1 line
Fix a warning on ppc (debian)
........
r45778 | george.yoshida | 2006-04-28 18:09:45 +0200 (Fri, 28 Apr 2006) | 2 lines
fix markup glitch
........
r45780 | georg.brandl | 2006-04-28 18:31:17 +0200 (Fri, 28 Apr 2006) | 3 lines
Add SeaMonkey to the list of Mozilla browsers.
........
r45781 | georg.brandl | 2006-04-28 18:36:55 +0200 (Fri, 28 Apr 2006) | 2 lines
Bug #1475009: clarify ntpath.join behavior with absolute components
........
r45783 | george.yoshida | 2006-04-28 18:40:14 +0200 (Fri, 28 Apr 2006) | 2 lines
correct a dead link
........
r45785 | georg.brandl | 2006-04-28 18:54:25 +0200 (Fri, 28 Apr 2006) | 4 lines
Bug #1472949: stringify IOErrors in shutil.copytree when appending
them to the Error errors list.
........
r45786 | georg.brandl | 2006-04-28 18:58:52 +0200 (Fri, 28 Apr 2006) | 3 lines
Bug #1478326: don't allow '/' in distutils.util.get_platform machine names
since this value is used to name the build directory.
........
r45788 | thomas.heller | 2006-04-28 19:02:18 +0200 (Fri, 28 Apr 2006) | 1 line
Remove a duplicated test (the same test is in test_incomplete.py).
........
r45792 | georg.brandl | 2006-04-28 21:09:24 +0200 (Fri, 28 Apr 2006) | 3 lines
Bug #1478429: make datetime.datetime.fromtimestamp accept every float,
possibly "rounding up" to the next whole second.
........
r45796 | george.yoshida | 2006-04-29 04:43:30 +0200 (Sat, 29 Apr 2006) | 2 lines
grammar fix
........
r45800 | ronald.oussoren | 2006-04-29 13:31:35 +0200 (Sat, 29 Apr 2006) | 2 lines
Patch 1471883: --enable-universalsdk on Mac OS X
........
r45801 | andrew.kuchling | 2006-04-29 13:53:15 +0200 (Sat, 29 Apr 2006) | 1 line
Add item
........
r45802 | andrew.kuchling | 2006-04-29 14:10:28 +0200 (Sat, 29 Apr 2006) | 1 line
Make case of 'ZIP' consistent
........
r45803 | andrew.kuchling | 2006-04-29 14:10:43 +0200 (Sat, 29 Apr 2006) | 1 line
Add item
........
r45808 | martin.v.loewis | 2006-04-29 14:37:25 +0200 (Sat, 29 Apr 2006) | 3 lines
Further changes for #1471883: Edit Misc/NEWS, and
add expat_config.h.
........
r45809 | brett.cannon | 2006-04-29 23:29:50 +0200 (Sat, 29 Apr 2006) | 2 lines
Fix docstring for contextfactory; mentioned old contextmanager name.
........
r45810 | gerhard.haering | 2006-04-30 01:12:41 +0200 (Sun, 30 Apr 2006) | 3 lines
This is the start of documentation for the sqlite3 module. Please feel free to
find a better place for the link to it than alongside bsddb & friends.
........
r45811 | andrew.kuchling | 2006-04-30 03:07:09 +0200 (Sun, 30 Apr 2006) | 1 line
Add two items
........
r45814 | george.yoshida | 2006-04-30 05:49:56 +0200 (Sun, 30 Apr 2006) | 2 lines
Use \versionchanged instead of \versionadded for new parameter support.
........
r45815 | georg.brandl | 2006-04-30 09:06:11 +0200 (Sun, 30 Apr 2006) | 2 lines
Patch #1470846: fix urllib2 ProxyBasicAuthHandler.
........
r45817 | georg.brandl | 2006-04-30 10:57:35 +0200 (Sun, 30 Apr 2006) | 3 lines
In stdlib, use hashlib instead of deprecated md5 and sha modules.
........
r45819 | georg.brandl | 2006-04-30 11:23:59 +0200 (Sun, 30 Apr 2006) | 3 lines
Patch #1470976: don't NLST files when retrieving over FTP.
........
r45821 | georg.brandl | 2006-04-30 13:13:56 +0200 (Sun, 30 Apr 2006) | 6 lines
Bug #1473625: stop cPickle making float dumps locale dependent in protocol 0.
On the way, add a decorator to test_support to facilitate running single
test functions in different locales with automatic cleanup.
........
r45822 | phillip.eby | 2006-04-30 17:59:26 +0200 (Sun, 30 Apr 2006) | 2 lines
Fix infinite regress when inspecting <string> or <stdin> frames.
........
r45824 | georg.brandl | 2006-04-30 19:42:26 +0200 (Sun, 30 Apr 2006) | 3 lines
Fix another problem in inspect: if the module for an object cannot be found, don't try to give its __dict__ to linecache.
........
r45825 | georg.brandl | 2006-04-30 20:14:54 +0200 (Sun, 30 Apr 2006) | 3 lines
Patch #1472854: make the rlcompleter.Completer class usable on non-
UNIX platforms.
........
r45826 | georg.brandl | 2006-04-30 21:34:19 +0200 (Sun, 30 Apr 2006) | 3 lines
Patch #1479438: add \keyword markup for "with".
........
r45827 | andrew.kuchling | 2006-04-30 23:19:31 +0200 (Sun, 30 Apr 2006) | 1 line
Add urllib2 HOWTO from Michael Foord
........
r45828 | andrew.kuchling | 2006-04-30 23:19:49 +0200 (Sun, 30 Apr 2006) | 1 line
Add item
........
r45830 | barry.warsaw | 2006-05-01 05:03:02 +0200 (Mon, 01 May 2006) | 11 lines
Port forward from 2.4 branch:
Patch #1464708 from William McVey: fixed handling of nested comments in mail
addresses. E.g.
"Foo ((Foo Bar)) <foo@example.com>"
Fixes for both rfc822.py and email package. This patch needs to be back
ported to Python 2.3 for email 2.5.
........
r45832 | fred.drake | 2006-05-01 08:25:58 +0200 (Mon, 01 May 2006) | 4 lines
- minor clarification in section title
- markup adjustments
(there is clearly much to be done in this section)
........
r45833 | martin.v.loewis | 2006-05-01 08:28:01 +0200 (Mon, 01 May 2006) | 2 lines
Work around deadlock risk. Will backport.
........
r45836 | andrew.kuchling | 2006-05-01 14:45:02 +0200 (Mon, 01 May 2006) | 1 line
Some ElementTree fixes: import from xml, not xmlcore; fix case of module name; mention list() instead of getchildren()
........
r45837 | gerhard.haering | 2006-05-01 17:14:48 +0200 (Mon, 01 May 2006) | 3 lines
Further integration of the documentation for the sqlite3 module. There's still
quite some content to move over from the pysqlite manual, but it's a start now.
........
r45838 | martin.v.loewis | 2006-05-01 17:56:03 +0200 (Mon, 01 May 2006) | 2 lines
Rename uisample to text, drop all non-text tables.
........
r45839 | martin.v.loewis | 2006-05-01 18:12:44 +0200 (Mon, 01 May 2006) | 2 lines
Add msilib documentation.
........
r45840 | martin.v.loewis | 2006-05-01 18:14:16 +0200 (Mon, 01 May 2006) | 4 lines
Rename parameters to match the documentation (which
in turn matches Microsoft's documentation).
Drop unused parameter in CAB.append.
........
r45841 | fred.drake | 2006-05-01 18:28:54 +0200 (Mon, 01 May 2006) | 1 line
add dependency
........
r45842 | andrew.kuchling | 2006-05-01 18:30:25 +0200 (Mon, 01 May 2006) | 1 line
Markup fixes; add some XXX comments noting problems
........
r45843 | andrew.kuchling | 2006-05-01 18:32:49 +0200 (Mon, 01 May 2006) | 1 line
Add item
........
r45844 | andrew.kuchling | 2006-05-01 19:06:54 +0200 (Mon, 01 May 2006) | 1 line
Markup fixes
........
r45850 | neal.norwitz | 2006-05-02 06:43:14 +0200 (Tue, 02 May 2006) | 3 lines
SF #1479181: split open() and file() from being aliases for each other.
........
r45852 | neal.norwitz | 2006-05-02 08:23:22 +0200 (Tue, 02 May 2006) | 1 line
Try to fix breakage caused by patch #1479181, r45850
........
r45853 | fred.drake | 2006-05-02 08:53:59 +0200 (Tue, 02 May 2006) | 3 lines
SF #1479988: add methods to allow access to weakrefs for the
weakref.WeakKeyDictionary and weakref.WeakValueDictionary
........
r45854 | neal.norwitz | 2006-05-02 09:27:47 +0200 (Tue, 02 May 2006) | 5 lines
Fix breakage from patch 1471883 (r45800 & r45808) on OSF/1.
The problem was that pyconfig.h was being included before some system headers
which caused redefinitions and other breakage. This moves system headers
after expat_config.h which includes pyconfig.h.
........
r45855 | vinay.sajip | 2006-05-02 10:35:36 +0200 (Tue, 02 May 2006) | 1 line
Replaced my dumb way of calculating seconds to midnight with Tim Peters' much more sensible suggestion. What was I thinking ?!?
........
r45856 | andrew.kuchling | 2006-05-02 13:30:03 +0200 (Tue, 02 May 2006) | 1 line
Provide encoding as keyword argument; soften warning paragraph about encodings
........
r45858 | guido.van.rossum | 2006-05-02 19:36:09 +0200 (Tue, 02 May 2006) | 2 lines
Fix the formatting of KeyboardInterrupt -- a bad issubclass() call.
........
r45862 | guido.van.rossum | 2006-05-02 21:47:52 +0200 (Tue, 02 May 2006) | 7 lines
Get rid of __context__, per the latest changes to PEP 343 and python-dev
discussion.
There are two places of documentation that still mention __context__:
Doc/lib/libstdtypes.tex -- I wasn't quite sure how to rewrite that without
spending a whole lot of time thinking about it; and whatsnew, which Andrew
usually likes to change himself.
........
r45863 | armin.rigo | 2006-05-02 21:52:32 +0200 (Tue, 02 May 2006) | 4 lines
Documentation bug: PySet_Pop() returns a new reference (because the
caller becomes the owner of that reference).
........
r45864 | guido.van.rossum | 2006-05-02 22:47:36 +0200 (Tue, 02 May 2006) | 4 lines
Hopefully this will fix the spurious failures of test_mailbox.py that I'm
experiencing. (This code and mailbox.py itself are full of calls to file()
that should be calls to open() -- but I'm not fixing those.)
........
r45865 | andrew.kuchling | 2006-05-02 23:44:33 +0200 (Tue, 02 May 2006) | 1 line
Use open() instead of file()
........
r45866 | andrew.kuchling | 2006-05-03 00:47:49 +0200 (Wed, 03 May 2006) | 1 line
Update context manager section for removal of __context__
........
r45867 | fred.drake | 2006-05-03 03:46:52 +0200 (Wed, 03 May 2006) | 1 line
remove unnecessary assignment
........
r45868 | fred.drake | 2006-05-03 03:48:24 +0200 (Wed, 03 May 2006) | 4 lines
tell LaTeX2HTML to:
- use UTF-8 output
- not mess with the >>> prompt!
........
r45869 | fred.drake | 2006-05-03 04:04:40 +0200 (Wed, 03 May 2006) | 3 lines
avoid ugly markup based on the unfortunate conversions of ">>" and "<<" to
guillemets; no need for magic here
........
r45870 | fred.drake | 2006-05-03 04:12:47 +0200 (Wed, 03 May 2006) | 1 line
at least comment on why curly-quotes are not enabled
........
r45871 | fred.drake | 2006-05-03 04:27:40 +0200 (Wed, 03 May 2006) | 1 line
one more place to avoid extra markup
........
r45872 | fred.drake | 2006-05-03 04:29:09 +0200 (Wed, 03 May 2006) | 1 line
one more place to avoid extra markup (how many will there be?)
........
r45873 | fred.drake | 2006-05-03 04:29:39 +0200 (Wed, 03 May 2006) | 1 line
fix up whitespace in prompt strings
........
r45876 | tim.peters | 2006-05-03 06:46:14 +0200 (Wed, 03 May 2006) | 2 lines
Whitespace normalization.
........
r45877 | martin.v.loewis | 2006-05-03 06:52:04 +0200 (Wed, 03 May 2006) | 2 lines
Correct some formulations, fix XXX comments.
........
r45879 | georg.brandl | 2006-05-03 07:05:02 +0200 (Wed, 03 May 2006) | 2 lines
Patch #1480067: don't redirect HTTP digest auth in urllib2
........
r45881 | georg.brandl | 2006-05-03 07:15:10 +0200 (Wed, 03 May 2006) | 3 lines
Move network tests from test_urllib2 to test_urllib2net.
........
r45887 | nick.coghlan | 2006-05-03 15:02:47 +0200 (Wed, 03 May 2006) | 1 line
Finish bringing SVN into line with latest version of PEP 343 by getting rid of all remaining references to context objects that I could find. Without a __context__() method context objects no longer exist. Also get test_with working again, and adopt a suggestion from Neal for decimal.Context.get_manager()
........
r45888 | nick.coghlan | 2006-05-03 15:17:49 +0200 (Wed, 03 May 2006) | 1 line
Get rid of a couple more context object references, fix some markup and clarify what happens when a generator context function swallows an exception.
........
r45889 | georg.brandl | 2006-05-03 19:46:13 +0200 (Wed, 03 May 2006) | 3 lines
Add seamonkey to list of Windows browsers too.
........
r45890 | georg.brandl | 2006-05-03 20:03:22 +0200 (Wed, 03 May 2006) | 3 lines
RFE #1472176: In httplib, don't encode the netloc and hostname with "idna" if not necessary.
........
r45891 | georg.brandl | 2006-05-03 20:12:33 +0200 (Wed, 03 May 2006) | 2 lines
Bug #1472191: convert breakpoint indices to ints before comparing them to ints
........
r45893 | georg.brandl | 2006-05-03 20:18:32 +0200 (Wed, 03 May 2006) | 3 lines
Bug #1385040: don't allow "def foo(a=1, b): pass" in the compiler package.
........
r45894 | thomas.heller | 2006-05-03 20:35:39 +0200 (Wed, 03 May 2006) | 1 line
Don't fail the tests when libglut.so or libgle.so cannot be loaded.
........
r45895 | georg.brandl | 2006-05-04 07:08:10 +0200 (Thu, 04 May 2006) | 2 lines
Bug #1481530: allow "from os.path import ..." with imputil
........
r45897 | martin.v.loewis | 2006-05-04 07:51:03 +0200 (Thu, 04 May 2006) | 2 lines
Patch #1475845: Raise IndentationError for unexpected indent.
........
r45898 | martin.v.loewis | 2006-05-04 12:08:42 +0200 (Thu, 04 May 2006) | 1 line
Implement os.{chdir,rename,rmdir,remove} using Win32 directly.
........
r45899 | martin.v.loewis | 2006-05-04 14:04:27 +0200 (Thu, 04 May 2006) | 2 lines
Drop now-unnecessary arguments to posix_2str.
........
r45900 | martin.v.loewis | 2006-05-04 16:27:52 +0200 (Thu, 04 May 2006) | 1 line
Update checks to consider Windows error numbers.
........
r45913 | thomas.heller | 2006-05-05 20:42:14 +0200 (Fri, 05 May 2006) | 2 lines
Export the 'free' standard C function for use in the test suite.
........
r45914 | thomas.heller | 2006-05-05 20:43:24 +0200 (Fri, 05 May 2006) | 3 lines
Fix memory leaks in the ctypes test suite, reported by valgrind, by
free()ing the memory we allocate.
........
r45915 | thomas.heller | 2006-05-05 20:46:27 +0200 (Fri, 05 May 2006) | 1 line
oops - the function is exported as 'my_free', not 'free'.
........
r45916 | thomas.heller | 2006-05-05 21:14:24 +0200 (Fri, 05 May 2006) | 2 lines
Clean up.
........
r45920 | george.yoshida | 2006-05-06 15:09:45 +0200 (Sat, 06 May 2006) | 2 lines
describe optional arguments for DocFileSuite
........
r45924 | george.yoshida | 2006-05-06 16:16:51 +0200 (Sat, 06 May 2006) | 2 lines
Use \versionchanged for the feature change
........
r45925 | martin.v.loewis | 2006-05-06 18:32:54 +0200 (Sat, 06 May 2006) | 1 line
Port access, chmod, parts of getcwdu, mkdir, and utime to direct Win32 API.
........
r45926 | martin.v.loewis | 2006-05-06 22:04:08 +0200 (Sat, 06 May 2006) | 2 lines
Handle ERROR_ALREADY_EXISTS.
........
r45931 | andrew.kuchling | 2006-05-07 19:12:12 +0200 (Sun, 07 May 2006) | 1 line
[Patch #1479977] Revised version of urllib2 HOWTO, edited by John J. Lee
........
r45932 | andrew.kuchling | 2006-05-07 19:14:53 +0200 (Sun, 07 May 2006) | 1 line
Minor language edit
........
r45934 | georg.brandl | 2006-05-07 22:44:34 +0200 (Sun, 07 May 2006) | 3 lines
Patch #1483395: add new TLDs to cookielib
........
r45936 | martin.v.loewis | 2006-05-08 07:25:56 +0200 (Mon, 08 May 2006) | 2 lines
Add missing PyMem_Free.
........
r45938 | georg.brandl | 2006-05-08 19:28:47 +0200 (Mon, 08 May 2006) | 3 lines
Add test for rev. 45934.
........
r45939 | georg.brandl | 2006-05-08 19:36:08 +0200 (Mon, 08 May 2006) | 3 lines
Patch #1479302: Make urllib2 digest auth and basic auth play together.
........
r45940 | georg.brandl | 2006-05-08 19:48:01 +0200 (Mon, 08 May 2006) | 3 lines
Patch #1478993: take advantage of BaseException/Exception split in cookielib
........
r45941 | neal.norwitz | 2006-05-09 07:38:56 +0200 (Tue, 09 May 2006) | 5 lines
Micro optimization. In the first case, we know that frame->f_exc_type
is NULL, so there's no reason to do anything with it. In the second case,
we know frame->f_exc_type is not NULL, so we can just do an INCREF.
........
r45943 | thomas.heller | 2006-05-09 22:20:15 +0200 (Tue, 09 May 2006) | 2 lines
Disable a test that is unreliable.
........
r45944 | tim.peters | 2006-05-10 04:43:01 +0200 (Wed, 10 May 2006) | 4 lines
Variant of patch #1478292. doctest.register_optionflag(name)
shouldn't create a new flag when `name` is already the name of
an option flag.
........
r45947 | neal.norwitz | 2006-05-10 08:57:58 +0200 (Wed, 10 May 2006) | 14 lines
Fix problems found by Coverity.
longobject.c: also fix an ssize_t problem
<a> could have been NULL, so hoist the size calc to not use <a>.
_ssl.c: under fail: self is DECREF'd, but it would have been NULL.
_elementtree.c: delete self if there was an error.
_csv.c: I'm not sure if lineterminator could have been anything other than
a string. However, other string method calls are checked, so check this
one too.
........
r45948 | thomas.wouters | 2006-05-10 17:04:11 +0200 (Wed, 10 May 2006) | 4 lines
Ignore reflog.txt, too.
........
r45949 | georg.brandl | 2006-05-10 17:59:06 +0200 (Wed, 10 May 2006) | 3 lines
Bug #1482988: indicate more prominently that the Stats class is in the pstats module.
........
r45950 | georg.brandl | 2006-05-10 18:09:03 +0200 (Wed, 10 May 2006) | 2 lines
Bug #1485447: subprocess: document that the "cwd" parameter isn't used to find the executable. Misc. other markup fixes.
........
r45952 | georg.brandl | 2006-05-10 18:11:44 +0200 (Wed, 10 May 2006) | 2 lines
Bug #1484978: curses.panel: clarify that Panel objects are destroyed on garbage collection.
........
r45954 | georg.brandl | 2006-05-10 18:26:03 +0200 (Wed, 10 May 2006) | 4 lines
Patch #1484695: Update the tarfile module to version 0.8. This fixes
a couple of issues, notably handling of long file names using the
GNU LONGNAME extension.
........
r45955 | georg.brandl | 2006-05-10 19:13:20 +0200 (Wed, 10 May 2006) | 4 lines
Patch #721464: pdb.Pdb instances can now be given explicit stdin and
stdout arguments, making it possible to redirect input and output
for remote debugging.
........
r45956 | andrew.kuchling | 2006-05-10 19:19:04 +0200 (Wed, 10 May 2006) | 1 line
Clarify description of exception handling
........
r45957 | georg.brandl | 2006-05-10 22:09:23 +0200 (Wed, 10 May 2006) | 2 lines
Fix two small errors in argument lists.
........
r45960 | brett.cannon | 2006-05-11 07:11:33 +0200 (Thu, 11 May 2006) | 5 lines
Detect if %zd is supported by printf() during configure and sets
PY_FORMAT_SIZE_T appropriately. Removes warnings on
OS X under gcc 4.0.1 when PY_FORMAT_SIZE_T is set to "" instead of "z" as is
needed.
........
r45963 | neal.norwitz | 2006-05-11 09:51:59 +0200 (Thu, 11 May 2006) | 1 line
Don't mask a no memory error with a less meaningful one as discussed on python-checkins
........
r45964 | martin.v.loewis | 2006-05-11 15:28:43 +0200 (Thu, 11 May 2006) | 3 lines
Change WindowsError to carry the Win32 error code in winerror,
and the DOS error code in errno. Revert changes where
WindowsError catch blocks unnecessarily special-case OSError.
........
r45965 | george.yoshida | 2006-05-11 17:53:27 +0200 (Thu, 11 May 2006) | 2 lines
Grammar fix
........
r45967 | andrew.kuchling | 2006-05-11 18:32:24 +0200 (Thu, 11 May 2006) | 1 line
typo fix
........
r45968 | tim.peters | 2006-05-11 18:37:42 +0200 (Thu, 11 May 2006) | 5 lines
BaseThreadedTestCase.setup(): stop special-casing WindowsError.
Rev 45964 fiddled with WindowsError, and broke test_bsddb3 on all
the Windows buildbot slaves as a result. This should repair it.
........
r45969 | georg.brandl | 2006-05-11 21:57:09 +0200 (Thu, 11 May 2006) | 2 lines
Typo fix.
........
r45970 | tim.peters | 2006-05-12 03:57:59 +0200 (Fri, 12 May 2006) | 5 lines
SF patch #1473132: Improve docs for tp_clear and tp_traverse,
by Collin Winter.
Bugfix candidate (but I'm not going to bother).
........
r45974 | martin.v.loewis | 2006-05-12 14:27:28 +0200 (Fri, 12 May 2006) | 4 lines
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.
........
r45975 | martin.v.loewis | 2006-05-12 15:57:36 +0200 (Fri, 12 May 2006) | 1 line
Move icon files into DLLs dir. Fixes #1477968.
........
r45976 | george.yoshida | 2006-05-12 18:40:11 +0200 (Fri, 12 May 2006) | 2 lines
At first there were 6 steps, but one was removed after that.
........
r45977 | martin.v.loewis | 2006-05-12 19:22:04 +0200 (Fri, 12 May 2006) | 1 line
Fix alignment error on Itanium.
........
r45978 | george.yoshida | 2006-05-12 19:25:26 +0200 (Fri, 12 May 2006) | 3 lines
Duplicated description about the illegal continue usage can be found in nearly the same place.
They are same, so keep the original one and remove the later-added one.
........
r45980 | thomas.heller | 2006-05-12 20:16:03 +0200 (Fri, 12 May 2006) | 2 lines
Add missing svn properties.
........
r45981 | thomas.heller | 2006-05-12 20:47:35 +0200 (Fri, 12 May 2006) | 1 line
set svn properties
........
r45982 | thomas.heller | 2006-05-12 21:31:46 +0200 (Fri, 12 May 2006) | 1 line
add svn:eol-style native svn:keywords Id
........
r45987 | gerhard.haering | 2006-05-13 01:49:49 +0200 (Sat, 13 May 2006) | 3 lines
Integrated the rest of the pysqlite reference manual into the Python
documentation. Ready to be reviewed and improved upon.
........
r45988 | george.yoshida | 2006-05-13 08:53:31 +0200 (Sat, 13 May 2006) | 2 lines
Add \exception markup
........
r45990 | martin.v.loewis | 2006-05-13 15:34:04 +0200 (Sat, 13 May 2006) | 2 lines
Revert 43315: Printing of %zd must be signed.
........
r45992 | tim.peters | 2006-05-14 01:28:20 +0200 (Sun, 14 May 2006) | 11 lines
Teach PyString_FromFormat, PyErr_Format, and PyString_FromFormatV
about "%u", "%lu" and "%zu" formats.
Since PyString_FromFormat and PyErr_Format have exactly the same rules
(both inherited from PyString_FromFormatV), it would be good if someone
with more LaTeX Fu changed one of them to just point to the other.
Their docs were way out of synch before this patch, and I just did a
mass copy+paste to repair that.
Not a backport candidate (this is a new feature).
........
r45993 | tim.peters | 2006-05-14 01:31:05 +0200 (Sun, 14 May 2006) | 2 lines
Typo repair.
........
r45994 | tim.peters | 2006-05-14 01:33:19 +0200 (Sun, 14 May 2006) | 2 lines
Remove lie in new comment.
........
r45995 | ronald.oussoren | 2006-05-14 21:56:34 +0200 (Sun, 14 May 2006) | 11 lines
Rework the build system for osx applications:
* Don't use xcodebuild for building PythonLauncher, but use a normal unix
makefile. This makes it a lot easier to use the same build flags as for the
rest of python (e.g. make a universal version of python launcher)
* Convert the mac makefile-s to makefile.in-s and use configure to set makefile
variables instead of forwarding them as command-line arguments
* Add a C version of pythonw, that we you can use '#!/usr/local/bin/pythonw'
* Build IDLE.app using bundlebuilder instead of BuildApplet, that will allow
easier modification of the bundle contents later on.
........
r45996 | ronald.oussoren | 2006-05-14 22:35:41 +0200 (Sun, 14 May 2006) | 6 lines
A first cut at replacing the icons on MacOS X. This replaces all icons by icons
based on the new python.org logo. These are also the first icons that are
"proper" OSX icons.
These icons were created by Jacob Rus.
........
r45997 | ronald.oussoren | 2006-05-14 23:07:41 +0200 (Sun, 14 May 2006) | 3 lines
I missed one small detail in my rewrite of the osx build files: the path
to the Python.app template.
........
r45998 | martin.v.loewis | 2006-05-15 07:51:36 +0200 (Mon, 15 May 2006) | 2 lines
Fix memory leak.
........
r45999 | neal.norwitz | 2006-05-15 08:48:14 +0200 (Mon, 15 May 2006) | 1 line
Move items implemented after a2 into the new a3 section
........
r46000 | neal.norwitz | 2006-05-15 09:04:36 +0200 (Mon, 15 May 2006) | 5 lines
- Bug #1487966: Fix SystemError with conditional expression in assignment
Most of the test_syntax changes are just updating the numbers.
........
r46001 | neal.norwitz | 2006-05-15 09:17:23 +0200 (Mon, 15 May 2006) | 1 line
Patch #1488312, Fix memory alignment problem on SPARC in unicode. Will backport
........
r46003 | martin.v.loewis | 2006-05-15 11:22:27 +0200 (Mon, 15 May 2006) | 3 lines
Remove bogus DECREF of self.
Change __str__() functions to METH_O.
Change WindowsError__str__ to use PyTuple_Pack.
........
r46005 | georg.brandl | 2006-05-15 21:30:35 +0200 (Mon, 15 May 2006) | 3 lines
[ 1488881 ] tarfile.py: support for file-objects and bz2 (cp. #1488634)
........
r46007 | tim.peters | 2006-05-15 22:44:10 +0200 (Mon, 15 May 2006) | 9 lines
ReadDetectFileobjTest: repair Windows disasters by opening
the file object in binary mode.
The Windows buildbot slaves shouldn't swap themselves to death
anymore. However, test_tarfile may still fail because of a
temp directory left behind from a previous failing run.
Windows buildbot owners may need to remove that directory
by hand.
........
r46009 | tim.peters | 2006-05-15 23:32:25 +0200 (Mon, 15 May 2006) | 3 lines
test_directory(): Remove the leftover temp directory that's making
the Windows buildbots fail test_tarfile.
........
r46010 | martin.v.loewis | 2006-05-16 09:05:37 +0200 (Tue, 16 May 2006) | 4 lines
- 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
........
r46012 | georg.brandl | 2006-05-16 09:38:27 +0200 (Tue, 16 May 2006) | 3 lines
Patch #1435422: zlib's compress and decompress objects now have a
copy() method.
........
r46015 | andrew.kuchling | 2006-05-16 18:11:54 +0200 (Tue, 16 May 2006) | 1 line
Add item
........
r46016 | andrew.kuchling | 2006-05-16 18:27:31 +0200 (Tue, 16 May 2006) | 3 lines
PEP 243 has been withdrawn, so don't refer to it any more.
The PyPI upload material has been moved into the section on PEP314.
........
r46017 | george.yoshida | 2006-05-16 19:42:16 +0200 (Tue, 16 May 2006) | 2 lines
Update for 'ImportWarning'
........
r46018 | george.yoshida | 2006-05-16 20:07:00 +0200 (Tue, 16 May 2006) | 4 lines
Mention that Exception is now a subclass of BaseException.
Remove a sentence that says that BaseException inherits from BaseException.
(I guess this is just a copy & paste mistake.)
........
r46019 | george.yoshida | 2006-05-16 20:26:10 +0200 (Tue, 16 May 2006) | 2 lines
Document ImportWarning
........
r46020 | tim.peters | 2006-05-17 01:22:20 +0200 (Wed, 17 May 2006) | 2 lines
Whitespace normalization.
........
r46021 | tim.peters | 2006-05-17 01:24:08 +0200 (Wed, 17 May 2006) | 2 lines
Text files missing the SVN eol-style property.
........
r46022 | tim.peters | 2006-05-17 03:30:11 +0200 (Wed, 17 May 2006) | 2 lines
PyZlib_copy(), PyZlib_uncopy(): Repair leaks on the normal-case path.
........
r46023 | georg.brandl | 2006-05-17 16:06:07 +0200 (Wed, 17 May 2006) | 3 lines
Remove misleading comment about type-class unification.
........
r46024 | georg.brandl | 2006-05-17 16:11:36 +0200 (Wed, 17 May 2006) | 3 lines
Apply patch #1489784 from Michael Foord.
........
r46025 | georg.brandl | 2006-05-17 16:18:20 +0200 (Wed, 17 May 2006) | 3 lines
Fix typo in os.utime docstring (patch #1490189)
........
r46026 | georg.brandl | 2006-05-17 16:26:50 +0200 (Wed, 17 May 2006) | 3 lines
Patch #1490224: set time.altzone correctly on Cygwin.
........
r46027 | georg.brandl | 2006-05-17 16:45:06 +0200 (Wed, 17 May 2006) | 4 lines
Add global debug flag to cookielib to avoid heavy dependency on the logging module.
Resolves #1484758.
........
r46028 | georg.brandl | 2006-05-17 16:56:04 +0200 (Wed, 17 May 2006) | 3 lines
Patch #1486962: Several bugs in the turtle Tk demo module were fixed
and several features added, such as speed and geometry control.
........
r46029 | georg.brandl | 2006-05-17 17:17:00 +0200 (Wed, 17 May 2006) | 4 lines
Delay-import some large modules to speed up urllib2 import.
(fixes #1484793).
........
r46030 | georg.brandl | 2006-05-17 17:51:16 +0200 (Wed, 17 May 2006) | 3 lines
Patch #1180296: improve locale string formatting functions
........
r46032 | tim.peters | 2006-05-18 04:06:40 +0200 (Thu, 18 May 2006) | 2 lines
Whitespace normalization.
........
r46033 | georg.brandl | 2006-05-18 08:11:19 +0200 (Thu, 18 May 2006) | 3 lines
Amendments to patch #1484695.
........
r46034 | georg.brandl | 2006-05-18 08:18:06 +0200 (Thu, 18 May 2006) | 3 lines
Remove unused import.
........
r46035 | georg.brandl | 2006-05-18 08:33:27 +0200 (Thu, 18 May 2006) | 3 lines
Fix test_locale for platforms without a default thousands separator.
........
r46036 | neal.norwitz | 2006-05-18 08:51:46 +0200 (Thu, 18 May 2006) | 1 line
Little cleanup
........
r46037 | georg.brandl | 2006-05-18 09:01:27 +0200 (Thu, 18 May 2006) | 4 lines
Bug #1462152: file() now checks more thoroughly for invalid mode
strings and removes a possible "U" before passing the mode to the
C library function.
........
r46038 | georg.brandl | 2006-05-18 09:20:05 +0200 (Thu, 18 May 2006) | 3 lines
Bug #1490688: properly document %e, %f, %g format subtleties.
........
r46039 | vinay.sajip | 2006-05-18 09:28:58 +0200 (Thu, 18 May 2006) | 1 line
Changed status from "beta" to "production"; since logging has been part of the stdlib since 2.3, it should be safe to make this assertion ;-)
........
r46040 | ronald.oussoren | 2006-05-18 11:04:15 +0200 (Thu, 18 May 2006) | 2 lines
Fix some minor issues with the generated application bundles on MacOSX
........
r46041 | andrew.kuchling | 2006-05-19 02:03:55 +0200 (Fri, 19 May 2006) | 1 line
Typo fix; add clarifying word
........
r46044 | neal.norwitz | 2006-05-19 08:31:23 +0200 (Fri, 19 May 2006) | 3 lines
Fix #132 from Coverity, retval could have been derefed
if a continue inside a try failed.
........
r46045 | neal.norwitz | 2006-05-19 08:43:50 +0200 (Fri, 19 May 2006) | 2 lines
Fix #1474677, non-keyword argument following keyword.
........
r46046 | neal.norwitz | 2006-05-19 09:00:58 +0200 (Fri, 19 May 2006) | 4 lines
Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
I suppose this could be backported if anyone cares.
........
r46047 | neal.norwitz | 2006-05-19 09:05:01 +0200 (Fri, 19 May 2006) | 7 lines
Oops, I forgot to include this file in the last commit (46046):
Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
I suppose this could be backported if anyone cares.
........
r46050 | ronald.oussoren | 2006-05-19 20:17:31 +0200 (Fri, 19 May 2006) | 6 lines
* Change working directory to the users home
directory, that makes the file open/save
dialogs more useable.
* Don't use argv emulator, its not needed
for idle.
........
r46052 | tim.peters | 2006-05-19 21:16:34 +0200 (Fri, 19 May 2006) | 2 lines
Whitespace normalization.
........
r46054 | ronald.oussoren | 2006-05-20 08:17:01 +0200 (Sat, 20 May 2006) | 9 lines
Fix bug #1000914 (again).
This patches a file that is generated by bgen, however the code is now the
same as a current copy of bgen would generate. Without this patch most types
in the Carbon.CF module are unusable.
I haven't managed to coax bgen into generating a complete copy of _CFmodule.c
yet :-(, hence the manual patching.
........
r46055 | george.yoshida | 2006-05-20 17:36:19 +0200 (Sat, 20 May 2006) | 3 lines
- markup fix
- add clarifying words
........
r46057 | george.yoshida | 2006-05-20 18:29:14 +0200 (Sat, 20 May 2006) | 3 lines
- Add 'as' and 'with' as new keywords in 2.5.
- Regenerate keyword lists with reswords.py.
........
r46058 | george.yoshida | 2006-05-20 20:07:26 +0200 (Sat, 20 May 2006) | 2 lines
Apply patch #1492147 from Mike Foord.
........
r46059 | andrew.kuchling | 2006-05-20 21:25:16 +0200 (Sat, 20 May 2006) | 1 line
Minor edits
........
r46061 | george.yoshida | 2006-05-21 06:22:59 +0200 (Sun, 21 May 2006) | 2 lines
Fix the TeX compile error.
........
r46062 | george.yoshida | 2006-05-21 06:40:32 +0200 (Sun, 21 May 2006) | 2 lines
Apply patch #1492255 from Mike Foord.
........
r46063 | martin.v.loewis | 2006-05-22 10:48:14 +0200 (Mon, 22 May 2006) | 1 line
Patch 1490384: New Icons for the PC build.
........
r46064 | martin.v.loewis | 2006-05-22 11:15:18 +0200 (Mon, 22 May 2006) | 1 line
Patch #1492356: Port to Windows CE (patch set 1).
........
r46065 | tim.peters | 2006-05-22 13:29:41 +0200 (Mon, 22 May 2006) | 4 lines
Define SIZEOF_{DOUBLE,FLOAT} on Windows. Else
Michael Hudson's nice gimmicks for IEEE special
values (infinities, NaNs) don't work.
........
r46070 | bob.ippolito | 2006-05-22 16:31:24 +0200 (Mon, 22 May 2006) | 2 lines
GzipFile.readline performance improvement (~30-40%), patch #1281707
........
r46071 | bob.ippolito | 2006-05-22 17:22:46 +0200 (Mon, 22 May 2006) | 1 line
Revert gzip readline performance patch #1281707 until a more generic performance improvement can be found
........
r46073 | fredrik.lundh | 2006-05-22 17:35:12 +0200 (Mon, 22 May 2006) | 4 lines
docstring tweaks: count counts non-overlapping substrings, not
total number of occurences
........
r46075 | bob.ippolito | 2006-05-22 17:59:12 +0200 (Mon, 22 May 2006) | 1 line
Apply revised patch for GzipFile.readline performance #1281707
........
r46076 | fredrik.lundh | 2006-05-22 18:29:30 +0200 (Mon, 22 May 2006) | 3 lines
needforspeed: speed up unicode repeat, unicode string copy
........
r46079 | fredrik.lundh | 2006-05-22 19:12:58 +0200 (Mon, 22 May 2006) | 4 lines
needforspeed: use memcpy for "long" strings; use a better algorithm
for long repeats.
........
r46084 | tim.peters | 2006-05-22 21:17:04 +0200 (Mon, 22 May 2006) | 7 lines
PyUnicode_Join(): Recent code changes introduced new
compiler warnings on Windows (signed vs unsigned mismatch
in comparisons). Cleaned that up by switching more locals
to Py_ssize_t. Simplified overflow checking (it can _be_
simpler because while these things are declared as
Py_ssize_t, then should in fact never be negative).
........
r46085 | tim.peters | 2006-05-23 07:47:16 +0200 (Tue, 23 May 2006) | 3 lines
unicode_repeat(): Change type of local to Py_ssize_t,
since that's what it should be.
........
r46094 | fredrik.lundh | 2006-05-23 12:10:57 +0200 (Tue, 23 May 2006) | 3 lines
needforspeed: check first *and* last character before doing a full memcmp
........
r46095 | fredrik.lundh | 2006-05-23 12:12:21 +0200 (Tue, 23 May 2006) | 4 lines
needforspeed: fixed unicode "in" operator to use same implementation
approach as find/index
........
r46096 | richard.jones | 2006-05-23 12:37:38 +0200 (Tue, 23 May 2006) | 7 lines
Merge from rjones-funccall branch.
Applied patch zombie-frames-2.diff from sf patch 876206 with updates for
Python 2.5 and also modified to retain the free_list to avoid the 67%
slow-down in pybench recursion test. 5% speed up in function call pybench.
........
r46098 | ronald.oussoren | 2006-05-23 13:04:24 +0200 (Tue, 23 May 2006) | 2 lines
Avoid creating a mess when installing a framework for the second time.
........
r46101 | georg.brandl | 2006-05-23 13:17:21 +0200 (Tue, 23 May 2006) | 3 lines
PyErr_NewException now accepts a tuple of base classes as its
"base" parameter.
........
r46103 | ronald.oussoren | 2006-05-23 13:47:16 +0200 (Tue, 23 May 2006) | 3 lines
Disable linking extensions with -lpython2.5 for darwin. This should fix bug
#1487105.
........
r46104 | ronald.oussoren | 2006-05-23 14:01:11 +0200 (Tue, 23 May 2006) | 6 lines
Patch #1488098.
This patchs makes it possible to create a universal build on OSX 10.4 and use
the result to build extensions on 10.3. It also makes it possible to override
the '-arch' and '-isysroot' compiler arguments for specific extensions.
........
r46108 | andrew.kuchling | 2006-05-23 14:44:36 +0200 (Tue, 23 May 2006) | 1 line
Add some items; mention the sprint
........
r46109 | andrew.kuchling | 2006-05-23 14:47:01 +0200 (Tue, 23 May 2006) | 1 line
Mention string improvements
........
r46110 | andrew.kuchling | 2006-05-23 14:49:35 +0200 (Tue, 23 May 2006) | 4 lines
Use 'speed' instead of 'performance', because I agree with the argument
at http://zestyping.livejournal.com/193260.html that 'erformance' really means
something more general.
........
r46113 | ronald.oussoren | 2006-05-23 17:09:57 +0200 (Tue, 23 May 2006) | 2 lines
An improved script for building the binary distribution on MacOSX.
........
r46128 | richard.jones | 2006-05-23 20:28:17 +0200 (Tue, 23 May 2006) | 3 lines
Applied patch 1337051 by Neal Norwitz, saving 4 ints on frame objects.
........
r46129 | richard.jones | 2006-05-23 20:32:11 +0200 (Tue, 23 May 2006) | 1 line
fix broken merge
........
r46130 | bob.ippolito | 2006-05-23 20:41:17 +0200 (Tue, 23 May 2006) | 1 line
Update Misc/NEWS for gzip patch #1281707
........
r46131 | bob.ippolito | 2006-05-23 20:43:47 +0200 (Tue, 23 May 2006) | 1 line
Update Misc/NEWS for gzip patch #1281707
........
r46132 | fredrik.lundh | 2006-05-23 20:44:25 +0200 (Tue, 23 May 2006) | 7 lines
needforspeed: use append+reverse for rsplit, use "bloom filters" to
speed up splitlines and strip with charsets; etc. rsplit is now as
fast as split in all our tests (reverse takes no time at all), and
splitlines() is nearly as fast as a plain split("\n") in our tests.
and we're not done yet... ;-)
........
r46133 | tim.peters | 2006-05-23 20:45:30 +0200 (Tue, 23 May 2006) | 38 lines
Bug #1334662 / patch #1335972: int(string, base) wrong answers.
In rare cases of strings specifying true values near sys.maxint,
and oddball bases (not decimal or a power of 2), int(string, base)
could deliver insane answers. This repairs all such problems, and
also speeds string->int significantly. On my box, here are %
speedups for decimal strings of various lengths:
length speedup
------ -------
1 12.4%
2 15.7%
3 20.6%
4 28.1%
5 33.2%
6 37.5%
7 41.9%
8 46.3%
9 51.2%
10 19.5%
11 19.9%
12 23.9%
13 23.7%
14 23.3%
15 24.9%
16 25.3%
17 28.3%
18 27.9%
19 35.7%
Note that the difference between 9 and 10 is the difference between
short and long Python ints on a 32-bit box. The patch doesn't
actually do anything to speed conversion to long: the speedup is
due to detecting "unsigned long" overflow more quickly.
This is a bugfix candidate, but it's a non-trivial patch and it
would be painful to separate the "bug fix" from the "speed up" parts.
........
r46134 | bob.ippolito | 2006-05-23 20:46:41 +0200 (Tue, 23 May 2006) | 1 line
Patch #1493701: performance enhancements for struct module.
........
r46136 | andrew.kuchling | 2006-05-23 21:00:45 +0200 (Tue, 23 May 2006) | 1 line
Remove duplicate item
........
r46141 | bob.ippolito | 2006-05-23 21:09:51 +0200 (Tue, 23 May 2006) | 1 line
revert #1493701
........
r46142 | bob.ippolito | 2006-05-23 21:11:34 +0200 (Tue, 23 May 2006) | 1 line
patch #1493701: performance enhancements for struct module
........
r46144 | bob.ippolito | 2006-05-23 21:12:41 +0200 (Tue, 23 May 2006) | 1 line
patch #1493701: performance enhancements for struct module
........
r46148 | bob.ippolito | 2006-05-23 21:25:52 +0200 (Tue, 23 May 2006) | 1 line
fix linking issue, warnings, in struct
........
r46149 | andrew.kuchling | 2006-05-23 21:29:38 +0200 (Tue, 23 May 2006) | 1 line
Add two items
........
r46150 | bob.ippolito | 2006-05-23 21:31:23 +0200 (Tue, 23 May 2006) | 1 line
forward declaration for PyStructType
........
r46151 | bob.ippolito | 2006-05-23 21:32:25 +0200 (Tue, 23 May 2006) | 1 line
fix typo in _struct
........
r46152 | andrew.kuchling | 2006-05-23 21:32:35 +0200 (Tue, 23 May 2006) | 1 line
Add item
........
r46153 | tim.peters | 2006-05-23 21:34:37 +0200 (Tue, 23 May 2006) | 3 lines
Get the Windows build working again (recover from
`struct` module changes).
........
r46155 | fredrik.lundh | 2006-05-23 21:47:35 +0200 (Tue, 23 May 2006) | 3 lines
return 0 on misses, not -1.
........
r46156 | tim.peters | 2006-05-23 23:51:35 +0200 (Tue, 23 May 2006) | 4 lines
test_struct grew weird behavior under regrtest.py -R,
due to a module-level cache. Clearing the cache should
make it stop showing up in refleak reports.
........
r46157 | tim.peters | 2006-05-23 23:54:23 +0200 (Tue, 23 May 2006) | 2 lines
Whitespace normalization.
........
r46158 | tim.peters | 2006-05-23 23:55:53 +0200 (Tue, 23 May 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46161 | fredrik.lundh | 2006-05-24 12:20:36 +0200 (Wed, 24 May 2006) | 3 lines
use Py_ssize_t for string indexes (thanks, neal!)
........
r46173 | fredrik.lundh | 2006-05-24 16:28:11 +0200 (Wed, 24 May 2006) | 14 lines
needforspeed: use "fastsearch" for count and findstring helpers. this
results in a 2.5x speedup on the stringbench count tests, and a 20x (!)
speedup on the stringbench search/find/contains test, compared to 2.5a2.
for more on the algorithm, see:
http://effbot.org/zone/stringlib.htm
if you get weird results, you can disable the new algoritm by undefining
USE_FAST in Objects/unicodeobject.c.
enjoy /F
........
r46182 | fredrik.lundh | 2006-05-24 17:11:01 +0200 (Wed, 24 May 2006) | 3 lines
needforspeedindeed: use fastsearch also for __contains__
........
r46184 | bob.ippolito | 2006-05-24 17:32:06 +0200 (Wed, 24 May 2006) | 1 line
refactor unpack, add unpack_from
........
r46189 | fredrik.lundh | 2006-05-24 18:35:18 +0200 (Wed, 24 May 2006) | 4 lines
needforspeed: refactored the replace code slightly; special-case
constant-length changes; use fastsearch to locate the first match.
........
r46198 | andrew.dalke | 2006-05-24 20:55:37 +0200 (Wed, 24 May 2006) | 10 lines
Added a slew of test for string replace, based various corner cases from
the Need For Speed sprint coding. Includes commented out overflow tests
which will be uncommented once the code is fixed.
This test will break the 8-bit string tests because
"".replace("", "A") == "" when it should == "A"
We have a fix for it, which should be added tomorrow.
........
r46200 | tim.peters | 2006-05-24 22:27:18 +0200 (Wed, 24 May 2006) | 2 lines
We can't leave the checked-in tests broken.
........
r46201 | tim.peters | 2006-05-24 22:29:44 +0200 (Wed, 24 May 2006) | 2 lines
Whitespace normalization.
........
r46202 | tim.peters | 2006-05-24 23:00:45 +0200 (Wed, 24 May 2006) | 4 lines
Disable the damn empty-string replace test -- it can't
be make to pass now for unicode if it passes for str, or
vice versa.
........
r46203 | tim.peters | 2006-05-24 23:10:40 +0200 (Wed, 24 May 2006) | 58 lines
Heavily fiddled variant of patch #1442927: PyLong_FromString optimization.
``long(str, base)`` is now up to 6x faster for non-power-of-2 bases. The
largest speedup is for inputs with about 1000 decimal digits. Conversion
from non-power-of-2 bases remains quadratic-time in the number of input
digits (it was and remains linear-time for bases 2, 4, 8, 16 and 32).
Speedups at various lengths for decimal inputs, comparing 2.4.3 with
current trunk. Note that it's actually a bit slower for 1-digit strings:
len speedup
---- -------
1 -4.5%
2 4.6%
3 8.3%
4 12.7%
5 16.9%
6 28.6%
7 35.5%
8 44.3%
9 46.6%
10 55.3%
11 65.7%
12 77.7%
13 73.4%
14 75.3%
15 85.2%
16 103.0%
17 95.1%
18 112.8%
19 117.9%
20 128.3%
30 174.5%
40 209.3%
50 236.3%
60 254.3%
70 262.9%
80 295.8%
90 297.3%
100 324.5%
200 374.6%
300 403.1%
400 391.1%
500 388.7%
600 440.6%
700 468.7%
800 498.0%
900 507.2%
1000 501.2%
2000 450.2%
3000 463.2%
4000 452.5%
5000 440.6%
6000 439.6%
7000 424.8%
8000 418.1%
9000 417.7%
........
r46204 | andrew.kuchling | 2006-05-25 02:23:03 +0200 (Thu, 25 May 2006) | 1 line
Minor edits; add an item
........
r46205 | fred.drake | 2006-05-25 04:42:25 +0200 (Thu, 25 May 2006) | 3 lines
fix broken links in PDF
(SF patch #1281291, contributed by Rory Yorke)
........
r46208 | walter.doerwald | 2006-05-25 10:53:28 +0200 (Thu, 25 May 2006) | 2 lines
Replace tab inside comment with space.
........
r46209 | thomas.wouters | 2006-05-25 13:25:51 +0200 (Thu, 25 May 2006) | 4 lines
Fix #1488915, Multiple dots in relative import statement raise SyntaxError.
........
r46210 | thomas.wouters | 2006-05-25 13:26:25 +0200 (Thu, 25 May 2006) | 5 lines
Update graminit.c for the fix for #1488915, Multiple dots in relative import
statement raise SyntaxError, and add testcase.
........
r46211 | andrew.kuchling | 2006-05-25 14:27:59 +0200 (Thu, 25 May 2006) | 1 line
Add entry; and fix a typo
........
r46214 | fredrik.lundh | 2006-05-25 17:22:03 +0200 (Thu, 25 May 2006) | 7 lines
needforspeed: speed up upper and lower for 8-bit string objects.
(the unicode versions of these are still 2x faster on windows,
though...)
based on work by Andrew Dalke, with tweaks by yours truly.
........
r46216 | fredrik.lundh | 2006-05-25 17:49:45 +0200 (Thu, 25 May 2006) | 5 lines
needforspeed: make new upper/lower work properly for single-character
strings too... (thanks to georg brandl for spotting the exact problem
faster than anyone else)
........
r46217 | kristjan.jonsson | 2006-05-25 17:53:30 +0200 (Thu, 25 May 2006) | 1 line
Added a new macro, Py_IS_FINITE(X). On windows there is an intrinsic for this and it is more efficient than to use !Py_IS_INFINITE(X) && !Py_IS_NAN(X). No change on other platforms
........
r46219 | fredrik.lundh | 2006-05-25 18:10:12 +0200 (Thu, 25 May 2006) | 4 lines
needforspeed: _toupper/_tolower is a SUSv2 thing; fall back on ISO C
versions if they're not defined.
........
r46220 | andrew.kuchling | 2006-05-25 18:23:15 +0200 (Thu, 25 May 2006) | 1 line
Fix comment typos
........
r46221 | andrew.dalke | 2006-05-25 18:30:52 +0200 (Thu, 25 May 2006) | 2 lines
Added tests for implementation error we came up with in the need for speed sprint.
........
r46222 | andrew.kuchling | 2006-05-25 18:34:54 +0200 (Thu, 25 May 2006) | 1 line
Fix another typo
........
r46223 | kristjan.jonsson | 2006-05-25 18:39:27 +0200 (Thu, 25 May 2006) | 1 line
Fix incorrect documentation for the Py_IS_FINITE(X) macro.
........
r46224 | fredrik.lundh | 2006-05-25 18:46:54 +0200 (Thu, 25 May 2006) | 3 lines
needforspeed: check for overflow in replace (from Andrew Dalke)
........
r46226 | fredrik.lundh | 2006-05-25 19:08:14 +0200 (Thu, 25 May 2006) | 5 lines
needforspeed: new replace implementation by Andrew Dalke. replace is
now about 3x faster on my machine, for the replace tests from string-
bench.
........
r46227 | tim.peters | 2006-05-25 19:34:03 +0200 (Thu, 25 May 2006) | 5 lines
A new table to help string->integer conversion was added yesterday to
both mystrtoul.c and longobject.c. Share the table instead. Also
cut its size by 64 entries (they had been used for an inscrutable
trick originally, but the code no longer tries to use that trick).
........
r46229 | andrew.dalke | 2006-05-25 19:53:00 +0200 (Thu, 25 May 2006) | 11 lines
Fixed problem identified by Georg. The special-case in-place code for replace
made a copy of the string using PyString_FromStringAndSize(s, n) and modify
the copied string in-place. However, 1 (and 0) character strings are shared
from a cache. This cause "A".replace("A", "a") to change the cached version
of "A" -- used by everyone.
Now may the copy with NULL as the string and do the memcpy manually. I've
added regression tests to check if this happens in the future. Perhaps
there should be a PyString_Copy for this case?
........
r46230 | fredrik.lundh | 2006-05-25 19:55:31 +0200 (Thu, 25 May 2006) | 4 lines
needforspeed: use "fastsearch" for count. this results in a 3x speedup
for the related stringbench tests.
........
r46231 | andrew.dalke | 2006-05-25 20:03:25 +0200 (Thu, 25 May 2006) | 4 lines
Code had returned an ssize_t, upcast to long, then converted with PyInt_FromLong.
Now using PyInt_FromSsize_t.
........
r46233 | andrew.kuchling | 2006-05-25 20:11:16 +0200 (Thu, 25 May 2006) | 1 line
Comment typo
........
r46234 | andrew.dalke | 2006-05-25 20:18:39 +0200 (Thu, 25 May 2006) | 4 lines
Added overflow test for adding two (very) large strings where the
new string is over max Py_ssize_t. I have no way to test it on my
box or any box I have access to. At least it doesn't break anything.
........
r46235 | bob.ippolito | 2006-05-25 20:20:23 +0200 (Thu, 25 May 2006) | 1 line
Faster path for PyLong_FromLongLong, using PyLong_FromLong algorithm
........
r46238 | georg.brandl | 2006-05-25 20:44:09 +0200 (Thu, 25 May 2006) | 3 lines
Guard the _active.remove() call to avoid errors when there is no _active list.
........
r46239 | fredrik.lundh | 2006-05-25 20:44:29 +0200 (Thu, 25 May 2006) | 4 lines
needforspeed: use fastsearch also for find/index and contains. the
related tests are now about 10x faster.
........
r46240 | bob.ippolito | 2006-05-25 20:44:50 +0200 (Thu, 25 May 2006) | 1 line
Struct now unpacks to PY_LONG_LONG directly when possible, also include #ifdef'ed out code that will return int instead of long when in bounds (not active since it's an API and doc change)
........
r46241 | jack.diederich | 2006-05-25 20:47:15 +0200 (Thu, 25 May 2006) | 1 line
* eliminate warning by reverting tmp_s type to 'const char*'
........
r46242 | bob.ippolito | 2006-05-25 21:03:19 +0200 (Thu, 25 May 2006) | 1 line
Fix Cygwin compiler issue
........
r46243 | bob.ippolito | 2006-05-25 21:15:27 +0200 (Thu, 25 May 2006) | 1 line
fix a struct regression where long would be returned for short unsigned integers
........
r46244 | georg.brandl | 2006-05-25 21:15:31 +0200 (Thu, 25 May 2006) | 4 lines
Replace PyObject_CallFunction calls with only object args
with PyObject_CallFunctionObjArgs, which is 30% faster.
........
r46245 | fredrik.lundh | 2006-05-25 21:19:05 +0200 (Thu, 25 May 2006) | 3 lines
needforspeed: use insert+reverse instead of append
........
r46246 | bob.ippolito | 2006-05-25 21:33:38 +0200 (Thu, 25 May 2006) | 1 line
Use LONG_MIN and LONG_MAX to check Python integer bounds instead of the incorrect INT_MIN and INT_MAX
........
r46248 | bob.ippolito | 2006-05-25 21:56:56 +0200 (Thu, 25 May 2006) | 1 line
Use faster struct pack/unpack functions for the endian table that matches the host's
........
r46249 | bob.ippolito | 2006-05-25 21:59:56 +0200 (Thu, 25 May 2006) | 1 line
enable darwin/x86 support for libffi and hence ctypes (doesn't yet support --enable-universalsdk)
........
r46252 | georg.brandl | 2006-05-25 22:28:10 +0200 (Thu, 25 May 2006) | 4 lines
Someone seems to just have copy-pasted the docs of
tp_compare to tp_richcompare ;)
........
r46253 | brett.cannon | 2006-05-25 22:44:08 +0200 (Thu, 25 May 2006) | 2 lines
Swap out bare malloc()/free() use for PyMem_MALLOC()/PyMem_FREE() .
........
r46254 | bob.ippolito | 2006-05-25 22:52:38 +0200 (Thu, 25 May 2006) | 1 line
squelch gcc4 darwin/x86 compiler warnings
........
r46255 | bob.ippolito | 2006-05-25 23:09:45 +0200 (Thu, 25 May 2006) | 1 line
fix test_float regression and 64-bit size mismatch issue
........
r46256 | georg.brandl | 2006-05-25 23:11:56 +0200 (Thu, 25 May 2006) | 3 lines
Add a x-ref to newer calling APIs.
........
r46257 | ronald.oussoren | 2006-05-25 23:30:54 +0200 (Thu, 25 May 2006) | 2 lines
Fix minor typo in prep_cif.c
........
r46259 | brett.cannon | 2006-05-25 23:33:11 +0200 (Thu, 25 May 2006) | 4 lines
Change test_values so that it compares the lowercasing of group names since getgrall() can return all lowercase names while getgrgid() returns proper casing.
Discovered on Ubuntu 5.04 (custom).
........
r46261 | tim.peters | 2006-05-25 23:50:17 +0200 (Thu, 25 May 2006) | 7 lines
Some Win64 pre-release in 2000 didn't support
QueryPerformanceCounter(), but we believe Win64 does
support it now. So use in time.clock().
It would be peachy if someone with a Win64 box tried
this ;-)
........
r46262 | tim.peters | 2006-05-25 23:52:19 +0200 (Thu, 25 May 2006) | 2 lines
Whitespace normalization.
........
r46263 | bob.ippolito | 2006-05-25 23:58:05 +0200 (Thu, 25 May 2006) | 1 line
Add missing files from x86 darwin ctypes patch
........
r46264 | brett.cannon | 2006-05-26 00:00:14 +0200 (Fri, 26 May 2006) | 2 lines
Move over to use of METH_O and METH_NOARGS.
........
r46265 | tim.peters | 2006-05-26 00:25:25 +0200 (Fri, 26 May 2006) | 3 lines
Repair idiot typo, and complete the job of trying to
use the Windows time.clock() implementation on Win64.
........
r46266 | tim.peters | 2006-05-26 00:28:46 +0200 (Fri, 26 May 2006) | 9 lines
Patch #1494387: SVN longobject.c compiler warnings
The SIGCHECK macro defined here has always been bizarre, but
it apparently causes compiler warnings on "Sun Studio 11".
I believe the warnings are bogus, but it doesn't hurt to make
the macro definition saner.
Bugfix candidate (but I'm not going to bother).
........
r46268 | fredrik.lundh | 2006-05-26 01:27:53 +0200 (Fri, 26 May 2006) | 8 lines
needforspeed: partition for 8-bit strings. for some simple tests,
this is on par with a corresponding find, and nearly twice as fast
as split(sep, 1)
full tests, a unicode version, and documentation will follow to-
morrow.
........
r46271 | andrew.kuchling | 2006-05-26 03:46:22 +0200 (Fri, 26 May 2006) | 1 line
Add Soc student
........
r46272 | ronald.oussoren | 2006-05-26 10:41:25 +0200 (Fri, 26 May 2006) | 3 lines
Without this patch OSX users couldn't add new help sources because the code
tried to update one item in a tuple.
........
r46273 | fredrik.lundh | 2006-05-26 10:54:28 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: partition implementation, part two.
feel free to improve the documentation and the docstrings.
........
r46274 | georg.brandl | 2006-05-26 11:05:54 +0200 (Fri, 26 May 2006) | 3 lines
Clarify docs for str.partition().
........
r46278 | fredrik.lundh | 2006-05-26 11:46:59 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: use METH_O for argument handling, which made partition some
~15% faster for the current tests (which is noticable faster than a corre-
sponding find call). thanks to neal-who-never-sleeps for the tip.
........
r46280 | fredrik.lundh | 2006-05-26 12:27:17 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: use Py_ssize_t for the fastsearch counter and skip
length (thanks, neal!). and yes, I've verified that this doesn't
slow things down ;-)
........
r46285 | andrew.dalke | 2006-05-26 13:11:38 +0200 (Fri, 26 May 2006) | 2 lines
Added a few more test cases for whitespace split. These strings have leading whitespace.
........
r46286 | jack.diederich | 2006-05-26 13:15:17 +0200 (Fri, 26 May 2006) | 1 line
use Py_ssize_t in places that may need it
........
r46287 | andrew.dalke | 2006-05-26 13:15:22 +0200 (Fri, 26 May 2006) | 2 lines
Added split whitespace checks for characters other than space.
........
r46288 | ronald.oussoren | 2006-05-26 13:17:55 +0200 (Fri, 26 May 2006) | 2 lines
Fix buglet in postinstall script, it would generate an invalid .cshrc file.
........
r46290 | georg.brandl | 2006-05-26 13:26:11 +0200 (Fri, 26 May 2006) | 3 lines
Add "partition" to UserString.
........
r46291 | fredrik.lundh | 2006-05-26 13:29:39 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: added Py_LOCAL macro, based on the LOCAL macro used
for SRE and others. applied Py_LOCAL to relevant portion of ceval,
which gives a 1-2% speedup on my machine. ymmv.
........
r46292 | jack.diederich | 2006-05-26 13:37:20 +0200 (Fri, 26 May 2006) | 1 line
when generating python code prefer to generate valid python code
........
r46293 | fredrik.lundh | 2006-05-26 13:38:15 +0200 (Fri, 26 May 2006) | 3 lines
use Py_LOCAL also for string and unicode objects
........
r46294 | ronald.oussoren | 2006-05-26 13:38:39 +0200 (Fri, 26 May 2006) | 12 lines
- Search the sqlite specific search directories
after the normal include directories when looking
for the version of sqlite to use.
- On OSX:
* Extract additional include and link directories
from the CFLAGS and LDFLAGS, if the user has
bothered to specify them we might as wel use them.
* Add '-Wl,-search_paths_first' to the extra_link_args
for readline and sqlite. This makes it possible to
use a static library to override the system provided
dynamic library.
........
r46295 | ronald.oussoren | 2006-05-26 13:43:26 +0200 (Fri, 26 May 2006) | 6 lines
Integrate installing a framework in the 'make install'
target. Until now users had to use 'make frameworkinstall'
to install python when it is configured with '--enable-framework'.
This tends to confuse users that don't hunt for readme files
hidden in platform specific directories :-)
........
r46297 | fredrik.lundh | 2006-05-26 13:54:04 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: added PY_LOCAL_AGGRESSIVE macro to enable "aggressive"
LOCAL inlining; also added some missing whitespace
........
r46298 | andrew.kuchling | 2006-05-26 14:01:44 +0200 (Fri, 26 May 2006) | 1 line
Typo fixes
........
r46299 | fredrik.lundh | 2006-05-26 14:01:49 +0200 (Fri, 26 May 2006) | 4 lines
Py_LOCAL shouldn't be used for data; it works for some .NET 2003 compilers,
but Trent's copy thinks that it's an anachronism...
........
r46300 | martin.blais | 2006-05-26 14:03:27 +0200 (Fri, 26 May 2006) | 12 lines
Support for buffer protocol for socket and struct.
* Added socket.recv_buf() and socket.recvfrom_buf() methods, that use the buffer
protocol (send and sendto already did).
* Added struct.pack_to(), that is the corresponding buffer compatible method to
unpack_from().
* Fixed minor typos in arraymodule.
........
r46302 | ronald.oussoren | 2006-05-26 14:23:20 +0200 (Fri, 26 May 2006) | 6 lines
- Remove previous version of the binary distribution script for OSX
- Some small bugfixes for the IDLE.app wrapper
- Tweaks to build-installer to ensure that python gets build in the right way,
including sqlite3.
- Updated readme files
........
r46305 | tim.peters | 2006-05-26 14:26:21 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46307 | andrew.dalke | 2006-05-26 14:28:15 +0200 (Fri, 26 May 2006) | 7 lines
I like tests.
The new split functions use a preallocated list. Added tests which exceed
the preallocation size, to exercise list appends/resizes.
Also added more edge case tests.
........
r46308 | andrew.dalke | 2006-05-26 14:31:00 +0200 (Fri, 26 May 2006) | 2 lines
Test cases for off-by-one errors in string split with multicharacter pattern.
........
r46309 | tim.peters | 2006-05-26 14:31:20 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46313 | andrew.kuchling | 2006-05-26 14:39:48 +0200 (Fri, 26 May 2006) | 1 line
Add str.partition()
........
r46314 | bob.ippolito | 2006-05-26 14:52:53 +0200 (Fri, 26 May 2006) | 1 line
quick hack to fix busted binhex test
........
r46316 | andrew.dalke | 2006-05-26 15:05:55 +0200 (Fri, 26 May 2006) | 2 lines
Added more rstrip tests, including for prealloc'ed arrays
........
r46320 | bob.ippolito | 2006-05-26 15:15:44 +0200 (Fri, 26 May 2006) | 1 line
fix #1229380 No struct.pack exception for some out of range integers
........
r46325 | tim.peters | 2006-05-26 15:39:17 +0200 (Fri, 26 May 2006) | 2 lines
Use open() to open files (was using file()).
........
r46327 | andrew.dalke | 2006-05-26 16:00:45 +0200 (Fri, 26 May 2006) | 37 lines
Changes to string.split/rsplit on whitespace to preallocate space in the
results list.
Originally it allocated 0 items and used the list growth during append. Now
it preallocates 12 items so the first few appends don't need list reallocs.
("Here are some words ."*2).split(None, 1) is 7% faster
("Here are some words ."*2).split() is is 15% faster
(Your milage may vary, see dealership for details.)
File parsing like this
for line in f:
count += len(line.split())
is also about 15% faster. There is a slowdown of about 3% for large
strings because of the additional overhead of checking if the append is
to a preallocated region of the list or not. This will be the rare case.
It could be improved with special case code but we decided it was not
useful enough.
There is a cost of 12*sizeof(PyObject *) bytes per list. For the normal
case of file parsing this is not a problem because of the lists have
a short lifetime. We have not come up with cases where this is a problem
in real life.
I chose 12 because human text averages about 11 words per line in books,
one of my data sets averages 6.2 words with a final peak at 11 words per
line, and I work with a tab delimited data set with 8 tabs per line (or
9 words per line). 12 encompasses all of these.
Also changed the last rstrip code to append then reverse, rather than
doing insert(0). The strip() and rstrip() times are now comparable.
........
r46328 | tim.peters | 2006-05-26 16:02:05 +0200 (Fri, 26 May 2006) | 5 lines
Explicitly close files. I'm trying to stop the frequent spurious test_tarfile
failures on Windows buildbots, but it's hard to know how since the regrtest
failure output is useless here, and it never fails when a buildbot slave runs
test_tarfile the second time in verbose mode.
........
r46329 | andrew.kuchling | 2006-05-26 16:03:41 +0200 (Fri, 26 May 2006) | 1 line
Add buffer support for struct, socket
........
r46330 | andrew.kuchling | 2006-05-26 16:04:19 +0200 (Fri, 26 May 2006) | 1 line
Typo fix
........
r46331 | bob.ippolito | 2006-05-26 16:07:23 +0200 (Fri, 26 May 2006) | 1 line
Fix distutils so that libffi will cross-compile between darwin/x86 and darwin/ppc
........
r46333 | bob.ippolito | 2006-05-26 16:23:21 +0200 (Fri, 26 May 2006) | 1 line
Fix _struct typo that broke some 64-bit platforms
........
r46335 | bob.ippolito | 2006-05-26 16:29:35 +0200 (Fri, 26 May 2006) | 1 line
Enable PY_USE_INT_WHEN_POSSIBLE in struct
........
r46343 | andrew.dalke | 2006-05-26 17:21:01 +0200 (Fri, 26 May 2006) | 2 lines
Eeked out another 3% or so performance in split whitespace by cleaning up the algorithm.
........
r46352 | andrew.dalke | 2006-05-26 18:22:52 +0200 (Fri, 26 May 2006) | 3 lines
Test for more edge strip cases; leading and trailing separator gets removed
even with strip(..., 0)
........
r46354 | bob.ippolito | 2006-05-26 18:23:28 +0200 (Fri, 26 May 2006) | 1 line
fix signed/unsigned mismatch in struct
........
r46355 | steve.holden | 2006-05-26 18:27:59 +0200 (Fri, 26 May 2006) | 5 lines
Add -t option to allow easy test selection.
Action verbose option correctly.
Tweak operation counts. Add empty and new instances tests.
Enable comparisons across different warp factors. Change version.
........
r46356 | fredrik.lundh | 2006-05-26 18:32:42 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: use Py_LOCAL on a few more locals in stringobject.c
........
r46357 | thomas.heller | 2006-05-26 18:42:44 +0200 (Fri, 26 May 2006) | 4 lines
For now, I gave up with automatic conversion of reST to Python-latex,
so I'm writing this in latex now.
Skeleton for the ctypes reference.
........
r46358 | tim.peters | 2006-05-26 18:49:28 +0200 (Fri, 26 May 2006) | 3 lines
Repair Windows compiler warnings about mixing
signed and unsigned integral types in comparisons.
........
r46359 | tim.peters | 2006-05-26 18:52:04 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46360 | tim.peters | 2006-05-26 18:53:04 +0200 (Fri, 26 May 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46362 | fredrik.lundh | 2006-05-26 19:04:58 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: stringlib refactoring (in progress)
........
r46363 | thomas.heller | 2006-05-26 19:18:33 +0200 (Fri, 26 May 2006) | 1 line
Write some docs.
........
r46364 | fredrik.lundh | 2006-05-26 19:22:38 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: stringlib refactoring (in progress)
........
r46366 | fredrik.lundh | 2006-05-26 19:26:39 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: cleanup
........
r46367 | fredrik.lundh | 2006-05-26 19:31:41 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: remove remaining USE_FAST macros; if fastsearch was
broken, someone would have noticed by now ;-)
........
r46368 | steve.holden | 2006-05-26 19:41:32 +0200 (Fri, 26 May 2006) | 5 lines
Use minimum calibration time rather than avergae to avoid
the illusion of negative run times. Halt with an error if
run times go below 10 ms, indicating that results will be
unreliable.
........
r46370 | thomas.heller | 2006-05-26 19:47:40 +0200 (Fri, 26 May 2006) | 2 lines
Reordered, and wrote more docs.
........
r46372 | georg.brandl | 2006-05-26 20:03:31 +0200 (Fri, 26 May 2006) | 9 lines
Need for speed: Patch #921466 : sys.path_importer_cache is now used to cache valid and
invalid file paths for the built-in import machinery which leads to
fewer open calls on startup.
Also fix issue with PEP 302 style import hooks which lead to more open()
calls than necessary.
........
r46373 | fredrik.lundh | 2006-05-26 20:05:34 +0200 (Fri, 26 May 2006) | 3 lines
removed unnecessary include
........
r46377 | fredrik.lundh | 2006-05-26 20:15:38 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: added rpartition implementation
........
r46380 | fredrik.lundh | 2006-05-26 20:24:15 +0200 (Fri, 26 May 2006) | 5 lines
needspeed: rpartition documentation, tests, and a bug fixes.
feel free to add more tests and improve the documentation.
........
r46381 | steve.holden | 2006-05-26 20:26:21 +0200 (Fri, 26 May 2006) | 4 lines
Revert tests to MAL's original round sizes to retiain comparability
from long ago and far away. Stop calling this pybench 1.4 because it
isn't. Remove the empty test, which was a bad idea.
........
r46387 | andrew.kuchling | 2006-05-26 20:41:18 +0200 (Fri, 26 May 2006) | 1 line
Add rpartition() and path caching
........
r46388 | andrew.dalke | 2006-05-26 21:02:09 +0200 (Fri, 26 May 2006) | 10 lines
substring split now uses /F's fast string matching algorithm.
(If compiled without FAST search support, changed the pre-memcmp test
to check the last character as well as the first. This gave a 25%
speedup for my test case.)
Rewrote the split algorithms so they stop when maxsplit gets to 0.
Previously they did a string match first then checked if the maxsplit
was reached. The new way prevents a needless string search.
........
r46391 | brett.cannon | 2006-05-26 21:04:47 +0200 (Fri, 26 May 2006) | 2 lines
Change C spacing to 4 spaces by default to match PEP 7 for new C files.
........
r46392 | georg.brandl | 2006-05-26 21:04:47 +0200 (Fri, 26 May 2006) | 3 lines
Exception isn't the root of all exception classes anymore.
........
r46397 | fredrik.lundh | 2006-05-26 21:23:21 +0200 (Fri, 26 May 2006) | 3 lines
added rpartition method to UserString class
........
r46398 | fredrik.lundh | 2006-05-26 21:24:53 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: stringlib refactoring, continued. added count and
find helpers; updated unicodeobject to use stringlib_count
........
r46400 | fredrik.lundh | 2006-05-26 21:29:05 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: stringlib refactoring: use stringlib/find for unicode
find
........
r46403 | fredrik.lundh | 2006-05-26 21:33:03 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: use a macro to fix slice indexes
........
r46404 | thomas.heller | 2006-05-26 21:43:45 +0200 (Fri, 26 May 2006) | 1 line
Write more docs.
........
r46406 | fredrik.lundh | 2006-05-26 21:48:07 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: stringlib refactoring: use stringlib/find for string find
........
r46407 | andrew.kuchling | 2006-05-26 21:51:10 +0200 (Fri, 26 May 2006) | 1 line
Comment typo
........
r46409 | georg.brandl | 2006-05-26 22:04:44 +0200 (Fri, 26 May 2006) | 3 lines
Replace Py_BuildValue("OO") by PyTuple_Pack.
........
r46411 | georg.brandl | 2006-05-26 22:14:47 +0200 (Fri, 26 May 2006) | 2 lines
Patch #1492218: document None being a constant.
........
r46415 | georg.brandl | 2006-05-26 22:22:50 +0200 (Fri, 26 May 2006) | 3 lines
Simplify calling.
........
r46416 | andrew.dalke | 2006-05-26 22:25:22 +0200 (Fri, 26 May 2006) | 4 lines
Added limits to the replace code so it does not count all of the matching
patterns in a string, only the number needed by the max limit.
........
r46417 | bob.ippolito | 2006-05-26 22:25:23 +0200 (Fri, 26 May 2006) | 1 line
enable all of the struct tests, use ssize_t, fix some whitespace
........
r46418 | tim.peters | 2006-05-26 22:56:56 +0200 (Fri, 26 May 2006) | 2 lines
Record Iceland sprint attendees.
........
r46421 | tim.peters | 2006-05-26 23:51:13 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46422 | steve.holden | 2006-05-27 00:17:54 +0200 (Sat, 27 May 2006) | 2 lines
Add Richard Tew to developers
........
r46423 | steve.holden | 2006-05-27 00:33:20 +0200 (Sat, 27 May 2006) | 2 lines
Update help text and documentaition.
........
r46424 | steve.holden | 2006-05-27 00:39:27 +0200 (Sat, 27 May 2006) | 2 lines
Blasted typos ...
........
r46425 | andrew.dalke | 2006-05-27 00:49:03 +0200 (Sat, 27 May 2006) | 2 lines
Added description of why splitlines doesn't use the prealloc strategy
........
r46426 | tim.peters | 2006-05-27 01:14:37 +0200 (Sat, 27 May 2006) | 19 lines
Patch 1145039.
set_exc_info(), reset_exc_info(): By exploiting the
likely (who knows?) invariant that when an exception's
`type` is NULL, its `value` and `traceback` are also NULL,
save some cycles in heavily-executed code.
This is a "a kronar saved is a kronar earned" patch: the
speedup isn't reliably measurable, but it obviously does
reduce the operation count in the normal (no exception
raised) path through PyEval_EvalFrameEx().
The tim-exc_sanity branch tries to push this harder, but
is still blowing up (at least in part due to pre-existing
subtle bugs that appear to have no other visible
consequences!).
Not a bugfix candidate.
........
r46429 | steve.holden | 2006-05-27 02:51:52 +0200 (Sat, 27 May 2006) | 2 lines
Reinstate new-style object tests.
........
r46430 | neal.norwitz | 2006-05-27 07:18:57 +0200 (Sat, 27 May 2006) | 1 line
Fix compiler warning (and whitespace) on Mac OS 10.4. (A lot of this code looked duplicated, I wonder if a utility function could help reduce the duplication here.)
........
r46431 | neal.norwitz | 2006-05-27 07:21:30 +0200 (Sat, 27 May 2006) | 4 lines
Fix Coverity warnings.
- Check the correct variable (str_obj, not str) for NULL
- sep_len was already verified it wasn't 0
........
r46432 | martin.v.loewis | 2006-05-27 10:36:52 +0200 (Sat, 27 May 2006) | 2 lines
Patch 1494554: Update numeric properties to Unicode 4.1.
........
r46433 | martin.v.loewis | 2006-05-27 10:54:29 +0200 (Sat, 27 May 2006) | 2 lines
Explain why 'consumed' is initialized.
........
r46436 | fredrik.lundh | 2006-05-27 12:05:10 +0200 (Sat, 27 May 2006) | 3 lines
needforspeed: more stringlib refactoring
........
r46438 | fredrik.lundh | 2006-05-27 12:39:48 +0200 (Sat, 27 May 2006) | 5 lines
needforspeed: backed out the Py_LOCAL-isation of ceval; the massive in-
lining killed performance on certain Intel boxes, and the "aggressive"
macro itself gives most of the benefits on others.
........
r46439 | andrew.dalke | 2006-05-27 13:04:36 +0200 (Sat, 27 May 2006) | 2 lines
fixed typo
........
r46440 | martin.v.loewis | 2006-05-27 13:07:49 +0200 (Sat, 27 May 2006) | 2 lines
Revert bogus change committed in 46432 to this file.
........
r46444 | andrew.kuchling | 2006-05-27 13:26:33 +0200 (Sat, 27 May 2006) | 1 line
Add Py_LOCAL macros
........
r46450 | bob.ippolito | 2006-05-27 13:47:12 +0200 (Sat, 27 May 2006) | 1 line
Remove the range checking and int usage #defines from _struct and strip out the now-dead code
........
r46454 | bob.ippolito | 2006-05-27 14:11:36 +0200 (Sat, 27 May 2006) | 1 line
Fix up struct docstrings, add struct.pack_to function for symmetry
........
r46456 | richard.jones | 2006-05-27 14:29:24 +0200 (Sat, 27 May 2006) | 2 lines
Conversion of exceptions over from faked-up classes to new-style C types.
........
r46457 | georg.brandl | 2006-05-27 14:30:25 +0200 (Sat, 27 May 2006) | 3 lines
Add news item for new-style exception class branch merge.
........
r46458 | tim.peters | 2006-05-27 14:36:53 +0200 (Sat, 27 May 2006) | 3 lines
More random thrashing trying to understand spurious
Windows failures. Who's keeping a bz2 file open?
........
r46460 | andrew.kuchling | 2006-05-27 15:44:37 +0200 (Sat, 27 May 2006) | 1 line
Mention new-style exceptions
........
r46461 | richard.jones | 2006-05-27 15:50:42 +0200 (Sat, 27 May 2006) | 1 line
credit where credit is due
........
r46462 | georg.brandl | 2006-05-27 16:02:03 +0200 (Sat, 27 May 2006) | 3 lines
Always close BZ2Proxy object. Remove unnecessary struct usage.
........
r46463 | tim.peters | 2006-05-27 16:13:13 +0200 (Sat, 27 May 2006) | 2 lines
The cheery optimism of old age.
........
r46464 | andrew.dalke | 2006-05-27 16:16:40 +0200 (Sat, 27 May 2006) | 2 lines
cleanup - removed trailing whitespace
........
r46465 | georg.brandl | 2006-05-27 16:41:55 +0200 (Sat, 27 May 2006) | 3 lines
Remove spurious semicolons after macro invocations.
........
r46468 | fredrik.lundh | 2006-05-27 16:58:20 +0200 (Sat, 27 May 2006) | 4 lines
needforspeed: replace improvements, changed to Py_LOCAL_INLINE
where appropriate
........
r46469 | fredrik.lundh | 2006-05-27 17:20:22 +0200 (Sat, 27 May 2006) | 4 lines
needforspeed: stringlib refactoring: changed find_obj to find_slice,
to enable use from stringobject
........
r46470 | fredrik.lundh | 2006-05-27 17:26:19 +0200 (Sat, 27 May 2006) | 3 lines
needforspeed: stringlib refactoring: use find_slice for stringobject
........
r46472 | kristjan.jonsson | 2006-05-27 17:41:31 +0200 (Sat, 27 May 2006) | 1 line
Add a PCBuild8 build directory for building with Visual Studio .NET 2005. Contains a special project to perform profile guided optimizations on the pythoncore.dll, by instrumenting and running pybench.py
........
r46473 | jack.diederich | 2006-05-27 17:44:34 +0200 (Sat, 27 May 2006) | 3 lines
needforspeed: use PyObject_MALLOC instead of system malloc for small
allocations. Use PyMem_MALLOC for larger (1k+) chunks. 1%-2% speedup.
........
r46474 | bob.ippolito | 2006-05-27 17:53:49 +0200 (Sat, 27 May 2006) | 1 line
fix struct regression on 64-bit platforms
........
r46475 | richard.jones | 2006-05-27 18:07:28 +0200 (Sat, 27 May 2006) | 1 line
doc string additions and tweaks
........
r46477 | richard.jones | 2006-05-27 18:15:11 +0200 (Sat, 27 May 2006) | 1 line
move semicolons
........
r46478 | george.yoshida | 2006-05-27 18:32:44 +0200 (Sat, 27 May 2006) | 2 lines
minor markup nits
........
r46488 | george.yoshida | 2006-05-27 18:51:43 +0200 (Sat, 27 May 2006) | 3 lines
End of Ch.3 is now about "with statement".
Avoid obsolescence by directly referring to the section.
........
r46489 | george.yoshida | 2006-05-27 19:09:17 +0200 (Sat, 27 May 2006) | 2 lines
fix typo
........
2006-05-27 19:21:47 +00:00
|
|
|
/* This is a reimplementation of the C library's chdir function,
|
|
|
|
|
but one that produces Win32 errors instead of DOS error codes.
|
|
|
|
|
chdir is essentially a wrapper around SetCurrentDirectory; however,
|
|
|
|
|
it also needs to set "magic" environment variables indicating
|
|
|
|
|
the per-drive current directory, which are of the form =<drive>: */
|
Merged revisions 66887,66891,66902-66903,66905-66906,66911-66913,66922,66927-66928,66936,66939-66940,66962,66964,66973 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
................
r66887 | benjamin.peterson | 2008-10-13 16:51:40 -0500 (Mon, 13 Oct 2008) | 1 line
document how to disable fixers
................
r66891 | amaury.forgeotdarc | 2008-10-14 16:47:22 -0500 (Tue, 14 Oct 2008) | 5 lines
#4122: On Windows, Py_UNICODE_ISSPACE cannot be used in an extension module:
compilation fails with "undefined reference to _Py_ascii_whitespace"
Will backport to 2.6.
................
r66902 | skip.montanaro | 2008-10-15 06:49:10 -0500 (Wed, 15 Oct 2008) | 1 line
easter egg
................
r66903 | benjamin.peterson | 2008-10-15 15:34:09 -0500 (Wed, 15 Oct 2008) | 1 line
don't recurse into directories that start with '.'
................
r66905 | benjamin.peterson | 2008-10-15 16:05:55 -0500 (Wed, 15 Oct 2008) | 1 line
support the optional line argument for idle
................
r66906 | benjamin.peterson | 2008-10-15 16:58:46 -0500 (Wed, 15 Oct 2008) | 1 line
add a much requested newline
................
r66911 | benjamin.peterson | 2008-10-15 18:10:28 -0500 (Wed, 15 Oct 2008) | 41 lines
Merged revisions 66805,66841,66860,66884-66886,66893,66907,66910 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3
........
r66805 | benjamin.peterson | 2008-10-04 20:11:02 -0500 (Sat, 04 Oct 2008) | 1 line
mention what the fixes directory is for
........
r66841 | benjamin.peterson | 2008-10-07 17:48:12 -0500 (Tue, 07 Oct 2008) | 1 line
use assertFalse and assertTrue
........
r66860 | benjamin.peterson | 2008-10-08 16:05:07 -0500 (Wed, 08 Oct 2008) | 1 line
instead of abusing the pattern matcher, use start_tree to find a next binding
........
r66884 | benjamin.peterson | 2008-10-13 15:50:30 -0500 (Mon, 13 Oct 2008) | 1 line
don't print tokens to stdout when -v is given
........
r66885 | benjamin.peterson | 2008-10-13 16:28:57 -0500 (Mon, 13 Oct 2008) | 1 line
add the -x option to disable fixers
........
r66886 | benjamin.peterson | 2008-10-13 16:33:53 -0500 (Mon, 13 Oct 2008) | 1 line
cut down on some crud
........
r66893 | benjamin.peterson | 2008-10-14 17:16:54 -0500 (Tue, 14 Oct 2008) | 1 line
add an optional set literal fixer
........
r66907 | benjamin.peterson | 2008-10-15 16:59:41 -0500 (Wed, 15 Oct 2008) | 1 line
don't write backup files by default
........
r66910 | benjamin.peterson | 2008-10-15 17:43:10 -0500 (Wed, 15 Oct 2008) | 1 line
add the -n option; it stops backupfiles from being written
........
................
r66912 | hirokazu.yamamoto | 2008-10-16 01:25:25 -0500 (Thu, 16 Oct 2008) | 2 lines
removed unused _PyUnicode_FromFileSystemEncodedObject.
made win32_chdir, win32_wchdir static.
................
r66913 | benjamin.peterson | 2008-10-16 13:52:14 -0500 (Thu, 16 Oct 2008) | 1 line
document that deque indexing is O(n) #4123
................
r66922 | benjamin.peterson | 2008-10-16 14:40:14 -0500 (Thu, 16 Oct 2008) | 1 line
use new showwarnings signature for idle #3391
................
r66927 | andrew.kuchling | 2008-10-16 15:15:47 -0500 (Thu, 16 Oct 2008) | 1 line
Fix wording (2.6.1 backport candidate)
................
r66928 | georg.brandl | 2008-10-16 15:20:56 -0500 (Thu, 16 Oct 2008) | 2 lines
Add more TOC to the whatsnew index page.
................
r66936 | georg.brandl | 2008-10-16 16:20:15 -0500 (Thu, 16 Oct 2008) | 2 lines
#4131: FF3 doesn't write cookies.txt files.
................
r66939 | georg.brandl | 2008-10-16 16:36:39 -0500 (Thu, 16 Oct 2008) | 2 lines
part of #4012: kill off old name "processing".
................
r66940 | georg.brandl | 2008-10-16 16:38:48 -0500 (Thu, 16 Oct 2008) | 2 lines
#4083: add "as" to except handler grammar as per PEP 3110.
................
r66962 | benjamin.peterson | 2008-10-17 15:01:01 -0500 (Fri, 17 Oct 2008) | 1 line
clarify CALL_FUNCTION #4141
................
r66964 | georg.brandl | 2008-10-17 16:41:49 -0500 (Fri, 17 Oct 2008) | 2 lines
Fix duplicate word.
................
r66973 | armin.ronacher | 2008-10-19 03:27:43 -0500 (Sun, 19 Oct 2008) | 3 lines
Fixed #4067 by implementing _attributes and _fields for the AST root node.
................
2008-10-19 14:07:49 +00:00
|
|
|
static BOOL __stdcall
|
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Inherits test_gzip/test_tarfile failures on 64-bit platforms from the trunk,
but I don't want the merge to hang around too long (even though the regular
p3yk-contributors are/have been busy with other things.)
Merged revisions 45621-46490 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r45621 | george.yoshida | 2006-04-21 18:34:17 +0200 (Fri, 21 Apr 2006) | 2 lines
Correct the grammar
........
r45622 | tim.peters | 2006-04-21 18:34:54 +0200 (Fri, 21 Apr 2006) | 2 lines
Whitespace normalization.
........
r45624 | thomas.heller | 2006-04-21 18:48:56 +0200 (Fri, 21 Apr 2006) | 1 line
Merge in changes from ctypes 0.9.9.6 upstream version.
........
r45625 | thomas.heller | 2006-04-21 18:51:04 +0200 (Fri, 21 Apr 2006) | 1 line
Merge in changes from ctypes 0.9.9.6 upstream version.
........
r45630 | thomas.heller | 2006-04-21 20:29:17 +0200 (Fri, 21 Apr 2006) | 8 lines
Documentation for ctypes.
I think that 'generic operating system services' is the best category.
Note that the Doc/lib/libctypes.latex file is generated from reST sources.
You are welcome to make typo fixes, and I'll try to keep the reST sources
in sync, but markup changes would be lost - they should be fixed in the tool
that creates the latex file.
The conversion script is external/ctypes/docs/manual/mkpydoc.py.
........
r45631 | tim.peters | 2006-04-21 23:18:10 +0200 (Fri, 21 Apr 2006) | 24 lines
SF bug #1473760 TempFile can hang on Windows.
Python 2.4 changed ntpath.abspath to do an import
inside the function. As a result, due to Python's
import lock, anything calling abspath on Windows
(directly, or indirectly like tempfile.TemporaryFile)
hung when it was called from a thread spawned as a
side effect of importing a module.
This is a depressingly frequent problem, and
deserves a more general fix. I'm settling for
a micro-fix here because this specific one accounts
for a report of Zope Corp's ZEO hanging on Windows,
and it was an odd way to change abspath to begin
with (ntpath needs a different implementation
depending on whether we're actually running on
Windows, and the _obvious_ way to arrange for that
is not to bury a possibly-failing import _inside_
the function).
Note that if/when other micro-fixes of this kind
get made, the new Lib/test/threaded_import_hangers.py
is a convenient place to add tests for them.
........
r45634 | phillip.eby | 2006-04-21 23:53:37 +0200 (Fri, 21 Apr 2006) | 2 lines
Guido wrote contextlib, not me, but thanks anyway. ;)
........
r45636 | andrew.kuchling | 2006-04-22 03:51:41 +0200 (Sat, 22 Apr 2006) | 1 line
Typo fixes
........
r45638 | andrew.kuchling | 2006-04-22 03:58:40 +0200 (Sat, 22 Apr 2006) | 1 line
Fix comment typo
........
r45639 | andrew.kuchling | 2006-04-22 04:06:03 +0200 (Sat, 22 Apr 2006) | 8 lines
Make copy of test_mailbox.py. We'll still want to check the backward
compatibility classes in the new mailbox.py that I'll be committing in
a few minutes.
One change has been made: the tests use len(mbox) instead of len(mbox.boxes).
The 'boxes' attribute was never documented and contains some internal state
that seems unlikely to have been useful.
........
r45640 | andrew.kuchling | 2006-04-22 04:32:43 +0200 (Sat, 22 Apr 2006) | 16 lines
Add Gregory K. Johnson's revised version of mailbox.py (funded by
the 2005 Summer of Code).
The revision adds a number of new mailbox classes that support adding
and removing messages; these classes also support mailbox locking and
default to using email.Message instead of rfc822.Message.
The old mailbox classes are largely left alone for backward compatibility.
The exception is the Maildir class, which was present in the old module
and now inherits from the new classes. The Maildir class's interface
is pretty simple, though, so I think it'll be compatible with existing
code.
(The change to the NEWS file also adds a missing word to a different
news item, which unfortunately required rewrapping the line.)
........
r45641 | tim.peters | 2006-04-22 07:52:59 +0200 (Sat, 22 Apr 2006) | 2 lines
Whitespace normalization.
........
r45642 | neal.norwitz | 2006-04-22 08:07:46 +0200 (Sat, 22 Apr 2006) | 1 line
Add libctypes as a dep
........
r45643 | martin.v.loewis | 2006-04-22 13:15:41 +0200 (Sat, 22 Apr 2006) | 1 line
Fix more ssize_t problems.
........
r45644 | martin.v.loewis | 2006-04-22 13:40:03 +0200 (Sat, 22 Apr 2006) | 1 line
Fix more ssize_t issues.
........
r45645 | george.yoshida | 2006-04-22 17:10:49 +0200 (Sat, 22 Apr 2006) | 2 lines
Typo fixes
........
r45647 | martin.v.loewis | 2006-04-22 17:19:54 +0200 (Sat, 22 Apr 2006) | 1 line
Port to Python 2.5. Drop .DEF file. Change output file names to .pyd.
........
r45648 | george.yoshida | 2006-04-22 17:27:14 +0200 (Sat, 22 Apr 2006) | 3 lines
- add versionadded tag
- make arbitrary arguments come last
........
r45649 | hyeshik.chang | 2006-04-22 17:48:15 +0200 (Sat, 22 Apr 2006) | 3 lines
Remove $CJKCodecs$ RCS tags. The CJKCodecs isn't maintained outside
anymore.
........
r45654 | greg.ward | 2006-04-23 05:47:58 +0200 (Sun, 23 Apr 2006) | 2 lines
Update optparse to Optik 1.5.1.
........
r45658 | george.yoshida | 2006-04-23 11:27:10 +0200 (Sun, 23 Apr 2006) | 2 lines
wrap SyntaxError with \exception{}
........
r45660 | ronald.oussoren | 2006-04-23 13:59:25 +0200 (Sun, 23 Apr 2006) | 6 lines
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.
........
r45661 | ronald.oussoren | 2006-04-23 14:36:23 +0200 (Sun, 23 Apr 2006) | 5 lines
Patch 1471761 - test for broken poll at runtime
This patch checks if poll is broken when the select module is loaded instead
of doing so at configure-time. This functionality is only active on Mac OS X.
........
r45662 | nick.coghlan | 2006-04-23 17:13:32 +0200 (Sun, 23 Apr 2006) | 1 line
Add a Context Types section to parallel the Iterator Types section (uses the same terminology as the 2.5a1 implementation)
........
r45663 | nick.coghlan | 2006-04-23 17:14:37 +0200 (Sun, 23 Apr 2006) | 1 line
Update contextlib documentation to use the same terminology as the module implementation
........
r45664 | gerhard.haering | 2006-04-23 17:24:26 +0200 (Sun, 23 Apr 2006) | 2 lines
Updated the sqlite3 module to the external pysqlite 2.2.2 version.
........
r45666 | nick.coghlan | 2006-04-23 17:39:16 +0200 (Sun, 23 Apr 2006) | 1 line
Update with statement documentation to use same terminology as 2.5a1 implementation
........
r45667 | nick.coghlan | 2006-04-23 18:05:04 +0200 (Sun, 23 Apr 2006) | 1 line
Add a (very) brief mention of the with statement to the end of chapter 8
........
r45668 | nick.coghlan | 2006-04-23 18:35:19 +0200 (Sun, 23 Apr 2006) | 1 line
Take 2 on mentioning the with statement, this time without inadvertently killing the Unicode examples
........
r45669 | nick.coghlan | 2006-04-23 19:04:07 +0200 (Sun, 23 Apr 2006) | 1 line
Backdated NEWS entry to record the implementation of PEP 338 for alpha 1
........
r45670 | tim.peters | 2006-04-23 20:13:45 +0200 (Sun, 23 Apr 2006) | 2 lines
Whitespace normalization.
........
r45671 | skip.montanaro | 2006-04-23 21:14:27 +0200 (Sun, 23 Apr 2006) | 1 line
first cut at trace module doc
........
r45672 | skip.montanaro | 2006-04-23 21:26:33 +0200 (Sun, 23 Apr 2006) | 1 line
minor tweak
........
r45673 | skip.montanaro | 2006-04-23 21:30:50 +0200 (Sun, 23 Apr 2006) | 1 line
it's always helpful if the example works...
........
r45674 | skip.montanaro | 2006-04-23 21:32:14 +0200 (Sun, 23 Apr 2006) | 1 line
correct example
........
r45675 | andrew.kuchling | 2006-04-23 23:01:04 +0200 (Sun, 23 Apr 2006) | 1 line
Edits to the PEP 343 section
........
r45676 | andrew.kuchling | 2006-04-23 23:51:10 +0200 (Sun, 23 Apr 2006) | 1 line
Add two items
........
r45677 | tim.peters | 2006-04-24 04:03:16 +0200 (Mon, 24 Apr 2006) | 5 lines
Bug #1337990: clarified that `doctest` does not support examples
requiring both expected output and an exception.
I'll backport to 2.4 next.
........
r45679 | nick.coghlan | 2006-04-24 05:04:43 +0200 (Mon, 24 Apr 2006) | 1 line
Note changes made to PEP 343 related documentation
........
r45681 | nick.coghlan | 2006-04-24 06:17:02 +0200 (Mon, 24 Apr 2006) | 1 line
Change PEP 343 related documentation to use the term context specifier instead of context object
........
r45682 | nick.coghlan | 2006-04-24 06:32:47 +0200 (Mon, 24 Apr 2006) | 1 line
Add unit tests for the -m and -c command line switches
........
r45683 | nick.coghlan | 2006-04-24 06:37:15 +0200 (Mon, 24 Apr 2006) | 1 line
Fix contextlib.nested to cope with exit methods raising and handling exceptions
........
r45685 | nick.coghlan | 2006-04-24 06:59:28 +0200 (Mon, 24 Apr 2006) | 1 line
Fix broken contextlib test from last checkin (I'd've sworn I tested that before checking it in. . .)
........
r45686 | nick.coghlan | 2006-04-24 07:24:26 +0200 (Mon, 24 Apr 2006) | 1 line
Back out new command line tests (broke buildbot)
........
r45687 | nick.coghlan | 2006-04-24 07:52:15 +0200 (Mon, 24 Apr 2006) | 1 line
More reliable version of new command line tests that just checks the exit codes
........
r45688 | thomas.wouters | 2006-04-24 13:37:13 +0200 (Mon, 24 Apr 2006) | 4 lines
Stop test_tcl's testLoadTk from leaking the Tk commands 'loadtk' registers.
........
r45690 | andrew.kuchling | 2006-04-24 16:30:47 +0200 (Mon, 24 Apr 2006) | 2 lines
Edits, using the new term
'context specifier' in a few places
........
r45697 | phillip.eby | 2006-04-24 22:53:13 +0200 (Mon, 24 Apr 2006) | 2 lines
Revert addition of setuptools
........
r45698 | tim.peters | 2006-04-25 00:45:13 +0200 (Tue, 25 Apr 2006) | 2 lines
Whitespace normalization.
........
r45700 | trent.mick | 2006-04-25 02:34:50 +0200 (Tue, 25 Apr 2006) | 4 lines
Put break at correct level so *all* root HKEYs acutally get checked for
an installed VC6. Otherwise only the first such tree gets checked and this
warning doesn't get displayed.
........
r45701 | tim.peters | 2006-04-25 05:31:36 +0200 (Tue, 25 Apr 2006) | 3 lines
Patch #1475231: add a new SKIP doctest option, thanks to
Edward Loper.
........
r45702 | neal.norwitz | 2006-04-25 07:04:35 +0200 (Tue, 25 Apr 2006) | 1 line
versionadded for SKIP
........
r45703 | neal.norwitz | 2006-04-25 07:05:03 +0200 (Tue, 25 Apr 2006) | 1 line
Restore Walters name
........
r45704 | neal.norwitz | 2006-04-25 07:49:42 +0200 (Tue, 25 Apr 2006) | 1 line
Revert previous change, SKIP had a versionadded elsewhere
........
r45706 | nick.coghlan | 2006-04-25 12:56:51 +0200 (Tue, 25 Apr 2006) | 31 lines
Move the PEP 343 documentation and implementation closer to the
terminology in the alpha 1 documentation.
- "context manager" reverts to its alpha 1 definition
- the term "context specifier" goes away entirely
- contextlib.GeneratorContextManager is renamed GeneratorContext
There are still a number of changes relative to alpha 1:
- the expression in the with statement is explicitly called the
"context expression" in the language reference
- the terms 'with statement context', 'context object' or 'with
statement context' are used in several places instead of a bare
'context'. The aim of this is to avoid ambiguity in relation to the
runtime context set up when the block is executed, and the context
objects that already exist in various application domains (such as
decimal.Context)
- contextlib.contextmanager is renamed to contextfactory
This best reflects the nature of the function resulting from the
use of that decorator
- decimal.ContextManager is renamed to WithStatementContext
Simple dropping the 'Manager' part wasn't possible due to the
fact that decimal.Context already exists and means something
different. WithStatementContext is ugly but workable.
A technically unrelated change snuck into this commit:
contextlib.closing now avoids the overhead of creating a
generator, since it's trivial to implement that particular
context manager directly.
........
r45707 | nick.coghlan | 2006-04-25 13:05:56 +0200 (Tue, 25 Apr 2006) | 1 line
Fix latex typo
........
r45708 | thomas.wouters | 2006-04-25 14:28:56 +0200 (Tue, 25 Apr 2006) | 4 lines
Fix markup glitch in unittest docs. Will backport.
........
r45710 | andrew.kuchling | 2006-04-25 14:31:38 +0200 (Tue, 25 Apr 2006) | 1 line
Add two items; easy_install is now off the table, though pkgutil still is
........
r45711 | andrew.kuchling | 2006-04-25 14:47:25 +0200 (Tue, 25 Apr 2006) | 1 line
Rework context terminology
........
r45712 | thomas.wouters | 2006-04-25 15:53:23 +0200 (Tue, 25 Apr 2006) | 9 lines
SF bug/patch #1433877: string parameter to ioctl not null terminated
The new char-array used in ioctl calls wasn't explicitly NUL-terminated;
quite probably the cause for the test_pty failures on Solaris that we
circumvented earlier. (I wasn't able to reproduce it with this patch, but it
has been somewhat elusive to start with.)
........
r45713 | george.yoshida | 2006-04-25 16:09:58 +0200 (Tue, 25 Apr 2006) | 2 lines
minor tweak
........
r45714 | thomas.wouters | 2006-04-25 17:08:10 +0200 (Tue, 25 Apr 2006) | 7 lines
Fix SF bug #1476111: SystemError in socket sendto. The AF_INET6 and
AF_PACKET cases in getsockaddrarg were missing their own checks for
tuple-ness of the address argument, which means a confusing SystemError was
raised by PyArg_ParseTuple instead.
........
r45715 | thomas.wouters | 2006-04-25 17:29:46 +0200 (Tue, 25 Apr 2006) | 10 lines
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.
........
r45717 | thomas.heller | 2006-04-25 20:26:08 +0200 (Tue, 25 Apr 2006) | 3 lines
Fix compiler warnings on Darwin.
Patch by Brett Canon, see
https://sourceforge.net/tracker/?func=detail&atid=532156&aid=1475959&group_id=71702
........
r45718 | guido.van.rossum | 2006-04-25 22:12:45 +0200 (Tue, 25 Apr 2006) | 4 lines
Implement MvL's improvement on __context__ in Condition;
this can just call __context__ on the underlying lock.
(The same change for Semaphore does *not* work!)
........
r45721 | tim.peters | 2006-04-26 03:15:53 +0200 (Wed, 26 Apr 2006) | 13 lines
Rev 45706 renamed stuff in contextlib.py, but didn't rename
uses of it in test_with.py. As a result, test_with has been skipped
(due to failing imports) on all buildbot boxes since. Alas, that's
not a test failure -- you have to pay attention to the
1 skip unexpected on PLATFORM:
test_with
kinds of output at the ends of test runs to notice that this got
broken.
It's likely that more renaming in test_with.py would be desirable.
........
r45722 | fred.drake | 2006-04-26 07:15:41 +0200 (Wed, 26 Apr 2006) | 1 line
markup fixes, cleanup
........
r45723 | fred.drake | 2006-04-26 07:19:39 +0200 (Wed, 26 Apr 2006) | 1 line
minor adjustment suggested by Peter Gephardt
........
r45724 | neal.norwitz | 2006-04-26 07:34:03 +0200 (Wed, 26 Apr 2006) | 10 lines
Patch from Aldo Cortesi (OpenBSD buildbot owner).
After the patch (45590) to add extra debug stats to the gc module, Python
was crashing on OpenBSD due to:
Fatal Python error: Interpreter not initialized (version mismatch?)
This seems to occur due to calling collect() when initialized (in pythonrun.c)
is set to 0. Now, the import will occur in the init function which
shouldn't suffer this problem.
........
r45725 | neal.norwitz | 2006-04-26 08:26:12 +0200 (Wed, 26 Apr 2006) | 3 lines
Fix this test on Solaris. There can be embedded \r, so don't just replace
the one at the end.
........
r45727 | nick.coghlan | 2006-04-26 13:50:04 +0200 (Wed, 26 Apr 2006) | 1 line
Fix an error in the last contextlib.closing example
........
r45728 | andrew.kuchling | 2006-04-26 14:21:06 +0200 (Wed, 26 Apr 2006) | 1 line
[Bug #1475080] Fix example
........
r45729 | andrew.kuchling | 2006-04-26 14:23:39 +0200 (Wed, 26 Apr 2006) | 1 line
Add labels to all sections
........
r45730 | thomas.wouters | 2006-04-26 17:53:30 +0200 (Wed, 26 Apr 2006) | 7 lines
The result of SF patch #1471578: big-memory tests for strings, lists and
tuples. Lots to be added, still, but this will give big-memory people
something to play with in 2.5 alpha 2, and hopefully get more people to
write these tests.
........
r45731 | tim.peters | 2006-04-26 19:11:16 +0200 (Wed, 26 Apr 2006) | 2 lines
Whitespace normalization.
........
r45732 | martin.v.loewis | 2006-04-26 19:19:44 +0200 (Wed, 26 Apr 2006) | 1 line
Use GS- and bufferoverlowU.lib where appropriate, for AMD64.
........
r45733 | thomas.wouters | 2006-04-26 20:46:01 +0200 (Wed, 26 Apr 2006) | 5 lines
Add tests for += and *= on strings, and fix the memory-use estimate for the
list.extend tests (they were estimating half the actual use.)
........
r45734 | thomas.wouters | 2006-04-26 21:14:46 +0200 (Wed, 26 Apr 2006) | 5 lines
Some more test-size-estimate fixes: test_append and test_insert trigger a
list resize, which overallocates.
........
r45735 | hyeshik.chang | 2006-04-26 21:20:26 +0200 (Wed, 26 Apr 2006) | 3 lines
Fix build on MIPS for libffi. I haven't tested this yet because I
don't have an access on MIPS machines. Will be tested by buildbot. :)
........
r45737 | fred.drake | 2006-04-27 01:40:32 +0200 (Thu, 27 Apr 2006) | 1 line
one more place to use the current Python version
........
r45738 | fred.drake | 2006-04-27 02:02:24 +0200 (Thu, 27 Apr 2006) | 3 lines
- update version numbers in file names again, until we have a better way
- elaborate instructions for Cygwin support (closes SF #839709)
........
r45739 | fred.drake | 2006-04-27 02:20:14 +0200 (Thu, 27 Apr 2006) | 1 line
add missing word
........
r45740 | anthony.baxter | 2006-04-27 04:11:24 +0200 (Thu, 27 Apr 2006) | 2 lines
2.5a2
........
r45741 | anthony.baxter | 2006-04-27 04:13:13 +0200 (Thu, 27 Apr 2006) | 1 line
2.5a2
........
r45749 | andrew.kuchling | 2006-04-27 14:22:37 +0200 (Thu, 27 Apr 2006) | 1 line
Now that 2.5a2 is out, revert to the current date
........
r45750 | andrew.kuchling | 2006-04-27 14:23:07 +0200 (Thu, 27 Apr 2006) | 1 line
Bump document version
........
r45751 | andrew.kuchling | 2006-04-27 14:34:39 +0200 (Thu, 27 Apr 2006) | 6 lines
[Bug #1477102] Add necessary import to example
This may be a useful style question for the docs -- should examples show
the necessary imports, or should it be assumed that the reader will
figure it out? In the What's New, I'm not consistent but usually opt
for omitting the imports.
........
r45753 | andrew.kuchling | 2006-04-27 14:38:35 +0200 (Thu, 27 Apr 2006) | 1 line
[Bug #1477140] Import Error base class
........
r45754 | andrew.kuchling | 2006-04-27 14:42:54 +0200 (Thu, 27 Apr 2006) | 1 line
Mention the xmlrpclib.Error base class, which is used in one of the examples
........
r45756 | george.yoshida | 2006-04-27 15:41:07 +0200 (Thu, 27 Apr 2006) | 2 lines
markup fix
........
r45757 | thomas.wouters | 2006-04-27 15:46:59 +0200 (Thu, 27 Apr 2006) | 4 lines
Some more size-estimate fixes, for large-list-tests.
........
r45758 | thomas.heller | 2006-04-27 17:50:42 +0200 (Thu, 27 Apr 2006) | 3 lines
Rerun the libffi configuration if any of the files used for that
are newer then fficonfig.py.
........
r45766 | thomas.wouters | 2006-04-28 00:37:50 +0200 (Fri, 28 Apr 2006) | 6 lines
Some style fixes and size-calculation fixes. Also do the small-memory run
using a prime number, rather than a convenient power-of-2-and-multiple-of-5,
so incorrect testing algorithms fail more easily.
........
r45767 | thomas.wouters | 2006-04-28 00:38:32 +0200 (Fri, 28 Apr 2006) | 6 lines
Do the small-memory run of big-meormy tests using a prime number, rather
than a convenient power-of-2-and-multiple-of-5, so incorrect testing
algorithms fail more easily.
........
r45768 | david.goodger | 2006-04-28 00:53:05 +0200 (Fri, 28 Apr 2006) | 1 line
Added SVN access for Steven Bethard and Talin, for PEP updating.
........
r45770 | thomas.wouters | 2006-04-28 01:13:20 +0200 (Fri, 28 Apr 2006) | 16 lines
- Add new Warning class, ImportWarning
- Warn-raise ImportWarning when importing would have picked up a directory
as package, if only it'd had an __init__.py. This swaps two tests (for
case-ness and __init__-ness), but case-test is not really more expensive,
and it's not in a speed-critical section.
- Test for the new warning by importing a common non-package directory on
sys.path: site-packages
- In regrtest.py, silence warnings generated by the build-environment
because Modules/ (which is added to sys.path for Setup-created modules)
has 'zlib' and '_ctypes' directories without __init__.py's.
........
r45771 | thomas.wouters | 2006-04-28 01:41:27 +0200 (Fri, 28 Apr 2006) | 6 lines
Add more ignores of ImportWarnings; these are all just potential triggers
(since they won't trigger if zlib is already sucessfully imported); they
were found by grepping .py files, instead of looking at warning output :)
........
r45773 | neal.norwitz | 2006-04-28 06:32:20 +0200 (Fri, 28 Apr 2006) | 1 line
Add some whitespace to be more consistent.
........
r45774 | neal.norwitz | 2006-04-28 06:34:43 +0200 (Fri, 28 Apr 2006) | 5 lines
Try to really fix the slow buildbots this time.
Printing to stdout, doesn't mean the data was actually written.
It depends on the buffering, so we need to flush. This will hopefully
really fix the buildbots getting killed due to no output on the slow bots.
........
r45775 | neal.norwitz | 2006-04-28 07:28:05 +0200 (Fri, 28 Apr 2006) | 1 line
Fix some warnings on Mac OS X 10.4
........
r45776 | neal.norwitz | 2006-04-28 07:28:30 +0200 (Fri, 28 Apr 2006) | 1 line
Fix a warning on alpha
........
r45777 | neal.norwitz | 2006-04-28 07:28:54 +0200 (Fri, 28 Apr 2006) | 1 line
Fix a warning on ppc (debian)
........
r45778 | george.yoshida | 2006-04-28 18:09:45 +0200 (Fri, 28 Apr 2006) | 2 lines
fix markup glitch
........
r45780 | georg.brandl | 2006-04-28 18:31:17 +0200 (Fri, 28 Apr 2006) | 3 lines
Add SeaMonkey to the list of Mozilla browsers.
........
r45781 | georg.brandl | 2006-04-28 18:36:55 +0200 (Fri, 28 Apr 2006) | 2 lines
Bug #1475009: clarify ntpath.join behavior with absolute components
........
r45783 | george.yoshida | 2006-04-28 18:40:14 +0200 (Fri, 28 Apr 2006) | 2 lines
correct a dead link
........
r45785 | georg.brandl | 2006-04-28 18:54:25 +0200 (Fri, 28 Apr 2006) | 4 lines
Bug #1472949: stringify IOErrors in shutil.copytree when appending
them to the Error errors list.
........
r45786 | georg.brandl | 2006-04-28 18:58:52 +0200 (Fri, 28 Apr 2006) | 3 lines
Bug #1478326: don't allow '/' in distutils.util.get_platform machine names
since this value is used to name the build directory.
........
r45788 | thomas.heller | 2006-04-28 19:02:18 +0200 (Fri, 28 Apr 2006) | 1 line
Remove a duplicated test (the same test is in test_incomplete.py).
........
r45792 | georg.brandl | 2006-04-28 21:09:24 +0200 (Fri, 28 Apr 2006) | 3 lines
Bug #1478429: make datetime.datetime.fromtimestamp accept every float,
possibly "rounding up" to the next whole second.
........
r45796 | george.yoshida | 2006-04-29 04:43:30 +0200 (Sat, 29 Apr 2006) | 2 lines
grammar fix
........
r45800 | ronald.oussoren | 2006-04-29 13:31:35 +0200 (Sat, 29 Apr 2006) | 2 lines
Patch 1471883: --enable-universalsdk on Mac OS X
........
r45801 | andrew.kuchling | 2006-04-29 13:53:15 +0200 (Sat, 29 Apr 2006) | 1 line
Add item
........
r45802 | andrew.kuchling | 2006-04-29 14:10:28 +0200 (Sat, 29 Apr 2006) | 1 line
Make case of 'ZIP' consistent
........
r45803 | andrew.kuchling | 2006-04-29 14:10:43 +0200 (Sat, 29 Apr 2006) | 1 line
Add item
........
r45808 | martin.v.loewis | 2006-04-29 14:37:25 +0200 (Sat, 29 Apr 2006) | 3 lines
Further changes for #1471883: Edit Misc/NEWS, and
add expat_config.h.
........
r45809 | brett.cannon | 2006-04-29 23:29:50 +0200 (Sat, 29 Apr 2006) | 2 lines
Fix docstring for contextfactory; mentioned old contextmanager name.
........
r45810 | gerhard.haering | 2006-04-30 01:12:41 +0200 (Sun, 30 Apr 2006) | 3 lines
This is the start of documentation for the sqlite3 module. Please feel free to
find a better place for the link to it than alongside bsddb & friends.
........
r45811 | andrew.kuchling | 2006-04-30 03:07:09 +0200 (Sun, 30 Apr 2006) | 1 line
Add two items
........
r45814 | george.yoshida | 2006-04-30 05:49:56 +0200 (Sun, 30 Apr 2006) | 2 lines
Use \versionchanged instead of \versionadded for new parameter support.
........
r45815 | georg.brandl | 2006-04-30 09:06:11 +0200 (Sun, 30 Apr 2006) | 2 lines
Patch #1470846: fix urllib2 ProxyBasicAuthHandler.
........
r45817 | georg.brandl | 2006-04-30 10:57:35 +0200 (Sun, 30 Apr 2006) | 3 lines
In stdlib, use hashlib instead of deprecated md5 and sha modules.
........
r45819 | georg.brandl | 2006-04-30 11:23:59 +0200 (Sun, 30 Apr 2006) | 3 lines
Patch #1470976: don't NLST files when retrieving over FTP.
........
r45821 | georg.brandl | 2006-04-30 13:13:56 +0200 (Sun, 30 Apr 2006) | 6 lines
Bug #1473625: stop cPickle making float dumps locale dependent in protocol 0.
On the way, add a decorator to test_support to facilitate running single
test functions in different locales with automatic cleanup.
........
r45822 | phillip.eby | 2006-04-30 17:59:26 +0200 (Sun, 30 Apr 2006) | 2 lines
Fix infinite regress when inspecting <string> or <stdin> frames.
........
r45824 | georg.brandl | 2006-04-30 19:42:26 +0200 (Sun, 30 Apr 2006) | 3 lines
Fix another problem in inspect: if the module for an object cannot be found, don't try to give its __dict__ to linecache.
........
r45825 | georg.brandl | 2006-04-30 20:14:54 +0200 (Sun, 30 Apr 2006) | 3 lines
Patch #1472854: make the rlcompleter.Completer class usable on non-
UNIX platforms.
........
r45826 | georg.brandl | 2006-04-30 21:34:19 +0200 (Sun, 30 Apr 2006) | 3 lines
Patch #1479438: add \keyword markup for "with".
........
r45827 | andrew.kuchling | 2006-04-30 23:19:31 +0200 (Sun, 30 Apr 2006) | 1 line
Add urllib2 HOWTO from Michael Foord
........
r45828 | andrew.kuchling | 2006-04-30 23:19:49 +0200 (Sun, 30 Apr 2006) | 1 line
Add item
........
r45830 | barry.warsaw | 2006-05-01 05:03:02 +0200 (Mon, 01 May 2006) | 11 lines
Port forward from 2.4 branch:
Patch #1464708 from William McVey: fixed handling of nested comments in mail
addresses. E.g.
"Foo ((Foo Bar)) <foo@example.com>"
Fixes for both rfc822.py and email package. This patch needs to be back
ported to Python 2.3 for email 2.5.
........
r45832 | fred.drake | 2006-05-01 08:25:58 +0200 (Mon, 01 May 2006) | 4 lines
- minor clarification in section title
- markup adjustments
(there is clearly much to be done in this section)
........
r45833 | martin.v.loewis | 2006-05-01 08:28:01 +0200 (Mon, 01 May 2006) | 2 lines
Work around deadlock risk. Will backport.
........
r45836 | andrew.kuchling | 2006-05-01 14:45:02 +0200 (Mon, 01 May 2006) | 1 line
Some ElementTree fixes: import from xml, not xmlcore; fix case of module name; mention list() instead of getchildren()
........
r45837 | gerhard.haering | 2006-05-01 17:14:48 +0200 (Mon, 01 May 2006) | 3 lines
Further integration of the documentation for the sqlite3 module. There's still
quite some content to move over from the pysqlite manual, but it's a start now.
........
r45838 | martin.v.loewis | 2006-05-01 17:56:03 +0200 (Mon, 01 May 2006) | 2 lines
Rename uisample to text, drop all non-text tables.
........
r45839 | martin.v.loewis | 2006-05-01 18:12:44 +0200 (Mon, 01 May 2006) | 2 lines
Add msilib documentation.
........
r45840 | martin.v.loewis | 2006-05-01 18:14:16 +0200 (Mon, 01 May 2006) | 4 lines
Rename parameters to match the documentation (which
in turn matches Microsoft's documentation).
Drop unused parameter in CAB.append.
........
r45841 | fred.drake | 2006-05-01 18:28:54 +0200 (Mon, 01 May 2006) | 1 line
add dependency
........
r45842 | andrew.kuchling | 2006-05-01 18:30:25 +0200 (Mon, 01 May 2006) | 1 line
Markup fixes; add some XXX comments noting problems
........
r45843 | andrew.kuchling | 2006-05-01 18:32:49 +0200 (Mon, 01 May 2006) | 1 line
Add item
........
r45844 | andrew.kuchling | 2006-05-01 19:06:54 +0200 (Mon, 01 May 2006) | 1 line
Markup fixes
........
r45850 | neal.norwitz | 2006-05-02 06:43:14 +0200 (Tue, 02 May 2006) | 3 lines
SF #1479181: split open() and file() from being aliases for each other.
........
r45852 | neal.norwitz | 2006-05-02 08:23:22 +0200 (Tue, 02 May 2006) | 1 line
Try to fix breakage caused by patch #1479181, r45850
........
r45853 | fred.drake | 2006-05-02 08:53:59 +0200 (Tue, 02 May 2006) | 3 lines
SF #1479988: add methods to allow access to weakrefs for the
weakref.WeakKeyDictionary and weakref.WeakValueDictionary
........
r45854 | neal.norwitz | 2006-05-02 09:27:47 +0200 (Tue, 02 May 2006) | 5 lines
Fix breakage from patch 1471883 (r45800 & r45808) on OSF/1.
The problem was that pyconfig.h was being included before some system headers
which caused redefinitions and other breakage. This moves system headers
after expat_config.h which includes pyconfig.h.
........
r45855 | vinay.sajip | 2006-05-02 10:35:36 +0200 (Tue, 02 May 2006) | 1 line
Replaced my dumb way of calculating seconds to midnight with Tim Peters' much more sensible suggestion. What was I thinking ?!?
........
r45856 | andrew.kuchling | 2006-05-02 13:30:03 +0200 (Tue, 02 May 2006) | 1 line
Provide encoding as keyword argument; soften warning paragraph about encodings
........
r45858 | guido.van.rossum | 2006-05-02 19:36:09 +0200 (Tue, 02 May 2006) | 2 lines
Fix the formatting of KeyboardInterrupt -- a bad issubclass() call.
........
r45862 | guido.van.rossum | 2006-05-02 21:47:52 +0200 (Tue, 02 May 2006) | 7 lines
Get rid of __context__, per the latest changes to PEP 343 and python-dev
discussion.
There are two places of documentation that still mention __context__:
Doc/lib/libstdtypes.tex -- I wasn't quite sure how to rewrite that without
spending a whole lot of time thinking about it; and whatsnew, which Andrew
usually likes to change himself.
........
r45863 | armin.rigo | 2006-05-02 21:52:32 +0200 (Tue, 02 May 2006) | 4 lines
Documentation bug: PySet_Pop() returns a new reference (because the
caller becomes the owner of that reference).
........
r45864 | guido.van.rossum | 2006-05-02 22:47:36 +0200 (Tue, 02 May 2006) | 4 lines
Hopefully this will fix the spurious failures of test_mailbox.py that I'm
experiencing. (This code and mailbox.py itself are full of calls to file()
that should be calls to open() -- but I'm not fixing those.)
........
r45865 | andrew.kuchling | 2006-05-02 23:44:33 +0200 (Tue, 02 May 2006) | 1 line
Use open() instead of file()
........
r45866 | andrew.kuchling | 2006-05-03 00:47:49 +0200 (Wed, 03 May 2006) | 1 line
Update context manager section for removal of __context__
........
r45867 | fred.drake | 2006-05-03 03:46:52 +0200 (Wed, 03 May 2006) | 1 line
remove unnecessary assignment
........
r45868 | fred.drake | 2006-05-03 03:48:24 +0200 (Wed, 03 May 2006) | 4 lines
tell LaTeX2HTML to:
- use UTF-8 output
- not mess with the >>> prompt!
........
r45869 | fred.drake | 2006-05-03 04:04:40 +0200 (Wed, 03 May 2006) | 3 lines
avoid ugly markup based on the unfortunate conversions of ">>" and "<<" to
guillemets; no need for magic here
........
r45870 | fred.drake | 2006-05-03 04:12:47 +0200 (Wed, 03 May 2006) | 1 line
at least comment on why curly-quotes are not enabled
........
r45871 | fred.drake | 2006-05-03 04:27:40 +0200 (Wed, 03 May 2006) | 1 line
one more place to avoid extra markup
........
r45872 | fred.drake | 2006-05-03 04:29:09 +0200 (Wed, 03 May 2006) | 1 line
one more place to avoid extra markup (how many will there be?)
........
r45873 | fred.drake | 2006-05-03 04:29:39 +0200 (Wed, 03 May 2006) | 1 line
fix up whitespace in prompt strings
........
r45876 | tim.peters | 2006-05-03 06:46:14 +0200 (Wed, 03 May 2006) | 2 lines
Whitespace normalization.
........
r45877 | martin.v.loewis | 2006-05-03 06:52:04 +0200 (Wed, 03 May 2006) | 2 lines
Correct some formulations, fix XXX comments.
........
r45879 | georg.brandl | 2006-05-03 07:05:02 +0200 (Wed, 03 May 2006) | 2 lines
Patch #1480067: don't redirect HTTP digest auth in urllib2
........
r45881 | georg.brandl | 2006-05-03 07:15:10 +0200 (Wed, 03 May 2006) | 3 lines
Move network tests from test_urllib2 to test_urllib2net.
........
r45887 | nick.coghlan | 2006-05-03 15:02:47 +0200 (Wed, 03 May 2006) | 1 line
Finish bringing SVN into line with latest version of PEP 343 by getting rid of all remaining references to context objects that I could find. Without a __context__() method context objects no longer exist. Also get test_with working again, and adopt a suggestion from Neal for decimal.Context.get_manager()
........
r45888 | nick.coghlan | 2006-05-03 15:17:49 +0200 (Wed, 03 May 2006) | 1 line
Get rid of a couple more context object references, fix some markup and clarify what happens when a generator context function swallows an exception.
........
r45889 | georg.brandl | 2006-05-03 19:46:13 +0200 (Wed, 03 May 2006) | 3 lines
Add seamonkey to list of Windows browsers too.
........
r45890 | georg.brandl | 2006-05-03 20:03:22 +0200 (Wed, 03 May 2006) | 3 lines
RFE #1472176: In httplib, don't encode the netloc and hostname with "idna" if not necessary.
........
r45891 | georg.brandl | 2006-05-03 20:12:33 +0200 (Wed, 03 May 2006) | 2 lines
Bug #1472191: convert breakpoint indices to ints before comparing them to ints
........
r45893 | georg.brandl | 2006-05-03 20:18:32 +0200 (Wed, 03 May 2006) | 3 lines
Bug #1385040: don't allow "def foo(a=1, b): pass" in the compiler package.
........
r45894 | thomas.heller | 2006-05-03 20:35:39 +0200 (Wed, 03 May 2006) | 1 line
Don't fail the tests when libglut.so or libgle.so cannot be loaded.
........
r45895 | georg.brandl | 2006-05-04 07:08:10 +0200 (Thu, 04 May 2006) | 2 lines
Bug #1481530: allow "from os.path import ..." with imputil
........
r45897 | martin.v.loewis | 2006-05-04 07:51:03 +0200 (Thu, 04 May 2006) | 2 lines
Patch #1475845: Raise IndentationError for unexpected indent.
........
r45898 | martin.v.loewis | 2006-05-04 12:08:42 +0200 (Thu, 04 May 2006) | 1 line
Implement os.{chdir,rename,rmdir,remove} using Win32 directly.
........
r45899 | martin.v.loewis | 2006-05-04 14:04:27 +0200 (Thu, 04 May 2006) | 2 lines
Drop now-unnecessary arguments to posix_2str.
........
r45900 | martin.v.loewis | 2006-05-04 16:27:52 +0200 (Thu, 04 May 2006) | 1 line
Update checks to consider Windows error numbers.
........
r45913 | thomas.heller | 2006-05-05 20:42:14 +0200 (Fri, 05 May 2006) | 2 lines
Export the 'free' standard C function for use in the test suite.
........
r45914 | thomas.heller | 2006-05-05 20:43:24 +0200 (Fri, 05 May 2006) | 3 lines
Fix memory leaks in the ctypes test suite, reported by valgrind, by
free()ing the memory we allocate.
........
r45915 | thomas.heller | 2006-05-05 20:46:27 +0200 (Fri, 05 May 2006) | 1 line
oops - the function is exported as 'my_free', not 'free'.
........
r45916 | thomas.heller | 2006-05-05 21:14:24 +0200 (Fri, 05 May 2006) | 2 lines
Clean up.
........
r45920 | george.yoshida | 2006-05-06 15:09:45 +0200 (Sat, 06 May 2006) | 2 lines
describe optional arguments for DocFileSuite
........
r45924 | george.yoshida | 2006-05-06 16:16:51 +0200 (Sat, 06 May 2006) | 2 lines
Use \versionchanged for the feature change
........
r45925 | martin.v.loewis | 2006-05-06 18:32:54 +0200 (Sat, 06 May 2006) | 1 line
Port access, chmod, parts of getcwdu, mkdir, and utime to direct Win32 API.
........
r45926 | martin.v.loewis | 2006-05-06 22:04:08 +0200 (Sat, 06 May 2006) | 2 lines
Handle ERROR_ALREADY_EXISTS.
........
r45931 | andrew.kuchling | 2006-05-07 19:12:12 +0200 (Sun, 07 May 2006) | 1 line
[Patch #1479977] Revised version of urllib2 HOWTO, edited by John J. Lee
........
r45932 | andrew.kuchling | 2006-05-07 19:14:53 +0200 (Sun, 07 May 2006) | 1 line
Minor language edit
........
r45934 | georg.brandl | 2006-05-07 22:44:34 +0200 (Sun, 07 May 2006) | 3 lines
Patch #1483395: add new TLDs to cookielib
........
r45936 | martin.v.loewis | 2006-05-08 07:25:56 +0200 (Mon, 08 May 2006) | 2 lines
Add missing PyMem_Free.
........
r45938 | georg.brandl | 2006-05-08 19:28:47 +0200 (Mon, 08 May 2006) | 3 lines
Add test for rev. 45934.
........
r45939 | georg.brandl | 2006-05-08 19:36:08 +0200 (Mon, 08 May 2006) | 3 lines
Patch #1479302: Make urllib2 digest auth and basic auth play together.
........
r45940 | georg.brandl | 2006-05-08 19:48:01 +0200 (Mon, 08 May 2006) | 3 lines
Patch #1478993: take advantage of BaseException/Exception split in cookielib
........
r45941 | neal.norwitz | 2006-05-09 07:38:56 +0200 (Tue, 09 May 2006) | 5 lines
Micro optimization. In the first case, we know that frame->f_exc_type
is NULL, so there's no reason to do anything with it. In the second case,
we know frame->f_exc_type is not NULL, so we can just do an INCREF.
........
r45943 | thomas.heller | 2006-05-09 22:20:15 +0200 (Tue, 09 May 2006) | 2 lines
Disable a test that is unreliable.
........
r45944 | tim.peters | 2006-05-10 04:43:01 +0200 (Wed, 10 May 2006) | 4 lines
Variant of patch #1478292. doctest.register_optionflag(name)
shouldn't create a new flag when `name` is already the name of
an option flag.
........
r45947 | neal.norwitz | 2006-05-10 08:57:58 +0200 (Wed, 10 May 2006) | 14 lines
Fix problems found by Coverity.
longobject.c: also fix an ssize_t problem
<a> could have been NULL, so hoist the size calc to not use <a>.
_ssl.c: under fail: self is DECREF'd, but it would have been NULL.
_elementtree.c: delete self if there was an error.
_csv.c: I'm not sure if lineterminator could have been anything other than
a string. However, other string method calls are checked, so check this
one too.
........
r45948 | thomas.wouters | 2006-05-10 17:04:11 +0200 (Wed, 10 May 2006) | 4 lines
Ignore reflog.txt, too.
........
r45949 | georg.brandl | 2006-05-10 17:59:06 +0200 (Wed, 10 May 2006) | 3 lines
Bug #1482988: indicate more prominently that the Stats class is in the pstats module.
........
r45950 | georg.brandl | 2006-05-10 18:09:03 +0200 (Wed, 10 May 2006) | 2 lines
Bug #1485447: subprocess: document that the "cwd" parameter isn't used to find the executable. Misc. other markup fixes.
........
r45952 | georg.brandl | 2006-05-10 18:11:44 +0200 (Wed, 10 May 2006) | 2 lines
Bug #1484978: curses.panel: clarify that Panel objects are destroyed on garbage collection.
........
r45954 | georg.brandl | 2006-05-10 18:26:03 +0200 (Wed, 10 May 2006) | 4 lines
Patch #1484695: Update the tarfile module to version 0.8. This fixes
a couple of issues, notably handling of long file names using the
GNU LONGNAME extension.
........
r45955 | georg.brandl | 2006-05-10 19:13:20 +0200 (Wed, 10 May 2006) | 4 lines
Patch #721464: pdb.Pdb instances can now be given explicit stdin and
stdout arguments, making it possible to redirect input and output
for remote debugging.
........
r45956 | andrew.kuchling | 2006-05-10 19:19:04 +0200 (Wed, 10 May 2006) | 1 line
Clarify description of exception handling
........
r45957 | georg.brandl | 2006-05-10 22:09:23 +0200 (Wed, 10 May 2006) | 2 lines
Fix two small errors in argument lists.
........
r45960 | brett.cannon | 2006-05-11 07:11:33 +0200 (Thu, 11 May 2006) | 5 lines
Detect if %zd is supported by printf() during configure and sets
PY_FORMAT_SIZE_T appropriately. Removes warnings on
OS X under gcc 4.0.1 when PY_FORMAT_SIZE_T is set to "" instead of "z" as is
needed.
........
r45963 | neal.norwitz | 2006-05-11 09:51:59 +0200 (Thu, 11 May 2006) | 1 line
Don't mask a no memory error with a less meaningful one as discussed on python-checkins
........
r45964 | martin.v.loewis | 2006-05-11 15:28:43 +0200 (Thu, 11 May 2006) | 3 lines
Change WindowsError to carry the Win32 error code in winerror,
and the DOS error code in errno. Revert changes where
WindowsError catch blocks unnecessarily special-case OSError.
........
r45965 | george.yoshida | 2006-05-11 17:53:27 +0200 (Thu, 11 May 2006) | 2 lines
Grammar fix
........
r45967 | andrew.kuchling | 2006-05-11 18:32:24 +0200 (Thu, 11 May 2006) | 1 line
typo fix
........
r45968 | tim.peters | 2006-05-11 18:37:42 +0200 (Thu, 11 May 2006) | 5 lines
BaseThreadedTestCase.setup(): stop special-casing WindowsError.
Rev 45964 fiddled with WindowsError, and broke test_bsddb3 on all
the Windows buildbot slaves as a result. This should repair it.
........
r45969 | georg.brandl | 2006-05-11 21:57:09 +0200 (Thu, 11 May 2006) | 2 lines
Typo fix.
........
r45970 | tim.peters | 2006-05-12 03:57:59 +0200 (Fri, 12 May 2006) | 5 lines
SF patch #1473132: Improve docs for tp_clear and tp_traverse,
by Collin Winter.
Bugfix candidate (but I'm not going to bother).
........
r45974 | martin.v.loewis | 2006-05-12 14:27:28 +0200 (Fri, 12 May 2006) | 4 lines
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.
........
r45975 | martin.v.loewis | 2006-05-12 15:57:36 +0200 (Fri, 12 May 2006) | 1 line
Move icon files into DLLs dir. Fixes #1477968.
........
r45976 | george.yoshida | 2006-05-12 18:40:11 +0200 (Fri, 12 May 2006) | 2 lines
At first there were 6 steps, but one was removed after that.
........
r45977 | martin.v.loewis | 2006-05-12 19:22:04 +0200 (Fri, 12 May 2006) | 1 line
Fix alignment error on Itanium.
........
r45978 | george.yoshida | 2006-05-12 19:25:26 +0200 (Fri, 12 May 2006) | 3 lines
Duplicated description about the illegal continue usage can be found in nearly the same place.
They are same, so keep the original one and remove the later-added one.
........
r45980 | thomas.heller | 2006-05-12 20:16:03 +0200 (Fri, 12 May 2006) | 2 lines
Add missing svn properties.
........
r45981 | thomas.heller | 2006-05-12 20:47:35 +0200 (Fri, 12 May 2006) | 1 line
set svn properties
........
r45982 | thomas.heller | 2006-05-12 21:31:46 +0200 (Fri, 12 May 2006) | 1 line
add svn:eol-style native svn:keywords Id
........
r45987 | gerhard.haering | 2006-05-13 01:49:49 +0200 (Sat, 13 May 2006) | 3 lines
Integrated the rest of the pysqlite reference manual into the Python
documentation. Ready to be reviewed and improved upon.
........
r45988 | george.yoshida | 2006-05-13 08:53:31 +0200 (Sat, 13 May 2006) | 2 lines
Add \exception markup
........
r45990 | martin.v.loewis | 2006-05-13 15:34:04 +0200 (Sat, 13 May 2006) | 2 lines
Revert 43315: Printing of %zd must be signed.
........
r45992 | tim.peters | 2006-05-14 01:28:20 +0200 (Sun, 14 May 2006) | 11 lines
Teach PyString_FromFormat, PyErr_Format, and PyString_FromFormatV
about "%u", "%lu" and "%zu" formats.
Since PyString_FromFormat and PyErr_Format have exactly the same rules
(both inherited from PyString_FromFormatV), it would be good if someone
with more LaTeX Fu changed one of them to just point to the other.
Their docs were way out of synch before this patch, and I just did a
mass copy+paste to repair that.
Not a backport candidate (this is a new feature).
........
r45993 | tim.peters | 2006-05-14 01:31:05 +0200 (Sun, 14 May 2006) | 2 lines
Typo repair.
........
r45994 | tim.peters | 2006-05-14 01:33:19 +0200 (Sun, 14 May 2006) | 2 lines
Remove lie in new comment.
........
r45995 | ronald.oussoren | 2006-05-14 21:56:34 +0200 (Sun, 14 May 2006) | 11 lines
Rework the build system for osx applications:
* Don't use xcodebuild for building PythonLauncher, but use a normal unix
makefile. This makes it a lot easier to use the same build flags as for the
rest of python (e.g. make a universal version of python launcher)
* Convert the mac makefile-s to makefile.in-s and use configure to set makefile
variables instead of forwarding them as command-line arguments
* Add a C version of pythonw, that we you can use '#!/usr/local/bin/pythonw'
* Build IDLE.app using bundlebuilder instead of BuildApplet, that will allow
easier modification of the bundle contents later on.
........
r45996 | ronald.oussoren | 2006-05-14 22:35:41 +0200 (Sun, 14 May 2006) | 6 lines
A first cut at replacing the icons on MacOS X. This replaces all icons by icons
based on the new python.org logo. These are also the first icons that are
"proper" OSX icons.
These icons were created by Jacob Rus.
........
r45997 | ronald.oussoren | 2006-05-14 23:07:41 +0200 (Sun, 14 May 2006) | 3 lines
I missed one small detail in my rewrite of the osx build files: the path
to the Python.app template.
........
r45998 | martin.v.loewis | 2006-05-15 07:51:36 +0200 (Mon, 15 May 2006) | 2 lines
Fix memory leak.
........
r45999 | neal.norwitz | 2006-05-15 08:48:14 +0200 (Mon, 15 May 2006) | 1 line
Move items implemented after a2 into the new a3 section
........
r46000 | neal.norwitz | 2006-05-15 09:04:36 +0200 (Mon, 15 May 2006) | 5 lines
- Bug #1487966: Fix SystemError with conditional expression in assignment
Most of the test_syntax changes are just updating the numbers.
........
r46001 | neal.norwitz | 2006-05-15 09:17:23 +0200 (Mon, 15 May 2006) | 1 line
Patch #1488312, Fix memory alignment problem on SPARC in unicode. Will backport
........
r46003 | martin.v.loewis | 2006-05-15 11:22:27 +0200 (Mon, 15 May 2006) | 3 lines
Remove bogus DECREF of self.
Change __str__() functions to METH_O.
Change WindowsError__str__ to use PyTuple_Pack.
........
r46005 | georg.brandl | 2006-05-15 21:30:35 +0200 (Mon, 15 May 2006) | 3 lines
[ 1488881 ] tarfile.py: support for file-objects and bz2 (cp. #1488634)
........
r46007 | tim.peters | 2006-05-15 22:44:10 +0200 (Mon, 15 May 2006) | 9 lines
ReadDetectFileobjTest: repair Windows disasters by opening
the file object in binary mode.
The Windows buildbot slaves shouldn't swap themselves to death
anymore. However, test_tarfile may still fail because of a
temp directory left behind from a previous failing run.
Windows buildbot owners may need to remove that directory
by hand.
........
r46009 | tim.peters | 2006-05-15 23:32:25 +0200 (Mon, 15 May 2006) | 3 lines
test_directory(): Remove the leftover temp directory that's making
the Windows buildbots fail test_tarfile.
........
r46010 | martin.v.loewis | 2006-05-16 09:05:37 +0200 (Tue, 16 May 2006) | 4 lines
- 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
........
r46012 | georg.brandl | 2006-05-16 09:38:27 +0200 (Tue, 16 May 2006) | 3 lines
Patch #1435422: zlib's compress and decompress objects now have a
copy() method.
........
r46015 | andrew.kuchling | 2006-05-16 18:11:54 +0200 (Tue, 16 May 2006) | 1 line
Add item
........
r46016 | andrew.kuchling | 2006-05-16 18:27:31 +0200 (Tue, 16 May 2006) | 3 lines
PEP 243 has been withdrawn, so don't refer to it any more.
The PyPI upload material has been moved into the section on PEP314.
........
r46017 | george.yoshida | 2006-05-16 19:42:16 +0200 (Tue, 16 May 2006) | 2 lines
Update for 'ImportWarning'
........
r46018 | george.yoshida | 2006-05-16 20:07:00 +0200 (Tue, 16 May 2006) | 4 lines
Mention that Exception is now a subclass of BaseException.
Remove a sentence that says that BaseException inherits from BaseException.
(I guess this is just a copy & paste mistake.)
........
r46019 | george.yoshida | 2006-05-16 20:26:10 +0200 (Tue, 16 May 2006) | 2 lines
Document ImportWarning
........
r46020 | tim.peters | 2006-05-17 01:22:20 +0200 (Wed, 17 May 2006) | 2 lines
Whitespace normalization.
........
r46021 | tim.peters | 2006-05-17 01:24:08 +0200 (Wed, 17 May 2006) | 2 lines
Text files missing the SVN eol-style property.
........
r46022 | tim.peters | 2006-05-17 03:30:11 +0200 (Wed, 17 May 2006) | 2 lines
PyZlib_copy(), PyZlib_uncopy(): Repair leaks on the normal-case path.
........
r46023 | georg.brandl | 2006-05-17 16:06:07 +0200 (Wed, 17 May 2006) | 3 lines
Remove misleading comment about type-class unification.
........
r46024 | georg.brandl | 2006-05-17 16:11:36 +0200 (Wed, 17 May 2006) | 3 lines
Apply patch #1489784 from Michael Foord.
........
r46025 | georg.brandl | 2006-05-17 16:18:20 +0200 (Wed, 17 May 2006) | 3 lines
Fix typo in os.utime docstring (patch #1490189)
........
r46026 | georg.brandl | 2006-05-17 16:26:50 +0200 (Wed, 17 May 2006) | 3 lines
Patch #1490224: set time.altzone correctly on Cygwin.
........
r46027 | georg.brandl | 2006-05-17 16:45:06 +0200 (Wed, 17 May 2006) | 4 lines
Add global debug flag to cookielib to avoid heavy dependency on the logging module.
Resolves #1484758.
........
r46028 | georg.brandl | 2006-05-17 16:56:04 +0200 (Wed, 17 May 2006) | 3 lines
Patch #1486962: Several bugs in the turtle Tk demo module were fixed
and several features added, such as speed and geometry control.
........
r46029 | georg.brandl | 2006-05-17 17:17:00 +0200 (Wed, 17 May 2006) | 4 lines
Delay-import some large modules to speed up urllib2 import.
(fixes #1484793).
........
r46030 | georg.brandl | 2006-05-17 17:51:16 +0200 (Wed, 17 May 2006) | 3 lines
Patch #1180296: improve locale string formatting functions
........
r46032 | tim.peters | 2006-05-18 04:06:40 +0200 (Thu, 18 May 2006) | 2 lines
Whitespace normalization.
........
r46033 | georg.brandl | 2006-05-18 08:11:19 +0200 (Thu, 18 May 2006) | 3 lines
Amendments to patch #1484695.
........
r46034 | georg.brandl | 2006-05-18 08:18:06 +0200 (Thu, 18 May 2006) | 3 lines
Remove unused import.
........
r46035 | georg.brandl | 2006-05-18 08:33:27 +0200 (Thu, 18 May 2006) | 3 lines
Fix test_locale for platforms without a default thousands separator.
........
r46036 | neal.norwitz | 2006-05-18 08:51:46 +0200 (Thu, 18 May 2006) | 1 line
Little cleanup
........
r46037 | georg.brandl | 2006-05-18 09:01:27 +0200 (Thu, 18 May 2006) | 4 lines
Bug #1462152: file() now checks more thoroughly for invalid mode
strings and removes a possible "U" before passing the mode to the
C library function.
........
r46038 | georg.brandl | 2006-05-18 09:20:05 +0200 (Thu, 18 May 2006) | 3 lines
Bug #1490688: properly document %e, %f, %g format subtleties.
........
r46039 | vinay.sajip | 2006-05-18 09:28:58 +0200 (Thu, 18 May 2006) | 1 line
Changed status from "beta" to "production"; since logging has been part of the stdlib since 2.3, it should be safe to make this assertion ;-)
........
r46040 | ronald.oussoren | 2006-05-18 11:04:15 +0200 (Thu, 18 May 2006) | 2 lines
Fix some minor issues with the generated application bundles on MacOSX
........
r46041 | andrew.kuchling | 2006-05-19 02:03:55 +0200 (Fri, 19 May 2006) | 1 line
Typo fix; add clarifying word
........
r46044 | neal.norwitz | 2006-05-19 08:31:23 +0200 (Fri, 19 May 2006) | 3 lines
Fix #132 from Coverity, retval could have been derefed
if a continue inside a try failed.
........
r46045 | neal.norwitz | 2006-05-19 08:43:50 +0200 (Fri, 19 May 2006) | 2 lines
Fix #1474677, non-keyword argument following keyword.
........
r46046 | neal.norwitz | 2006-05-19 09:00:58 +0200 (Fri, 19 May 2006) | 4 lines
Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
I suppose this could be backported if anyone cares.
........
r46047 | neal.norwitz | 2006-05-19 09:05:01 +0200 (Fri, 19 May 2006) | 7 lines
Oops, I forgot to include this file in the last commit (46046):
Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
I suppose this could be backported if anyone cares.
........
r46050 | ronald.oussoren | 2006-05-19 20:17:31 +0200 (Fri, 19 May 2006) | 6 lines
* Change working directory to the users home
directory, that makes the file open/save
dialogs more useable.
* Don't use argv emulator, its not needed
for idle.
........
r46052 | tim.peters | 2006-05-19 21:16:34 +0200 (Fri, 19 May 2006) | 2 lines
Whitespace normalization.
........
r46054 | ronald.oussoren | 2006-05-20 08:17:01 +0200 (Sat, 20 May 2006) | 9 lines
Fix bug #1000914 (again).
This patches a file that is generated by bgen, however the code is now the
same as a current copy of bgen would generate. Without this patch most types
in the Carbon.CF module are unusable.
I haven't managed to coax bgen into generating a complete copy of _CFmodule.c
yet :-(, hence the manual patching.
........
r46055 | george.yoshida | 2006-05-20 17:36:19 +0200 (Sat, 20 May 2006) | 3 lines
- markup fix
- add clarifying words
........
r46057 | george.yoshida | 2006-05-20 18:29:14 +0200 (Sat, 20 May 2006) | 3 lines
- Add 'as' and 'with' as new keywords in 2.5.
- Regenerate keyword lists with reswords.py.
........
r46058 | george.yoshida | 2006-05-20 20:07:26 +0200 (Sat, 20 May 2006) | 2 lines
Apply patch #1492147 from Mike Foord.
........
r46059 | andrew.kuchling | 2006-05-20 21:25:16 +0200 (Sat, 20 May 2006) | 1 line
Minor edits
........
r46061 | george.yoshida | 2006-05-21 06:22:59 +0200 (Sun, 21 May 2006) | 2 lines
Fix the TeX compile error.
........
r46062 | george.yoshida | 2006-05-21 06:40:32 +0200 (Sun, 21 May 2006) | 2 lines
Apply patch #1492255 from Mike Foord.
........
r46063 | martin.v.loewis | 2006-05-22 10:48:14 +0200 (Mon, 22 May 2006) | 1 line
Patch 1490384: New Icons for the PC build.
........
r46064 | martin.v.loewis | 2006-05-22 11:15:18 +0200 (Mon, 22 May 2006) | 1 line
Patch #1492356: Port to Windows CE (patch set 1).
........
r46065 | tim.peters | 2006-05-22 13:29:41 +0200 (Mon, 22 May 2006) | 4 lines
Define SIZEOF_{DOUBLE,FLOAT} on Windows. Else
Michael Hudson's nice gimmicks for IEEE special
values (infinities, NaNs) don't work.
........
r46070 | bob.ippolito | 2006-05-22 16:31:24 +0200 (Mon, 22 May 2006) | 2 lines
GzipFile.readline performance improvement (~30-40%), patch #1281707
........
r46071 | bob.ippolito | 2006-05-22 17:22:46 +0200 (Mon, 22 May 2006) | 1 line
Revert gzip readline performance patch #1281707 until a more generic performance improvement can be found
........
r46073 | fredrik.lundh | 2006-05-22 17:35:12 +0200 (Mon, 22 May 2006) | 4 lines
docstring tweaks: count counts non-overlapping substrings, not
total number of occurences
........
r46075 | bob.ippolito | 2006-05-22 17:59:12 +0200 (Mon, 22 May 2006) | 1 line
Apply revised patch for GzipFile.readline performance #1281707
........
r46076 | fredrik.lundh | 2006-05-22 18:29:30 +0200 (Mon, 22 May 2006) | 3 lines
needforspeed: speed up unicode repeat, unicode string copy
........
r46079 | fredrik.lundh | 2006-05-22 19:12:58 +0200 (Mon, 22 May 2006) | 4 lines
needforspeed: use memcpy for "long" strings; use a better algorithm
for long repeats.
........
r46084 | tim.peters | 2006-05-22 21:17:04 +0200 (Mon, 22 May 2006) | 7 lines
PyUnicode_Join(): Recent code changes introduced new
compiler warnings on Windows (signed vs unsigned mismatch
in comparisons). Cleaned that up by switching more locals
to Py_ssize_t. Simplified overflow checking (it can _be_
simpler because while these things are declared as
Py_ssize_t, then should in fact never be negative).
........
r46085 | tim.peters | 2006-05-23 07:47:16 +0200 (Tue, 23 May 2006) | 3 lines
unicode_repeat(): Change type of local to Py_ssize_t,
since that's what it should be.
........
r46094 | fredrik.lundh | 2006-05-23 12:10:57 +0200 (Tue, 23 May 2006) | 3 lines
needforspeed: check first *and* last character before doing a full memcmp
........
r46095 | fredrik.lundh | 2006-05-23 12:12:21 +0200 (Tue, 23 May 2006) | 4 lines
needforspeed: fixed unicode "in" operator to use same implementation
approach as find/index
........
r46096 | richard.jones | 2006-05-23 12:37:38 +0200 (Tue, 23 May 2006) | 7 lines
Merge from rjones-funccall branch.
Applied patch zombie-frames-2.diff from sf patch 876206 with updates for
Python 2.5 and also modified to retain the free_list to avoid the 67%
slow-down in pybench recursion test. 5% speed up in function call pybench.
........
r46098 | ronald.oussoren | 2006-05-23 13:04:24 +0200 (Tue, 23 May 2006) | 2 lines
Avoid creating a mess when installing a framework for the second time.
........
r46101 | georg.brandl | 2006-05-23 13:17:21 +0200 (Tue, 23 May 2006) | 3 lines
PyErr_NewException now accepts a tuple of base classes as its
"base" parameter.
........
r46103 | ronald.oussoren | 2006-05-23 13:47:16 +0200 (Tue, 23 May 2006) | 3 lines
Disable linking extensions with -lpython2.5 for darwin. This should fix bug
#1487105.
........
r46104 | ronald.oussoren | 2006-05-23 14:01:11 +0200 (Tue, 23 May 2006) | 6 lines
Patch #1488098.
This patchs makes it possible to create a universal build on OSX 10.4 and use
the result to build extensions on 10.3. It also makes it possible to override
the '-arch' and '-isysroot' compiler arguments for specific extensions.
........
r46108 | andrew.kuchling | 2006-05-23 14:44:36 +0200 (Tue, 23 May 2006) | 1 line
Add some items; mention the sprint
........
r46109 | andrew.kuchling | 2006-05-23 14:47:01 +0200 (Tue, 23 May 2006) | 1 line
Mention string improvements
........
r46110 | andrew.kuchling | 2006-05-23 14:49:35 +0200 (Tue, 23 May 2006) | 4 lines
Use 'speed' instead of 'performance', because I agree with the argument
at http://zestyping.livejournal.com/193260.html that 'erformance' really means
something more general.
........
r46113 | ronald.oussoren | 2006-05-23 17:09:57 +0200 (Tue, 23 May 2006) | 2 lines
An improved script for building the binary distribution on MacOSX.
........
r46128 | richard.jones | 2006-05-23 20:28:17 +0200 (Tue, 23 May 2006) | 3 lines
Applied patch 1337051 by Neal Norwitz, saving 4 ints on frame objects.
........
r46129 | richard.jones | 2006-05-23 20:32:11 +0200 (Tue, 23 May 2006) | 1 line
fix broken merge
........
r46130 | bob.ippolito | 2006-05-23 20:41:17 +0200 (Tue, 23 May 2006) | 1 line
Update Misc/NEWS for gzip patch #1281707
........
r46131 | bob.ippolito | 2006-05-23 20:43:47 +0200 (Tue, 23 May 2006) | 1 line
Update Misc/NEWS for gzip patch #1281707
........
r46132 | fredrik.lundh | 2006-05-23 20:44:25 +0200 (Tue, 23 May 2006) | 7 lines
needforspeed: use append+reverse for rsplit, use "bloom filters" to
speed up splitlines and strip with charsets; etc. rsplit is now as
fast as split in all our tests (reverse takes no time at all), and
splitlines() is nearly as fast as a plain split("\n") in our tests.
and we're not done yet... ;-)
........
r46133 | tim.peters | 2006-05-23 20:45:30 +0200 (Tue, 23 May 2006) | 38 lines
Bug #1334662 / patch #1335972: int(string, base) wrong answers.
In rare cases of strings specifying true values near sys.maxint,
and oddball bases (not decimal or a power of 2), int(string, base)
could deliver insane answers. This repairs all such problems, and
also speeds string->int significantly. On my box, here are %
speedups for decimal strings of various lengths:
length speedup
------ -------
1 12.4%
2 15.7%
3 20.6%
4 28.1%
5 33.2%
6 37.5%
7 41.9%
8 46.3%
9 51.2%
10 19.5%
11 19.9%
12 23.9%
13 23.7%
14 23.3%
15 24.9%
16 25.3%
17 28.3%
18 27.9%
19 35.7%
Note that the difference between 9 and 10 is the difference between
short and long Python ints on a 32-bit box. The patch doesn't
actually do anything to speed conversion to long: the speedup is
due to detecting "unsigned long" overflow more quickly.
This is a bugfix candidate, but it's a non-trivial patch and it
would be painful to separate the "bug fix" from the "speed up" parts.
........
r46134 | bob.ippolito | 2006-05-23 20:46:41 +0200 (Tue, 23 May 2006) | 1 line
Patch #1493701: performance enhancements for struct module.
........
r46136 | andrew.kuchling | 2006-05-23 21:00:45 +0200 (Tue, 23 May 2006) | 1 line
Remove duplicate item
........
r46141 | bob.ippolito | 2006-05-23 21:09:51 +0200 (Tue, 23 May 2006) | 1 line
revert #1493701
........
r46142 | bob.ippolito | 2006-05-23 21:11:34 +0200 (Tue, 23 May 2006) | 1 line
patch #1493701: performance enhancements for struct module
........
r46144 | bob.ippolito | 2006-05-23 21:12:41 +0200 (Tue, 23 May 2006) | 1 line
patch #1493701: performance enhancements for struct module
........
r46148 | bob.ippolito | 2006-05-23 21:25:52 +0200 (Tue, 23 May 2006) | 1 line
fix linking issue, warnings, in struct
........
r46149 | andrew.kuchling | 2006-05-23 21:29:38 +0200 (Tue, 23 May 2006) | 1 line
Add two items
........
r46150 | bob.ippolito | 2006-05-23 21:31:23 +0200 (Tue, 23 May 2006) | 1 line
forward declaration for PyStructType
........
r46151 | bob.ippolito | 2006-05-23 21:32:25 +0200 (Tue, 23 May 2006) | 1 line
fix typo in _struct
........
r46152 | andrew.kuchling | 2006-05-23 21:32:35 +0200 (Tue, 23 May 2006) | 1 line
Add item
........
r46153 | tim.peters | 2006-05-23 21:34:37 +0200 (Tue, 23 May 2006) | 3 lines
Get the Windows build working again (recover from
`struct` module changes).
........
r46155 | fredrik.lundh | 2006-05-23 21:47:35 +0200 (Tue, 23 May 2006) | 3 lines
return 0 on misses, not -1.
........
r46156 | tim.peters | 2006-05-23 23:51:35 +0200 (Tue, 23 May 2006) | 4 lines
test_struct grew weird behavior under regrtest.py -R,
due to a module-level cache. Clearing the cache should
make it stop showing up in refleak reports.
........
r46157 | tim.peters | 2006-05-23 23:54:23 +0200 (Tue, 23 May 2006) | 2 lines
Whitespace normalization.
........
r46158 | tim.peters | 2006-05-23 23:55:53 +0200 (Tue, 23 May 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46161 | fredrik.lundh | 2006-05-24 12:20:36 +0200 (Wed, 24 May 2006) | 3 lines
use Py_ssize_t for string indexes (thanks, neal!)
........
r46173 | fredrik.lundh | 2006-05-24 16:28:11 +0200 (Wed, 24 May 2006) | 14 lines
needforspeed: use "fastsearch" for count and findstring helpers. this
results in a 2.5x speedup on the stringbench count tests, and a 20x (!)
speedup on the stringbench search/find/contains test, compared to 2.5a2.
for more on the algorithm, see:
http://effbot.org/zone/stringlib.htm
if you get weird results, you can disable the new algoritm by undefining
USE_FAST in Objects/unicodeobject.c.
enjoy /F
........
r46182 | fredrik.lundh | 2006-05-24 17:11:01 +0200 (Wed, 24 May 2006) | 3 lines
needforspeedindeed: use fastsearch also for __contains__
........
r46184 | bob.ippolito | 2006-05-24 17:32:06 +0200 (Wed, 24 May 2006) | 1 line
refactor unpack, add unpack_from
........
r46189 | fredrik.lundh | 2006-05-24 18:35:18 +0200 (Wed, 24 May 2006) | 4 lines
needforspeed: refactored the replace code slightly; special-case
constant-length changes; use fastsearch to locate the first match.
........
r46198 | andrew.dalke | 2006-05-24 20:55:37 +0200 (Wed, 24 May 2006) | 10 lines
Added a slew of test for string replace, based various corner cases from
the Need For Speed sprint coding. Includes commented out overflow tests
which will be uncommented once the code is fixed.
This test will break the 8-bit string tests because
"".replace("", "A") == "" when it should == "A"
We have a fix for it, which should be added tomorrow.
........
r46200 | tim.peters | 2006-05-24 22:27:18 +0200 (Wed, 24 May 2006) | 2 lines
We can't leave the checked-in tests broken.
........
r46201 | tim.peters | 2006-05-24 22:29:44 +0200 (Wed, 24 May 2006) | 2 lines
Whitespace normalization.
........
r46202 | tim.peters | 2006-05-24 23:00:45 +0200 (Wed, 24 May 2006) | 4 lines
Disable the damn empty-string replace test -- it can't
be make to pass now for unicode if it passes for str, or
vice versa.
........
r46203 | tim.peters | 2006-05-24 23:10:40 +0200 (Wed, 24 May 2006) | 58 lines
Heavily fiddled variant of patch #1442927: PyLong_FromString optimization.
``long(str, base)`` is now up to 6x faster for non-power-of-2 bases. The
largest speedup is for inputs with about 1000 decimal digits. Conversion
from non-power-of-2 bases remains quadratic-time in the number of input
digits (it was and remains linear-time for bases 2, 4, 8, 16 and 32).
Speedups at various lengths for decimal inputs, comparing 2.4.3 with
current trunk. Note that it's actually a bit slower for 1-digit strings:
len speedup
---- -------
1 -4.5%
2 4.6%
3 8.3%
4 12.7%
5 16.9%
6 28.6%
7 35.5%
8 44.3%
9 46.6%
10 55.3%
11 65.7%
12 77.7%
13 73.4%
14 75.3%
15 85.2%
16 103.0%
17 95.1%
18 112.8%
19 117.9%
20 128.3%
30 174.5%
40 209.3%
50 236.3%
60 254.3%
70 262.9%
80 295.8%
90 297.3%
100 324.5%
200 374.6%
300 403.1%
400 391.1%
500 388.7%
600 440.6%
700 468.7%
800 498.0%
900 507.2%
1000 501.2%
2000 450.2%
3000 463.2%
4000 452.5%
5000 440.6%
6000 439.6%
7000 424.8%
8000 418.1%
9000 417.7%
........
r46204 | andrew.kuchling | 2006-05-25 02:23:03 +0200 (Thu, 25 May 2006) | 1 line
Minor edits; add an item
........
r46205 | fred.drake | 2006-05-25 04:42:25 +0200 (Thu, 25 May 2006) | 3 lines
fix broken links in PDF
(SF patch #1281291, contributed by Rory Yorke)
........
r46208 | walter.doerwald | 2006-05-25 10:53:28 +0200 (Thu, 25 May 2006) | 2 lines
Replace tab inside comment with space.
........
r46209 | thomas.wouters | 2006-05-25 13:25:51 +0200 (Thu, 25 May 2006) | 4 lines
Fix #1488915, Multiple dots in relative import statement raise SyntaxError.
........
r46210 | thomas.wouters | 2006-05-25 13:26:25 +0200 (Thu, 25 May 2006) | 5 lines
Update graminit.c for the fix for #1488915, Multiple dots in relative import
statement raise SyntaxError, and add testcase.
........
r46211 | andrew.kuchling | 2006-05-25 14:27:59 +0200 (Thu, 25 May 2006) | 1 line
Add entry; and fix a typo
........
r46214 | fredrik.lundh | 2006-05-25 17:22:03 +0200 (Thu, 25 May 2006) | 7 lines
needforspeed: speed up upper and lower for 8-bit string objects.
(the unicode versions of these are still 2x faster on windows,
though...)
based on work by Andrew Dalke, with tweaks by yours truly.
........
r46216 | fredrik.lundh | 2006-05-25 17:49:45 +0200 (Thu, 25 May 2006) | 5 lines
needforspeed: make new upper/lower work properly for single-character
strings too... (thanks to georg brandl for spotting the exact problem
faster than anyone else)
........
r46217 | kristjan.jonsson | 2006-05-25 17:53:30 +0200 (Thu, 25 May 2006) | 1 line
Added a new macro, Py_IS_FINITE(X). On windows there is an intrinsic for this and it is more efficient than to use !Py_IS_INFINITE(X) && !Py_IS_NAN(X). No change on other platforms
........
r46219 | fredrik.lundh | 2006-05-25 18:10:12 +0200 (Thu, 25 May 2006) | 4 lines
needforspeed: _toupper/_tolower is a SUSv2 thing; fall back on ISO C
versions if they're not defined.
........
r46220 | andrew.kuchling | 2006-05-25 18:23:15 +0200 (Thu, 25 May 2006) | 1 line
Fix comment typos
........
r46221 | andrew.dalke | 2006-05-25 18:30:52 +0200 (Thu, 25 May 2006) | 2 lines
Added tests for implementation error we came up with in the need for speed sprint.
........
r46222 | andrew.kuchling | 2006-05-25 18:34:54 +0200 (Thu, 25 May 2006) | 1 line
Fix another typo
........
r46223 | kristjan.jonsson | 2006-05-25 18:39:27 +0200 (Thu, 25 May 2006) | 1 line
Fix incorrect documentation for the Py_IS_FINITE(X) macro.
........
r46224 | fredrik.lundh | 2006-05-25 18:46:54 +0200 (Thu, 25 May 2006) | 3 lines
needforspeed: check for overflow in replace (from Andrew Dalke)
........
r46226 | fredrik.lundh | 2006-05-25 19:08:14 +0200 (Thu, 25 May 2006) | 5 lines
needforspeed: new replace implementation by Andrew Dalke. replace is
now about 3x faster on my machine, for the replace tests from string-
bench.
........
r46227 | tim.peters | 2006-05-25 19:34:03 +0200 (Thu, 25 May 2006) | 5 lines
A new table to help string->integer conversion was added yesterday to
both mystrtoul.c and longobject.c. Share the table instead. Also
cut its size by 64 entries (they had been used for an inscrutable
trick originally, but the code no longer tries to use that trick).
........
r46229 | andrew.dalke | 2006-05-25 19:53:00 +0200 (Thu, 25 May 2006) | 11 lines
Fixed problem identified by Georg. The special-case in-place code for replace
made a copy of the string using PyString_FromStringAndSize(s, n) and modify
the copied string in-place. However, 1 (and 0) character strings are shared
from a cache. This cause "A".replace("A", "a") to change the cached version
of "A" -- used by everyone.
Now may the copy with NULL as the string and do the memcpy manually. I've
added regression tests to check if this happens in the future. Perhaps
there should be a PyString_Copy for this case?
........
r46230 | fredrik.lundh | 2006-05-25 19:55:31 +0200 (Thu, 25 May 2006) | 4 lines
needforspeed: use "fastsearch" for count. this results in a 3x speedup
for the related stringbench tests.
........
r46231 | andrew.dalke | 2006-05-25 20:03:25 +0200 (Thu, 25 May 2006) | 4 lines
Code had returned an ssize_t, upcast to long, then converted with PyInt_FromLong.
Now using PyInt_FromSsize_t.
........
r46233 | andrew.kuchling | 2006-05-25 20:11:16 +0200 (Thu, 25 May 2006) | 1 line
Comment typo
........
r46234 | andrew.dalke | 2006-05-25 20:18:39 +0200 (Thu, 25 May 2006) | 4 lines
Added overflow test for adding two (very) large strings where the
new string is over max Py_ssize_t. I have no way to test it on my
box or any box I have access to. At least it doesn't break anything.
........
r46235 | bob.ippolito | 2006-05-25 20:20:23 +0200 (Thu, 25 May 2006) | 1 line
Faster path for PyLong_FromLongLong, using PyLong_FromLong algorithm
........
r46238 | georg.brandl | 2006-05-25 20:44:09 +0200 (Thu, 25 May 2006) | 3 lines
Guard the _active.remove() call to avoid errors when there is no _active list.
........
r46239 | fredrik.lundh | 2006-05-25 20:44:29 +0200 (Thu, 25 May 2006) | 4 lines
needforspeed: use fastsearch also for find/index and contains. the
related tests are now about 10x faster.
........
r46240 | bob.ippolito | 2006-05-25 20:44:50 +0200 (Thu, 25 May 2006) | 1 line
Struct now unpacks to PY_LONG_LONG directly when possible, also include #ifdef'ed out code that will return int instead of long when in bounds (not active since it's an API and doc change)
........
r46241 | jack.diederich | 2006-05-25 20:47:15 +0200 (Thu, 25 May 2006) | 1 line
* eliminate warning by reverting tmp_s type to 'const char*'
........
r46242 | bob.ippolito | 2006-05-25 21:03:19 +0200 (Thu, 25 May 2006) | 1 line
Fix Cygwin compiler issue
........
r46243 | bob.ippolito | 2006-05-25 21:15:27 +0200 (Thu, 25 May 2006) | 1 line
fix a struct regression where long would be returned for short unsigned integers
........
r46244 | georg.brandl | 2006-05-25 21:15:31 +0200 (Thu, 25 May 2006) | 4 lines
Replace PyObject_CallFunction calls with only object args
with PyObject_CallFunctionObjArgs, which is 30% faster.
........
r46245 | fredrik.lundh | 2006-05-25 21:19:05 +0200 (Thu, 25 May 2006) | 3 lines
needforspeed: use insert+reverse instead of append
........
r46246 | bob.ippolito | 2006-05-25 21:33:38 +0200 (Thu, 25 May 2006) | 1 line
Use LONG_MIN and LONG_MAX to check Python integer bounds instead of the incorrect INT_MIN and INT_MAX
........
r46248 | bob.ippolito | 2006-05-25 21:56:56 +0200 (Thu, 25 May 2006) | 1 line
Use faster struct pack/unpack functions for the endian table that matches the host's
........
r46249 | bob.ippolito | 2006-05-25 21:59:56 +0200 (Thu, 25 May 2006) | 1 line
enable darwin/x86 support for libffi and hence ctypes (doesn't yet support --enable-universalsdk)
........
r46252 | georg.brandl | 2006-05-25 22:28:10 +0200 (Thu, 25 May 2006) | 4 lines
Someone seems to just have copy-pasted the docs of
tp_compare to tp_richcompare ;)
........
r46253 | brett.cannon | 2006-05-25 22:44:08 +0200 (Thu, 25 May 2006) | 2 lines
Swap out bare malloc()/free() use for PyMem_MALLOC()/PyMem_FREE() .
........
r46254 | bob.ippolito | 2006-05-25 22:52:38 +0200 (Thu, 25 May 2006) | 1 line
squelch gcc4 darwin/x86 compiler warnings
........
r46255 | bob.ippolito | 2006-05-25 23:09:45 +0200 (Thu, 25 May 2006) | 1 line
fix test_float regression and 64-bit size mismatch issue
........
r46256 | georg.brandl | 2006-05-25 23:11:56 +0200 (Thu, 25 May 2006) | 3 lines
Add a x-ref to newer calling APIs.
........
r46257 | ronald.oussoren | 2006-05-25 23:30:54 +0200 (Thu, 25 May 2006) | 2 lines
Fix minor typo in prep_cif.c
........
r46259 | brett.cannon | 2006-05-25 23:33:11 +0200 (Thu, 25 May 2006) | 4 lines
Change test_values so that it compares the lowercasing of group names since getgrall() can return all lowercase names while getgrgid() returns proper casing.
Discovered on Ubuntu 5.04 (custom).
........
r46261 | tim.peters | 2006-05-25 23:50:17 +0200 (Thu, 25 May 2006) | 7 lines
Some Win64 pre-release in 2000 didn't support
QueryPerformanceCounter(), but we believe Win64 does
support it now. So use in time.clock().
It would be peachy if someone with a Win64 box tried
this ;-)
........
r46262 | tim.peters | 2006-05-25 23:52:19 +0200 (Thu, 25 May 2006) | 2 lines
Whitespace normalization.
........
r46263 | bob.ippolito | 2006-05-25 23:58:05 +0200 (Thu, 25 May 2006) | 1 line
Add missing files from x86 darwin ctypes patch
........
r46264 | brett.cannon | 2006-05-26 00:00:14 +0200 (Fri, 26 May 2006) | 2 lines
Move over to use of METH_O and METH_NOARGS.
........
r46265 | tim.peters | 2006-05-26 00:25:25 +0200 (Fri, 26 May 2006) | 3 lines
Repair idiot typo, and complete the job of trying to
use the Windows time.clock() implementation on Win64.
........
r46266 | tim.peters | 2006-05-26 00:28:46 +0200 (Fri, 26 May 2006) | 9 lines
Patch #1494387: SVN longobject.c compiler warnings
The SIGCHECK macro defined here has always been bizarre, but
it apparently causes compiler warnings on "Sun Studio 11".
I believe the warnings are bogus, but it doesn't hurt to make
the macro definition saner.
Bugfix candidate (but I'm not going to bother).
........
r46268 | fredrik.lundh | 2006-05-26 01:27:53 +0200 (Fri, 26 May 2006) | 8 lines
needforspeed: partition for 8-bit strings. for some simple tests,
this is on par with a corresponding find, and nearly twice as fast
as split(sep, 1)
full tests, a unicode version, and documentation will follow to-
morrow.
........
r46271 | andrew.kuchling | 2006-05-26 03:46:22 +0200 (Fri, 26 May 2006) | 1 line
Add Soc student
........
r46272 | ronald.oussoren | 2006-05-26 10:41:25 +0200 (Fri, 26 May 2006) | 3 lines
Without this patch OSX users couldn't add new help sources because the code
tried to update one item in a tuple.
........
r46273 | fredrik.lundh | 2006-05-26 10:54:28 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: partition implementation, part two.
feel free to improve the documentation and the docstrings.
........
r46274 | georg.brandl | 2006-05-26 11:05:54 +0200 (Fri, 26 May 2006) | 3 lines
Clarify docs for str.partition().
........
r46278 | fredrik.lundh | 2006-05-26 11:46:59 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: use METH_O for argument handling, which made partition some
~15% faster for the current tests (which is noticable faster than a corre-
sponding find call). thanks to neal-who-never-sleeps for the tip.
........
r46280 | fredrik.lundh | 2006-05-26 12:27:17 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: use Py_ssize_t for the fastsearch counter and skip
length (thanks, neal!). and yes, I've verified that this doesn't
slow things down ;-)
........
r46285 | andrew.dalke | 2006-05-26 13:11:38 +0200 (Fri, 26 May 2006) | 2 lines
Added a few more test cases for whitespace split. These strings have leading whitespace.
........
r46286 | jack.diederich | 2006-05-26 13:15:17 +0200 (Fri, 26 May 2006) | 1 line
use Py_ssize_t in places that may need it
........
r46287 | andrew.dalke | 2006-05-26 13:15:22 +0200 (Fri, 26 May 2006) | 2 lines
Added split whitespace checks for characters other than space.
........
r46288 | ronald.oussoren | 2006-05-26 13:17:55 +0200 (Fri, 26 May 2006) | 2 lines
Fix buglet in postinstall script, it would generate an invalid .cshrc file.
........
r46290 | georg.brandl | 2006-05-26 13:26:11 +0200 (Fri, 26 May 2006) | 3 lines
Add "partition" to UserString.
........
r46291 | fredrik.lundh | 2006-05-26 13:29:39 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: added Py_LOCAL macro, based on the LOCAL macro used
for SRE and others. applied Py_LOCAL to relevant portion of ceval,
which gives a 1-2% speedup on my machine. ymmv.
........
r46292 | jack.diederich | 2006-05-26 13:37:20 +0200 (Fri, 26 May 2006) | 1 line
when generating python code prefer to generate valid python code
........
r46293 | fredrik.lundh | 2006-05-26 13:38:15 +0200 (Fri, 26 May 2006) | 3 lines
use Py_LOCAL also for string and unicode objects
........
r46294 | ronald.oussoren | 2006-05-26 13:38:39 +0200 (Fri, 26 May 2006) | 12 lines
- Search the sqlite specific search directories
after the normal include directories when looking
for the version of sqlite to use.
- On OSX:
* Extract additional include and link directories
from the CFLAGS and LDFLAGS, if the user has
bothered to specify them we might as wel use them.
* Add '-Wl,-search_paths_first' to the extra_link_args
for readline and sqlite. This makes it possible to
use a static library to override the system provided
dynamic library.
........
r46295 | ronald.oussoren | 2006-05-26 13:43:26 +0200 (Fri, 26 May 2006) | 6 lines
Integrate installing a framework in the 'make install'
target. Until now users had to use 'make frameworkinstall'
to install python when it is configured with '--enable-framework'.
This tends to confuse users that don't hunt for readme files
hidden in platform specific directories :-)
........
r46297 | fredrik.lundh | 2006-05-26 13:54:04 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: added PY_LOCAL_AGGRESSIVE macro to enable "aggressive"
LOCAL inlining; also added some missing whitespace
........
r46298 | andrew.kuchling | 2006-05-26 14:01:44 +0200 (Fri, 26 May 2006) | 1 line
Typo fixes
........
r46299 | fredrik.lundh | 2006-05-26 14:01:49 +0200 (Fri, 26 May 2006) | 4 lines
Py_LOCAL shouldn't be used for data; it works for some .NET 2003 compilers,
but Trent's copy thinks that it's an anachronism...
........
r46300 | martin.blais | 2006-05-26 14:03:27 +0200 (Fri, 26 May 2006) | 12 lines
Support for buffer protocol for socket and struct.
* Added socket.recv_buf() and socket.recvfrom_buf() methods, that use the buffer
protocol (send and sendto already did).
* Added struct.pack_to(), that is the corresponding buffer compatible method to
unpack_from().
* Fixed minor typos in arraymodule.
........
r46302 | ronald.oussoren | 2006-05-26 14:23:20 +0200 (Fri, 26 May 2006) | 6 lines
- Remove previous version of the binary distribution script for OSX
- Some small bugfixes for the IDLE.app wrapper
- Tweaks to build-installer to ensure that python gets build in the right way,
including sqlite3.
- Updated readme files
........
r46305 | tim.peters | 2006-05-26 14:26:21 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46307 | andrew.dalke | 2006-05-26 14:28:15 +0200 (Fri, 26 May 2006) | 7 lines
I like tests.
The new split functions use a preallocated list. Added tests which exceed
the preallocation size, to exercise list appends/resizes.
Also added more edge case tests.
........
r46308 | andrew.dalke | 2006-05-26 14:31:00 +0200 (Fri, 26 May 2006) | 2 lines
Test cases for off-by-one errors in string split with multicharacter pattern.
........
r46309 | tim.peters | 2006-05-26 14:31:20 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46313 | andrew.kuchling | 2006-05-26 14:39:48 +0200 (Fri, 26 May 2006) | 1 line
Add str.partition()
........
r46314 | bob.ippolito | 2006-05-26 14:52:53 +0200 (Fri, 26 May 2006) | 1 line
quick hack to fix busted binhex test
........
r46316 | andrew.dalke | 2006-05-26 15:05:55 +0200 (Fri, 26 May 2006) | 2 lines
Added more rstrip tests, including for prealloc'ed arrays
........
r46320 | bob.ippolito | 2006-05-26 15:15:44 +0200 (Fri, 26 May 2006) | 1 line
fix #1229380 No struct.pack exception for some out of range integers
........
r46325 | tim.peters | 2006-05-26 15:39:17 +0200 (Fri, 26 May 2006) | 2 lines
Use open() to open files (was using file()).
........
r46327 | andrew.dalke | 2006-05-26 16:00:45 +0200 (Fri, 26 May 2006) | 37 lines
Changes to string.split/rsplit on whitespace to preallocate space in the
results list.
Originally it allocated 0 items and used the list growth during append. Now
it preallocates 12 items so the first few appends don't need list reallocs.
("Here are some words ."*2).split(None, 1) is 7% faster
("Here are some words ."*2).split() is is 15% faster
(Your milage may vary, see dealership for details.)
File parsing like this
for line in f:
count += len(line.split())
is also about 15% faster. There is a slowdown of about 3% for large
strings because of the additional overhead of checking if the append is
to a preallocated region of the list or not. This will be the rare case.
It could be improved with special case code but we decided it was not
useful enough.
There is a cost of 12*sizeof(PyObject *) bytes per list. For the normal
case of file parsing this is not a problem because of the lists have
a short lifetime. We have not come up with cases where this is a problem
in real life.
I chose 12 because human text averages about 11 words per line in books,
one of my data sets averages 6.2 words with a final peak at 11 words per
line, and I work with a tab delimited data set with 8 tabs per line (or
9 words per line). 12 encompasses all of these.
Also changed the last rstrip code to append then reverse, rather than
doing insert(0). The strip() and rstrip() times are now comparable.
........
r46328 | tim.peters | 2006-05-26 16:02:05 +0200 (Fri, 26 May 2006) | 5 lines
Explicitly close files. I'm trying to stop the frequent spurious test_tarfile
failures on Windows buildbots, but it's hard to know how since the regrtest
failure output is useless here, and it never fails when a buildbot slave runs
test_tarfile the second time in verbose mode.
........
r46329 | andrew.kuchling | 2006-05-26 16:03:41 +0200 (Fri, 26 May 2006) | 1 line
Add buffer support for struct, socket
........
r46330 | andrew.kuchling | 2006-05-26 16:04:19 +0200 (Fri, 26 May 2006) | 1 line
Typo fix
........
r46331 | bob.ippolito | 2006-05-26 16:07:23 +0200 (Fri, 26 May 2006) | 1 line
Fix distutils so that libffi will cross-compile between darwin/x86 and darwin/ppc
........
r46333 | bob.ippolito | 2006-05-26 16:23:21 +0200 (Fri, 26 May 2006) | 1 line
Fix _struct typo that broke some 64-bit platforms
........
r46335 | bob.ippolito | 2006-05-26 16:29:35 +0200 (Fri, 26 May 2006) | 1 line
Enable PY_USE_INT_WHEN_POSSIBLE in struct
........
r46343 | andrew.dalke | 2006-05-26 17:21:01 +0200 (Fri, 26 May 2006) | 2 lines
Eeked out another 3% or so performance in split whitespace by cleaning up the algorithm.
........
r46352 | andrew.dalke | 2006-05-26 18:22:52 +0200 (Fri, 26 May 2006) | 3 lines
Test for more edge strip cases; leading and trailing separator gets removed
even with strip(..., 0)
........
r46354 | bob.ippolito | 2006-05-26 18:23:28 +0200 (Fri, 26 May 2006) | 1 line
fix signed/unsigned mismatch in struct
........
r46355 | steve.holden | 2006-05-26 18:27:59 +0200 (Fri, 26 May 2006) | 5 lines
Add -t option to allow easy test selection.
Action verbose option correctly.
Tweak operation counts. Add empty and new instances tests.
Enable comparisons across different warp factors. Change version.
........
r46356 | fredrik.lundh | 2006-05-26 18:32:42 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: use Py_LOCAL on a few more locals in stringobject.c
........
r46357 | thomas.heller | 2006-05-26 18:42:44 +0200 (Fri, 26 May 2006) | 4 lines
For now, I gave up with automatic conversion of reST to Python-latex,
so I'm writing this in latex now.
Skeleton for the ctypes reference.
........
r46358 | tim.peters | 2006-05-26 18:49:28 +0200 (Fri, 26 May 2006) | 3 lines
Repair Windows compiler warnings about mixing
signed and unsigned integral types in comparisons.
........
r46359 | tim.peters | 2006-05-26 18:52:04 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46360 | tim.peters | 2006-05-26 18:53:04 +0200 (Fri, 26 May 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46362 | fredrik.lundh | 2006-05-26 19:04:58 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: stringlib refactoring (in progress)
........
r46363 | thomas.heller | 2006-05-26 19:18:33 +0200 (Fri, 26 May 2006) | 1 line
Write some docs.
........
r46364 | fredrik.lundh | 2006-05-26 19:22:38 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: stringlib refactoring (in progress)
........
r46366 | fredrik.lundh | 2006-05-26 19:26:39 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: cleanup
........
r46367 | fredrik.lundh | 2006-05-26 19:31:41 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: remove remaining USE_FAST macros; if fastsearch was
broken, someone would have noticed by now ;-)
........
r46368 | steve.holden | 2006-05-26 19:41:32 +0200 (Fri, 26 May 2006) | 5 lines
Use minimum calibration time rather than avergae to avoid
the illusion of negative run times. Halt with an error if
run times go below 10 ms, indicating that results will be
unreliable.
........
r46370 | thomas.heller | 2006-05-26 19:47:40 +0200 (Fri, 26 May 2006) | 2 lines
Reordered, and wrote more docs.
........
r46372 | georg.brandl | 2006-05-26 20:03:31 +0200 (Fri, 26 May 2006) | 9 lines
Need for speed: Patch #921466 : sys.path_importer_cache is now used to cache valid and
invalid file paths for the built-in import machinery which leads to
fewer open calls on startup.
Also fix issue with PEP 302 style import hooks which lead to more open()
calls than necessary.
........
r46373 | fredrik.lundh | 2006-05-26 20:05:34 +0200 (Fri, 26 May 2006) | 3 lines
removed unnecessary include
........
r46377 | fredrik.lundh | 2006-05-26 20:15:38 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: added rpartition implementation
........
r46380 | fredrik.lundh | 2006-05-26 20:24:15 +0200 (Fri, 26 May 2006) | 5 lines
needspeed: rpartition documentation, tests, and a bug fixes.
feel free to add more tests and improve the documentation.
........
r46381 | steve.holden | 2006-05-26 20:26:21 +0200 (Fri, 26 May 2006) | 4 lines
Revert tests to MAL's original round sizes to retiain comparability
from long ago and far away. Stop calling this pybench 1.4 because it
isn't. Remove the empty test, which was a bad idea.
........
r46387 | andrew.kuchling | 2006-05-26 20:41:18 +0200 (Fri, 26 May 2006) | 1 line
Add rpartition() and path caching
........
r46388 | andrew.dalke | 2006-05-26 21:02:09 +0200 (Fri, 26 May 2006) | 10 lines
substring split now uses /F's fast string matching algorithm.
(If compiled without FAST search support, changed the pre-memcmp test
to check the last character as well as the first. This gave a 25%
speedup for my test case.)
Rewrote the split algorithms so they stop when maxsplit gets to 0.
Previously they did a string match first then checked if the maxsplit
was reached. The new way prevents a needless string search.
........
r46391 | brett.cannon | 2006-05-26 21:04:47 +0200 (Fri, 26 May 2006) | 2 lines
Change C spacing to 4 spaces by default to match PEP 7 for new C files.
........
r46392 | georg.brandl | 2006-05-26 21:04:47 +0200 (Fri, 26 May 2006) | 3 lines
Exception isn't the root of all exception classes anymore.
........
r46397 | fredrik.lundh | 2006-05-26 21:23:21 +0200 (Fri, 26 May 2006) | 3 lines
added rpartition method to UserString class
........
r46398 | fredrik.lundh | 2006-05-26 21:24:53 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: stringlib refactoring, continued. added count and
find helpers; updated unicodeobject to use stringlib_count
........
r46400 | fredrik.lundh | 2006-05-26 21:29:05 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: stringlib refactoring: use stringlib/find for unicode
find
........
r46403 | fredrik.lundh | 2006-05-26 21:33:03 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: use a macro to fix slice indexes
........
r46404 | thomas.heller | 2006-05-26 21:43:45 +0200 (Fri, 26 May 2006) | 1 line
Write more docs.
........
r46406 | fredrik.lundh | 2006-05-26 21:48:07 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: stringlib refactoring: use stringlib/find for string find
........
r46407 | andrew.kuchling | 2006-05-26 21:51:10 +0200 (Fri, 26 May 2006) | 1 line
Comment typo
........
r46409 | georg.brandl | 2006-05-26 22:04:44 +0200 (Fri, 26 May 2006) | 3 lines
Replace Py_BuildValue("OO") by PyTuple_Pack.
........
r46411 | georg.brandl | 2006-05-26 22:14:47 +0200 (Fri, 26 May 2006) | 2 lines
Patch #1492218: document None being a constant.
........
r46415 | georg.brandl | 2006-05-26 22:22:50 +0200 (Fri, 26 May 2006) | 3 lines
Simplify calling.
........
r46416 | andrew.dalke | 2006-05-26 22:25:22 +0200 (Fri, 26 May 2006) | 4 lines
Added limits to the replace code so it does not count all of the matching
patterns in a string, only the number needed by the max limit.
........
r46417 | bob.ippolito | 2006-05-26 22:25:23 +0200 (Fri, 26 May 2006) | 1 line
enable all of the struct tests, use ssize_t, fix some whitespace
........
r46418 | tim.peters | 2006-05-26 22:56:56 +0200 (Fri, 26 May 2006) | 2 lines
Record Iceland sprint attendees.
........
r46421 | tim.peters | 2006-05-26 23:51:13 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46422 | steve.holden | 2006-05-27 00:17:54 +0200 (Sat, 27 May 2006) | 2 lines
Add Richard Tew to developers
........
r46423 | steve.holden | 2006-05-27 00:33:20 +0200 (Sat, 27 May 2006) | 2 lines
Update help text and documentaition.
........
r46424 | steve.holden | 2006-05-27 00:39:27 +0200 (Sat, 27 May 2006) | 2 lines
Blasted typos ...
........
r46425 | andrew.dalke | 2006-05-27 00:49:03 +0200 (Sat, 27 May 2006) | 2 lines
Added description of why splitlines doesn't use the prealloc strategy
........
r46426 | tim.peters | 2006-05-27 01:14:37 +0200 (Sat, 27 May 2006) | 19 lines
Patch 1145039.
set_exc_info(), reset_exc_info(): By exploiting the
likely (who knows?) invariant that when an exception's
`type` is NULL, its `value` and `traceback` are also NULL,
save some cycles in heavily-executed code.
This is a "a kronar saved is a kronar earned" patch: the
speedup isn't reliably measurable, but it obviously does
reduce the operation count in the normal (no exception
raised) path through PyEval_EvalFrameEx().
The tim-exc_sanity branch tries to push this harder, but
is still blowing up (at least in part due to pre-existing
subtle bugs that appear to have no other visible
consequences!).
Not a bugfix candidate.
........
r46429 | steve.holden | 2006-05-27 02:51:52 +0200 (Sat, 27 May 2006) | 2 lines
Reinstate new-style object tests.
........
r46430 | neal.norwitz | 2006-05-27 07:18:57 +0200 (Sat, 27 May 2006) | 1 line
Fix compiler warning (and whitespace) on Mac OS 10.4. (A lot of this code looked duplicated, I wonder if a utility function could help reduce the duplication here.)
........
r46431 | neal.norwitz | 2006-05-27 07:21:30 +0200 (Sat, 27 May 2006) | 4 lines
Fix Coverity warnings.
- Check the correct variable (str_obj, not str) for NULL
- sep_len was already verified it wasn't 0
........
r46432 | martin.v.loewis | 2006-05-27 10:36:52 +0200 (Sat, 27 May 2006) | 2 lines
Patch 1494554: Update numeric properties to Unicode 4.1.
........
r46433 | martin.v.loewis | 2006-05-27 10:54:29 +0200 (Sat, 27 May 2006) | 2 lines
Explain why 'consumed' is initialized.
........
r46436 | fredrik.lundh | 2006-05-27 12:05:10 +0200 (Sat, 27 May 2006) | 3 lines
needforspeed: more stringlib refactoring
........
r46438 | fredrik.lundh | 2006-05-27 12:39:48 +0200 (Sat, 27 May 2006) | 5 lines
needforspeed: backed out the Py_LOCAL-isation of ceval; the massive in-
lining killed performance on certain Intel boxes, and the "aggressive"
macro itself gives most of the benefits on others.
........
r46439 | andrew.dalke | 2006-05-27 13:04:36 +0200 (Sat, 27 May 2006) | 2 lines
fixed typo
........
r46440 | martin.v.loewis | 2006-05-27 13:07:49 +0200 (Sat, 27 May 2006) | 2 lines
Revert bogus change committed in 46432 to this file.
........
r46444 | andrew.kuchling | 2006-05-27 13:26:33 +0200 (Sat, 27 May 2006) | 1 line
Add Py_LOCAL macros
........
r46450 | bob.ippolito | 2006-05-27 13:47:12 +0200 (Sat, 27 May 2006) | 1 line
Remove the range checking and int usage #defines from _struct and strip out the now-dead code
........
r46454 | bob.ippolito | 2006-05-27 14:11:36 +0200 (Sat, 27 May 2006) | 1 line
Fix up struct docstrings, add struct.pack_to function for symmetry
........
r46456 | richard.jones | 2006-05-27 14:29:24 +0200 (Sat, 27 May 2006) | 2 lines
Conversion of exceptions over from faked-up classes to new-style C types.
........
r46457 | georg.brandl | 2006-05-27 14:30:25 +0200 (Sat, 27 May 2006) | 3 lines
Add news item for new-style exception class branch merge.
........
r46458 | tim.peters | 2006-05-27 14:36:53 +0200 (Sat, 27 May 2006) | 3 lines
More random thrashing trying to understand spurious
Windows failures. Who's keeping a bz2 file open?
........
r46460 | andrew.kuchling | 2006-05-27 15:44:37 +0200 (Sat, 27 May 2006) | 1 line
Mention new-style exceptions
........
r46461 | richard.jones | 2006-05-27 15:50:42 +0200 (Sat, 27 May 2006) | 1 line
credit where credit is due
........
r46462 | georg.brandl | 2006-05-27 16:02:03 +0200 (Sat, 27 May 2006) | 3 lines
Always close BZ2Proxy object. Remove unnecessary struct usage.
........
r46463 | tim.peters | 2006-05-27 16:13:13 +0200 (Sat, 27 May 2006) | 2 lines
The cheery optimism of old age.
........
r46464 | andrew.dalke | 2006-05-27 16:16:40 +0200 (Sat, 27 May 2006) | 2 lines
cleanup - removed trailing whitespace
........
r46465 | georg.brandl | 2006-05-27 16:41:55 +0200 (Sat, 27 May 2006) | 3 lines
Remove spurious semicolons after macro invocations.
........
r46468 | fredrik.lundh | 2006-05-27 16:58:20 +0200 (Sat, 27 May 2006) | 4 lines
needforspeed: replace improvements, changed to Py_LOCAL_INLINE
where appropriate
........
r46469 | fredrik.lundh | 2006-05-27 17:20:22 +0200 (Sat, 27 May 2006) | 4 lines
needforspeed: stringlib refactoring: changed find_obj to find_slice,
to enable use from stringobject
........
r46470 | fredrik.lundh | 2006-05-27 17:26:19 +0200 (Sat, 27 May 2006) | 3 lines
needforspeed: stringlib refactoring: use find_slice for stringobject
........
r46472 | kristjan.jonsson | 2006-05-27 17:41:31 +0200 (Sat, 27 May 2006) | 1 line
Add a PCBuild8 build directory for building with Visual Studio .NET 2005. Contains a special project to perform profile guided optimizations on the pythoncore.dll, by instrumenting and running pybench.py
........
r46473 | jack.diederich | 2006-05-27 17:44:34 +0200 (Sat, 27 May 2006) | 3 lines
needforspeed: use PyObject_MALLOC instead of system malloc for small
allocations. Use PyMem_MALLOC for larger (1k+) chunks. 1%-2% speedup.
........
r46474 | bob.ippolito | 2006-05-27 17:53:49 +0200 (Sat, 27 May 2006) | 1 line
fix struct regression on 64-bit platforms
........
r46475 | richard.jones | 2006-05-27 18:07:28 +0200 (Sat, 27 May 2006) | 1 line
doc string additions and tweaks
........
r46477 | richard.jones | 2006-05-27 18:15:11 +0200 (Sat, 27 May 2006) | 1 line
move semicolons
........
r46478 | george.yoshida | 2006-05-27 18:32:44 +0200 (Sat, 27 May 2006) | 2 lines
minor markup nits
........
r46488 | george.yoshida | 2006-05-27 18:51:43 +0200 (Sat, 27 May 2006) | 3 lines
End of Ch.3 is now about "with statement".
Avoid obsolescence by directly referring to the section.
........
r46489 | george.yoshida | 2006-05-27 19:09:17 +0200 (Sat, 27 May 2006) | 2 lines
fix typo
........
2006-05-27 19:21:47 +00:00
|
|
|
win32_wchdir(LPCWSTR path)
|
|
|
|
|
{
|
2015-12-13 21:40:26 +01:00
|
|
|
wchar_t path_buf[MAX_PATH], *new_path = path_buf;
|
2010-05-06 00:08:46 +00:00
|
|
|
int result;
|
|
|
|
|
wchar_t env[4] = L"=x:";
|
|
|
|
|
|
|
|
|
|
if(!SetCurrentDirectoryW(path))
|
|
|
|
|
return FALSE;
|
2015-12-13 21:40:26 +01:00
|
|
|
result = GetCurrentDirectoryW(Py_ARRAY_LENGTH(path_buf), new_path);
|
2010-05-06 00:08:46 +00:00
|
|
|
if (!result)
|
|
|
|
|
return FALSE;
|
2015-12-14 00:21:50 +01:00
|
|
|
if (result > Py_ARRAY_LENGTH(path_buf)) {
|
2013-07-07 16:21:41 +02:00
|
|
|
new_path = PyMem_RawMalloc(result * sizeof(wchar_t));
|
2010-05-06 00:08:46 +00:00
|
|
|
if (!new_path) {
|
|
|
|
|
SetLastError(ERROR_OUTOFMEMORY);
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
result = GetCurrentDirectoryW(result, new_path);
|
|
|
|
|
if (!result) {
|
2013-07-07 16:21:41 +02:00
|
|
|
PyMem_RawFree(new_path);
|
2010-05-06 00:08:46 +00:00
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-03-01 12:13:56 +03:00
|
|
|
int is_unc_like_path = (wcsncmp(new_path, L"\\\\", 2) == 0 ||
|
|
|
|
|
wcsncmp(new_path, L"//", 2) == 0);
|
|
|
|
|
if (!is_unc_like_path) {
|
|
|
|
|
env[1] = new_path[0];
|
|
|
|
|
result = SetEnvironmentVariableW(env, new_path);
|
|
|
|
|
}
|
2015-12-13 21:40:26 +01:00
|
|
|
if (new_path != path_buf)
|
2013-07-07 16:21:41 +02:00
|
|
|
PyMem_RawFree(new_path);
|
2018-03-01 12:13:56 +03:00
|
|
|
return result ? TRUE : FALSE;
|
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Inherits test_gzip/test_tarfile failures on 64-bit platforms from the trunk,
but I don't want the merge to hang around too long (even though the regular
p3yk-contributors are/have been busy with other things.)
Merged revisions 45621-46490 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r45621 | george.yoshida | 2006-04-21 18:34:17 +0200 (Fri, 21 Apr 2006) | 2 lines
Correct the grammar
........
r45622 | tim.peters | 2006-04-21 18:34:54 +0200 (Fri, 21 Apr 2006) | 2 lines
Whitespace normalization.
........
r45624 | thomas.heller | 2006-04-21 18:48:56 +0200 (Fri, 21 Apr 2006) | 1 line
Merge in changes from ctypes 0.9.9.6 upstream version.
........
r45625 | thomas.heller | 2006-04-21 18:51:04 +0200 (Fri, 21 Apr 2006) | 1 line
Merge in changes from ctypes 0.9.9.6 upstream version.
........
r45630 | thomas.heller | 2006-04-21 20:29:17 +0200 (Fri, 21 Apr 2006) | 8 lines
Documentation for ctypes.
I think that 'generic operating system services' is the best category.
Note that the Doc/lib/libctypes.latex file is generated from reST sources.
You are welcome to make typo fixes, and I'll try to keep the reST sources
in sync, but markup changes would be lost - they should be fixed in the tool
that creates the latex file.
The conversion script is external/ctypes/docs/manual/mkpydoc.py.
........
r45631 | tim.peters | 2006-04-21 23:18:10 +0200 (Fri, 21 Apr 2006) | 24 lines
SF bug #1473760 TempFile can hang on Windows.
Python 2.4 changed ntpath.abspath to do an import
inside the function. As a result, due to Python's
import lock, anything calling abspath on Windows
(directly, or indirectly like tempfile.TemporaryFile)
hung when it was called from a thread spawned as a
side effect of importing a module.
This is a depressingly frequent problem, and
deserves a more general fix. I'm settling for
a micro-fix here because this specific one accounts
for a report of Zope Corp's ZEO hanging on Windows,
and it was an odd way to change abspath to begin
with (ntpath needs a different implementation
depending on whether we're actually running on
Windows, and the _obvious_ way to arrange for that
is not to bury a possibly-failing import _inside_
the function).
Note that if/when other micro-fixes of this kind
get made, the new Lib/test/threaded_import_hangers.py
is a convenient place to add tests for them.
........
r45634 | phillip.eby | 2006-04-21 23:53:37 +0200 (Fri, 21 Apr 2006) | 2 lines
Guido wrote contextlib, not me, but thanks anyway. ;)
........
r45636 | andrew.kuchling | 2006-04-22 03:51:41 +0200 (Sat, 22 Apr 2006) | 1 line
Typo fixes
........
r45638 | andrew.kuchling | 2006-04-22 03:58:40 +0200 (Sat, 22 Apr 2006) | 1 line
Fix comment typo
........
r45639 | andrew.kuchling | 2006-04-22 04:06:03 +0200 (Sat, 22 Apr 2006) | 8 lines
Make copy of test_mailbox.py. We'll still want to check the backward
compatibility classes in the new mailbox.py that I'll be committing in
a few minutes.
One change has been made: the tests use len(mbox) instead of len(mbox.boxes).
The 'boxes' attribute was never documented and contains some internal state
that seems unlikely to have been useful.
........
r45640 | andrew.kuchling | 2006-04-22 04:32:43 +0200 (Sat, 22 Apr 2006) | 16 lines
Add Gregory K. Johnson's revised version of mailbox.py (funded by
the 2005 Summer of Code).
The revision adds a number of new mailbox classes that support adding
and removing messages; these classes also support mailbox locking and
default to using email.Message instead of rfc822.Message.
The old mailbox classes are largely left alone for backward compatibility.
The exception is the Maildir class, which was present in the old module
and now inherits from the new classes. The Maildir class's interface
is pretty simple, though, so I think it'll be compatible with existing
code.
(The change to the NEWS file also adds a missing word to a different
news item, which unfortunately required rewrapping the line.)
........
r45641 | tim.peters | 2006-04-22 07:52:59 +0200 (Sat, 22 Apr 2006) | 2 lines
Whitespace normalization.
........
r45642 | neal.norwitz | 2006-04-22 08:07:46 +0200 (Sat, 22 Apr 2006) | 1 line
Add libctypes as a dep
........
r45643 | martin.v.loewis | 2006-04-22 13:15:41 +0200 (Sat, 22 Apr 2006) | 1 line
Fix more ssize_t problems.
........
r45644 | martin.v.loewis | 2006-04-22 13:40:03 +0200 (Sat, 22 Apr 2006) | 1 line
Fix more ssize_t issues.
........
r45645 | george.yoshida | 2006-04-22 17:10:49 +0200 (Sat, 22 Apr 2006) | 2 lines
Typo fixes
........
r45647 | martin.v.loewis | 2006-04-22 17:19:54 +0200 (Sat, 22 Apr 2006) | 1 line
Port to Python 2.5. Drop .DEF file. Change output file names to .pyd.
........
r45648 | george.yoshida | 2006-04-22 17:27:14 +0200 (Sat, 22 Apr 2006) | 3 lines
- add versionadded tag
- make arbitrary arguments come last
........
r45649 | hyeshik.chang | 2006-04-22 17:48:15 +0200 (Sat, 22 Apr 2006) | 3 lines
Remove $CJKCodecs$ RCS tags. The CJKCodecs isn't maintained outside
anymore.
........
r45654 | greg.ward | 2006-04-23 05:47:58 +0200 (Sun, 23 Apr 2006) | 2 lines
Update optparse to Optik 1.5.1.
........
r45658 | george.yoshida | 2006-04-23 11:27:10 +0200 (Sun, 23 Apr 2006) | 2 lines
wrap SyntaxError with \exception{}
........
r45660 | ronald.oussoren | 2006-04-23 13:59:25 +0200 (Sun, 23 Apr 2006) | 6 lines
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.
........
r45661 | ronald.oussoren | 2006-04-23 14:36:23 +0200 (Sun, 23 Apr 2006) | 5 lines
Patch 1471761 - test for broken poll at runtime
This patch checks if poll is broken when the select module is loaded instead
of doing so at configure-time. This functionality is only active on Mac OS X.
........
r45662 | nick.coghlan | 2006-04-23 17:13:32 +0200 (Sun, 23 Apr 2006) | 1 line
Add a Context Types section to parallel the Iterator Types section (uses the same terminology as the 2.5a1 implementation)
........
r45663 | nick.coghlan | 2006-04-23 17:14:37 +0200 (Sun, 23 Apr 2006) | 1 line
Update contextlib documentation to use the same terminology as the module implementation
........
r45664 | gerhard.haering | 2006-04-23 17:24:26 +0200 (Sun, 23 Apr 2006) | 2 lines
Updated the sqlite3 module to the external pysqlite 2.2.2 version.
........
r45666 | nick.coghlan | 2006-04-23 17:39:16 +0200 (Sun, 23 Apr 2006) | 1 line
Update with statement documentation to use same terminology as 2.5a1 implementation
........
r45667 | nick.coghlan | 2006-04-23 18:05:04 +0200 (Sun, 23 Apr 2006) | 1 line
Add a (very) brief mention of the with statement to the end of chapter 8
........
r45668 | nick.coghlan | 2006-04-23 18:35:19 +0200 (Sun, 23 Apr 2006) | 1 line
Take 2 on mentioning the with statement, this time without inadvertently killing the Unicode examples
........
r45669 | nick.coghlan | 2006-04-23 19:04:07 +0200 (Sun, 23 Apr 2006) | 1 line
Backdated NEWS entry to record the implementation of PEP 338 for alpha 1
........
r45670 | tim.peters | 2006-04-23 20:13:45 +0200 (Sun, 23 Apr 2006) | 2 lines
Whitespace normalization.
........
r45671 | skip.montanaro | 2006-04-23 21:14:27 +0200 (Sun, 23 Apr 2006) | 1 line
first cut at trace module doc
........
r45672 | skip.montanaro | 2006-04-23 21:26:33 +0200 (Sun, 23 Apr 2006) | 1 line
minor tweak
........
r45673 | skip.montanaro | 2006-04-23 21:30:50 +0200 (Sun, 23 Apr 2006) | 1 line
it's always helpful if the example works...
........
r45674 | skip.montanaro | 2006-04-23 21:32:14 +0200 (Sun, 23 Apr 2006) | 1 line
correct example
........
r45675 | andrew.kuchling | 2006-04-23 23:01:04 +0200 (Sun, 23 Apr 2006) | 1 line
Edits to the PEP 343 section
........
r45676 | andrew.kuchling | 2006-04-23 23:51:10 +0200 (Sun, 23 Apr 2006) | 1 line
Add two items
........
r45677 | tim.peters | 2006-04-24 04:03:16 +0200 (Mon, 24 Apr 2006) | 5 lines
Bug #1337990: clarified that `doctest` does not support examples
requiring both expected output and an exception.
I'll backport to 2.4 next.
........
r45679 | nick.coghlan | 2006-04-24 05:04:43 +0200 (Mon, 24 Apr 2006) | 1 line
Note changes made to PEP 343 related documentation
........
r45681 | nick.coghlan | 2006-04-24 06:17:02 +0200 (Mon, 24 Apr 2006) | 1 line
Change PEP 343 related documentation to use the term context specifier instead of context object
........
r45682 | nick.coghlan | 2006-04-24 06:32:47 +0200 (Mon, 24 Apr 2006) | 1 line
Add unit tests for the -m and -c command line switches
........
r45683 | nick.coghlan | 2006-04-24 06:37:15 +0200 (Mon, 24 Apr 2006) | 1 line
Fix contextlib.nested to cope with exit methods raising and handling exceptions
........
r45685 | nick.coghlan | 2006-04-24 06:59:28 +0200 (Mon, 24 Apr 2006) | 1 line
Fix broken contextlib test from last checkin (I'd've sworn I tested that before checking it in. . .)
........
r45686 | nick.coghlan | 2006-04-24 07:24:26 +0200 (Mon, 24 Apr 2006) | 1 line
Back out new command line tests (broke buildbot)
........
r45687 | nick.coghlan | 2006-04-24 07:52:15 +0200 (Mon, 24 Apr 2006) | 1 line
More reliable version of new command line tests that just checks the exit codes
........
r45688 | thomas.wouters | 2006-04-24 13:37:13 +0200 (Mon, 24 Apr 2006) | 4 lines
Stop test_tcl's testLoadTk from leaking the Tk commands 'loadtk' registers.
........
r45690 | andrew.kuchling | 2006-04-24 16:30:47 +0200 (Mon, 24 Apr 2006) | 2 lines
Edits, using the new term
'context specifier' in a few places
........
r45697 | phillip.eby | 2006-04-24 22:53:13 +0200 (Mon, 24 Apr 2006) | 2 lines
Revert addition of setuptools
........
r45698 | tim.peters | 2006-04-25 00:45:13 +0200 (Tue, 25 Apr 2006) | 2 lines
Whitespace normalization.
........
r45700 | trent.mick | 2006-04-25 02:34:50 +0200 (Tue, 25 Apr 2006) | 4 lines
Put break at correct level so *all* root HKEYs acutally get checked for
an installed VC6. Otherwise only the first such tree gets checked and this
warning doesn't get displayed.
........
r45701 | tim.peters | 2006-04-25 05:31:36 +0200 (Tue, 25 Apr 2006) | 3 lines
Patch #1475231: add a new SKIP doctest option, thanks to
Edward Loper.
........
r45702 | neal.norwitz | 2006-04-25 07:04:35 +0200 (Tue, 25 Apr 2006) | 1 line
versionadded for SKIP
........
r45703 | neal.norwitz | 2006-04-25 07:05:03 +0200 (Tue, 25 Apr 2006) | 1 line
Restore Walters name
........
r45704 | neal.norwitz | 2006-04-25 07:49:42 +0200 (Tue, 25 Apr 2006) | 1 line
Revert previous change, SKIP had a versionadded elsewhere
........
r45706 | nick.coghlan | 2006-04-25 12:56:51 +0200 (Tue, 25 Apr 2006) | 31 lines
Move the PEP 343 documentation and implementation closer to the
terminology in the alpha 1 documentation.
- "context manager" reverts to its alpha 1 definition
- the term "context specifier" goes away entirely
- contextlib.GeneratorContextManager is renamed GeneratorContext
There are still a number of changes relative to alpha 1:
- the expression in the with statement is explicitly called the
"context expression" in the language reference
- the terms 'with statement context', 'context object' or 'with
statement context' are used in several places instead of a bare
'context'. The aim of this is to avoid ambiguity in relation to the
runtime context set up when the block is executed, and the context
objects that already exist in various application domains (such as
decimal.Context)
- contextlib.contextmanager is renamed to contextfactory
This best reflects the nature of the function resulting from the
use of that decorator
- decimal.ContextManager is renamed to WithStatementContext
Simple dropping the 'Manager' part wasn't possible due to the
fact that decimal.Context already exists and means something
different. WithStatementContext is ugly but workable.
A technically unrelated change snuck into this commit:
contextlib.closing now avoids the overhead of creating a
generator, since it's trivial to implement that particular
context manager directly.
........
r45707 | nick.coghlan | 2006-04-25 13:05:56 +0200 (Tue, 25 Apr 2006) | 1 line
Fix latex typo
........
r45708 | thomas.wouters | 2006-04-25 14:28:56 +0200 (Tue, 25 Apr 2006) | 4 lines
Fix markup glitch in unittest docs. Will backport.
........
r45710 | andrew.kuchling | 2006-04-25 14:31:38 +0200 (Tue, 25 Apr 2006) | 1 line
Add two items; easy_install is now off the table, though pkgutil still is
........
r45711 | andrew.kuchling | 2006-04-25 14:47:25 +0200 (Tue, 25 Apr 2006) | 1 line
Rework context terminology
........
r45712 | thomas.wouters | 2006-04-25 15:53:23 +0200 (Tue, 25 Apr 2006) | 9 lines
SF bug/patch #1433877: string parameter to ioctl not null terminated
The new char-array used in ioctl calls wasn't explicitly NUL-terminated;
quite probably the cause for the test_pty failures on Solaris that we
circumvented earlier. (I wasn't able to reproduce it with this patch, but it
has been somewhat elusive to start with.)
........
r45713 | george.yoshida | 2006-04-25 16:09:58 +0200 (Tue, 25 Apr 2006) | 2 lines
minor tweak
........
r45714 | thomas.wouters | 2006-04-25 17:08:10 +0200 (Tue, 25 Apr 2006) | 7 lines
Fix SF bug #1476111: SystemError in socket sendto. The AF_INET6 and
AF_PACKET cases in getsockaddrarg were missing their own checks for
tuple-ness of the address argument, which means a confusing SystemError was
raised by PyArg_ParseTuple instead.
........
r45715 | thomas.wouters | 2006-04-25 17:29:46 +0200 (Tue, 25 Apr 2006) | 10 lines
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.
........
r45717 | thomas.heller | 2006-04-25 20:26:08 +0200 (Tue, 25 Apr 2006) | 3 lines
Fix compiler warnings on Darwin.
Patch by Brett Canon, see
https://sourceforge.net/tracker/?func=detail&atid=532156&aid=1475959&group_id=71702
........
r45718 | guido.van.rossum | 2006-04-25 22:12:45 +0200 (Tue, 25 Apr 2006) | 4 lines
Implement MvL's improvement on __context__ in Condition;
this can just call __context__ on the underlying lock.
(The same change for Semaphore does *not* work!)
........
r45721 | tim.peters | 2006-04-26 03:15:53 +0200 (Wed, 26 Apr 2006) | 13 lines
Rev 45706 renamed stuff in contextlib.py, but didn't rename
uses of it in test_with.py. As a result, test_with has been skipped
(due to failing imports) on all buildbot boxes since. Alas, that's
not a test failure -- you have to pay attention to the
1 skip unexpected on PLATFORM:
test_with
kinds of output at the ends of test runs to notice that this got
broken.
It's likely that more renaming in test_with.py would be desirable.
........
r45722 | fred.drake | 2006-04-26 07:15:41 +0200 (Wed, 26 Apr 2006) | 1 line
markup fixes, cleanup
........
r45723 | fred.drake | 2006-04-26 07:19:39 +0200 (Wed, 26 Apr 2006) | 1 line
minor adjustment suggested by Peter Gephardt
........
r45724 | neal.norwitz | 2006-04-26 07:34:03 +0200 (Wed, 26 Apr 2006) | 10 lines
Patch from Aldo Cortesi (OpenBSD buildbot owner).
After the patch (45590) to add extra debug stats to the gc module, Python
was crashing on OpenBSD due to:
Fatal Python error: Interpreter not initialized (version mismatch?)
This seems to occur due to calling collect() when initialized (in pythonrun.c)
is set to 0. Now, the import will occur in the init function which
shouldn't suffer this problem.
........
r45725 | neal.norwitz | 2006-04-26 08:26:12 +0200 (Wed, 26 Apr 2006) | 3 lines
Fix this test on Solaris. There can be embedded \r, so don't just replace
the one at the end.
........
r45727 | nick.coghlan | 2006-04-26 13:50:04 +0200 (Wed, 26 Apr 2006) | 1 line
Fix an error in the last contextlib.closing example
........
r45728 | andrew.kuchling | 2006-04-26 14:21:06 +0200 (Wed, 26 Apr 2006) | 1 line
[Bug #1475080] Fix example
........
r45729 | andrew.kuchling | 2006-04-26 14:23:39 +0200 (Wed, 26 Apr 2006) | 1 line
Add labels to all sections
........
r45730 | thomas.wouters | 2006-04-26 17:53:30 +0200 (Wed, 26 Apr 2006) | 7 lines
The result of SF patch #1471578: big-memory tests for strings, lists and
tuples. Lots to be added, still, but this will give big-memory people
something to play with in 2.5 alpha 2, and hopefully get more people to
write these tests.
........
r45731 | tim.peters | 2006-04-26 19:11:16 +0200 (Wed, 26 Apr 2006) | 2 lines
Whitespace normalization.
........
r45732 | martin.v.loewis | 2006-04-26 19:19:44 +0200 (Wed, 26 Apr 2006) | 1 line
Use GS- and bufferoverlowU.lib where appropriate, for AMD64.
........
r45733 | thomas.wouters | 2006-04-26 20:46:01 +0200 (Wed, 26 Apr 2006) | 5 lines
Add tests for += and *= on strings, and fix the memory-use estimate for the
list.extend tests (they were estimating half the actual use.)
........
r45734 | thomas.wouters | 2006-04-26 21:14:46 +0200 (Wed, 26 Apr 2006) | 5 lines
Some more test-size-estimate fixes: test_append and test_insert trigger a
list resize, which overallocates.
........
r45735 | hyeshik.chang | 2006-04-26 21:20:26 +0200 (Wed, 26 Apr 2006) | 3 lines
Fix build on MIPS for libffi. I haven't tested this yet because I
don't have an access on MIPS machines. Will be tested by buildbot. :)
........
r45737 | fred.drake | 2006-04-27 01:40:32 +0200 (Thu, 27 Apr 2006) | 1 line
one more place to use the current Python version
........
r45738 | fred.drake | 2006-04-27 02:02:24 +0200 (Thu, 27 Apr 2006) | 3 lines
- update version numbers in file names again, until we have a better way
- elaborate instructions for Cygwin support (closes SF #839709)
........
r45739 | fred.drake | 2006-04-27 02:20:14 +0200 (Thu, 27 Apr 2006) | 1 line
add missing word
........
r45740 | anthony.baxter | 2006-04-27 04:11:24 +0200 (Thu, 27 Apr 2006) | 2 lines
2.5a2
........
r45741 | anthony.baxter | 2006-04-27 04:13:13 +0200 (Thu, 27 Apr 2006) | 1 line
2.5a2
........
r45749 | andrew.kuchling | 2006-04-27 14:22:37 +0200 (Thu, 27 Apr 2006) | 1 line
Now that 2.5a2 is out, revert to the current date
........
r45750 | andrew.kuchling | 2006-04-27 14:23:07 +0200 (Thu, 27 Apr 2006) | 1 line
Bump document version
........
r45751 | andrew.kuchling | 2006-04-27 14:34:39 +0200 (Thu, 27 Apr 2006) | 6 lines
[Bug #1477102] Add necessary import to example
This may be a useful style question for the docs -- should examples show
the necessary imports, or should it be assumed that the reader will
figure it out? In the What's New, I'm not consistent but usually opt
for omitting the imports.
........
r45753 | andrew.kuchling | 2006-04-27 14:38:35 +0200 (Thu, 27 Apr 2006) | 1 line
[Bug #1477140] Import Error base class
........
r45754 | andrew.kuchling | 2006-04-27 14:42:54 +0200 (Thu, 27 Apr 2006) | 1 line
Mention the xmlrpclib.Error base class, which is used in one of the examples
........
r45756 | george.yoshida | 2006-04-27 15:41:07 +0200 (Thu, 27 Apr 2006) | 2 lines
markup fix
........
r45757 | thomas.wouters | 2006-04-27 15:46:59 +0200 (Thu, 27 Apr 2006) | 4 lines
Some more size-estimate fixes, for large-list-tests.
........
r45758 | thomas.heller | 2006-04-27 17:50:42 +0200 (Thu, 27 Apr 2006) | 3 lines
Rerun the libffi configuration if any of the files used for that
are newer then fficonfig.py.
........
r45766 | thomas.wouters | 2006-04-28 00:37:50 +0200 (Fri, 28 Apr 2006) | 6 lines
Some style fixes and size-calculation fixes. Also do the small-memory run
using a prime number, rather than a convenient power-of-2-and-multiple-of-5,
so incorrect testing algorithms fail more easily.
........
r45767 | thomas.wouters | 2006-04-28 00:38:32 +0200 (Fri, 28 Apr 2006) | 6 lines
Do the small-memory run of big-meormy tests using a prime number, rather
than a convenient power-of-2-and-multiple-of-5, so incorrect testing
algorithms fail more easily.
........
r45768 | david.goodger | 2006-04-28 00:53:05 +0200 (Fri, 28 Apr 2006) | 1 line
Added SVN access for Steven Bethard and Talin, for PEP updating.
........
r45770 | thomas.wouters | 2006-04-28 01:13:20 +0200 (Fri, 28 Apr 2006) | 16 lines
- Add new Warning class, ImportWarning
- Warn-raise ImportWarning when importing would have picked up a directory
as package, if only it'd had an __init__.py. This swaps two tests (for
case-ness and __init__-ness), but case-test is not really more expensive,
and it's not in a speed-critical section.
- Test for the new warning by importing a common non-package directory on
sys.path: site-packages
- In regrtest.py, silence warnings generated by the build-environment
because Modules/ (which is added to sys.path for Setup-created modules)
has 'zlib' and '_ctypes' directories without __init__.py's.
........
r45771 | thomas.wouters | 2006-04-28 01:41:27 +0200 (Fri, 28 Apr 2006) | 6 lines
Add more ignores of ImportWarnings; these are all just potential triggers
(since they won't trigger if zlib is already sucessfully imported); they
were found by grepping .py files, instead of looking at warning output :)
........
r45773 | neal.norwitz | 2006-04-28 06:32:20 +0200 (Fri, 28 Apr 2006) | 1 line
Add some whitespace to be more consistent.
........
r45774 | neal.norwitz | 2006-04-28 06:34:43 +0200 (Fri, 28 Apr 2006) | 5 lines
Try to really fix the slow buildbots this time.
Printing to stdout, doesn't mean the data was actually written.
It depends on the buffering, so we need to flush. This will hopefully
really fix the buildbots getting killed due to no output on the slow bots.
........
r45775 | neal.norwitz | 2006-04-28 07:28:05 +0200 (Fri, 28 Apr 2006) | 1 line
Fix some warnings on Mac OS X 10.4
........
r45776 | neal.norwitz | 2006-04-28 07:28:30 +0200 (Fri, 28 Apr 2006) | 1 line
Fix a warning on alpha
........
r45777 | neal.norwitz | 2006-04-28 07:28:54 +0200 (Fri, 28 Apr 2006) | 1 line
Fix a warning on ppc (debian)
........
r45778 | george.yoshida | 2006-04-28 18:09:45 +0200 (Fri, 28 Apr 2006) | 2 lines
fix markup glitch
........
r45780 | georg.brandl | 2006-04-28 18:31:17 +0200 (Fri, 28 Apr 2006) | 3 lines
Add SeaMonkey to the list of Mozilla browsers.
........
r45781 | georg.brandl | 2006-04-28 18:36:55 +0200 (Fri, 28 Apr 2006) | 2 lines
Bug #1475009: clarify ntpath.join behavior with absolute components
........
r45783 | george.yoshida | 2006-04-28 18:40:14 +0200 (Fri, 28 Apr 2006) | 2 lines
correct a dead link
........
r45785 | georg.brandl | 2006-04-28 18:54:25 +0200 (Fri, 28 Apr 2006) | 4 lines
Bug #1472949: stringify IOErrors in shutil.copytree when appending
them to the Error errors list.
........
r45786 | georg.brandl | 2006-04-28 18:58:52 +0200 (Fri, 28 Apr 2006) | 3 lines
Bug #1478326: don't allow '/' in distutils.util.get_platform machine names
since this value is used to name the build directory.
........
r45788 | thomas.heller | 2006-04-28 19:02:18 +0200 (Fri, 28 Apr 2006) | 1 line
Remove a duplicated test (the same test is in test_incomplete.py).
........
r45792 | georg.brandl | 2006-04-28 21:09:24 +0200 (Fri, 28 Apr 2006) | 3 lines
Bug #1478429: make datetime.datetime.fromtimestamp accept every float,
possibly "rounding up" to the next whole second.
........
r45796 | george.yoshida | 2006-04-29 04:43:30 +0200 (Sat, 29 Apr 2006) | 2 lines
grammar fix
........
r45800 | ronald.oussoren | 2006-04-29 13:31:35 +0200 (Sat, 29 Apr 2006) | 2 lines
Patch 1471883: --enable-universalsdk on Mac OS X
........
r45801 | andrew.kuchling | 2006-04-29 13:53:15 +0200 (Sat, 29 Apr 2006) | 1 line
Add item
........
r45802 | andrew.kuchling | 2006-04-29 14:10:28 +0200 (Sat, 29 Apr 2006) | 1 line
Make case of 'ZIP' consistent
........
r45803 | andrew.kuchling | 2006-04-29 14:10:43 +0200 (Sat, 29 Apr 2006) | 1 line
Add item
........
r45808 | martin.v.loewis | 2006-04-29 14:37:25 +0200 (Sat, 29 Apr 2006) | 3 lines
Further changes for #1471883: Edit Misc/NEWS, and
add expat_config.h.
........
r45809 | brett.cannon | 2006-04-29 23:29:50 +0200 (Sat, 29 Apr 2006) | 2 lines
Fix docstring for contextfactory; mentioned old contextmanager name.
........
r45810 | gerhard.haering | 2006-04-30 01:12:41 +0200 (Sun, 30 Apr 2006) | 3 lines
This is the start of documentation for the sqlite3 module. Please feel free to
find a better place for the link to it than alongside bsddb & friends.
........
r45811 | andrew.kuchling | 2006-04-30 03:07:09 +0200 (Sun, 30 Apr 2006) | 1 line
Add two items
........
r45814 | george.yoshida | 2006-04-30 05:49:56 +0200 (Sun, 30 Apr 2006) | 2 lines
Use \versionchanged instead of \versionadded for new parameter support.
........
r45815 | georg.brandl | 2006-04-30 09:06:11 +0200 (Sun, 30 Apr 2006) | 2 lines
Patch #1470846: fix urllib2 ProxyBasicAuthHandler.
........
r45817 | georg.brandl | 2006-04-30 10:57:35 +0200 (Sun, 30 Apr 2006) | 3 lines
In stdlib, use hashlib instead of deprecated md5 and sha modules.
........
r45819 | georg.brandl | 2006-04-30 11:23:59 +0200 (Sun, 30 Apr 2006) | 3 lines
Patch #1470976: don't NLST files when retrieving over FTP.
........
r45821 | georg.brandl | 2006-04-30 13:13:56 +0200 (Sun, 30 Apr 2006) | 6 lines
Bug #1473625: stop cPickle making float dumps locale dependent in protocol 0.
On the way, add a decorator to test_support to facilitate running single
test functions in different locales with automatic cleanup.
........
r45822 | phillip.eby | 2006-04-30 17:59:26 +0200 (Sun, 30 Apr 2006) | 2 lines
Fix infinite regress when inspecting <string> or <stdin> frames.
........
r45824 | georg.brandl | 2006-04-30 19:42:26 +0200 (Sun, 30 Apr 2006) | 3 lines
Fix another problem in inspect: if the module for an object cannot be found, don't try to give its __dict__ to linecache.
........
r45825 | georg.brandl | 2006-04-30 20:14:54 +0200 (Sun, 30 Apr 2006) | 3 lines
Patch #1472854: make the rlcompleter.Completer class usable on non-
UNIX platforms.
........
r45826 | georg.brandl | 2006-04-30 21:34:19 +0200 (Sun, 30 Apr 2006) | 3 lines
Patch #1479438: add \keyword markup for "with".
........
r45827 | andrew.kuchling | 2006-04-30 23:19:31 +0200 (Sun, 30 Apr 2006) | 1 line
Add urllib2 HOWTO from Michael Foord
........
r45828 | andrew.kuchling | 2006-04-30 23:19:49 +0200 (Sun, 30 Apr 2006) | 1 line
Add item
........
r45830 | barry.warsaw | 2006-05-01 05:03:02 +0200 (Mon, 01 May 2006) | 11 lines
Port forward from 2.4 branch:
Patch #1464708 from William McVey: fixed handling of nested comments in mail
addresses. E.g.
"Foo ((Foo Bar)) <foo@example.com>"
Fixes for both rfc822.py and email package. This patch needs to be back
ported to Python 2.3 for email 2.5.
........
r45832 | fred.drake | 2006-05-01 08:25:58 +0200 (Mon, 01 May 2006) | 4 lines
- minor clarification in section title
- markup adjustments
(there is clearly much to be done in this section)
........
r45833 | martin.v.loewis | 2006-05-01 08:28:01 +0200 (Mon, 01 May 2006) | 2 lines
Work around deadlock risk. Will backport.
........
r45836 | andrew.kuchling | 2006-05-01 14:45:02 +0200 (Mon, 01 May 2006) | 1 line
Some ElementTree fixes: import from xml, not xmlcore; fix case of module name; mention list() instead of getchildren()
........
r45837 | gerhard.haering | 2006-05-01 17:14:48 +0200 (Mon, 01 May 2006) | 3 lines
Further integration of the documentation for the sqlite3 module. There's still
quite some content to move over from the pysqlite manual, but it's a start now.
........
r45838 | martin.v.loewis | 2006-05-01 17:56:03 +0200 (Mon, 01 May 2006) | 2 lines
Rename uisample to text, drop all non-text tables.
........
r45839 | martin.v.loewis | 2006-05-01 18:12:44 +0200 (Mon, 01 May 2006) | 2 lines
Add msilib documentation.
........
r45840 | martin.v.loewis | 2006-05-01 18:14:16 +0200 (Mon, 01 May 2006) | 4 lines
Rename parameters to match the documentation (which
in turn matches Microsoft's documentation).
Drop unused parameter in CAB.append.
........
r45841 | fred.drake | 2006-05-01 18:28:54 +0200 (Mon, 01 May 2006) | 1 line
add dependency
........
r45842 | andrew.kuchling | 2006-05-01 18:30:25 +0200 (Mon, 01 May 2006) | 1 line
Markup fixes; add some XXX comments noting problems
........
r45843 | andrew.kuchling | 2006-05-01 18:32:49 +0200 (Mon, 01 May 2006) | 1 line
Add item
........
r45844 | andrew.kuchling | 2006-05-01 19:06:54 +0200 (Mon, 01 May 2006) | 1 line
Markup fixes
........
r45850 | neal.norwitz | 2006-05-02 06:43:14 +0200 (Tue, 02 May 2006) | 3 lines
SF #1479181: split open() and file() from being aliases for each other.
........
r45852 | neal.norwitz | 2006-05-02 08:23:22 +0200 (Tue, 02 May 2006) | 1 line
Try to fix breakage caused by patch #1479181, r45850
........
r45853 | fred.drake | 2006-05-02 08:53:59 +0200 (Tue, 02 May 2006) | 3 lines
SF #1479988: add methods to allow access to weakrefs for the
weakref.WeakKeyDictionary and weakref.WeakValueDictionary
........
r45854 | neal.norwitz | 2006-05-02 09:27:47 +0200 (Tue, 02 May 2006) | 5 lines
Fix breakage from patch 1471883 (r45800 & r45808) on OSF/1.
The problem was that pyconfig.h was being included before some system headers
which caused redefinitions and other breakage. This moves system headers
after expat_config.h which includes pyconfig.h.
........
r45855 | vinay.sajip | 2006-05-02 10:35:36 +0200 (Tue, 02 May 2006) | 1 line
Replaced my dumb way of calculating seconds to midnight with Tim Peters' much more sensible suggestion. What was I thinking ?!?
........
r45856 | andrew.kuchling | 2006-05-02 13:30:03 +0200 (Tue, 02 May 2006) | 1 line
Provide encoding as keyword argument; soften warning paragraph about encodings
........
r45858 | guido.van.rossum | 2006-05-02 19:36:09 +0200 (Tue, 02 May 2006) | 2 lines
Fix the formatting of KeyboardInterrupt -- a bad issubclass() call.
........
r45862 | guido.van.rossum | 2006-05-02 21:47:52 +0200 (Tue, 02 May 2006) | 7 lines
Get rid of __context__, per the latest changes to PEP 343 and python-dev
discussion.
There are two places of documentation that still mention __context__:
Doc/lib/libstdtypes.tex -- I wasn't quite sure how to rewrite that without
spending a whole lot of time thinking about it; and whatsnew, which Andrew
usually likes to change himself.
........
r45863 | armin.rigo | 2006-05-02 21:52:32 +0200 (Tue, 02 May 2006) | 4 lines
Documentation bug: PySet_Pop() returns a new reference (because the
caller becomes the owner of that reference).
........
r45864 | guido.van.rossum | 2006-05-02 22:47:36 +0200 (Tue, 02 May 2006) | 4 lines
Hopefully this will fix the spurious failures of test_mailbox.py that I'm
experiencing. (This code and mailbox.py itself are full of calls to file()
that should be calls to open() -- but I'm not fixing those.)
........
r45865 | andrew.kuchling | 2006-05-02 23:44:33 +0200 (Tue, 02 May 2006) | 1 line
Use open() instead of file()
........
r45866 | andrew.kuchling | 2006-05-03 00:47:49 +0200 (Wed, 03 May 2006) | 1 line
Update context manager section for removal of __context__
........
r45867 | fred.drake | 2006-05-03 03:46:52 +0200 (Wed, 03 May 2006) | 1 line
remove unnecessary assignment
........
r45868 | fred.drake | 2006-05-03 03:48:24 +0200 (Wed, 03 May 2006) | 4 lines
tell LaTeX2HTML to:
- use UTF-8 output
- not mess with the >>> prompt!
........
r45869 | fred.drake | 2006-05-03 04:04:40 +0200 (Wed, 03 May 2006) | 3 lines
avoid ugly markup based on the unfortunate conversions of ">>" and "<<" to
guillemets; no need for magic here
........
r45870 | fred.drake | 2006-05-03 04:12:47 +0200 (Wed, 03 May 2006) | 1 line
at least comment on why curly-quotes are not enabled
........
r45871 | fred.drake | 2006-05-03 04:27:40 +0200 (Wed, 03 May 2006) | 1 line
one more place to avoid extra markup
........
r45872 | fred.drake | 2006-05-03 04:29:09 +0200 (Wed, 03 May 2006) | 1 line
one more place to avoid extra markup (how many will there be?)
........
r45873 | fred.drake | 2006-05-03 04:29:39 +0200 (Wed, 03 May 2006) | 1 line
fix up whitespace in prompt strings
........
r45876 | tim.peters | 2006-05-03 06:46:14 +0200 (Wed, 03 May 2006) | 2 lines
Whitespace normalization.
........
r45877 | martin.v.loewis | 2006-05-03 06:52:04 +0200 (Wed, 03 May 2006) | 2 lines
Correct some formulations, fix XXX comments.
........
r45879 | georg.brandl | 2006-05-03 07:05:02 +0200 (Wed, 03 May 2006) | 2 lines
Patch #1480067: don't redirect HTTP digest auth in urllib2
........
r45881 | georg.brandl | 2006-05-03 07:15:10 +0200 (Wed, 03 May 2006) | 3 lines
Move network tests from test_urllib2 to test_urllib2net.
........
r45887 | nick.coghlan | 2006-05-03 15:02:47 +0200 (Wed, 03 May 2006) | 1 line
Finish bringing SVN into line with latest version of PEP 343 by getting rid of all remaining references to context objects that I could find. Without a __context__() method context objects no longer exist. Also get test_with working again, and adopt a suggestion from Neal for decimal.Context.get_manager()
........
r45888 | nick.coghlan | 2006-05-03 15:17:49 +0200 (Wed, 03 May 2006) | 1 line
Get rid of a couple more context object references, fix some markup and clarify what happens when a generator context function swallows an exception.
........
r45889 | georg.brandl | 2006-05-03 19:46:13 +0200 (Wed, 03 May 2006) | 3 lines
Add seamonkey to list of Windows browsers too.
........
r45890 | georg.brandl | 2006-05-03 20:03:22 +0200 (Wed, 03 May 2006) | 3 lines
RFE #1472176: In httplib, don't encode the netloc and hostname with "idna" if not necessary.
........
r45891 | georg.brandl | 2006-05-03 20:12:33 +0200 (Wed, 03 May 2006) | 2 lines
Bug #1472191: convert breakpoint indices to ints before comparing them to ints
........
r45893 | georg.brandl | 2006-05-03 20:18:32 +0200 (Wed, 03 May 2006) | 3 lines
Bug #1385040: don't allow "def foo(a=1, b): pass" in the compiler package.
........
r45894 | thomas.heller | 2006-05-03 20:35:39 +0200 (Wed, 03 May 2006) | 1 line
Don't fail the tests when libglut.so or libgle.so cannot be loaded.
........
r45895 | georg.brandl | 2006-05-04 07:08:10 +0200 (Thu, 04 May 2006) | 2 lines
Bug #1481530: allow "from os.path import ..." with imputil
........
r45897 | martin.v.loewis | 2006-05-04 07:51:03 +0200 (Thu, 04 May 2006) | 2 lines
Patch #1475845: Raise IndentationError for unexpected indent.
........
r45898 | martin.v.loewis | 2006-05-04 12:08:42 +0200 (Thu, 04 May 2006) | 1 line
Implement os.{chdir,rename,rmdir,remove} using Win32 directly.
........
r45899 | martin.v.loewis | 2006-05-04 14:04:27 +0200 (Thu, 04 May 2006) | 2 lines
Drop now-unnecessary arguments to posix_2str.
........
r45900 | martin.v.loewis | 2006-05-04 16:27:52 +0200 (Thu, 04 May 2006) | 1 line
Update checks to consider Windows error numbers.
........
r45913 | thomas.heller | 2006-05-05 20:42:14 +0200 (Fri, 05 May 2006) | 2 lines
Export the 'free' standard C function for use in the test suite.
........
r45914 | thomas.heller | 2006-05-05 20:43:24 +0200 (Fri, 05 May 2006) | 3 lines
Fix memory leaks in the ctypes test suite, reported by valgrind, by
free()ing the memory we allocate.
........
r45915 | thomas.heller | 2006-05-05 20:46:27 +0200 (Fri, 05 May 2006) | 1 line
oops - the function is exported as 'my_free', not 'free'.
........
r45916 | thomas.heller | 2006-05-05 21:14:24 +0200 (Fri, 05 May 2006) | 2 lines
Clean up.
........
r45920 | george.yoshida | 2006-05-06 15:09:45 +0200 (Sat, 06 May 2006) | 2 lines
describe optional arguments for DocFileSuite
........
r45924 | george.yoshida | 2006-05-06 16:16:51 +0200 (Sat, 06 May 2006) | 2 lines
Use \versionchanged for the feature change
........
r45925 | martin.v.loewis | 2006-05-06 18:32:54 +0200 (Sat, 06 May 2006) | 1 line
Port access, chmod, parts of getcwdu, mkdir, and utime to direct Win32 API.
........
r45926 | martin.v.loewis | 2006-05-06 22:04:08 +0200 (Sat, 06 May 2006) | 2 lines
Handle ERROR_ALREADY_EXISTS.
........
r45931 | andrew.kuchling | 2006-05-07 19:12:12 +0200 (Sun, 07 May 2006) | 1 line
[Patch #1479977] Revised version of urllib2 HOWTO, edited by John J. Lee
........
r45932 | andrew.kuchling | 2006-05-07 19:14:53 +0200 (Sun, 07 May 2006) | 1 line
Minor language edit
........
r45934 | georg.brandl | 2006-05-07 22:44:34 +0200 (Sun, 07 May 2006) | 3 lines
Patch #1483395: add new TLDs to cookielib
........
r45936 | martin.v.loewis | 2006-05-08 07:25:56 +0200 (Mon, 08 May 2006) | 2 lines
Add missing PyMem_Free.
........
r45938 | georg.brandl | 2006-05-08 19:28:47 +0200 (Mon, 08 May 2006) | 3 lines
Add test for rev. 45934.
........
r45939 | georg.brandl | 2006-05-08 19:36:08 +0200 (Mon, 08 May 2006) | 3 lines
Patch #1479302: Make urllib2 digest auth and basic auth play together.
........
r45940 | georg.brandl | 2006-05-08 19:48:01 +0200 (Mon, 08 May 2006) | 3 lines
Patch #1478993: take advantage of BaseException/Exception split in cookielib
........
r45941 | neal.norwitz | 2006-05-09 07:38:56 +0200 (Tue, 09 May 2006) | 5 lines
Micro optimization. In the first case, we know that frame->f_exc_type
is NULL, so there's no reason to do anything with it. In the second case,
we know frame->f_exc_type is not NULL, so we can just do an INCREF.
........
r45943 | thomas.heller | 2006-05-09 22:20:15 +0200 (Tue, 09 May 2006) | 2 lines
Disable a test that is unreliable.
........
r45944 | tim.peters | 2006-05-10 04:43:01 +0200 (Wed, 10 May 2006) | 4 lines
Variant of patch #1478292. doctest.register_optionflag(name)
shouldn't create a new flag when `name` is already the name of
an option flag.
........
r45947 | neal.norwitz | 2006-05-10 08:57:58 +0200 (Wed, 10 May 2006) | 14 lines
Fix problems found by Coverity.
longobject.c: also fix an ssize_t problem
<a> could have been NULL, so hoist the size calc to not use <a>.
_ssl.c: under fail: self is DECREF'd, but it would have been NULL.
_elementtree.c: delete self if there was an error.
_csv.c: I'm not sure if lineterminator could have been anything other than
a string. However, other string method calls are checked, so check this
one too.
........
r45948 | thomas.wouters | 2006-05-10 17:04:11 +0200 (Wed, 10 May 2006) | 4 lines
Ignore reflog.txt, too.
........
r45949 | georg.brandl | 2006-05-10 17:59:06 +0200 (Wed, 10 May 2006) | 3 lines
Bug #1482988: indicate more prominently that the Stats class is in the pstats module.
........
r45950 | georg.brandl | 2006-05-10 18:09:03 +0200 (Wed, 10 May 2006) | 2 lines
Bug #1485447: subprocess: document that the "cwd" parameter isn't used to find the executable. Misc. other markup fixes.
........
r45952 | georg.brandl | 2006-05-10 18:11:44 +0200 (Wed, 10 May 2006) | 2 lines
Bug #1484978: curses.panel: clarify that Panel objects are destroyed on garbage collection.
........
r45954 | georg.brandl | 2006-05-10 18:26:03 +0200 (Wed, 10 May 2006) | 4 lines
Patch #1484695: Update the tarfile module to version 0.8. This fixes
a couple of issues, notably handling of long file names using the
GNU LONGNAME extension.
........
r45955 | georg.brandl | 2006-05-10 19:13:20 +0200 (Wed, 10 May 2006) | 4 lines
Patch #721464: pdb.Pdb instances can now be given explicit stdin and
stdout arguments, making it possible to redirect input and output
for remote debugging.
........
r45956 | andrew.kuchling | 2006-05-10 19:19:04 +0200 (Wed, 10 May 2006) | 1 line
Clarify description of exception handling
........
r45957 | georg.brandl | 2006-05-10 22:09:23 +0200 (Wed, 10 May 2006) | 2 lines
Fix two small errors in argument lists.
........
r45960 | brett.cannon | 2006-05-11 07:11:33 +0200 (Thu, 11 May 2006) | 5 lines
Detect if %zd is supported by printf() during configure and sets
PY_FORMAT_SIZE_T appropriately. Removes warnings on
OS X under gcc 4.0.1 when PY_FORMAT_SIZE_T is set to "" instead of "z" as is
needed.
........
r45963 | neal.norwitz | 2006-05-11 09:51:59 +0200 (Thu, 11 May 2006) | 1 line
Don't mask a no memory error with a less meaningful one as discussed on python-checkins
........
r45964 | martin.v.loewis | 2006-05-11 15:28:43 +0200 (Thu, 11 May 2006) | 3 lines
Change WindowsError to carry the Win32 error code in winerror,
and the DOS error code in errno. Revert changes where
WindowsError catch blocks unnecessarily special-case OSError.
........
r45965 | george.yoshida | 2006-05-11 17:53:27 +0200 (Thu, 11 May 2006) | 2 lines
Grammar fix
........
r45967 | andrew.kuchling | 2006-05-11 18:32:24 +0200 (Thu, 11 May 2006) | 1 line
typo fix
........
r45968 | tim.peters | 2006-05-11 18:37:42 +0200 (Thu, 11 May 2006) | 5 lines
BaseThreadedTestCase.setup(): stop special-casing WindowsError.
Rev 45964 fiddled with WindowsError, and broke test_bsddb3 on all
the Windows buildbot slaves as a result. This should repair it.
........
r45969 | georg.brandl | 2006-05-11 21:57:09 +0200 (Thu, 11 May 2006) | 2 lines
Typo fix.
........
r45970 | tim.peters | 2006-05-12 03:57:59 +0200 (Fri, 12 May 2006) | 5 lines
SF patch #1473132: Improve docs for tp_clear and tp_traverse,
by Collin Winter.
Bugfix candidate (but I'm not going to bother).
........
r45974 | martin.v.loewis | 2006-05-12 14:27:28 +0200 (Fri, 12 May 2006) | 4 lines
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.
........
r45975 | martin.v.loewis | 2006-05-12 15:57:36 +0200 (Fri, 12 May 2006) | 1 line
Move icon files into DLLs dir. Fixes #1477968.
........
r45976 | george.yoshida | 2006-05-12 18:40:11 +0200 (Fri, 12 May 2006) | 2 lines
At first there were 6 steps, but one was removed after that.
........
r45977 | martin.v.loewis | 2006-05-12 19:22:04 +0200 (Fri, 12 May 2006) | 1 line
Fix alignment error on Itanium.
........
r45978 | george.yoshida | 2006-05-12 19:25:26 +0200 (Fri, 12 May 2006) | 3 lines
Duplicated description about the illegal continue usage can be found in nearly the same place.
They are same, so keep the original one and remove the later-added one.
........
r45980 | thomas.heller | 2006-05-12 20:16:03 +0200 (Fri, 12 May 2006) | 2 lines
Add missing svn properties.
........
r45981 | thomas.heller | 2006-05-12 20:47:35 +0200 (Fri, 12 May 2006) | 1 line
set svn properties
........
r45982 | thomas.heller | 2006-05-12 21:31:46 +0200 (Fri, 12 May 2006) | 1 line
add svn:eol-style native svn:keywords Id
........
r45987 | gerhard.haering | 2006-05-13 01:49:49 +0200 (Sat, 13 May 2006) | 3 lines
Integrated the rest of the pysqlite reference manual into the Python
documentation. Ready to be reviewed and improved upon.
........
r45988 | george.yoshida | 2006-05-13 08:53:31 +0200 (Sat, 13 May 2006) | 2 lines
Add \exception markup
........
r45990 | martin.v.loewis | 2006-05-13 15:34:04 +0200 (Sat, 13 May 2006) | 2 lines
Revert 43315: Printing of %zd must be signed.
........
r45992 | tim.peters | 2006-05-14 01:28:20 +0200 (Sun, 14 May 2006) | 11 lines
Teach PyString_FromFormat, PyErr_Format, and PyString_FromFormatV
about "%u", "%lu" and "%zu" formats.
Since PyString_FromFormat and PyErr_Format have exactly the same rules
(both inherited from PyString_FromFormatV), it would be good if someone
with more LaTeX Fu changed one of them to just point to the other.
Their docs were way out of synch before this patch, and I just did a
mass copy+paste to repair that.
Not a backport candidate (this is a new feature).
........
r45993 | tim.peters | 2006-05-14 01:31:05 +0200 (Sun, 14 May 2006) | 2 lines
Typo repair.
........
r45994 | tim.peters | 2006-05-14 01:33:19 +0200 (Sun, 14 May 2006) | 2 lines
Remove lie in new comment.
........
r45995 | ronald.oussoren | 2006-05-14 21:56:34 +0200 (Sun, 14 May 2006) | 11 lines
Rework the build system for osx applications:
* Don't use xcodebuild for building PythonLauncher, but use a normal unix
makefile. This makes it a lot easier to use the same build flags as for the
rest of python (e.g. make a universal version of python launcher)
* Convert the mac makefile-s to makefile.in-s and use configure to set makefile
variables instead of forwarding them as command-line arguments
* Add a C version of pythonw, that we you can use '#!/usr/local/bin/pythonw'
* Build IDLE.app using bundlebuilder instead of BuildApplet, that will allow
easier modification of the bundle contents later on.
........
r45996 | ronald.oussoren | 2006-05-14 22:35:41 +0200 (Sun, 14 May 2006) | 6 lines
A first cut at replacing the icons on MacOS X. This replaces all icons by icons
based on the new python.org logo. These are also the first icons that are
"proper" OSX icons.
These icons were created by Jacob Rus.
........
r45997 | ronald.oussoren | 2006-05-14 23:07:41 +0200 (Sun, 14 May 2006) | 3 lines
I missed one small detail in my rewrite of the osx build files: the path
to the Python.app template.
........
r45998 | martin.v.loewis | 2006-05-15 07:51:36 +0200 (Mon, 15 May 2006) | 2 lines
Fix memory leak.
........
r45999 | neal.norwitz | 2006-05-15 08:48:14 +0200 (Mon, 15 May 2006) | 1 line
Move items implemented after a2 into the new a3 section
........
r46000 | neal.norwitz | 2006-05-15 09:04:36 +0200 (Mon, 15 May 2006) | 5 lines
- Bug #1487966: Fix SystemError with conditional expression in assignment
Most of the test_syntax changes are just updating the numbers.
........
r46001 | neal.norwitz | 2006-05-15 09:17:23 +0200 (Mon, 15 May 2006) | 1 line
Patch #1488312, Fix memory alignment problem on SPARC in unicode. Will backport
........
r46003 | martin.v.loewis | 2006-05-15 11:22:27 +0200 (Mon, 15 May 2006) | 3 lines
Remove bogus DECREF of self.
Change __str__() functions to METH_O.
Change WindowsError__str__ to use PyTuple_Pack.
........
r46005 | georg.brandl | 2006-05-15 21:30:35 +0200 (Mon, 15 May 2006) | 3 lines
[ 1488881 ] tarfile.py: support for file-objects and bz2 (cp. #1488634)
........
r46007 | tim.peters | 2006-05-15 22:44:10 +0200 (Mon, 15 May 2006) | 9 lines
ReadDetectFileobjTest: repair Windows disasters by opening
the file object in binary mode.
The Windows buildbot slaves shouldn't swap themselves to death
anymore. However, test_tarfile may still fail because of a
temp directory left behind from a previous failing run.
Windows buildbot owners may need to remove that directory
by hand.
........
r46009 | tim.peters | 2006-05-15 23:32:25 +0200 (Mon, 15 May 2006) | 3 lines
test_directory(): Remove the leftover temp directory that's making
the Windows buildbots fail test_tarfile.
........
r46010 | martin.v.loewis | 2006-05-16 09:05:37 +0200 (Tue, 16 May 2006) | 4 lines
- 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
........
r46012 | georg.brandl | 2006-05-16 09:38:27 +0200 (Tue, 16 May 2006) | 3 lines
Patch #1435422: zlib's compress and decompress objects now have a
copy() method.
........
r46015 | andrew.kuchling | 2006-05-16 18:11:54 +0200 (Tue, 16 May 2006) | 1 line
Add item
........
r46016 | andrew.kuchling | 2006-05-16 18:27:31 +0200 (Tue, 16 May 2006) | 3 lines
PEP 243 has been withdrawn, so don't refer to it any more.
The PyPI upload material has been moved into the section on PEP314.
........
r46017 | george.yoshida | 2006-05-16 19:42:16 +0200 (Tue, 16 May 2006) | 2 lines
Update for 'ImportWarning'
........
r46018 | george.yoshida | 2006-05-16 20:07:00 +0200 (Tue, 16 May 2006) | 4 lines
Mention that Exception is now a subclass of BaseException.
Remove a sentence that says that BaseException inherits from BaseException.
(I guess this is just a copy & paste mistake.)
........
r46019 | george.yoshida | 2006-05-16 20:26:10 +0200 (Tue, 16 May 2006) | 2 lines
Document ImportWarning
........
r46020 | tim.peters | 2006-05-17 01:22:20 +0200 (Wed, 17 May 2006) | 2 lines
Whitespace normalization.
........
r46021 | tim.peters | 2006-05-17 01:24:08 +0200 (Wed, 17 May 2006) | 2 lines
Text files missing the SVN eol-style property.
........
r46022 | tim.peters | 2006-05-17 03:30:11 +0200 (Wed, 17 May 2006) | 2 lines
PyZlib_copy(), PyZlib_uncopy(): Repair leaks on the normal-case path.
........
r46023 | georg.brandl | 2006-05-17 16:06:07 +0200 (Wed, 17 May 2006) | 3 lines
Remove misleading comment about type-class unification.
........
r46024 | georg.brandl | 2006-05-17 16:11:36 +0200 (Wed, 17 May 2006) | 3 lines
Apply patch #1489784 from Michael Foord.
........
r46025 | georg.brandl | 2006-05-17 16:18:20 +0200 (Wed, 17 May 2006) | 3 lines
Fix typo in os.utime docstring (patch #1490189)
........
r46026 | georg.brandl | 2006-05-17 16:26:50 +0200 (Wed, 17 May 2006) | 3 lines
Patch #1490224: set time.altzone correctly on Cygwin.
........
r46027 | georg.brandl | 2006-05-17 16:45:06 +0200 (Wed, 17 May 2006) | 4 lines
Add global debug flag to cookielib to avoid heavy dependency on the logging module.
Resolves #1484758.
........
r46028 | georg.brandl | 2006-05-17 16:56:04 +0200 (Wed, 17 May 2006) | 3 lines
Patch #1486962: Several bugs in the turtle Tk demo module were fixed
and several features added, such as speed and geometry control.
........
r46029 | georg.brandl | 2006-05-17 17:17:00 +0200 (Wed, 17 May 2006) | 4 lines
Delay-import some large modules to speed up urllib2 import.
(fixes #1484793).
........
r46030 | georg.brandl | 2006-05-17 17:51:16 +0200 (Wed, 17 May 2006) | 3 lines
Patch #1180296: improve locale string formatting functions
........
r46032 | tim.peters | 2006-05-18 04:06:40 +0200 (Thu, 18 May 2006) | 2 lines
Whitespace normalization.
........
r46033 | georg.brandl | 2006-05-18 08:11:19 +0200 (Thu, 18 May 2006) | 3 lines
Amendments to patch #1484695.
........
r46034 | georg.brandl | 2006-05-18 08:18:06 +0200 (Thu, 18 May 2006) | 3 lines
Remove unused import.
........
r46035 | georg.brandl | 2006-05-18 08:33:27 +0200 (Thu, 18 May 2006) | 3 lines
Fix test_locale for platforms without a default thousands separator.
........
r46036 | neal.norwitz | 2006-05-18 08:51:46 +0200 (Thu, 18 May 2006) | 1 line
Little cleanup
........
r46037 | georg.brandl | 2006-05-18 09:01:27 +0200 (Thu, 18 May 2006) | 4 lines
Bug #1462152: file() now checks more thoroughly for invalid mode
strings and removes a possible "U" before passing the mode to the
C library function.
........
r46038 | georg.brandl | 2006-05-18 09:20:05 +0200 (Thu, 18 May 2006) | 3 lines
Bug #1490688: properly document %e, %f, %g format subtleties.
........
r46039 | vinay.sajip | 2006-05-18 09:28:58 +0200 (Thu, 18 May 2006) | 1 line
Changed status from "beta" to "production"; since logging has been part of the stdlib since 2.3, it should be safe to make this assertion ;-)
........
r46040 | ronald.oussoren | 2006-05-18 11:04:15 +0200 (Thu, 18 May 2006) | 2 lines
Fix some minor issues with the generated application bundles on MacOSX
........
r46041 | andrew.kuchling | 2006-05-19 02:03:55 +0200 (Fri, 19 May 2006) | 1 line
Typo fix; add clarifying word
........
r46044 | neal.norwitz | 2006-05-19 08:31:23 +0200 (Fri, 19 May 2006) | 3 lines
Fix #132 from Coverity, retval could have been derefed
if a continue inside a try failed.
........
r46045 | neal.norwitz | 2006-05-19 08:43:50 +0200 (Fri, 19 May 2006) | 2 lines
Fix #1474677, non-keyword argument following keyword.
........
r46046 | neal.norwitz | 2006-05-19 09:00:58 +0200 (Fri, 19 May 2006) | 4 lines
Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
I suppose this could be backported if anyone cares.
........
r46047 | neal.norwitz | 2006-05-19 09:05:01 +0200 (Fri, 19 May 2006) | 7 lines
Oops, I forgot to include this file in the last commit (46046):
Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
I suppose this could be backported if anyone cares.
........
r46050 | ronald.oussoren | 2006-05-19 20:17:31 +0200 (Fri, 19 May 2006) | 6 lines
* Change working directory to the users home
directory, that makes the file open/save
dialogs more useable.
* Don't use argv emulator, its not needed
for idle.
........
r46052 | tim.peters | 2006-05-19 21:16:34 +0200 (Fri, 19 May 2006) | 2 lines
Whitespace normalization.
........
r46054 | ronald.oussoren | 2006-05-20 08:17:01 +0200 (Sat, 20 May 2006) | 9 lines
Fix bug #1000914 (again).
This patches a file that is generated by bgen, however the code is now the
same as a current copy of bgen would generate. Without this patch most types
in the Carbon.CF module are unusable.
I haven't managed to coax bgen into generating a complete copy of _CFmodule.c
yet :-(, hence the manual patching.
........
r46055 | george.yoshida | 2006-05-20 17:36:19 +0200 (Sat, 20 May 2006) | 3 lines
- markup fix
- add clarifying words
........
r46057 | george.yoshida | 2006-05-20 18:29:14 +0200 (Sat, 20 May 2006) | 3 lines
- Add 'as' and 'with' as new keywords in 2.5.
- Regenerate keyword lists with reswords.py.
........
r46058 | george.yoshida | 2006-05-20 20:07:26 +0200 (Sat, 20 May 2006) | 2 lines
Apply patch #1492147 from Mike Foord.
........
r46059 | andrew.kuchling | 2006-05-20 21:25:16 +0200 (Sat, 20 May 2006) | 1 line
Minor edits
........
r46061 | george.yoshida | 2006-05-21 06:22:59 +0200 (Sun, 21 May 2006) | 2 lines
Fix the TeX compile error.
........
r46062 | george.yoshida | 2006-05-21 06:40:32 +0200 (Sun, 21 May 2006) | 2 lines
Apply patch #1492255 from Mike Foord.
........
r46063 | martin.v.loewis | 2006-05-22 10:48:14 +0200 (Mon, 22 May 2006) | 1 line
Patch 1490384: New Icons for the PC build.
........
r46064 | martin.v.loewis | 2006-05-22 11:15:18 +0200 (Mon, 22 May 2006) | 1 line
Patch #1492356: Port to Windows CE (patch set 1).
........
r46065 | tim.peters | 2006-05-22 13:29:41 +0200 (Mon, 22 May 2006) | 4 lines
Define SIZEOF_{DOUBLE,FLOAT} on Windows. Else
Michael Hudson's nice gimmicks for IEEE special
values (infinities, NaNs) don't work.
........
r46070 | bob.ippolito | 2006-05-22 16:31:24 +0200 (Mon, 22 May 2006) | 2 lines
GzipFile.readline performance improvement (~30-40%), patch #1281707
........
r46071 | bob.ippolito | 2006-05-22 17:22:46 +0200 (Mon, 22 May 2006) | 1 line
Revert gzip readline performance patch #1281707 until a more generic performance improvement can be found
........
r46073 | fredrik.lundh | 2006-05-22 17:35:12 +0200 (Mon, 22 May 2006) | 4 lines
docstring tweaks: count counts non-overlapping substrings, not
total number of occurences
........
r46075 | bob.ippolito | 2006-05-22 17:59:12 +0200 (Mon, 22 May 2006) | 1 line
Apply revised patch for GzipFile.readline performance #1281707
........
r46076 | fredrik.lundh | 2006-05-22 18:29:30 +0200 (Mon, 22 May 2006) | 3 lines
needforspeed: speed up unicode repeat, unicode string copy
........
r46079 | fredrik.lundh | 2006-05-22 19:12:58 +0200 (Mon, 22 May 2006) | 4 lines
needforspeed: use memcpy for "long" strings; use a better algorithm
for long repeats.
........
r46084 | tim.peters | 2006-05-22 21:17:04 +0200 (Mon, 22 May 2006) | 7 lines
PyUnicode_Join(): Recent code changes introduced new
compiler warnings on Windows (signed vs unsigned mismatch
in comparisons). Cleaned that up by switching more locals
to Py_ssize_t. Simplified overflow checking (it can _be_
simpler because while these things are declared as
Py_ssize_t, then should in fact never be negative).
........
r46085 | tim.peters | 2006-05-23 07:47:16 +0200 (Tue, 23 May 2006) | 3 lines
unicode_repeat(): Change type of local to Py_ssize_t,
since that's what it should be.
........
r46094 | fredrik.lundh | 2006-05-23 12:10:57 +0200 (Tue, 23 May 2006) | 3 lines
needforspeed: check first *and* last character before doing a full memcmp
........
r46095 | fredrik.lundh | 2006-05-23 12:12:21 +0200 (Tue, 23 May 2006) | 4 lines
needforspeed: fixed unicode "in" operator to use same implementation
approach as find/index
........
r46096 | richard.jones | 2006-05-23 12:37:38 +0200 (Tue, 23 May 2006) | 7 lines
Merge from rjones-funccall branch.
Applied patch zombie-frames-2.diff from sf patch 876206 with updates for
Python 2.5 and also modified to retain the free_list to avoid the 67%
slow-down in pybench recursion test. 5% speed up in function call pybench.
........
r46098 | ronald.oussoren | 2006-05-23 13:04:24 +0200 (Tue, 23 May 2006) | 2 lines
Avoid creating a mess when installing a framework for the second time.
........
r46101 | georg.brandl | 2006-05-23 13:17:21 +0200 (Tue, 23 May 2006) | 3 lines
PyErr_NewException now accepts a tuple of base classes as its
"base" parameter.
........
r46103 | ronald.oussoren | 2006-05-23 13:47:16 +0200 (Tue, 23 May 2006) | 3 lines
Disable linking extensions with -lpython2.5 for darwin. This should fix bug
#1487105.
........
r46104 | ronald.oussoren | 2006-05-23 14:01:11 +0200 (Tue, 23 May 2006) | 6 lines
Patch #1488098.
This patchs makes it possible to create a universal build on OSX 10.4 and use
the result to build extensions on 10.3. It also makes it possible to override
the '-arch' and '-isysroot' compiler arguments for specific extensions.
........
r46108 | andrew.kuchling | 2006-05-23 14:44:36 +0200 (Tue, 23 May 2006) | 1 line
Add some items; mention the sprint
........
r46109 | andrew.kuchling | 2006-05-23 14:47:01 +0200 (Tue, 23 May 2006) | 1 line
Mention string improvements
........
r46110 | andrew.kuchling | 2006-05-23 14:49:35 +0200 (Tue, 23 May 2006) | 4 lines
Use 'speed' instead of 'performance', because I agree with the argument
at http://zestyping.livejournal.com/193260.html that 'erformance' really means
something more general.
........
r46113 | ronald.oussoren | 2006-05-23 17:09:57 +0200 (Tue, 23 May 2006) | 2 lines
An improved script for building the binary distribution on MacOSX.
........
r46128 | richard.jones | 2006-05-23 20:28:17 +0200 (Tue, 23 May 2006) | 3 lines
Applied patch 1337051 by Neal Norwitz, saving 4 ints on frame objects.
........
r46129 | richard.jones | 2006-05-23 20:32:11 +0200 (Tue, 23 May 2006) | 1 line
fix broken merge
........
r46130 | bob.ippolito | 2006-05-23 20:41:17 +0200 (Tue, 23 May 2006) | 1 line
Update Misc/NEWS for gzip patch #1281707
........
r46131 | bob.ippolito | 2006-05-23 20:43:47 +0200 (Tue, 23 May 2006) | 1 line
Update Misc/NEWS for gzip patch #1281707
........
r46132 | fredrik.lundh | 2006-05-23 20:44:25 +0200 (Tue, 23 May 2006) | 7 lines
needforspeed: use append+reverse for rsplit, use "bloom filters" to
speed up splitlines and strip with charsets; etc. rsplit is now as
fast as split in all our tests (reverse takes no time at all), and
splitlines() is nearly as fast as a plain split("\n") in our tests.
and we're not done yet... ;-)
........
r46133 | tim.peters | 2006-05-23 20:45:30 +0200 (Tue, 23 May 2006) | 38 lines
Bug #1334662 / patch #1335972: int(string, base) wrong answers.
In rare cases of strings specifying true values near sys.maxint,
and oddball bases (not decimal or a power of 2), int(string, base)
could deliver insane answers. This repairs all such problems, and
also speeds string->int significantly. On my box, here are %
speedups for decimal strings of various lengths:
length speedup
------ -------
1 12.4%
2 15.7%
3 20.6%
4 28.1%
5 33.2%
6 37.5%
7 41.9%
8 46.3%
9 51.2%
10 19.5%
11 19.9%
12 23.9%
13 23.7%
14 23.3%
15 24.9%
16 25.3%
17 28.3%
18 27.9%
19 35.7%
Note that the difference between 9 and 10 is the difference between
short and long Python ints on a 32-bit box. The patch doesn't
actually do anything to speed conversion to long: the speedup is
due to detecting "unsigned long" overflow more quickly.
This is a bugfix candidate, but it's a non-trivial patch and it
would be painful to separate the "bug fix" from the "speed up" parts.
........
r46134 | bob.ippolito | 2006-05-23 20:46:41 +0200 (Tue, 23 May 2006) | 1 line
Patch #1493701: performance enhancements for struct module.
........
r46136 | andrew.kuchling | 2006-05-23 21:00:45 +0200 (Tue, 23 May 2006) | 1 line
Remove duplicate item
........
r46141 | bob.ippolito | 2006-05-23 21:09:51 +0200 (Tue, 23 May 2006) | 1 line
revert #1493701
........
r46142 | bob.ippolito | 2006-05-23 21:11:34 +0200 (Tue, 23 May 2006) | 1 line
patch #1493701: performance enhancements for struct module
........
r46144 | bob.ippolito | 2006-05-23 21:12:41 +0200 (Tue, 23 May 2006) | 1 line
patch #1493701: performance enhancements for struct module
........
r46148 | bob.ippolito | 2006-05-23 21:25:52 +0200 (Tue, 23 May 2006) | 1 line
fix linking issue, warnings, in struct
........
r46149 | andrew.kuchling | 2006-05-23 21:29:38 +0200 (Tue, 23 May 2006) | 1 line
Add two items
........
r46150 | bob.ippolito | 2006-05-23 21:31:23 +0200 (Tue, 23 May 2006) | 1 line
forward declaration for PyStructType
........
r46151 | bob.ippolito | 2006-05-23 21:32:25 +0200 (Tue, 23 May 2006) | 1 line
fix typo in _struct
........
r46152 | andrew.kuchling | 2006-05-23 21:32:35 +0200 (Tue, 23 May 2006) | 1 line
Add item
........
r46153 | tim.peters | 2006-05-23 21:34:37 +0200 (Tue, 23 May 2006) | 3 lines
Get the Windows build working again (recover from
`struct` module changes).
........
r46155 | fredrik.lundh | 2006-05-23 21:47:35 +0200 (Tue, 23 May 2006) | 3 lines
return 0 on misses, not -1.
........
r46156 | tim.peters | 2006-05-23 23:51:35 +0200 (Tue, 23 May 2006) | 4 lines
test_struct grew weird behavior under regrtest.py -R,
due to a module-level cache. Clearing the cache should
make it stop showing up in refleak reports.
........
r46157 | tim.peters | 2006-05-23 23:54:23 +0200 (Tue, 23 May 2006) | 2 lines
Whitespace normalization.
........
r46158 | tim.peters | 2006-05-23 23:55:53 +0200 (Tue, 23 May 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46161 | fredrik.lundh | 2006-05-24 12:20:36 +0200 (Wed, 24 May 2006) | 3 lines
use Py_ssize_t for string indexes (thanks, neal!)
........
r46173 | fredrik.lundh | 2006-05-24 16:28:11 +0200 (Wed, 24 May 2006) | 14 lines
needforspeed: use "fastsearch" for count and findstring helpers. this
results in a 2.5x speedup on the stringbench count tests, and a 20x (!)
speedup on the stringbench search/find/contains test, compared to 2.5a2.
for more on the algorithm, see:
http://effbot.org/zone/stringlib.htm
if you get weird results, you can disable the new algoritm by undefining
USE_FAST in Objects/unicodeobject.c.
enjoy /F
........
r46182 | fredrik.lundh | 2006-05-24 17:11:01 +0200 (Wed, 24 May 2006) | 3 lines
needforspeedindeed: use fastsearch also for __contains__
........
r46184 | bob.ippolito | 2006-05-24 17:32:06 +0200 (Wed, 24 May 2006) | 1 line
refactor unpack, add unpack_from
........
r46189 | fredrik.lundh | 2006-05-24 18:35:18 +0200 (Wed, 24 May 2006) | 4 lines
needforspeed: refactored the replace code slightly; special-case
constant-length changes; use fastsearch to locate the first match.
........
r46198 | andrew.dalke | 2006-05-24 20:55:37 +0200 (Wed, 24 May 2006) | 10 lines
Added a slew of test for string replace, based various corner cases from
the Need For Speed sprint coding. Includes commented out overflow tests
which will be uncommented once the code is fixed.
This test will break the 8-bit string tests because
"".replace("", "A") == "" when it should == "A"
We have a fix for it, which should be added tomorrow.
........
r46200 | tim.peters | 2006-05-24 22:27:18 +0200 (Wed, 24 May 2006) | 2 lines
We can't leave the checked-in tests broken.
........
r46201 | tim.peters | 2006-05-24 22:29:44 +0200 (Wed, 24 May 2006) | 2 lines
Whitespace normalization.
........
r46202 | tim.peters | 2006-05-24 23:00:45 +0200 (Wed, 24 May 2006) | 4 lines
Disable the damn empty-string replace test -- it can't
be make to pass now for unicode if it passes for str, or
vice versa.
........
r46203 | tim.peters | 2006-05-24 23:10:40 +0200 (Wed, 24 May 2006) | 58 lines
Heavily fiddled variant of patch #1442927: PyLong_FromString optimization.
``long(str, base)`` is now up to 6x faster for non-power-of-2 bases. The
largest speedup is for inputs with about 1000 decimal digits. Conversion
from non-power-of-2 bases remains quadratic-time in the number of input
digits (it was and remains linear-time for bases 2, 4, 8, 16 and 32).
Speedups at various lengths for decimal inputs, comparing 2.4.3 with
current trunk. Note that it's actually a bit slower for 1-digit strings:
len speedup
---- -------
1 -4.5%
2 4.6%
3 8.3%
4 12.7%
5 16.9%
6 28.6%
7 35.5%
8 44.3%
9 46.6%
10 55.3%
11 65.7%
12 77.7%
13 73.4%
14 75.3%
15 85.2%
16 103.0%
17 95.1%
18 112.8%
19 117.9%
20 128.3%
30 174.5%
40 209.3%
50 236.3%
60 254.3%
70 262.9%
80 295.8%
90 297.3%
100 324.5%
200 374.6%
300 403.1%
400 391.1%
500 388.7%
600 440.6%
700 468.7%
800 498.0%
900 507.2%
1000 501.2%
2000 450.2%
3000 463.2%
4000 452.5%
5000 440.6%
6000 439.6%
7000 424.8%
8000 418.1%
9000 417.7%
........
r46204 | andrew.kuchling | 2006-05-25 02:23:03 +0200 (Thu, 25 May 2006) | 1 line
Minor edits; add an item
........
r46205 | fred.drake | 2006-05-25 04:42:25 +0200 (Thu, 25 May 2006) | 3 lines
fix broken links in PDF
(SF patch #1281291, contributed by Rory Yorke)
........
r46208 | walter.doerwald | 2006-05-25 10:53:28 +0200 (Thu, 25 May 2006) | 2 lines
Replace tab inside comment with space.
........
r46209 | thomas.wouters | 2006-05-25 13:25:51 +0200 (Thu, 25 May 2006) | 4 lines
Fix #1488915, Multiple dots in relative import statement raise SyntaxError.
........
r46210 | thomas.wouters | 2006-05-25 13:26:25 +0200 (Thu, 25 May 2006) | 5 lines
Update graminit.c for the fix for #1488915, Multiple dots in relative import
statement raise SyntaxError, and add testcase.
........
r46211 | andrew.kuchling | 2006-05-25 14:27:59 +0200 (Thu, 25 May 2006) | 1 line
Add entry; and fix a typo
........
r46214 | fredrik.lundh | 2006-05-25 17:22:03 +0200 (Thu, 25 May 2006) | 7 lines
needforspeed: speed up upper and lower for 8-bit string objects.
(the unicode versions of these are still 2x faster on windows,
though...)
based on work by Andrew Dalke, with tweaks by yours truly.
........
r46216 | fredrik.lundh | 2006-05-25 17:49:45 +0200 (Thu, 25 May 2006) | 5 lines
needforspeed: make new upper/lower work properly for single-character
strings too... (thanks to georg brandl for spotting the exact problem
faster than anyone else)
........
r46217 | kristjan.jonsson | 2006-05-25 17:53:30 +0200 (Thu, 25 May 2006) | 1 line
Added a new macro, Py_IS_FINITE(X). On windows there is an intrinsic for this and it is more efficient than to use !Py_IS_INFINITE(X) && !Py_IS_NAN(X). No change on other platforms
........
r46219 | fredrik.lundh | 2006-05-25 18:10:12 +0200 (Thu, 25 May 2006) | 4 lines
needforspeed: _toupper/_tolower is a SUSv2 thing; fall back on ISO C
versions if they're not defined.
........
r46220 | andrew.kuchling | 2006-05-25 18:23:15 +0200 (Thu, 25 May 2006) | 1 line
Fix comment typos
........
r46221 | andrew.dalke | 2006-05-25 18:30:52 +0200 (Thu, 25 May 2006) | 2 lines
Added tests for implementation error we came up with in the need for speed sprint.
........
r46222 | andrew.kuchling | 2006-05-25 18:34:54 +0200 (Thu, 25 May 2006) | 1 line
Fix another typo
........
r46223 | kristjan.jonsson | 2006-05-25 18:39:27 +0200 (Thu, 25 May 2006) | 1 line
Fix incorrect documentation for the Py_IS_FINITE(X) macro.
........
r46224 | fredrik.lundh | 2006-05-25 18:46:54 +0200 (Thu, 25 May 2006) | 3 lines
needforspeed: check for overflow in replace (from Andrew Dalke)
........
r46226 | fredrik.lundh | 2006-05-25 19:08:14 +0200 (Thu, 25 May 2006) | 5 lines
needforspeed: new replace implementation by Andrew Dalke. replace is
now about 3x faster on my machine, for the replace tests from string-
bench.
........
r46227 | tim.peters | 2006-05-25 19:34:03 +0200 (Thu, 25 May 2006) | 5 lines
A new table to help string->integer conversion was added yesterday to
both mystrtoul.c and longobject.c. Share the table instead. Also
cut its size by 64 entries (they had been used for an inscrutable
trick originally, but the code no longer tries to use that trick).
........
r46229 | andrew.dalke | 2006-05-25 19:53:00 +0200 (Thu, 25 May 2006) | 11 lines
Fixed problem identified by Georg. The special-case in-place code for replace
made a copy of the string using PyString_FromStringAndSize(s, n) and modify
the copied string in-place. However, 1 (and 0) character strings are shared
from a cache. This cause "A".replace("A", "a") to change the cached version
of "A" -- used by everyone.
Now may the copy with NULL as the string and do the memcpy manually. I've
added regression tests to check if this happens in the future. Perhaps
there should be a PyString_Copy for this case?
........
r46230 | fredrik.lundh | 2006-05-25 19:55:31 +0200 (Thu, 25 May 2006) | 4 lines
needforspeed: use "fastsearch" for count. this results in a 3x speedup
for the related stringbench tests.
........
r46231 | andrew.dalke | 2006-05-25 20:03:25 +0200 (Thu, 25 May 2006) | 4 lines
Code had returned an ssize_t, upcast to long, then converted with PyInt_FromLong.
Now using PyInt_FromSsize_t.
........
r46233 | andrew.kuchling | 2006-05-25 20:11:16 +0200 (Thu, 25 May 2006) | 1 line
Comment typo
........
r46234 | andrew.dalke | 2006-05-25 20:18:39 +0200 (Thu, 25 May 2006) | 4 lines
Added overflow test for adding two (very) large strings where the
new string is over max Py_ssize_t. I have no way to test it on my
box or any box I have access to. At least it doesn't break anything.
........
r46235 | bob.ippolito | 2006-05-25 20:20:23 +0200 (Thu, 25 May 2006) | 1 line
Faster path for PyLong_FromLongLong, using PyLong_FromLong algorithm
........
r46238 | georg.brandl | 2006-05-25 20:44:09 +0200 (Thu, 25 May 2006) | 3 lines
Guard the _active.remove() call to avoid errors when there is no _active list.
........
r46239 | fredrik.lundh | 2006-05-25 20:44:29 +0200 (Thu, 25 May 2006) | 4 lines
needforspeed: use fastsearch also for find/index and contains. the
related tests are now about 10x faster.
........
r46240 | bob.ippolito | 2006-05-25 20:44:50 +0200 (Thu, 25 May 2006) | 1 line
Struct now unpacks to PY_LONG_LONG directly when possible, also include #ifdef'ed out code that will return int instead of long when in bounds (not active since it's an API and doc change)
........
r46241 | jack.diederich | 2006-05-25 20:47:15 +0200 (Thu, 25 May 2006) | 1 line
* eliminate warning by reverting tmp_s type to 'const char*'
........
r46242 | bob.ippolito | 2006-05-25 21:03:19 +0200 (Thu, 25 May 2006) | 1 line
Fix Cygwin compiler issue
........
r46243 | bob.ippolito | 2006-05-25 21:15:27 +0200 (Thu, 25 May 2006) | 1 line
fix a struct regression where long would be returned for short unsigned integers
........
r46244 | georg.brandl | 2006-05-25 21:15:31 +0200 (Thu, 25 May 2006) | 4 lines
Replace PyObject_CallFunction calls with only object args
with PyObject_CallFunctionObjArgs, which is 30% faster.
........
r46245 | fredrik.lundh | 2006-05-25 21:19:05 +0200 (Thu, 25 May 2006) | 3 lines
needforspeed: use insert+reverse instead of append
........
r46246 | bob.ippolito | 2006-05-25 21:33:38 +0200 (Thu, 25 May 2006) | 1 line
Use LONG_MIN and LONG_MAX to check Python integer bounds instead of the incorrect INT_MIN and INT_MAX
........
r46248 | bob.ippolito | 2006-05-25 21:56:56 +0200 (Thu, 25 May 2006) | 1 line
Use faster struct pack/unpack functions for the endian table that matches the host's
........
r46249 | bob.ippolito | 2006-05-25 21:59:56 +0200 (Thu, 25 May 2006) | 1 line
enable darwin/x86 support for libffi and hence ctypes (doesn't yet support --enable-universalsdk)
........
r46252 | georg.brandl | 2006-05-25 22:28:10 +0200 (Thu, 25 May 2006) | 4 lines
Someone seems to just have copy-pasted the docs of
tp_compare to tp_richcompare ;)
........
r46253 | brett.cannon | 2006-05-25 22:44:08 +0200 (Thu, 25 May 2006) | 2 lines
Swap out bare malloc()/free() use for PyMem_MALLOC()/PyMem_FREE() .
........
r46254 | bob.ippolito | 2006-05-25 22:52:38 +0200 (Thu, 25 May 2006) | 1 line
squelch gcc4 darwin/x86 compiler warnings
........
r46255 | bob.ippolito | 2006-05-25 23:09:45 +0200 (Thu, 25 May 2006) | 1 line
fix test_float regression and 64-bit size mismatch issue
........
r46256 | georg.brandl | 2006-05-25 23:11:56 +0200 (Thu, 25 May 2006) | 3 lines
Add a x-ref to newer calling APIs.
........
r46257 | ronald.oussoren | 2006-05-25 23:30:54 +0200 (Thu, 25 May 2006) | 2 lines
Fix minor typo in prep_cif.c
........
r46259 | brett.cannon | 2006-05-25 23:33:11 +0200 (Thu, 25 May 2006) | 4 lines
Change test_values so that it compares the lowercasing of group names since getgrall() can return all lowercase names while getgrgid() returns proper casing.
Discovered on Ubuntu 5.04 (custom).
........
r46261 | tim.peters | 2006-05-25 23:50:17 +0200 (Thu, 25 May 2006) | 7 lines
Some Win64 pre-release in 2000 didn't support
QueryPerformanceCounter(), but we believe Win64 does
support it now. So use in time.clock().
It would be peachy if someone with a Win64 box tried
this ;-)
........
r46262 | tim.peters | 2006-05-25 23:52:19 +0200 (Thu, 25 May 2006) | 2 lines
Whitespace normalization.
........
r46263 | bob.ippolito | 2006-05-25 23:58:05 +0200 (Thu, 25 May 2006) | 1 line
Add missing files from x86 darwin ctypes patch
........
r46264 | brett.cannon | 2006-05-26 00:00:14 +0200 (Fri, 26 May 2006) | 2 lines
Move over to use of METH_O and METH_NOARGS.
........
r46265 | tim.peters | 2006-05-26 00:25:25 +0200 (Fri, 26 May 2006) | 3 lines
Repair idiot typo, and complete the job of trying to
use the Windows time.clock() implementation on Win64.
........
r46266 | tim.peters | 2006-05-26 00:28:46 +0200 (Fri, 26 May 2006) | 9 lines
Patch #1494387: SVN longobject.c compiler warnings
The SIGCHECK macro defined here has always been bizarre, but
it apparently causes compiler warnings on "Sun Studio 11".
I believe the warnings are bogus, but it doesn't hurt to make
the macro definition saner.
Bugfix candidate (but I'm not going to bother).
........
r46268 | fredrik.lundh | 2006-05-26 01:27:53 +0200 (Fri, 26 May 2006) | 8 lines
needforspeed: partition for 8-bit strings. for some simple tests,
this is on par with a corresponding find, and nearly twice as fast
as split(sep, 1)
full tests, a unicode version, and documentation will follow to-
morrow.
........
r46271 | andrew.kuchling | 2006-05-26 03:46:22 +0200 (Fri, 26 May 2006) | 1 line
Add Soc student
........
r46272 | ronald.oussoren | 2006-05-26 10:41:25 +0200 (Fri, 26 May 2006) | 3 lines
Without this patch OSX users couldn't add new help sources because the code
tried to update one item in a tuple.
........
r46273 | fredrik.lundh | 2006-05-26 10:54:28 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: partition implementation, part two.
feel free to improve the documentation and the docstrings.
........
r46274 | georg.brandl | 2006-05-26 11:05:54 +0200 (Fri, 26 May 2006) | 3 lines
Clarify docs for str.partition().
........
r46278 | fredrik.lundh | 2006-05-26 11:46:59 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: use METH_O for argument handling, which made partition some
~15% faster for the current tests (which is noticable faster than a corre-
sponding find call). thanks to neal-who-never-sleeps for the tip.
........
r46280 | fredrik.lundh | 2006-05-26 12:27:17 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: use Py_ssize_t for the fastsearch counter and skip
length (thanks, neal!). and yes, I've verified that this doesn't
slow things down ;-)
........
r46285 | andrew.dalke | 2006-05-26 13:11:38 +0200 (Fri, 26 May 2006) | 2 lines
Added a few more test cases for whitespace split. These strings have leading whitespace.
........
r46286 | jack.diederich | 2006-05-26 13:15:17 +0200 (Fri, 26 May 2006) | 1 line
use Py_ssize_t in places that may need it
........
r46287 | andrew.dalke | 2006-05-26 13:15:22 +0200 (Fri, 26 May 2006) | 2 lines
Added split whitespace checks for characters other than space.
........
r46288 | ronald.oussoren | 2006-05-26 13:17:55 +0200 (Fri, 26 May 2006) | 2 lines
Fix buglet in postinstall script, it would generate an invalid .cshrc file.
........
r46290 | georg.brandl | 2006-05-26 13:26:11 +0200 (Fri, 26 May 2006) | 3 lines
Add "partition" to UserString.
........
r46291 | fredrik.lundh | 2006-05-26 13:29:39 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: added Py_LOCAL macro, based on the LOCAL macro used
for SRE and others. applied Py_LOCAL to relevant portion of ceval,
which gives a 1-2% speedup on my machine. ymmv.
........
r46292 | jack.diederich | 2006-05-26 13:37:20 +0200 (Fri, 26 May 2006) | 1 line
when generating python code prefer to generate valid python code
........
r46293 | fredrik.lundh | 2006-05-26 13:38:15 +0200 (Fri, 26 May 2006) | 3 lines
use Py_LOCAL also for string and unicode objects
........
r46294 | ronald.oussoren | 2006-05-26 13:38:39 +0200 (Fri, 26 May 2006) | 12 lines
- Search the sqlite specific search directories
after the normal include directories when looking
for the version of sqlite to use.
- On OSX:
* Extract additional include and link directories
from the CFLAGS and LDFLAGS, if the user has
bothered to specify them we might as wel use them.
* Add '-Wl,-search_paths_first' to the extra_link_args
for readline and sqlite. This makes it possible to
use a static library to override the system provided
dynamic library.
........
r46295 | ronald.oussoren | 2006-05-26 13:43:26 +0200 (Fri, 26 May 2006) | 6 lines
Integrate installing a framework in the 'make install'
target. Until now users had to use 'make frameworkinstall'
to install python when it is configured with '--enable-framework'.
This tends to confuse users that don't hunt for readme files
hidden in platform specific directories :-)
........
r46297 | fredrik.lundh | 2006-05-26 13:54:04 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: added PY_LOCAL_AGGRESSIVE macro to enable "aggressive"
LOCAL inlining; also added some missing whitespace
........
r46298 | andrew.kuchling | 2006-05-26 14:01:44 +0200 (Fri, 26 May 2006) | 1 line
Typo fixes
........
r46299 | fredrik.lundh | 2006-05-26 14:01:49 +0200 (Fri, 26 May 2006) | 4 lines
Py_LOCAL shouldn't be used for data; it works for some .NET 2003 compilers,
but Trent's copy thinks that it's an anachronism...
........
r46300 | martin.blais | 2006-05-26 14:03:27 +0200 (Fri, 26 May 2006) | 12 lines
Support for buffer protocol for socket and struct.
* Added socket.recv_buf() and socket.recvfrom_buf() methods, that use the buffer
protocol (send and sendto already did).
* Added struct.pack_to(), that is the corresponding buffer compatible method to
unpack_from().
* Fixed minor typos in arraymodule.
........
r46302 | ronald.oussoren | 2006-05-26 14:23:20 +0200 (Fri, 26 May 2006) | 6 lines
- Remove previous version of the binary distribution script for OSX
- Some small bugfixes for the IDLE.app wrapper
- Tweaks to build-installer to ensure that python gets build in the right way,
including sqlite3.
- Updated readme files
........
r46305 | tim.peters | 2006-05-26 14:26:21 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46307 | andrew.dalke | 2006-05-26 14:28:15 +0200 (Fri, 26 May 2006) | 7 lines
I like tests.
The new split functions use a preallocated list. Added tests which exceed
the preallocation size, to exercise list appends/resizes.
Also added more edge case tests.
........
r46308 | andrew.dalke | 2006-05-26 14:31:00 +0200 (Fri, 26 May 2006) | 2 lines
Test cases for off-by-one errors in string split with multicharacter pattern.
........
r46309 | tim.peters | 2006-05-26 14:31:20 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46313 | andrew.kuchling | 2006-05-26 14:39:48 +0200 (Fri, 26 May 2006) | 1 line
Add str.partition()
........
r46314 | bob.ippolito | 2006-05-26 14:52:53 +0200 (Fri, 26 May 2006) | 1 line
quick hack to fix busted binhex test
........
r46316 | andrew.dalke | 2006-05-26 15:05:55 +0200 (Fri, 26 May 2006) | 2 lines
Added more rstrip tests, including for prealloc'ed arrays
........
r46320 | bob.ippolito | 2006-05-26 15:15:44 +0200 (Fri, 26 May 2006) | 1 line
fix #1229380 No struct.pack exception for some out of range integers
........
r46325 | tim.peters | 2006-05-26 15:39:17 +0200 (Fri, 26 May 2006) | 2 lines
Use open() to open files (was using file()).
........
r46327 | andrew.dalke | 2006-05-26 16:00:45 +0200 (Fri, 26 May 2006) | 37 lines
Changes to string.split/rsplit on whitespace to preallocate space in the
results list.
Originally it allocated 0 items and used the list growth during append. Now
it preallocates 12 items so the first few appends don't need list reallocs.
("Here are some words ."*2).split(None, 1) is 7% faster
("Here are some words ."*2).split() is is 15% faster
(Your milage may vary, see dealership for details.)
File parsing like this
for line in f:
count += len(line.split())
is also about 15% faster. There is a slowdown of about 3% for large
strings because of the additional overhead of checking if the append is
to a preallocated region of the list or not. This will be the rare case.
It could be improved with special case code but we decided it was not
useful enough.
There is a cost of 12*sizeof(PyObject *) bytes per list. For the normal
case of file parsing this is not a problem because of the lists have
a short lifetime. We have not come up with cases where this is a problem
in real life.
I chose 12 because human text averages about 11 words per line in books,
one of my data sets averages 6.2 words with a final peak at 11 words per
line, and I work with a tab delimited data set with 8 tabs per line (or
9 words per line). 12 encompasses all of these.
Also changed the last rstrip code to append then reverse, rather than
doing insert(0). The strip() and rstrip() times are now comparable.
........
r46328 | tim.peters | 2006-05-26 16:02:05 +0200 (Fri, 26 May 2006) | 5 lines
Explicitly close files. I'm trying to stop the frequent spurious test_tarfile
failures on Windows buildbots, but it's hard to know how since the regrtest
failure output is useless here, and it never fails when a buildbot slave runs
test_tarfile the second time in verbose mode.
........
r46329 | andrew.kuchling | 2006-05-26 16:03:41 +0200 (Fri, 26 May 2006) | 1 line
Add buffer support for struct, socket
........
r46330 | andrew.kuchling | 2006-05-26 16:04:19 +0200 (Fri, 26 May 2006) | 1 line
Typo fix
........
r46331 | bob.ippolito | 2006-05-26 16:07:23 +0200 (Fri, 26 May 2006) | 1 line
Fix distutils so that libffi will cross-compile between darwin/x86 and darwin/ppc
........
r46333 | bob.ippolito | 2006-05-26 16:23:21 +0200 (Fri, 26 May 2006) | 1 line
Fix _struct typo that broke some 64-bit platforms
........
r46335 | bob.ippolito | 2006-05-26 16:29:35 +0200 (Fri, 26 May 2006) | 1 line
Enable PY_USE_INT_WHEN_POSSIBLE in struct
........
r46343 | andrew.dalke | 2006-05-26 17:21:01 +0200 (Fri, 26 May 2006) | 2 lines
Eeked out another 3% or so performance in split whitespace by cleaning up the algorithm.
........
r46352 | andrew.dalke | 2006-05-26 18:22:52 +0200 (Fri, 26 May 2006) | 3 lines
Test for more edge strip cases; leading and trailing separator gets removed
even with strip(..., 0)
........
r46354 | bob.ippolito | 2006-05-26 18:23:28 +0200 (Fri, 26 May 2006) | 1 line
fix signed/unsigned mismatch in struct
........
r46355 | steve.holden | 2006-05-26 18:27:59 +0200 (Fri, 26 May 2006) | 5 lines
Add -t option to allow easy test selection.
Action verbose option correctly.
Tweak operation counts. Add empty and new instances tests.
Enable comparisons across different warp factors. Change version.
........
r46356 | fredrik.lundh | 2006-05-26 18:32:42 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: use Py_LOCAL on a few more locals in stringobject.c
........
r46357 | thomas.heller | 2006-05-26 18:42:44 +0200 (Fri, 26 May 2006) | 4 lines
For now, I gave up with automatic conversion of reST to Python-latex,
so I'm writing this in latex now.
Skeleton for the ctypes reference.
........
r46358 | tim.peters | 2006-05-26 18:49:28 +0200 (Fri, 26 May 2006) | 3 lines
Repair Windows compiler warnings about mixing
signed and unsigned integral types in comparisons.
........
r46359 | tim.peters | 2006-05-26 18:52:04 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46360 | tim.peters | 2006-05-26 18:53:04 +0200 (Fri, 26 May 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46362 | fredrik.lundh | 2006-05-26 19:04:58 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: stringlib refactoring (in progress)
........
r46363 | thomas.heller | 2006-05-26 19:18:33 +0200 (Fri, 26 May 2006) | 1 line
Write some docs.
........
r46364 | fredrik.lundh | 2006-05-26 19:22:38 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: stringlib refactoring (in progress)
........
r46366 | fredrik.lundh | 2006-05-26 19:26:39 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: cleanup
........
r46367 | fredrik.lundh | 2006-05-26 19:31:41 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: remove remaining USE_FAST macros; if fastsearch was
broken, someone would have noticed by now ;-)
........
r46368 | steve.holden | 2006-05-26 19:41:32 +0200 (Fri, 26 May 2006) | 5 lines
Use minimum calibration time rather than avergae to avoid
the illusion of negative run times. Halt with an error if
run times go below 10 ms, indicating that results will be
unreliable.
........
r46370 | thomas.heller | 2006-05-26 19:47:40 +0200 (Fri, 26 May 2006) | 2 lines
Reordered, and wrote more docs.
........
r46372 | georg.brandl | 2006-05-26 20:03:31 +0200 (Fri, 26 May 2006) | 9 lines
Need for speed: Patch #921466 : sys.path_importer_cache is now used to cache valid and
invalid file paths for the built-in import machinery which leads to
fewer open calls on startup.
Also fix issue with PEP 302 style import hooks which lead to more open()
calls than necessary.
........
r46373 | fredrik.lundh | 2006-05-26 20:05:34 +0200 (Fri, 26 May 2006) | 3 lines
removed unnecessary include
........
r46377 | fredrik.lundh | 2006-05-26 20:15:38 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: added rpartition implementation
........
r46380 | fredrik.lundh | 2006-05-26 20:24:15 +0200 (Fri, 26 May 2006) | 5 lines
needspeed: rpartition documentation, tests, and a bug fixes.
feel free to add more tests and improve the documentation.
........
r46381 | steve.holden | 2006-05-26 20:26:21 +0200 (Fri, 26 May 2006) | 4 lines
Revert tests to MAL's original round sizes to retiain comparability
from long ago and far away. Stop calling this pybench 1.4 because it
isn't. Remove the empty test, which was a bad idea.
........
r46387 | andrew.kuchling | 2006-05-26 20:41:18 +0200 (Fri, 26 May 2006) | 1 line
Add rpartition() and path caching
........
r46388 | andrew.dalke | 2006-05-26 21:02:09 +0200 (Fri, 26 May 2006) | 10 lines
substring split now uses /F's fast string matching algorithm.
(If compiled without FAST search support, changed the pre-memcmp test
to check the last character as well as the first. This gave a 25%
speedup for my test case.)
Rewrote the split algorithms so they stop when maxsplit gets to 0.
Previously they did a string match first then checked if the maxsplit
was reached. The new way prevents a needless string search.
........
r46391 | brett.cannon | 2006-05-26 21:04:47 +0200 (Fri, 26 May 2006) | 2 lines
Change C spacing to 4 spaces by default to match PEP 7 for new C files.
........
r46392 | georg.brandl | 2006-05-26 21:04:47 +0200 (Fri, 26 May 2006) | 3 lines
Exception isn't the root of all exception classes anymore.
........
r46397 | fredrik.lundh | 2006-05-26 21:23:21 +0200 (Fri, 26 May 2006) | 3 lines
added rpartition method to UserString class
........
r46398 | fredrik.lundh | 2006-05-26 21:24:53 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: stringlib refactoring, continued. added count and
find helpers; updated unicodeobject to use stringlib_count
........
r46400 | fredrik.lundh | 2006-05-26 21:29:05 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: stringlib refactoring: use stringlib/find for unicode
find
........
r46403 | fredrik.lundh | 2006-05-26 21:33:03 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: use a macro to fix slice indexes
........
r46404 | thomas.heller | 2006-05-26 21:43:45 +0200 (Fri, 26 May 2006) | 1 line
Write more docs.
........
r46406 | fredrik.lundh | 2006-05-26 21:48:07 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: stringlib refactoring: use stringlib/find for string find
........
r46407 | andrew.kuchling | 2006-05-26 21:51:10 +0200 (Fri, 26 May 2006) | 1 line
Comment typo
........
r46409 | georg.brandl | 2006-05-26 22:04:44 +0200 (Fri, 26 May 2006) | 3 lines
Replace Py_BuildValue("OO") by PyTuple_Pack.
........
r46411 | georg.brandl | 2006-05-26 22:14:47 +0200 (Fri, 26 May 2006) | 2 lines
Patch #1492218: document None being a constant.
........
r46415 | georg.brandl | 2006-05-26 22:22:50 +0200 (Fri, 26 May 2006) | 3 lines
Simplify calling.
........
r46416 | andrew.dalke | 2006-05-26 22:25:22 +0200 (Fri, 26 May 2006) | 4 lines
Added limits to the replace code so it does not count all of the matching
patterns in a string, only the number needed by the max limit.
........
r46417 | bob.ippolito | 2006-05-26 22:25:23 +0200 (Fri, 26 May 2006) | 1 line
enable all of the struct tests, use ssize_t, fix some whitespace
........
r46418 | tim.peters | 2006-05-26 22:56:56 +0200 (Fri, 26 May 2006) | 2 lines
Record Iceland sprint attendees.
........
r46421 | tim.peters | 2006-05-26 23:51:13 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46422 | steve.holden | 2006-05-27 00:17:54 +0200 (Sat, 27 May 2006) | 2 lines
Add Richard Tew to developers
........
r46423 | steve.holden | 2006-05-27 00:33:20 +0200 (Sat, 27 May 2006) | 2 lines
Update help text and documentaition.
........
r46424 | steve.holden | 2006-05-27 00:39:27 +0200 (Sat, 27 May 2006) | 2 lines
Blasted typos ...
........
r46425 | andrew.dalke | 2006-05-27 00:49:03 +0200 (Sat, 27 May 2006) | 2 lines
Added description of why splitlines doesn't use the prealloc strategy
........
r46426 | tim.peters | 2006-05-27 01:14:37 +0200 (Sat, 27 May 2006) | 19 lines
Patch 1145039.
set_exc_info(), reset_exc_info(): By exploiting the
likely (who knows?) invariant that when an exception's
`type` is NULL, its `value` and `traceback` are also NULL,
save some cycles in heavily-executed code.
This is a "a kronar saved is a kronar earned" patch: the
speedup isn't reliably measurable, but it obviously does
reduce the operation count in the normal (no exception
raised) path through PyEval_EvalFrameEx().
The tim-exc_sanity branch tries to push this harder, but
is still blowing up (at least in part due to pre-existing
subtle bugs that appear to have no other visible
consequences!).
Not a bugfix candidate.
........
r46429 | steve.holden | 2006-05-27 02:51:52 +0200 (Sat, 27 May 2006) | 2 lines
Reinstate new-style object tests.
........
r46430 | neal.norwitz | 2006-05-27 07:18:57 +0200 (Sat, 27 May 2006) | 1 line
Fix compiler warning (and whitespace) on Mac OS 10.4. (A lot of this code looked duplicated, I wonder if a utility function could help reduce the duplication here.)
........
r46431 | neal.norwitz | 2006-05-27 07:21:30 +0200 (Sat, 27 May 2006) | 4 lines
Fix Coverity warnings.
- Check the correct variable (str_obj, not str) for NULL
- sep_len was already verified it wasn't 0
........
r46432 | martin.v.loewis | 2006-05-27 10:36:52 +0200 (Sat, 27 May 2006) | 2 lines
Patch 1494554: Update numeric properties to Unicode 4.1.
........
r46433 | martin.v.loewis | 2006-05-27 10:54:29 +0200 (Sat, 27 May 2006) | 2 lines
Explain why 'consumed' is initialized.
........
r46436 | fredrik.lundh | 2006-05-27 12:05:10 +0200 (Sat, 27 May 2006) | 3 lines
needforspeed: more stringlib refactoring
........
r46438 | fredrik.lundh | 2006-05-27 12:39:48 +0200 (Sat, 27 May 2006) | 5 lines
needforspeed: backed out the Py_LOCAL-isation of ceval; the massive in-
lining killed performance on certain Intel boxes, and the "aggressive"
macro itself gives most of the benefits on others.
........
r46439 | andrew.dalke | 2006-05-27 13:04:36 +0200 (Sat, 27 May 2006) | 2 lines
fixed typo
........
r46440 | martin.v.loewis | 2006-05-27 13:07:49 +0200 (Sat, 27 May 2006) | 2 lines
Revert bogus change committed in 46432 to this file.
........
r46444 | andrew.kuchling | 2006-05-27 13:26:33 +0200 (Sat, 27 May 2006) | 1 line
Add Py_LOCAL macros
........
r46450 | bob.ippolito | 2006-05-27 13:47:12 +0200 (Sat, 27 May 2006) | 1 line
Remove the range checking and int usage #defines from _struct and strip out the now-dead code
........
r46454 | bob.ippolito | 2006-05-27 14:11:36 +0200 (Sat, 27 May 2006) | 1 line
Fix up struct docstrings, add struct.pack_to function for symmetry
........
r46456 | richard.jones | 2006-05-27 14:29:24 +0200 (Sat, 27 May 2006) | 2 lines
Conversion of exceptions over from faked-up classes to new-style C types.
........
r46457 | georg.brandl | 2006-05-27 14:30:25 +0200 (Sat, 27 May 2006) | 3 lines
Add news item for new-style exception class branch merge.
........
r46458 | tim.peters | 2006-05-27 14:36:53 +0200 (Sat, 27 May 2006) | 3 lines
More random thrashing trying to understand spurious
Windows failures. Who's keeping a bz2 file open?
........
r46460 | andrew.kuchling | 2006-05-27 15:44:37 +0200 (Sat, 27 May 2006) | 1 line
Mention new-style exceptions
........
r46461 | richard.jones | 2006-05-27 15:50:42 +0200 (Sat, 27 May 2006) | 1 line
credit where credit is due
........
r46462 | georg.brandl | 2006-05-27 16:02:03 +0200 (Sat, 27 May 2006) | 3 lines
Always close BZ2Proxy object. Remove unnecessary struct usage.
........
r46463 | tim.peters | 2006-05-27 16:13:13 +0200 (Sat, 27 May 2006) | 2 lines
The cheery optimism of old age.
........
r46464 | andrew.dalke | 2006-05-27 16:16:40 +0200 (Sat, 27 May 2006) | 2 lines
cleanup - removed trailing whitespace
........
r46465 | georg.brandl | 2006-05-27 16:41:55 +0200 (Sat, 27 May 2006) | 3 lines
Remove spurious semicolons after macro invocations.
........
r46468 | fredrik.lundh | 2006-05-27 16:58:20 +0200 (Sat, 27 May 2006) | 4 lines
needforspeed: replace improvements, changed to Py_LOCAL_INLINE
where appropriate
........
r46469 | fredrik.lundh | 2006-05-27 17:20:22 +0200 (Sat, 27 May 2006) | 4 lines
needforspeed: stringlib refactoring: changed find_obj to find_slice,
to enable use from stringobject
........
r46470 | fredrik.lundh | 2006-05-27 17:26:19 +0200 (Sat, 27 May 2006) | 3 lines
needforspeed: stringlib refactoring: use find_slice for stringobject
........
r46472 | kristjan.jonsson | 2006-05-27 17:41:31 +0200 (Sat, 27 May 2006) | 1 line
Add a PCBuild8 build directory for building with Visual Studio .NET 2005. Contains a special project to perform profile guided optimizations on the pythoncore.dll, by instrumenting and running pybench.py
........
r46473 | jack.diederich | 2006-05-27 17:44:34 +0200 (Sat, 27 May 2006) | 3 lines
needforspeed: use PyObject_MALLOC instead of system malloc for small
allocations. Use PyMem_MALLOC for larger (1k+) chunks. 1%-2% speedup.
........
r46474 | bob.ippolito | 2006-05-27 17:53:49 +0200 (Sat, 27 May 2006) | 1 line
fix struct regression on 64-bit platforms
........
r46475 | richard.jones | 2006-05-27 18:07:28 +0200 (Sat, 27 May 2006) | 1 line
doc string additions and tweaks
........
r46477 | richard.jones | 2006-05-27 18:15:11 +0200 (Sat, 27 May 2006) | 1 line
move semicolons
........
r46478 | george.yoshida | 2006-05-27 18:32:44 +0200 (Sat, 27 May 2006) | 2 lines
minor markup nits
........
r46488 | george.yoshida | 2006-05-27 18:51:43 +0200 (Sat, 27 May 2006) | 3 lines
End of Ch.3 is now about "with statement".
Avoid obsolescence by directly referring to the section.
........
r46489 | george.yoshida | 2006-05-27 19:09:17 +0200 (Sat, 27 May 2006) | 2 lines
fix typo
........
2006-05-27 19:21:47 +00:00
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2006-02-03 12:54:16 +00:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
/* The CRT of Windows has a number of flaws wrt. its stat() implementation:
|
|
|
|
|
- time stamps are restricted to second resolution
|
|
|
|
|
- file modification times suffer from forth-and-back conversions between
|
|
|
|
|
UTC and local time
|
|
|
|
|
Therefore, we implement our own stat, based on the Win32 API directly.
|
|
|
|
|
*/
|
2010-05-06 00:08:46 +00:00
|
|
|
#define HAVE_STAT_NSEC 1
|
2014-06-19 09:46:37 -05:00
|
|
|
#define HAVE_STRUCT_STAT_ST_FILE_ATTRIBUTES 1
|
2019-08-21 15:27:33 -07:00
|
|
|
#define HAVE_STRUCT_STAT_ST_REPARSE_TAG 1
|
2006-02-03 12:54:16 +00:00
|
|
|
|
2015-03-08 01:58:04 +01:00
|
|
|
static void
|
2016-09-08 10:35:16 -07:00
|
|
|
find_data_to_file_info(WIN32_FIND_DATAW *pFileData,
|
|
|
|
|
BY_HANDLE_FILE_INFORMATION *info,
|
|
|
|
|
ULONG *reparse_tag)
|
2015-03-08 01:58:04 +01:00
|
|
|
{
|
|
|
|
|
memset(info, 0, sizeof(*info));
|
|
|
|
|
info->dwFileAttributes = pFileData->dwFileAttributes;
|
|
|
|
|
info->ftCreationTime = pFileData->ftCreationTime;
|
|
|
|
|
info->ftLastAccessTime = pFileData->ftLastAccessTime;
|
|
|
|
|
info->ftLastWriteTime = pFileData->ftLastWriteTime;
|
|
|
|
|
info->nFileSizeHigh = pFileData->nFileSizeHigh;
|
|
|
|
|
info->nFileSizeLow = pFileData->nFileSizeLow;
|
|
|
|
|
/* info->nNumberOfLinks = 1; */
|
|
|
|
|
if (pFileData->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
|
|
|
|
|
*reparse_tag = pFileData->dwReserved0;
|
|
|
|
|
else
|
|
|
|
|
*reparse_tag = 0;
|
|
|
|
|
}
|
|
|
|
|
|
Merged revisions 53952-54987 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r53954 | jeremy.hylton | 2007-02-26 10:41:18 -0800 (Mon, 26 Feb 2007) | 10 lines
Do not copy free variables to locals in class namespaces.
Fixes bug 1569356, but at the cost of a minor incompatibility in
locals(). Add test that verifies that the class namespace is not
polluted. Also clarify the behavior in the library docs.
Along the way, cleaned up the dict_to_map and map_to_dict
implementations and added some comments that explain what they do.
........
r53955 | jeremy.hylton | 2007-02-26 11:00:20 -0800 (Mon, 26 Feb 2007) | 2 lines
Fix assertion.
........
r53969 | neal.norwitz | 2007-02-26 14:41:45 -0800 (Mon, 26 Feb 2007) | 3 lines
When printing an unraisable error, don't print exceptions. before the name.
This duplicates the behavior whening normally printing exceptions.
........
r53970 | andrew.kuchling | 2007-02-26 15:02:47 -0800 (Mon, 26 Feb 2007) | 1 line
Markup fix
........
r53975 | neal.norwitz | 2007-02-26 15:48:27 -0800 (Mon, 26 Feb 2007) | 3 lines
SF #1669182, 2.5 was already fixed. Just assert in 2.6 since string exceptions
are gone.
........
r53976 | andrew.kuchling | 2007-02-26 15:54:17 -0800 (Mon, 26 Feb 2007) | 1 line
Add some items
........
r53981 | jeremy.hylton | 2007-02-26 17:01:59 -0800 (Mon, 26 Feb 2007) | 4 lines
Fix long-standing bug in name mangling for package imports
Reported by Mike Verdone.
........
r53993 | jeremy.hylton | 2007-02-27 08:00:06 -0800 (Tue, 27 Feb 2007) | 2 lines
tabify
........
r53994 | jeremy.hylton | 2007-02-27 08:13:23 -0800 (Tue, 27 Feb 2007) | 5 lines
tabify
Note that ast.c still has a mix of tabs and spaces, because it
attempts to use four-space indents for more of the new code.
........
r53996 | jeremy.hylton | 2007-02-27 09:24:48 -0800 (Tue, 27 Feb 2007) | 2 lines
whitespace normalization
........
r53997 | jeremy.hylton | 2007-02-27 10:29:45 -0800 (Tue, 27 Feb 2007) | 24 lines
Add checking for a number of metaclass error conditions.
We add some new rules that are required for preserving internal
invariants of types.
1. If type (or a subclass of type) appears in bases, it must appear
before any non-type bases. If a non-type base (like a regular
new-style class) occurred first, it could trick type into
allocating the new class an __dict__ which must be impossible.
2. There are several checks that are made of bases when creating a
type. Those checks are now repeated when assigning to __bases__.
We also add the restriction that assignment to __bases__ may not
change the metaclass of the type.
Add new tests for these cases and for a few other oddball errors that
were no previously tested. Remove a crasher test that was fixed.
Also some internal refactoring: Extract the code to find the most
derived metaclass of a type and its bases. It is now needed in two
places. Rewrite the TypeError checks in test_descr to use doctest.
The tests now clearly show what exception they expect to see.
........
r53998 | jeremy.hylton | 2007-02-27 10:33:31 -0800 (Tue, 27 Feb 2007) | 2 lines
Add news about changes to metaclasses and __bases__ error checking.
........
r54016 | armin.rigo | 2007-02-28 01:25:29 -0800 (Wed, 28 Feb 2007) | 3 lines
Modify the segfaulting example to show why r53997 is not a solution to
it.
........
r54022 | brett.cannon | 2007-02-28 10:15:00 -0800 (Wed, 28 Feb 2007) | 2 lines
Add a test for instantiating SyntaxError with no arguments.
........
r54026 | raymond.hettinger | 2007-02-28 10:27:41 -0800 (Wed, 28 Feb 2007) | 1 line
Docstring nit.
........
r54033 | raymond.hettinger | 2007-02-28 10:37:52 -0800 (Wed, 28 Feb 2007) | 1 line
Prepare collections module for pure python code entries.
........
r54053 | raymond.hettinger | 2007-02-28 22:16:43 -0800 (Wed, 28 Feb 2007) | 1 line
Add collections.NamedTuple
........
r54054 | neal.norwitz | 2007-02-28 23:04:41 -0800 (Wed, 28 Feb 2007) | 1 line
Add Pat and Eric for work on PEP 3101 in the sandbox
........
r54061 | andrew.kuchling | 2007-03-01 06:36:12 -0800 (Thu, 01 Mar 2007) | 1 line
Add NamedTuple
........
r54080 | georg.brandl | 2007-03-02 06:37:12 -0800 (Fri, 02 Mar 2007) | 2 lines
Bug #1628895: some better tries to find HTML documentation in pydoc.
........
r54086 | raymond.hettinger | 2007-03-02 11:20:46 -0800 (Fri, 02 Mar 2007) | 1 line
Fix embarrassing typo and fix constantification of None
........
r54088 | georg.brandl | 2007-03-02 12:30:14 -0800 (Fri, 02 Mar 2007) | 2 lines
Bugs #1668032, #1668036, #1669304: clarify behavior of PyMem_Realloc and _Resize.
........
r54114 | georg.brandl | 2007-03-04 09:18:54 -0800 (Sun, 04 Mar 2007) | 2 lines
Fix a bug in test_dict and test_userdict, found at the PyPy sprint.
........
r54124 | skip.montanaro | 2007-03-04 12:52:28 -0800 (Sun, 04 Mar 2007) | 2 lines
Teach setup.py how to find Berkeley DB on Macs using MacPorts.
........
r54125 | skip.montanaro | 2007-03-04 12:54:12 -0800 (Sun, 04 Mar 2007) | 1 line
note MacPorts/BerkDB change in setup.py
........
r54136 | neal.norwitz | 2007-03-04 23:52:01 -0800 (Sun, 04 Mar 2007) | 1 line
Added Pete for 3101 too
........
r54138 | facundo.batista | 2007-03-05 08:31:54 -0800 (Mon, 05 Mar 2007) | 1 line
Minor corrections to docs, and an explanation comentary
........
r54139 | georg.brandl | 2007-03-05 14:28:08 -0800 (Mon, 05 Mar 2007) | 3 lines
Patch #1674228: when assigning a slice (old-style), check for the
sq_ass_slice instead of the sq_slice slot.
........
r54149 | georg.brandl | 2007-03-06 01:33:01 -0800 (Tue, 06 Mar 2007) | 3 lines
Nit: a struct field is set to GenericAlloc, not GenericAlloc().
........
r54150 | georg.brandl | 2007-03-06 02:02:47 -0800 (Tue, 06 Mar 2007) | 3 lines
Patch #1671450: add a section about subclassing builtin types to the
"extending and embedding" tutorial.
........
r54152 | martin.v.loewis | 2007-03-06 02:41:24 -0800 (Tue, 06 Mar 2007) | 2 lines
Patch #1121142: Implement ZipFile.open.
........
r54154 | georg.brandl | 2007-03-06 03:51:14 -0800 (Tue, 06 Mar 2007) | 2 lines
A test case for the fix in #1674228.
........
r54156 | georg.brandl | 2007-03-06 03:52:24 -0800 (Tue, 06 Mar 2007) | 2 lines
Patch #1672481: fix bug in idlelib.MultiCall.
........
r54159 | georg.brandl | 2007-03-06 04:17:50 -0800 (Tue, 06 Mar 2007) | 1 line
Bug #1674503: close the file opened by execfile() in an error condition.
........
r54160 | georg.brandl | 2007-03-06 05:32:52 -0800 (Tue, 06 Mar 2007) | 3 lines
Fix another reincarnation of bug #1576657 in defaultdict.
........
r54162 | georg.brandl | 2007-03-06 05:35:00 -0800 (Tue, 06 Mar 2007) | 2 lines
A test case for the defaultdict KeyError bug.
........
r54164 | georg.brandl | 2007-03-06 05:37:45 -0800 (Tue, 06 Mar 2007) | 3 lines
Patch #1663234: you can now run doctest on test files and modules
using "python -m doctest [-v] filename ...".
........
r54165 | martin.v.loewis | 2007-03-06 06:43:00 -0800 (Tue, 06 Mar 2007) | 3 lines
Patch #912410: Replace HTML entity references for attribute values
in HTMLParser.
........
r54166 | skip.montanaro | 2007-03-06 07:41:38 -0800 (Tue, 06 Mar 2007) | 1 line
patch 1673619 - identify extension modules which cannot be built
........
r54167 | guido.van.rossum | 2007-03-06 07:50:01 -0800 (Tue, 06 Mar 2007) | 5 lines
Patch #1646728: datetime.fromtimestamp fails with negative
fractional times. With unittest.
Somebody please backport to 2.5.
........
r54169 | georg.brandl | 2007-03-06 09:49:14 -0800 (Tue, 06 Mar 2007) | 2 lines
Fix cmp vs. key argument for list.sort.
........
r54170 | georg.brandl | 2007-03-06 10:21:32 -0800 (Tue, 06 Mar 2007) | 2 lines
Small nit, found by Neal.
........
r54171 | georg.brandl | 2007-03-06 10:29:58 -0800 (Tue, 06 Mar 2007) | 3 lines
Patch #1602128: clarify that richcmp methods can return NotImplemented
and should return True or False otherwise.
........
r54173 | georg.brandl | 2007-03-06 10:41:12 -0800 (Tue, 06 Mar 2007) | 2 lines
Patch #1638879: don't accept strings with embedded NUL bytes in long().
........
r54175 | georg.brandl | 2007-03-06 10:47:31 -0800 (Tue, 06 Mar 2007) | 2 lines
Patch #1673121: update README wrt. OSX default shell.
........
r54177 | georg.brandl | 2007-03-06 10:59:11 -0800 (Tue, 06 Mar 2007) | 3 lines
Patch #1654417: make operator.{get,set,del}slice use the full range
of Py_ssize_t.
........
r54180 | walter.doerwald | 2007-03-06 12:38:57 -0800 (Tue, 06 Mar 2007) | 4 lines
Patch for bug #1633621: if curses.resizeterm() or
curses.resize_term() is called, update _curses.LINES,
_curses.COLS, curses.LINES and curses.COLS.
........
r54182 | walter.doerwald | 2007-03-06 13:15:24 -0800 (Tue, 06 Mar 2007) | 2 lines
Document change to curses.
........
r54188 | georg.brandl | 2007-03-06 16:34:46 -0800 (Tue, 06 Mar 2007) | 5 lines
Variant of patch #697613: don't exit the interpreter on a SystemExit
exception if the -i command line option or PYTHONINSPECT environment
variable is given, but break into the interactive interpreter just like
on other exceptions or normal program exit.
(backport)
........
r54189 | georg.brandl | 2007-03-06 16:40:28 -0800 (Tue, 06 Mar 2007) | 4 lines
Patch #703779: unset __file__ in __main__ after running a file. This
makes the filenames the warning module prints much more sensible when
a PYTHONSTARTUP file is used.
........
r54192 | george.yoshida | 2007-03-06 20:21:18 -0800 (Tue, 06 Mar 2007) | 2 lines
add versionadded info
........
r54195 | georg.brandl | 2007-03-06 23:39:06 -0800 (Tue, 06 Mar 2007) | 2 lines
Patch #812285: allow multiple auth schemes in AbstractBasicAuthHandler.
........
r54197 | georg.brandl | 2007-03-07 00:31:51 -0800 (Wed, 07 Mar 2007) | 3 lines
Patch #1001604: glob.glob() now returns unicode filenames if it was
given a unicode argument and os.listdir() returns unicode filenames.
........
r54199 | georg.brandl | 2007-03-07 01:09:40 -0800 (Wed, 07 Mar 2007) | 3 lines
Patches #1550273, #1550272: fix a few bugs in unittest and add a
comprehensive test suite for the module.
........
r54201 | georg.brandl | 2007-03-07 01:21:06 -0800 (Wed, 07 Mar 2007) | 3 lines
Patch #787789: allow to pass custom TestRunner instances to unittest's
main() function.
........
r54202 | georg.brandl | 2007-03-07 01:34:45 -0800 (Wed, 07 Mar 2007) | 2 lines
Patch #1669331: clarify shutil.copyfileobj() behavior wrt. file position.
........
r54204 | martin.v.loewis | 2007-03-07 03:04:33 -0800 (Wed, 07 Mar 2007) | 2 lines
Bug #1115886: os.path.splitext('.cshrc') gives now ('.cshrc', '').
........
r54206 | georg.brandl | 2007-03-07 03:37:42 -0800 (Wed, 07 Mar 2007) | 2 lines
Patch #1675471: convert test_pty to unittest.
........
r54207 | georg.brandl | 2007-03-07 03:54:49 -0800 (Wed, 07 Mar 2007) | 4 lines
Add some sanity checks to unittest.TestSuite's addTest(s) methods.
Fixes #878275.
........
r54209 | guido.van.rossum | 2007-03-07 07:16:29 -0800 (Wed, 07 Mar 2007) | 3 lines
Windows doesn't support negative timestamps. Skip the tests involving them
if os.name == "nt".
........
r54219 | martin.v.loewis | 2007-03-08 05:42:43 -0800 (Thu, 08 Mar 2007) | 2 lines
Add missing ) in parenthical remark.
........
r54220 | georg.brandl | 2007-03-08 09:49:06 -0800 (Thu, 08 Mar 2007) | 2 lines
Fix #1676656: \em is different from \emph...
........
r54222 | georg.brandl | 2007-03-08 10:37:31 -0800 (Thu, 08 Mar 2007) | 2 lines
Add a NEWS entry for rev. 54207,8.
........
r54225 | raymond.hettinger | 2007-03-08 11:24:27 -0800 (Thu, 08 Mar 2007) | 1 line
SF 1676321: empty() returned wrong result
........
r54227 | collin.winter | 2007-03-08 11:58:14 -0800 (Thu, 08 Mar 2007) | 1 line
Backported r54226 from p3yk: Move test_unittest, test_doctest and test_doctest2 higher up in the testing order.
........
r54230 | raymond.hettinger | 2007-03-08 13:33:47 -0800 (Thu, 08 Mar 2007) | 1 line
SF #1637850: make_table in difflib did not work with unicode
........
r54232 | collin.winter | 2007-03-08 14:16:25 -0800 (Thu, 08 Mar 2007) | 1 line
Patch #1668482: don't use '-' in mkstemp
........
r54233 | brett.cannon | 2007-03-08 15:58:11 -0800 (Thu, 08 Mar 2007) | 10 lines
Introduce test.test_support.TransientResource. It's a context manager to
surround calls to resources that may or may not be available. Specifying the
expected exception and attributes to be raised if the resource is not available
prevents overly broad catching of exceptions.
This is meant to help suppress spurious failures by raising
test.test_support.ResourceDenied if the exception matches. It would probably
be good to go through the various network tests and surround the calls to catch
connection timeouts (as done with test_socket_ssl in this commit).
........
r54234 | collin.winter | 2007-03-08 19:15:56 -0800 (Thu, 08 Mar 2007) | 1 line
Patch #1481079: Support of HTTP_REFERER in CGIHTTPServer.py
........
r54235 | collin.winter | 2007-03-08 19:26:32 -0800 (Thu, 08 Mar 2007) | 1 line
Add NEWS item for patch #1481079 (r54234).
........
r54237 | neal.norwitz | 2007-03-08 21:59:01 -0800 (Thu, 08 Mar 2007) | 1 line
Fix SF #1676971, Complex OverflowError has a typo
........
r54239 | georg.brandl | 2007-03-09 04:58:41 -0800 (Fri, 09 Mar 2007) | 2 lines
Typo.
........
r54240 | martin.v.loewis | 2007-03-09 07:35:55 -0800 (Fri, 09 Mar 2007) | 2 lines
Patch #957003: Implement smtplib.LMTP.
........
r54243 | collin.winter | 2007-03-09 10:09:10 -0800 (Fri, 09 Mar 2007) | 2 lines
Bug #1629566: clarify the docs on the return values of parsedate() and parsedate_tz() in email.utils and rfc822.
........
r54244 | thomas.heller | 2007-03-09 11:21:28 -0800 (Fri, 09 Mar 2007) | 3 lines
Fix bug #1646630: ctypes.string_at(buf, 0) and ctypes.wstring_at(buf, 0)
returned string up to the first NUL character.
........
r54245 | martin.v.loewis | 2007-03-09 11:36:01 -0800 (Fri, 09 Mar 2007) | 2 lines
Add Ziga Seilnacht.
........
r54247 | collin.winter | 2007-03-09 12:33:07 -0800 (Fri, 09 Mar 2007) | 2 lines
Patch #1491866: change the complex() constructor to allow parthensized forms. This means complex(repr(x)) now works instead of raising a ValueError.
........
r54248 | thomas.heller | 2007-03-09 12:39:22 -0800 (Fri, 09 Mar 2007) | 7 lines
Bug #1651235: When a tuple was passed to a ctypes function call,
Python would crash instead of raising an error.
The crash was caused by a section of code that should have been
removed long ago, at that time ctypes had other ways to pass
parameters to function calls.
........
r54250 | collin.winter | 2007-03-09 15:30:39 -0800 (Fri, 09 Mar 2007) | 1 line
Hashing simplification pointed out by Thomas Wouters.
........
r54252 | collin.winter | 2007-03-09 18:23:40 -0800 (Fri, 09 Mar 2007) | 5 lines
* Unlink test files before and after each test; hopefully this will cut down on recent buildbot failures in test_islink.
* Drop safe_remove() in favor of test_support.unlink().
* Fix the indentation of test_samefile so that it runs.
........
r54253 | collin.winter | 2007-03-09 18:51:26 -0800 (Fri, 09 Mar 2007) | 3 lines
Bug #1531963: Make SocketServer.TCPServer's server_address always be equal to calling getsockname() on the server's socket.
Will backport.
........
r54254 | neal.norwitz | 2007-03-09 19:19:18 -0800 (Fri, 09 Mar 2007) | 4 lines
Simplify a little by handling the TCP case first.
Update to use predominant style of spaces around = in args list
and print to stderr if debugging.
........
r54256 | collin.winter | 2007-03-09 19:35:34 -0800 (Fri, 09 Mar 2007) | 1 line
Add proper attribution for a bug fix.
........
r54257 | georg.brandl | 2007-03-09 23:38:14 -0800 (Fri, 09 Mar 2007) | 2 lines
Typos.
........
r54260 | collin.winter | 2007-03-10 06:33:32 -0800 (Sat, 10 Mar 2007) | 1 line
Convert an assert to a raise so it works even in the presence of -O.
........
r54262 | collin.winter | 2007-03-10 06:41:48 -0800 (Sat, 10 Mar 2007) | 2 lines
Patch #1599845: Add an option to disable the implicit calls to server_bind() and server_activate() in the constructors for TCPServer, SimpleXMLRPCServer and DocXMLRPCServer.
........
r54268 | georg.brandl | 2007-03-11 00:28:46 -0800 (Sun, 11 Mar 2007) | 2 lines
Add missing "return" statements in exception handler.
........
r54270 | ziga.seilnacht | 2007-03-11 08:54:54 -0700 (Sun, 11 Mar 2007) | 3 lines
Patch #1675981: remove unreachable code from type.__new__() method.
__dict__ and __weakref__ are removed from the slots tuple earlier
in the code, in the loop that mangles slot names. Will backport.
........
r54271 | collin.winter | 2007-03-11 09:00:20 -0700 (Sun, 11 Mar 2007) | 3 lines
Patch #1192590: Fix pdb's "ignore" and "condition" commands so they trap the IndexError caused by passing in an invalid breakpoint number.
Will backport.
........
r54274 | vinay.sajip | 2007-03-11 11:32:07 -0700 (Sun, 11 Mar 2007) | 1 line
Fix resource leak reported in SF #1516995.
........
r54278 | collin.winter | 2007-03-11 18:55:54 -0700 (Sun, 11 Mar 2007) | 4 lines
Patch #1678662: ftp.python.org does not exist. So the testcode in urllib.py must use a more
stable FTP.
Will backport.
........
r54280 | barry.warsaw | 2007-03-11 20:20:01 -0700 (Sun, 11 Mar 2007) | 8 lines
Tokio Kikuchi's fix for SF bug #1629369; folding whitespace allowed in the
display name of an email address, e.g.
Foo
\tBar <foo@example.com>
Test case added by Barry.
........
r54282 | skip.montanaro | 2007-03-11 20:30:50 -0700 (Sun, 11 Mar 2007) | 4 lines
Sane humans would call these invalid tests, but Andrew McNamara pointed out
that given the inputs in these tests Excel does indeed produce the output
these tests expect. Document that for future confused folks.
........
r54283 | martin.v.loewis | 2007-03-12 03:50:39 -0700 (Mon, 12 Mar 2007) | 2 lines
Bug #1675511: Use -Kpic instead of -xcode=pic32 on Solaris/x86.
........
r54285 | martin.v.loewis | 2007-03-12 04:01:10 -0700 (Mon, 12 Mar 2007) | 2 lines
Patch #1677862: Require a space or tab after import in .pth files.
........
r54287 | georg.brandl | 2007-03-12 06:17:36 -0700 (Mon, 12 Mar 2007) | 8 lines
Backport from Py3k branch:
Patch #1591665: implement the __dir__() special function lookup in PyObject_Dir.
Had to change a few bits of the patch because classobjs and __methods__ are still
in Py2.6.
........
r54288 | georg.brandl | 2007-03-12 07:30:05 -0700 (Mon, 12 Mar 2007) | 3 lines
Bug #1678647: write a newline after printing an exception in any
case, even when converting the value to a string failed.
........
r54290 | collin.winter | 2007-03-12 08:57:19 -0700 (Mon, 12 Mar 2007) | 1 line
Patch #1678088: convert test_operations to use unittest, fold the result into test_dict.
........
r54291 | collin.winter | 2007-03-12 09:11:39 -0700 (Mon, 12 Mar 2007) | 3 lines
Bug #742342: make Python stop segfaulting on infinitely-recursive reload()s. Fixed by patch #922167.
Will backport.
........
r54292 | georg.brandl | 2007-03-12 09:15:09 -0700 (Mon, 12 Mar 2007) | 2 lines
Typo fix.
........
r54295 | collin.winter | 2007-03-12 10:24:07 -0700 (Mon, 12 Mar 2007) | 1 line
Patch #1670993: Refactor test_threadedtempfile.py to use unittest.
........
r54296 | tim.peters | 2007-03-12 11:07:52 -0700 (Mon, 12 Mar 2007) | 2 lines
Whitespace normalization.
........
r54297 | tim.peters | 2007-03-12 11:09:22 -0700 (Mon, 12 Mar 2007) | 2 lines
Set missing svn:eol-style property on text files.
........
r54315 | brett.cannon | 2007-03-12 19:34:09 -0700 (Mon, 12 Mar 2007) | 8 lines
Add test.test_support.transient_internet . Returns a context manager that
nests test.test_support.TransientResource context managers that capture
exceptions raised when the Internet connection is flaky.
Initially using in test_socket_ssl but should probably be expanded to cover any
test that should not raise the captured exceptions if the Internet connection
works.
........
r54316 | brett.cannon | 2007-03-12 20:05:40 -0700 (Mon, 12 Mar 2007) | 2 lines
Fix a typo where the variable name was not updated.
........
r54318 | neal.norwitz | 2007-03-12 21:59:58 -0700 (Mon, 12 Mar 2007) | 1 line
Add Jerry Seutter for a bunch of his recent patches refactoring tests
........
r54319 | neal.norwitz | 2007-03-12 22:07:14 -0700 (Mon, 12 Mar 2007) | 7 lines
Add some other acks for recent checkins:
Brian Leair - 922167
Tomer Filiba - 1591665
Jeremy Jones - 1192590
........
r54321 | neal.norwitz | 2007-03-12 22:31:38 -0700 (Mon, 12 Mar 2007) | 9 lines
Fix some style nits:
* lines too long
* wrong indentation
* space after a function name
* wrong function name in error string
* simplifying some logic
Also add an error check to PyDict_SetItemString.
........
r54322 | georg.brandl | 2007-03-13 00:23:16 -0700 (Tue, 13 Mar 2007) | 2 lines
Typo and grammar fixes.
........
r54323 | georg.brandl | 2007-03-13 00:50:57 -0700 (Tue, 13 Mar 2007) | 2 lines
Patch #1679379: add documentation for fnmatch.translate().
........
r54325 | georg.brandl | 2007-03-13 00:57:51 -0700 (Tue, 13 Mar 2007) | 2 lines
Patch #1642844: comments to clarify the complexobject constructor.
........
r54326 | georg.brandl | 2007-03-13 01:14:27 -0700 (Tue, 13 Mar 2007) | 3 lines
Patch #1668100: urllib2 now correctly raises URLError instead of
OSError if accessing a local file via the file:// protocol fails.
........
r54327 | georg.brandl | 2007-03-13 02:32:11 -0700 (Tue, 13 Mar 2007) | 4 lines
Patch #1635454: the csv.DictWriter class now includes the offending
field names in its exception message if you try to write a record with
a dictionary containing fields not in the CSV field names list.
........
r54328 | georg.brandl | 2007-03-13 02:41:31 -0700 (Tue, 13 Mar 2007) | 3 lines
Patch #1555098: use str.join() instead of repeated string
concatenation in robotparser.
........
r54329 | georg.brandl | 2007-03-13 03:06:48 -0700 (Tue, 13 Mar 2007) | 3 lines
Patch #1542681: add entries for "with", "as" and "CONTEXTMANAGERS" to
pydoc's help keywords.
........
r54331 | georg.brandl | 2007-03-13 03:19:22 -0700 (Tue, 13 Mar 2007) | 3 lines
Patch #1569798: fix a bug in distutils when building Python from a
directory within sys.exec_prefix.
........
r54333 | martin.v.loewis | 2007-03-13 03:24:00 -0700 (Tue, 13 Mar 2007) | 4 lines
Patch #1449244: Support Unicode strings in
email.message.Message.{set_charset,get_content_charset}.
Will backport.
........
r54335 | lars.gustaebel | 2007-03-13 03:47:19 -0700 (Tue, 13 Mar 2007) | 34 lines
This is the implementation of POSIX.1-2001 (pax) format read/write
support.
The TarInfo class now contains all necessary logic to process and
create tar header data which has been moved there from the TarFile
class. The fromtarfile() method was added. The new path and linkpath
properties are aliases for the name and linkname attributes in
correspondence to the pax naming scheme.
The TarFile constructor and classmethods now accept a number of
keyword arguments which could only be set as attributes before (e.g.
dereference, ignore_zeros). The encoding and pax_headers arguments
were added for pax support. There is a new tarinfo keyword argument
that allows using subclassed TarInfo objects in TarFile.
The boolean TarFile.posix attribute is deprecated, because now three
tar formats are supported. Instead, the desired format for writing is
specified using the constants USTAR_FORMAT, GNU_FORMAT and PAX_FORMAT
as the format keyword argument. This change affects TarInfo.tobuf()
as well.
The test suite has been heavily reorganized and partially rewritten.
A new testtar.tar was added that contains sample data in many formats
from 4 different tar programs.
Some bugs and quirks that also have been fixed:
Directory names do no longer have a trailing slash in TarInfo.name or
TarFile.getnames().
Adding the same file twice does not create a hardlink file member.
The TarFile constructor does no longer need a name argument.
The TarFile._mode attribute was renamed to mode and contains either
'r', 'w' or 'a'.
........
r54336 | georg.brandl | 2007-03-13 05:34:25 -0700 (Tue, 13 Mar 2007) | 3 lines
Bug #1622896: fix a rare corner case where the bz2 module raised an
error in spite of a succesful compression.
........
r54338 | lars.gustaebel | 2007-03-13 08:47:07 -0700 (Tue, 13 Mar 2007) | 3 lines
Quick fix for tests that fail on systems with an encoding other
than 'iso8859-1'.
........
r54339 | georg.brandl | 2007-03-13 10:43:32 -0700 (Tue, 13 Mar 2007) | 4 lines
Patch #1603688: ConfigParser.SafeConfigParser now checks values that
are set for invalid interpolation sequences that would lead to errors
on reading back those values.
........
r54341 | georg.brandl | 2007-03-13 11:15:41 -0700 (Tue, 13 Mar 2007) | 3 lines
Patch #1581073: add a flag to textwrap that prevents the dropping of
whitespace while wrapping.
........
r54343 | georg.brandl | 2007-03-13 11:24:40 -0700 (Tue, 13 Mar 2007) | 2 lines
Patch #1605192: list allowed states in error messages for imaplib.
........
r54344 | georg.brandl | 2007-03-13 11:31:49 -0700 (Tue, 13 Mar 2007) | 4 lines
Patch #1537850: tempfile.NamedTemporaryFile now has a "delete" parameter
which can be set to False to prevent the default delete-on-close
behavior.
........
r54345 | collin.winter | 2007-03-13 11:53:04 -0700 (Tue, 13 Mar 2007) | 9 lines
Add acks for recent patch checkins:
Arvin Schnell - 1668482
S?\195?\169bastien Martini - 1481079
Heiko Wundram - 1491866
Damon Kohler - 1545011
Peter Parente - 1599845
Bjorn Lindqvist - 1678662
........
r54346 | georg.brandl | 2007-03-13 12:00:36 -0700 (Tue, 13 Mar 2007) | 2 lines
Acks for recent patches.
........
r54347 | georg.brandl | 2007-03-13 12:18:18 -0700 (Tue, 13 Mar 2007) | 3 lines
Fix a tab.
........
r54348 | georg.brandl | 2007-03-13 12:32:21 -0700 (Tue, 13 Mar 2007) | 4 lines
Patch #1533909: the timeit module now accepts callables in addition to
strings for the code to time and the setup code. Also added two
convenience functions for instantiating a Timer and calling its methods.
........
r54352 | georg.brandl | 2007-03-13 13:02:57 -0700 (Tue, 13 Mar 2007) | 3 lines
Patch #1530482: add pydoc.render_doc() which returns the documentation
for a thing instead of paging it to stdout, which pydoc.doc() does.
........
r54357 | thomas.heller | 2007-03-13 13:42:52 -0700 (Tue, 13 Mar 2007) | 1 line
Patch #1649190: Adding support for _Bool to ctypes as c_bool, by David Remahl.
........
r54358 | georg.brandl | 2007-03-13 13:46:32 -0700 (Tue, 13 Mar 2007) | 2 lines
Patch #1444529: the builtin compile() now accepts keyword arguments.
(backport)
........
r54359 | thomas.heller | 2007-03-13 14:01:39 -0700 (Tue, 13 Mar 2007) | 1 line
Add versionadded marker for ctypes.c_bool.
........
r54360 | georg.brandl | 2007-03-13 14:08:15 -0700 (Tue, 13 Mar 2007) | 3 lines
Patch #1393667: pdb now has a "run" command which restarts the debugged
Python program, optionally with different arguments.
........
r54361 | georg.brandl | 2007-03-13 14:32:01 -0700 (Tue, 13 Mar 2007) | 3 lines
Deprecate commands.getstatus().
........
r54362 | georg.brandl | 2007-03-13 14:32:56 -0700 (Tue, 13 Mar 2007) | 2 lines
NEWS entry for getstatus() deprecation.
........
r54363 | georg.brandl | 2007-03-13 14:58:44 -0700 (Tue, 13 Mar 2007) | 4 lines
Patch #1429539: pdb now correctly initializes the __main__ module for
the debugged script, which means that imports from __main__ work
correctly now.
........
r54364 | georg.brandl | 2007-03-13 15:07:36 -0700 (Tue, 13 Mar 2007) | 4 lines
Patch #957650: "%var%" environment variable references are now properly
expanded in ntpath.expandvars(), also "~user" home directory references
are recognized and handled on Windows.
........
r54365 | georg.brandl | 2007-03-13 15:16:30 -0700 (Tue, 13 Mar 2007) | 2 lines
Patch #1194449: correctly detect unbound methods in pydoc.
........
r54367 | georg.brandl | 2007-03-13 15:49:43 -0700 (Tue, 13 Mar 2007) | 5 lines
Patch #1185447: binascii.b2a_qp() now correctly quotes binary characters
with ASCII value less than 32. Also, it correctly quotes dots only if
they occur on a single line, as opposed to the previous behavior of
quoting dots if they are the second character of any line.
........
r54368 | collin.winter | 2007-03-13 16:02:15 -0700 (Tue, 13 Mar 2007) | 1 line
Inline PyImport_GetModulesReloading().
........
r54371 | barry.warsaw | 2007-03-13 21:59:50 -0700 (Tue, 13 Mar 2007) | 6 lines
SF bug #1582282; decode_header() incorrectly splits not-conformant RFC
2047-like headers where there is no whitespace between encoded words. This
fix changes the matching regexp to include a trailing lookahead assertion that
the closing ?= must be followed by whitespace, newline, or end-of-string.
This also changes the regexp to add the MULTILINE flag.
........
r54372 | gregory.p.smith | 2007-03-14 00:17:40 -0700 (Wed, 14 Mar 2007) | 2 lines
correct order and names of the less often used keyword parameters.
........
r54373 | gregory.p.smith | 2007-03-14 00:19:50 -0700 (Wed, 14 Mar 2007) | 5 lines
Its time to stop listing (Unix, Windows) when we really mean "everything but Mac OS 9"
now that nobody is likely to use Python on Mac OS 9 and most of the (Mac) platform
items are all OS X special API specific since OS X is unixy enough for these modules
to be available out of the box.
........
r54376 | georg.brandl | 2007-03-14 01:27:52 -0700 (Wed, 14 Mar 2007) | 4 lines
Bug #767111: fix long-standing bug in urllib which caused an
AttributeError instead of an IOError when the server's response didn't
contain a valid HTTP status line.
........
r54378 | ziga.seilnacht | 2007-03-14 05:24:09 -0700 (Wed, 14 Mar 2007) | 4 lines
Patch #1680015: Don't modify __slots__ tuple if it contains an unicode
name. Remove a reference leak that happened if the name could not be
converted to string. Will backport.
........
r54386 | martin.v.loewis | 2007-03-14 13:02:31 -0700 (Wed, 14 Mar 2007) | 3 lines
Patch #1559413: Fix test_cmd_line if sys.executable contains a space.
Will backport.
........
r54389 | brett.cannon | 2007-03-14 14:40:13 -0700 (Wed, 14 Mar 2007) | 3 lines
Note how test_socket_ssl has various exceptions that deal with a flaky Net
connection are silenced.
........
r54390 | brett.cannon | 2007-03-14 14:44:15 -0700 (Wed, 14 Mar 2007) | 2 lines
Raise ResourceDenied in test_urllib2net when the Net connection goes bad.
........
r54391 | neal.norwitz | 2007-03-14 21:41:20 -0700 (Wed, 14 Mar 2007) | 1 line
Wrap a long line and fix a typo (is -> if)
........
r54392 | georg.brandl | 2007-03-15 00:38:14 -0700 (Thu, 15 Mar 2007) | 3 lines
Patch #1680978: consistently use "alive" instead of "active" in the
thread lib doc.
........
r54394 | georg.brandl | 2007-03-15 00:41:30 -0700 (Thu, 15 Mar 2007) | 3 lines
Patch #1681153: the wave module now closes a file object it opened if
initialization failed.
........
r54397 | ziga.seilnacht | 2007-03-15 04:44:55 -0700 (Thu, 15 Mar 2007) | 3 lines
Patch #1462488: prevent a segfault in object_reduce_ex() by splitting
the implementation for __reduce__ and __reduce_ex__ into two separate
functions. Fixes bug #931877. Will backport.
........
r54404 | collin.winter | 2007-03-15 21:11:30 -0700 (Thu, 15 Mar 2007) | 3 lines
Patch #1642547: Fix an error/crash when encountering syntax errors in complex if statements.
Will backport.
........
r54406 | georg.brandl | 2007-03-16 00:55:09 -0700 (Fri, 16 Mar 2007) | 5 lines
Bug #1681228: the webbrowser module now correctly uses the default
GNOME or KDE browser, depending on whether there is a session of one
of those present. Also, it tries the Windows default browser before
trying Mozilla variants.
(backport)
........
r54407 | georg.brandl | 2007-03-16 01:22:40 -0700 (Fri, 16 Mar 2007) | 4 lines
Patch #1273829: os.walk() now has a "followlinks" parameter. If set to
True (which is not the default), it visits symlinks pointing to
directories.
........
r54408 | georg.brandl | 2007-03-16 01:24:21 -0700 (Fri, 16 Mar 2007) | 2 lines
Add \versionadded tag.
........
r54409 | georg.brandl | 2007-03-16 01:33:47 -0700 (Fri, 16 Mar 2007) | 2 lines
RFE #1670167: fix in isinstance() docs.
........
r54412 | ziga.seilnacht | 2007-03-16 04:59:38 -0700 (Fri, 16 Mar 2007) | 3 lines
Patch #1623563: allow __class__ assignment for classes with __slots__.
The old and the new class are still required to have the same slot
names, but the order in which they are specified is not relevant.
........
r54413 | ziga.seilnacht | 2007-03-16 05:11:11 -0700 (Fri, 16 Mar 2007) | 2 lines
Whitespace cleanup. Also remove the empty lines
from the previous check in.
........
r54414 | jeremy.hylton | 2007-03-16 07:49:11 -0700 (Fri, 16 Mar 2007) | 2 lines
Remove warning: funcion declaration isn't a prototype
........
r54415 | jeremy.hylton | 2007-03-16 08:59:47 -0700 (Fri, 16 Mar 2007) | 11 lines
Clean up formatting of this file.
The file should now follow PEP 7, except that it uses 4 space indents
(in the style of Py3k). This particular code would be really hard to
read with the regular tab idents.
Other changes:
- reflow long lines
- change multi-line conditionals to have test at end of line
........
r54417 | collin.winter | 2007-03-16 14:13:35 -0700 (Fri, 16 Mar 2007) | 1 line
Patch #1676994: Refactor test_popen2 to use unittest.
........
r54418 | collin.winter | 2007-03-16 14:15:35 -0700 (Fri, 16 Mar 2007) | 1 line
Remove test/output/test_popen2 (missed in r54417).
........
r54419 | collin.winter | 2007-03-16 15:16:08 -0700 (Fri, 16 Mar 2007) | 1 line
Patch 1339796: add a relpath() function to os.path.
........
r54421 | georg.brandl | 2007-03-17 09:08:45 -0700 (Sat, 17 Mar 2007) | 5 lines
Patch #1675423: PyComplex_AsCComplex() now tries to convert an object
to complex using its __complex__() method before falling back to the
__float__() method. Therefore, the functions in the cmath module now
can operate on objects that define a __complex__() method.
(backport)
........
r54423 | gregory.p.smith | 2007-03-17 15:33:35 -0700 (Sat, 17 Mar 2007) | 2 lines
move note to the correct section
........
r54426 | georg.brandl | 2007-03-18 01:25:00 -0700 (Sun, 18 Mar 2007) | 2 lines
Patch #1682878: the new socket methods are recv_into and recvfrom_into, not *_buf.
........
r54432 | georg.brandl | 2007-03-18 11:28:25 -0700 (Sun, 18 Mar 2007) | 2 lines
Patch #1678339: test case for bug in difflib.
........
r54439 | collin.winter | 2007-03-19 11:52:08 -0700 (Mon, 19 Mar 2007) | 1 line
Patch #1630118: add a SpooledTemporaryFile class to tempfile.
........
r54441 | georg.brandl | 2007-03-19 12:02:48 -0700 (Mon, 19 Mar 2007) | 2 lines
Patch #1683328: fixes and enhancements for "unparse" demo.
........
r54456 | neal.norwitz | 2007-03-19 22:07:28 -0700 (Mon, 19 Mar 2007) | 1 line
Add some doc that was left out from some change to platform.py
........
r54457 | neal.norwitz | 2007-03-19 22:08:23 -0700 (Mon, 19 Mar 2007) | 1 line
Add a comment about 3k migration
........
r54458 | neal.norwitz | 2007-03-19 22:21:21 -0700 (Mon, 19 Mar 2007) | 1 line
Get rid of deprecation warning when testing commands.getstatus()
........
r54459 | neal.norwitz | 2007-03-19 22:23:09 -0700 (Mon, 19 Mar 2007) | 4 lines
Try backing out 54407 to see if it corrects the problems on the Windows
buildbots. This rev was backported, so we will need to keep both branches
in sync, pending the outcome of the test after this checkin.
........
r54460 | neal.norwitz | 2007-03-19 23:13:25 -0700 (Mon, 19 Mar 2007) | 1 line
Try to make this test more resistant to dropping from previous runs (ie, files that may exist but cause the test to fail). Should be backported (assuming it works :-)
........
r54461 | neal.norwitz | 2007-03-19 23:16:26 -0700 (Mon, 19 Mar 2007) | 1 line
Try to make this test more resistant to dropping from previous runs (ie, files that may exist but cause the test to fail). Should be backported (assuming it works :-)
........
r54462 | neal.norwitz | 2007-03-19 23:53:17 -0700 (Mon, 19 Mar 2007) | 5 lines
Try to be a little more resilient to errors. This might help the test
pass, but my guess is that it won't. I'm guessing that some other
test is leaving this file open which means it can't be removed
under Windows AFAIK.
........
r54463 | neal.norwitz | 2007-03-20 01:14:57 -0700 (Tue, 20 Mar 2007) | 8 lines
Try to get test_urllib to pass on Windows by closing the file.
I'm guessing that's the problem. h.getfile() must be called *after*
h.getreply() and the fp can be None.
I'm not entirely convinced this is the best fix (or even correct).
The buildbots will tell us if things improve or not. I don't
know if this needs to be backported (assuming it actually works).
........
r54465 | raymond.hettinger | 2007-03-20 14:27:24 -0700 (Tue, 20 Mar 2007) | 1 line
Extend work on rev 52962 and 53829 eliminating redundant PyObject_Hash() calls and fixing set/dict interoperability.
........
r54468 | georg.brandl | 2007-03-20 16:05:14 -0700 (Tue, 20 Mar 2007) | 2 lines
Fix for glob.py if filesystem encoding is None.
........
r54479 | neal.norwitz | 2007-03-20 23:39:48 -0700 (Tue, 20 Mar 2007) | 1 line
Remove unused file spotted by Paul Hankin
........
r54480 | georg.brandl | 2007-03-21 02:00:39 -0700 (Wed, 21 Mar 2007) | 3 lines
Patch #1682205: a TypeError while unpacking an iterable is no longer
masked by a generic one with the message "unpack non-sequence".
........
r54482 | georg.brandl | 2007-03-21 02:10:29 -0700 (Wed, 21 Mar 2007) | 2 lines
New test for rev. 54407 which only uses directories under TESTFN.
........
r54483 | georg.brandl | 2007-03-21 02:16:53 -0700 (Wed, 21 Mar 2007) | 2 lines
Patch #1684834: document some utility C API functions.
........
r54485 | georg.brandl | 2007-03-21 04:51:25 -0700 (Wed, 21 Mar 2007) | 2 lines
Fix #1684254: split BROWSER contents with shlex to avoid displaying 'URL'.
........
r54487 | andrew.kuchling | 2007-03-21 07:32:43 -0700 (Wed, 21 Mar 2007) | 1 line
Add comments on maintenance of this file
........
r54489 | andrew.kuchling | 2007-03-21 09:57:32 -0700 (Wed, 21 Mar 2007) | 1 line
Fix sentence, and fix typo in example
........
r54490 | andrew.kuchling | 2007-03-21 09:59:20 -0700 (Wed, 21 Mar 2007) | 1 line
Put code examples at left margin instead of indenting them
........
r54491 | facundo.batista | 2007-03-21 12:41:24 -0700 (Wed, 21 Mar 2007) | 1 line
Minor clarification, saying that blocking means no timeout (from bug #882297)
........
r54492 | ziga.seilnacht | 2007-03-21 13:07:56 -0700 (Wed, 21 Mar 2007) | 2 lines
Bug #1675967: re patterns pickled with older Python versions can
now be unpickled. Will backport.
........
r54495 | raymond.hettinger | 2007-03-21 13:33:57 -0700 (Wed, 21 Mar 2007) | 1 line
Add test and fix for fromkeys() optional argument.
........
r54524 | georg.brandl | 2007-03-22 01:05:45 -0700 (Thu, 22 Mar 2007) | 2 lines
Bug #1685704: use -m switch in timeit docs.
........
r54533 | thomas.heller | 2007-03-22 12:44:31 -0700 (Thu, 22 Mar 2007) | 5 lines
Back out "Patch #1643874: memory leak in ctypes fixed."
The code in this patch leaves no way to give up the ownership of a
BSTR instance.
........
r54538 | thomas.heller | 2007-03-22 13:34:37 -0700 (Thu, 22 Mar 2007) | 2 lines
Explain the purpose of the b_needsfree flag (forward ported from release25-maint).
........
r54539 | guido.van.rossum | 2007-03-22 21:58:42 -0700 (Thu, 22 Mar 2007) | 12 lines
- Bug #1683368: The object.__init__() and object.__new__() methods are
now stricter in rejecting excess arguments. The only time when
either allows excess arguments is when it is not overridden and the
other one is. For backwards compatibility, when both are
overridden, it is a deprecation warning (for now; maybe a Py3k
warning later).
When merging this into 3.0, the warnings should become errors.
Note: without the change to string.py, lots of spurious warnings happen.
What's going on there?
........
r54540 | neal.norwitz | 2007-03-22 22:17:23 -0700 (Thu, 22 Mar 2007) | 1 line
Add Mark Dickinson for SF # 1675423.
........
r54541 | martin.v.loewis | 2007-03-23 03:35:49 -0700 (Fri, 23 Mar 2007) | 3 lines
Patch #1686451: Fix return type for PySequence_{Count,Index,Fast_GET_SIZE}.
Will backport.
........
r54543 | martin.v.loewis | 2007-03-23 06:27:15 -0700 (Fri, 23 Mar 2007) | 3 lines
Bug #978833: Revert r50844, as it broke _socketobject.dup.
Will backport.
........
r54545 | guido.van.rossum | 2007-03-23 11:53:03 -0700 (Fri, 23 Mar 2007) | 8 lines
Add a type.__init__() method that enforces the same signature as
type.__new__(), and then calls object.__init__(cls), just to be anal.
This allows us to restore the code in string.py's _TemplateMetaclass
that called super(...).__init__(name, bases, dct), which I commented
out yesterday since it broke due to the stricter argument checking
added to object.__init__().
........
r54546 | facundo.batista | 2007-03-23 11:54:07 -0700 (Fri, 23 Mar 2007) | 4 lines
Added a 'create_connect()' function to socket.py, which creates a
connection with an optional timeout, and modified httplib.py to
use this function in HTTPConnection. Applies patch 1676823.
........
r54547 | guido.van.rossum | 2007-03-23 12:39:01 -0700 (Fri, 23 Mar 2007) | 2 lines
Add note about type.__init__().
........
r54553 | thomas.heller | 2007-03-23 12:55:27 -0700 (Fri, 23 Mar 2007) | 5 lines
Prevent creation (followed by a segfault) of array types when the size
overflows the valid Py_ssize_t range. Check return values of
PyMem_Malloc.
Will backport to release25-maint.
........
r54555 | facundo.batista | 2007-03-23 13:23:08 -0700 (Fri, 23 Mar 2007) | 6 lines
Surrounded with try/finally to socket's default timeout setting
changes in the tests, so failing one test won't produce strange
results in others. Also relaxed the timeout settings in the test
(where actually the value didn't mean anything).
........
r54556 | collin.winter | 2007-03-23 15:24:39 -0700 (Fri, 23 Mar 2007) | 1 line
Make test_relpath() pass on Windows.
........
r54559 | ziga.seilnacht | 2007-03-24 07:24:26 -0700 (Sat, 24 Mar 2007) | 6 lines
Patch #1489771: update syntax rules in Python Reference Manual.
Python 2.5 added support for explicit relative import statements and
yield expressions, which were missing in the manual.
Also fix grammar productions that used the names from the Grammar file,
markup that broke the generated grammar.txt, and wrap some lines that
broke the pdf output. Will backport.
........
r54565 | georg.brandl | 2007-03-24 15:20:34 -0700 (Sat, 24 Mar 2007) | 2 lines
Remove typo accent.
........
r54566 | georg.brandl | 2007-03-24 15:27:56 -0700 (Sat, 24 Mar 2007) | 2 lines
Revert accidental change.
........
r54567 | brett.cannon | 2007-03-24 18:32:36 -0700 (Sat, 24 Mar 2007) | 3 lines
Change the docs to no longer claim that unittest is preferred over doctest for
regression tests.
........
r54568 | facundo.batista | 2007-03-24 18:53:21 -0700 (Sat, 24 Mar 2007) | 4 lines
Redone the tests, using the infrastructure already present
for threading and socket serving.
........
r54570 | facundo.batista | 2007-03-24 20:20:05 -0700 (Sat, 24 Mar 2007) | 3 lines
Closing the HTTP connection after each test, and listening more.
........
r54572 | georg.brandl | 2007-03-25 11:44:35 -0700 (Sun, 25 Mar 2007) | 2 lines
Markup fix.
........
r54573 | georg.brandl | 2007-03-25 12:04:55 -0700 (Sun, 25 Mar 2007) | 2 lines
Markup fix.
........
r54580 | facundo.batista | 2007-03-26 13:18:31 -0700 (Mon, 26 Mar 2007) | 5 lines
Added an optional timeout to FTP class. Also I started a test_ftplib.py
file to test the ftp lib (right now I included a basic test, the timeout
one, and nothing else).
........
r54581 | georg.brandl | 2007-03-26 13:28:28 -0700 (Mon, 26 Mar 2007) | 2 lines
Some nits.
........
r54582 | facundo.batista | 2007-03-26 13:56:09 -0700 (Mon, 26 Mar 2007) | 4 lines
Forgot to add the file before the previous commit, here go
the ftplib tests.
........
r54585 | facundo.batista | 2007-03-27 11:23:21 -0700 (Tue, 27 Mar 2007) | 5 lines
Added an optional timeout to poplib.POP3. Also created a
test_poplib.py file with a basic test and the timeout
ones. Docs are also updated.
........
r54586 | facundo.batista | 2007-03-27 11:50:29 -0700 (Tue, 27 Mar 2007) | 3 lines
The basic test cases of poplib.py.
........
r54594 | facundo.batista | 2007-03-27 20:45:20 -0700 (Tue, 27 Mar 2007) | 4 lines
Bug 1688393. Adds a control of negative values in
socket.recvfrom, which caused an ugly crash.
........
r54599 | facundo.batista | 2007-03-28 11:25:54 -0700 (Wed, 28 Mar 2007) | 5 lines
Added timeout to smtplib (to SMTP and SMTP_SSL). Also created
the test_smtplib.py file, with a basic test and the timeout
ones. Docs are updated too.
........
r54603 | collin.winter | 2007-03-28 16:34:06 -0700 (Wed, 28 Mar 2007) | 3 lines
Consolidate patches #1690164, 1683397, and 1690169, all of which refactor XML-related test suites. The patches are applied together because they use a common output/xmltests file.
Thanks to Jerry Seutter for all three patches.
........
r54604 | collin.winter | 2007-03-28 19:28:16 -0700 (Wed, 28 Mar 2007) | 1 line
Make test_zipfile clean up its temporary files properly.
........
r54605 | georg.brandl | 2007-03-29 00:41:32 -0700 (Thu, 29 Mar 2007) | 2 lines
These are actually methods.
........
r54606 | georg.brandl | 2007-03-29 05:42:07 -0700 (Thu, 29 Mar 2007) | 4 lines
In Windows' time.clock(), when QueryPerformanceFrequency() fails,
the C lib's clock() is used, but it must be divided by CLOCKS_PER_SEC
as for the POSIX implementation (thanks to #pypy).
........
r54608 | facundo.batista | 2007-03-29 11:22:35 -0700 (Thu, 29 Mar 2007) | 5 lines
Added timout parameter to telnetlib.Telnet. Also created
test_telnetlib.py with a basic test and timeout ones.
Docs are also updated.
........
r54613 | facundo.batista | 2007-03-30 06:00:35 -0700 (Fri, 30 Mar 2007) | 4 lines
Added the posibility to pass the timeout to FTP.connect, not only when
instantiating the class. Docs and tests are updated.
........
r54614 | collin.winter | 2007-03-30 07:01:25 -0700 (Fri, 30 Mar 2007) | 1 line
Bug #1688274: add documentation for C-level class objects.
........
r54615 | marc-andre.lemburg | 2007-03-30 08:01:42 -0700 (Fri, 30 Mar 2007) | 4 lines
Bump the patch level version of distutils since there were a few bug fixes since
the 2.5.0 release.
........
r54617 | georg.brandl | 2007-03-30 08:49:05 -0700 (Fri, 30 Mar 2007) | 2 lines
Markup fix.
........
r54618 | georg.brandl | 2007-03-30 10:39:39 -0700 (Fri, 30 Mar 2007) | 2 lines
Label name fix.
........
r54619 | georg.brandl | 2007-03-30 10:47:21 -0700 (Fri, 30 Mar 2007) | 2 lines
Duplicate label fix.
........
r54620 | georg.brandl | 2007-03-30 10:48:39 -0700 (Fri, 30 Mar 2007) | 2 lines
Markup fix.
........
r54623 | andrew.kuchling | 2007-03-30 11:00:15 -0700 (Fri, 30 Mar 2007) | 1 line
Add item. (Oops, accidentally checked this in on my branch)
........
r54624 | georg.brandl | 2007-03-30 12:01:38 -0700 (Fri, 30 Mar 2007) | 2 lines
Duplicate label fix.
........
r54625 | georg.brandl | 2007-03-30 12:14:02 -0700 (Fri, 30 Mar 2007) | 2 lines
Markup fix.
........
r54629 | georg.brandl | 2007-03-31 03:17:31 -0700 (Sat, 31 Mar 2007) | 2 lines
repair string literal.
........
r54630 | georg.brandl | 2007-03-31 04:54:58 -0700 (Sat, 31 Mar 2007) | 2 lines
Markup fix.
........
r54631 | georg.brandl | 2007-03-31 04:58:36 -0700 (Sat, 31 Mar 2007) | 2 lines
Duplicate label fix.
........
r54632 | georg.brandl | 2007-03-31 04:59:54 -0700 (Sat, 31 Mar 2007) | 2 lines
Typo fix.
........
r54633 | neal.norwitz | 2007-03-31 11:54:18 -0700 (Sat, 31 Mar 2007) | 1 line
Fix method names. Will backport.
........
r54634 | georg.brandl | 2007-03-31 11:56:11 -0700 (Sat, 31 Mar 2007) | 4 lines
Bug #1655392: don't add -L/usr/lib/pythonX.Y/config to the LDFLAGS
returned by python-config if Python was built with --enable-shared
because that prevented the shared library from being used.
........
r54637 | collin.winter | 2007-03-31 12:31:34 -0700 (Sat, 31 Mar 2007) | 1 line
Shut up an occaisonal buildbot error due to test files being left around.
........
r54644 | neal.norwitz | 2007-04-01 11:24:22 -0700 (Sun, 01 Apr 2007) | 11 lines
SF #1685563, MSVCCompiler creates redundant and long PATH strings
If MSVCCompiler.initialize() was called multiple times, the path
would get duplicated. On Windows, this is a problem because the
path is limited to 4k. There's no benefit in adding a path multiple
times, so prevent that from occuring. We also normalize the path
before checking for duplicates so things like /a and /a/ won't both
be stored.
Will backport.
........
r54646 | brett.cannon | 2007-04-01 11:47:27 -0700 (Sun, 01 Apr 2007) | 8 lines
time.strptime's caching of its locale object was being recreated when the
locale changed but not used during the function call it was recreated during.
The test in this checkin is untested (OS X does not have the proper locale
support for me to test), although the fix for the bug this deals with
was tested by the OP (#1290505). Once the buildbots verify the test at least
doesn't fail it becomes a backport candidate.
........
r54647 | brett.cannon | 2007-04-01 12:46:19 -0700 (Sun, 01 Apr 2007) | 3 lines
Fix the test for recreating the locale cache object by not worrying about if
one of the test locales cannot be set.
........
r54649 | georg.brandl | 2007-04-01 14:29:15 -0700 (Sun, 01 Apr 2007) | 2 lines
Fix a lot of markup and meta-information glitches.
........
r54650 | georg.brandl | 2007-04-01 14:39:52 -0700 (Sun, 01 Apr 2007) | 2 lines
Another fix.
........
r54651 | georg.brandl | 2007-04-01 15:39:10 -0700 (Sun, 01 Apr 2007) | 2 lines
Lots of explicit class names for method and member descs.
........
r54652 | georg.brandl | 2007-04-01 15:40:12 -0700 (Sun, 01 Apr 2007) | 2 lines
Explicit class names.
........
r54653 | georg.brandl | 2007-04-01 15:47:31 -0700 (Sun, 01 Apr 2007) | 2 lines
Some semantic fixes.
........
r54654 | georg.brandl | 2007-04-01 16:29:10 -0700 (Sun, 01 Apr 2007) | 2 lines
Remove bogus entry.
........
r54655 | georg.brandl | 2007-04-01 16:31:30 -0700 (Sun, 01 Apr 2007) | 2 lines
Fix the class name of strings.
........
r54658 | raymond.hettinger | 2007-04-02 10:29:30 -0700 (Mon, 02 Apr 2007) | 1 line
SF #1693079: Cannot save empty array in shelve
........
r54663 | raymond.hettinger | 2007-04-02 15:54:21 -0700 (Mon, 02 Apr 2007) | 3 lines
Array module's buffer interface can now handle empty arrays.
........
r54664 | guido.van.rossum | 2007-04-02 16:55:37 -0700 (Mon, 02 Apr 2007) | 5 lines
Fix warnings about object.__init__() signature.
Two (test_array and test_descr) were bug IMO; the third (copy_reg)
is a work-around which recognizes that object.__init__() doesn't do
anything.
........
r54666 | raymond.hettinger | 2007-04-02 17:02:11 -0700 (Mon, 02 Apr 2007) | 1 line
SF 1602378 Clarify docstrings for bisect
........
r54668 | raymond.hettinger | 2007-04-02 18:39:43 -0700 (Mon, 02 Apr 2007) | 3 lines
SF #1382213: Tutorial section 9.5.1 ignores MRO for new-style classes
........
r54669 | matthias.klose | 2007-04-02 21:35:59 -0700 (Mon, 02 Apr 2007) | 4 lines
- Fix an off-by-one bug in locale.strxfrm().
patch taken from http://bugs.debian.org/416934.
........
r54671 | georg.brandl | 2007-04-03 00:04:27 -0700 (Tue, 03 Apr 2007) | 9 lines
Fix the strange case of
\begin{methoddesc}[NNTP]{...}
where
\ifx#1\@undefined ended up comparing N and N, therefore executing
the true part of the conditional, blowing up at \@undefined.
........
r54672 | facundo.batista | 2007-04-03 07:05:08 -0700 (Tue, 03 Apr 2007) | 4 lines
Now using unittest for the tests infraestructure. Also split the
tests in those who need the network, and that who doesn't.
........
r54673 | walter.doerwald | 2007-04-03 09:08:10 -0700 (Tue, 03 Apr 2007) | 4 lines
Move the functionality for catching warnings in test_warnings.py into a separate
class to that reusing the functionality in test_structmembers.py doesn't rerun
the tests from test_warnings.py.
........
r54674 | walter.doerwald | 2007-04-03 09:16:24 -0700 (Tue, 03 Apr 2007) | 2 lines
Document that CatchWarningTests is reused by test_structmembers.py.
........
r54675 | walter.doerwald | 2007-04-03 09:53:43 -0700 (Tue, 03 Apr 2007) | 4 lines
Add tests for the filename.
Test that the stacklevel is handled correctly.
........
r54676 | facundo.batista | 2007-04-03 10:29:48 -0700 (Tue, 03 Apr 2007) | 6 lines
Added a SSL server to test_socket_ssl.py to be able to test
locally. Now, it checks if have openssl available and run
those specific tests (it starts openssl at the beggining of
all the tests and then kills it at the end).
........
r54677 | walter.doerwald | 2007-04-03 11:33:29 -0700 (Tue, 03 Apr 2007) | 6 lines
Implement a contextmanager test.test_support.catch_warning that can
be used to catch the last warning issued by the warning framework.
Change test_warnings.py and test_structmembers.py to use this
new contextmanager.
........
r54678 | facundo.batista | 2007-04-03 14:15:34 -0700 (Tue, 03 Apr 2007) | 4 lines
Changed the whole structure of startup and checking if the
server is available. Hope to not get more false alarms.
........
r54681 | facundo.batista | 2007-04-04 07:10:40 -0700 (Wed, 04 Apr 2007) | 4 lines
Fixed the way that the .pem files are looked for, and changed
how to kill the process in win32 to use the _handle attribute.
........
r54682 | guido.van.rossum | 2007-04-04 10:43:02 -0700 (Wed, 04 Apr 2007) | 4 lines
Fix a race condition in this test -- instead of assuming that it will take
the test server thread at most 0.5 seconds to get ready, use an event
variable.
........
r54683 | collin.winter | 2007-04-04 11:14:17 -0700 (Wed, 04 Apr 2007) | 1 line
Clean up imports.
........
r54684 | collin.winter | 2007-04-04 11:16:24 -0700 (Wed, 04 Apr 2007) | 1 line
Stop using test_support.verify().
........
r54685 | martin.v.loewis | 2007-04-04 11:30:36 -0700 (Wed, 04 Apr 2007) | 2 lines
Bug #1686475: Support stat'ing open files on Windows again.
Will backport to 2.5.
........
r54687 | collin.winter | 2007-04-04 11:33:40 -0700 (Wed, 04 Apr 2007) | 1 line
Make test_getopt use unittest.
........
r54688 | collin.winter | 2007-04-04 11:36:30 -0700 (Wed, 04 Apr 2007) | 1 line
Make test_softspace use unittest.
........
r54689 | ziga.seilnacht | 2007-04-04 11:38:47 -0700 (Wed, 04 Apr 2007) | 2 lines
Fix WalkTests.test_traversal() on Windows. The cleanup in
MakedirTests.setUp() can now be removed.
........
r54695 | raymond.hettinger | 2007-04-05 11:00:03 -0700 (Thu, 05 Apr 2007) | 3 lines
Bug #1563759: struct.unpack doens't support buffer protocol objects
........
r54697 | collin.winter | 2007-04-05 13:05:07 -0700 (Thu, 05 Apr 2007) | 1 line
Convert test_long_future to use unittest.
........
r54698 | collin.winter | 2007-04-05 13:08:56 -0700 (Thu, 05 Apr 2007) | 1 line
Convert test_normalization to use unittest.
........
r54699 | andrew.kuchling | 2007-04-05 18:11:58 -0700 (Thu, 05 Apr 2007) | 1 line
Some grammar fixes
........
r54704 | collin.winter | 2007-04-06 12:27:40 -0700 (Fri, 06 Apr 2007) | 1 line
Convert test_stringprep to use unittest.
........
r54705 | collin.winter | 2007-04-06 12:32:32 -0700 (Fri, 06 Apr 2007) | 1 line
Import cleanup in test_crypt.
........
r54706 | collin.winter | 2007-04-06 13:00:05 -0700 (Fri, 06 Apr 2007) | 1 line
Convert test_gc to use unittest.
........
r54707 | collin.winter | 2007-04-06 13:03:11 -0700 (Fri, 06 Apr 2007) | 1 line
Convert test_module to use unittest.
........
r54711 | collin.winter | 2007-04-06 21:40:43 -0700 (Fri, 06 Apr 2007) | 1 line
Convert test_fileinput to use unittest.
........
r54712 | brett.cannon | 2007-04-07 21:29:32 -0700 (Sat, 07 Apr 2007) | 5 lines
Doc that file.next() has undefined behaviour when called on a file opened with
'w'. Closes bug #1569057.
To be backported once 2.5 branch is unfrozen.
........
r54726 | vinay.sajip | 2007-04-09 09:16:10 -0700 (Mon, 09 Apr 2007) | 1 line
Added optional timeout to SocketHandler.makeSocket (SF #1695948)
........
r54727 | ziga.seilnacht | 2007-04-09 12:10:29 -0700 (Mon, 09 Apr 2007) | 3 lines
Patch #1695862: remove old test directory that causes test_urllib failures
on Windows buildbots. The change is a one time fix and will be removed
after a successful buildbot run.
........
r54729 | facundo.batista | 2007-04-09 20:00:37 -0700 (Mon, 09 Apr 2007) | 3 lines
Minor fix to the tests pass ok even with -O.
........
r54730 | collin.winter | 2007-04-09 21:44:49 -0700 (Mon, 09 Apr 2007) | 1 line
Typo fix.
........
r54732 | facundo.batista | 2007-04-10 05:58:45 -0700 (Tue, 10 Apr 2007) | 5 lines
General clean-up. Lot of margin corrections, comments, some typos.
Exceptions now are raised in the new style. And a mockup class is
now also new style. Thanks Santiago Pereson.
........
r54741 | georg.brandl | 2007-04-10 14:39:38 -0700 (Tue, 10 Apr 2007) | 2 lines
Repair a duplicate label and some obsolete uses of \setindexsubitem.
........
r54746 | andrew.kuchling | 2007-04-11 06:39:00 -0700 (Wed, 11 Apr 2007) | 1 line
Add window.chgat() method, submitted via e-mail by Fabian Kreutz
........
r54747 | andrew.kuchling | 2007-04-11 06:42:25 -0700 (Wed, 11 Apr 2007) | 1 line
Point readers at the patch submission instructions
........
r54748 | andrew.kuchling | 2007-04-11 06:47:13 -0700 (Wed, 11 Apr 2007) | 1 line
Describe undocumented third argument to touchline()
........
r54757 | georg.brandl | 2007-04-11 10:16:24 -0700 (Wed, 11 Apr 2007) | 3 lines
Add some missing NULL checks which trigger crashes on low-memory conditions.
Found by Victor Stinner. Will backport when 2.5 branch is unfrozen.
........
r54760 | raymond.hettinger | 2007-04-11 11:40:58 -0700 (Wed, 11 Apr 2007) | 1 line
SF 1191699: Make slices picklable
........
r54762 | georg.brandl | 2007-04-11 12:25:11 -0700 (Wed, 11 Apr 2007) | 2 lines
Exceptions are no longer old-style instances. Fix accordingly.
........
r54763 | georg.brandl | 2007-04-11 16:28:44 -0700 (Wed, 11 Apr 2007) | 2 lines
Repair missing spaces after \UNIX.
........
r54772 | raymond.hettinger | 2007-04-11 21:10:00 -0700 (Wed, 11 Apr 2007) | 1 line
SF 1193128: Let str.translate(None) be an identity transformation
........
r54784 | georg.brandl | 2007-04-12 00:01:19 -0700 (Thu, 12 Apr 2007) | 2 lines
Patch #1698951: clarify deprecation message in rexec and Bastion
........
r54785 | ziga.seilnacht | 2007-04-12 01:46:51 -0700 (Thu, 12 Apr 2007) | 2 lines
Patch #1695862: remove the cleanup code, now that Windows buildbots are green
again.
........
r54786 | walter.doerwald | 2007-04-12 03:35:00 -0700 (Thu, 12 Apr 2007) | 3 lines
Fix utf-8-sig incremental decoder, which didn't recognise a BOM when the
first chunk fed to the decoder started with a BOM, but was longer than 3 bytes.
........
r54807 | barry.warsaw | 2007-04-13 11:47:14 -0700 (Fri, 13 Apr 2007) | 8 lines
Port r54805 from python25-maint branch:
Add code to read from master_fd in the parent, breaking when we get an OSError
(EIO can occur on Linux) or there's no more data to read. Without this,
test_pty.py can hang on the waitpid() because the child is blocking on the
stdout write. This will definitely happen on Mac OS X and could potentially
happen on other platforms. See the comment for details.
........
r54812 | kristjan.jonsson | 2007-04-13 15:07:33 -0700 (Fri, 13 Apr 2007) | 1 line
Fix a bug when using the __lltrace__ opcode tracer, and a problem sith signed chars in frameobject.c which can occur with opcodes > 127
........
r54814 | kristjan.jonsson | 2007-04-13 15:20:13 -0700 (Fri, 13 Apr 2007) | 1 line
Fix potential crash in path manipulation on windows
........
r54816 | trent.mick | 2007-04-13 16:22:05 -0700 (Fri, 13 Apr 2007) | 4 lines
Add the necessary dependency for the Windows VC6 build to ensure 'pythoncore'
is built before '_ctypes' is attempted.
Will backport to 2.5 once it is unfrozen for 2.5.1.
........
r54825 | neal.norwitz | 2007-04-13 22:25:50 -0700 (Fri, 13 Apr 2007) | 3 lines
When __slots__ are set to a unicode string, make it work the same as
setting a plain string, ie don't expand to single letter identifiers.
........
r54841 | neal.norwitz | 2007-04-16 00:37:55 -0700 (Mon, 16 Apr 2007) | 1 line
SF #1701207, Fix bogus assertion (and test it!)
........
r54844 | collin.winter | 2007-04-16 15:10:32 -0700 (Mon, 16 Apr 2007) | 1 line
Check the availability of the urlfetch resource earlier than before.
........
r54849 | martin.v.loewis | 2007-04-16 22:02:01 -0700 (Mon, 16 Apr 2007) | 2 lines
Add Travis Oliphant.
........
r54873 | brett.cannon | 2007-04-18 20:44:17 -0700 (Wed, 18 Apr 2007) | 2 lines
Silence a compiler warning about incompatible pointer types.
........
r54874 | neal.norwitz | 2007-04-18 22:52:37 -0700 (Wed, 18 Apr 2007) | 2 lines
SF #1703270, add missing declaration in readline.c to avoid compiler warning.
........
r54875 | armin.rigo | 2007-04-19 07:44:48 -0700 (Thu, 19 Apr 2007) | 8 lines
Revert r53997 as per
http://mail.python.org/pipermail/python-dev/2007-March/071796.html .
I've kept a couple of still-valid extra tests in test_descr, but didn't
bother to sort through the new comments and refactorings added in r53997
to see if some of them could be kept. If so, they could go in a
follow-up check-in.
........
r54876 | armin.rigo | 2007-04-19 07:56:48 -0700 (Thu, 19 Apr 2007) | 2 lines
Fix a usage of the dangerous pattern decref - modify field - incref.
........
r54884 | neal.norwitz | 2007-04-19 22:20:38 -0700 (Thu, 19 Apr 2007) | 9 lines
Add an optional address to copy the failure mails to.
Detect a conflict in the only file that should have outstanding changes
when this script is run. This doesn't matter on the trunk, but does
when run on a branch. Trunk always has the date set to today in
boilerplate.tex. Each time a release is cut with a different date,
a conflict occurs. (We could copy a known good version, but then
we would lose changes to this file.)
........
r54918 | georg.brandl | 2007-04-21 13:35:38 -0700 (Sat, 21 Apr 2007) | 3 lines
Bug #1704790: bind name "sys" locally in __del__ method so that it is
not cleared before __del__ is run.
........
r54920 | facundo.batista | 2007-04-21 18:18:56 -0700 (Sat, 21 Apr 2007) | 5 lines
Added tests for other methods of SSL object. Now we cover
all the object methods. This is the final step to close
the #451607 bug.
........
r54927 | facundo.batista | 2007-04-23 10:08:31 -0700 (Mon, 23 Apr 2007) | 5 lines
As specified in RFC 2616, 2xx code indicates that the client's
request was successfully received, understood, and accepted.
Now in these cases no error is raised. Also fixed tests.
........
r54929 | collin.winter | 2007-04-23 20:43:46 -0700 (Mon, 23 Apr 2007) | 1 line
Convert PyUnit -> unittest.
........
r54931 | collin.winter | 2007-04-23 21:09:52 -0700 (Mon, 23 Apr 2007) | 1 line
Remove code that hasn't been called in years.
........
r54932 | neal.norwitz | 2007-04-23 21:53:12 -0700 (Mon, 23 Apr 2007) | 1 line
Fix SF #1703110, Incorrect example for add_password() (use uri, not host)
........
r54934 | georg.brandl | 2007-04-24 03:36:42 -0700 (Tue, 24 Apr 2007) | 2 lines
Some new year updates.
........
r54938 | facundo.batista | 2007-04-24 06:54:38 -0700 (Tue, 24 Apr 2007) | 4 lines
Added a comment about last change in urllib2.py (all 2xx responses
are ok now).
........
r54939 | georg.brandl | 2007-04-24 08:10:09 -0700 (Tue, 24 Apr 2007) | 2 lines
Bug #1705717: error in sys.argv docs.
........
r54941 | georg.brandl | 2007-04-24 08:27:13 -0700 (Tue, 24 Apr 2007) | 4 lines
Bug #1706381: Specifying the SWIG option "-c++" in the setup.py file
(as opposed to the command line) will now write file names ending in
".cpp" too.
........
r54944 | raymond.hettinger | 2007-04-24 15:13:43 -0700 (Tue, 24 Apr 2007) | 1 line
Fix markup
........
r54945 | kristjan.jonsson | 2007-04-24 17:10:50 -0700 (Tue, 24 Apr 2007) | 1 line
Merge change 54909 from release25-maint: Fix several minor issues discovered using code analysis in VisualStudio 2005 Team Edition
........
r54947 | kristjan.jonsson | 2007-04-24 17:17:39 -0700 (Tue, 24 Apr 2007) | 1 line
Make pythoncore compile cleanly with VisualStudio 2005. Used an explicit typecast to get a 64 bit integer, and undefined the Yield macro that conflicts with winbase.h
........
r54948 | kristjan.jonsson | 2007-04-24 17:19:26 -0700 (Tue, 24 Apr 2007) | 1 line
Remove obsolete comment. Importing of .dll files has been discontinued, only .pyd files supported on windows now.
........
r54949 | georg.brandl | 2007-04-24 23:24:59 -0700 (Tue, 24 Apr 2007) | 2 lines
Patch #1698768: updated the "using Python on the Mac" intro.
........
r54951 | georg.brandl | 2007-04-24 23:25:55 -0700 (Tue, 24 Apr 2007) | 2 lines
Markup fix.
........
r54953 | neal.norwitz | 2007-04-24 23:30:05 -0700 (Tue, 24 Apr 2007) | 3 lines
Whitespace normalization. Ugh, we really need to do this more often.
You might want to review this change as it's my first time. Be gentle. :-)
........
r54956 | collin.winter | 2007-04-25 10:29:52 -0700 (Wed, 25 Apr 2007) | 1 line
Standardize on test.test_support.run_unittest() (as opposed to a mix of run_unittest() and run_suite()). Also, add functionality to run_unittest() that admits usage of unittest.TestLoader.loadTestsFromModule().
........
r54957 | collin.winter | 2007-04-25 10:37:35 -0700 (Wed, 25 Apr 2007) | 1 line
Remove functionality from test_datetime.test_main() that does reference count checking; 'regrtest.py -R' is the way to do this kind of testing.
........
r54958 | collin.winter | 2007-04-25 10:57:53 -0700 (Wed, 25 Apr 2007) | 1 line
Change test_support.have_unicode to use True/False instead of 1/0.
........
r54959 | tim.peters | 2007-04-25 11:47:18 -0700 (Wed, 25 Apr 2007) | 2 lines
Whitespace normalization.
........
r54960 | tim.peters | 2007-04-25 11:48:35 -0700 (Wed, 25 Apr 2007) | 2 lines
Set missing svn:eol-style property on text files.
........
r54961 | collin.winter | 2007-04-25 11:54:36 -0700 (Wed, 25 Apr 2007) | 1 line
Import and raise statement cleanup.
........
r54969 | collin.winter | 2007-04-25 13:41:34 -0700 (Wed, 25 Apr 2007) | 1 line
Convert test_ossaudiodev to use unittest.
........
r54974 | collin.winter | 2007-04-25 14:50:25 -0700 (Wed, 25 Apr 2007) | 1 line
Fix an issue related to the unittest conversion.
........
r54979 | fred.drake | 2007-04-25 21:42:19 -0700 (Wed, 25 Apr 2007) | 1 line
fix some markup errors
........
r54982 | kristjan.jonsson | 2007-04-26 02:15:08 -0700 (Thu, 26 Apr 2007) | 1 line
Export function sanitize_the_mode from fileobject.c as _PyFile_SanitizeMode(). Use this function in posixmodule.c when implementing fdopen(). This fixes test_subprocess.py for a VisualStudio 2005 compile.
........
r54983 | kristjan.jonsson | 2007-04-26 06:44:16 -0700 (Thu, 26 Apr 2007) | 1 line
The locale "En" appears not to be valid on windows underi VisualStudio.2005. Added "English" to the test_locale.py to make the testsuite pass for that build
........
r54984 | steve.holden | 2007-04-26 07:23:12 -0700 (Thu, 26 Apr 2007) | 1 line
Minor wording change on slicing aide-memoire.
........
r54985 | kristjan.jonsson | 2007-04-26 08:24:54 -0700 (Thu, 26 Apr 2007) | 1 line
Accomodate 64 bit time_t in the _bsddb module.
........
2007-04-27 19:54:29 +00:00
|
|
|
static BOOL
|
2016-09-08 10:35:16 -07:00
|
|
|
attributes_from_dir(LPCWSTR pszFile, BY_HANDLE_FILE_INFORMATION *info, ULONG *reparse_tag)
|
Merged revisions 53952-54987 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r53954 | jeremy.hylton | 2007-02-26 10:41:18 -0800 (Mon, 26 Feb 2007) | 10 lines
Do not copy free variables to locals in class namespaces.
Fixes bug 1569356, but at the cost of a minor incompatibility in
locals(). Add test that verifies that the class namespace is not
polluted. Also clarify the behavior in the library docs.
Along the way, cleaned up the dict_to_map and map_to_dict
implementations and added some comments that explain what they do.
........
r53955 | jeremy.hylton | 2007-02-26 11:00:20 -0800 (Mon, 26 Feb 2007) | 2 lines
Fix assertion.
........
r53969 | neal.norwitz | 2007-02-26 14:41:45 -0800 (Mon, 26 Feb 2007) | 3 lines
When printing an unraisable error, don't print exceptions. before the name.
This duplicates the behavior whening normally printing exceptions.
........
r53970 | andrew.kuchling | 2007-02-26 15:02:47 -0800 (Mon, 26 Feb 2007) | 1 line
Markup fix
........
r53975 | neal.norwitz | 2007-02-26 15:48:27 -0800 (Mon, 26 Feb 2007) | 3 lines
SF #1669182, 2.5 was already fixed. Just assert in 2.6 since string exceptions
are gone.
........
r53976 | andrew.kuchling | 2007-02-26 15:54:17 -0800 (Mon, 26 Feb 2007) | 1 line
Add some items
........
r53981 | jeremy.hylton | 2007-02-26 17:01:59 -0800 (Mon, 26 Feb 2007) | 4 lines
Fix long-standing bug in name mangling for package imports
Reported by Mike Verdone.
........
r53993 | jeremy.hylton | 2007-02-27 08:00:06 -0800 (Tue, 27 Feb 2007) | 2 lines
tabify
........
r53994 | jeremy.hylton | 2007-02-27 08:13:23 -0800 (Tue, 27 Feb 2007) | 5 lines
tabify
Note that ast.c still has a mix of tabs and spaces, because it
attempts to use four-space indents for more of the new code.
........
r53996 | jeremy.hylton | 2007-02-27 09:24:48 -0800 (Tue, 27 Feb 2007) | 2 lines
whitespace normalization
........
r53997 | jeremy.hylton | 2007-02-27 10:29:45 -0800 (Tue, 27 Feb 2007) | 24 lines
Add checking for a number of metaclass error conditions.
We add some new rules that are required for preserving internal
invariants of types.
1. If type (or a subclass of type) appears in bases, it must appear
before any non-type bases. If a non-type base (like a regular
new-style class) occurred first, it could trick type into
allocating the new class an __dict__ which must be impossible.
2. There are several checks that are made of bases when creating a
type. Those checks are now repeated when assigning to __bases__.
We also add the restriction that assignment to __bases__ may not
change the metaclass of the type.
Add new tests for these cases and for a few other oddball errors that
were no previously tested. Remove a crasher test that was fixed.
Also some internal refactoring: Extract the code to find the most
derived metaclass of a type and its bases. It is now needed in two
places. Rewrite the TypeError checks in test_descr to use doctest.
The tests now clearly show what exception they expect to see.
........
r53998 | jeremy.hylton | 2007-02-27 10:33:31 -0800 (Tue, 27 Feb 2007) | 2 lines
Add news about changes to metaclasses and __bases__ error checking.
........
r54016 | armin.rigo | 2007-02-28 01:25:29 -0800 (Wed, 28 Feb 2007) | 3 lines
Modify the segfaulting example to show why r53997 is not a solution to
it.
........
r54022 | brett.cannon | 2007-02-28 10:15:00 -0800 (Wed, 28 Feb 2007) | 2 lines
Add a test for instantiating SyntaxError with no arguments.
........
r54026 | raymond.hettinger | 2007-02-28 10:27:41 -0800 (Wed, 28 Feb 2007) | 1 line
Docstring nit.
........
r54033 | raymond.hettinger | 2007-02-28 10:37:52 -0800 (Wed, 28 Feb 2007) | 1 line
Prepare collections module for pure python code entries.
........
r54053 | raymond.hettinger | 2007-02-28 22:16:43 -0800 (Wed, 28 Feb 2007) | 1 line
Add collections.NamedTuple
........
r54054 | neal.norwitz | 2007-02-28 23:04:41 -0800 (Wed, 28 Feb 2007) | 1 line
Add Pat and Eric for work on PEP 3101 in the sandbox
........
r54061 | andrew.kuchling | 2007-03-01 06:36:12 -0800 (Thu, 01 Mar 2007) | 1 line
Add NamedTuple
........
r54080 | georg.brandl | 2007-03-02 06:37:12 -0800 (Fri, 02 Mar 2007) | 2 lines
Bug #1628895: some better tries to find HTML documentation in pydoc.
........
r54086 | raymond.hettinger | 2007-03-02 11:20:46 -0800 (Fri, 02 Mar 2007) | 1 line
Fix embarrassing typo and fix constantification of None
........
r54088 | georg.brandl | 2007-03-02 12:30:14 -0800 (Fri, 02 Mar 2007) | 2 lines
Bugs #1668032, #1668036, #1669304: clarify behavior of PyMem_Realloc and _Resize.
........
r54114 | georg.brandl | 2007-03-04 09:18:54 -0800 (Sun, 04 Mar 2007) | 2 lines
Fix a bug in test_dict and test_userdict, found at the PyPy sprint.
........
r54124 | skip.montanaro | 2007-03-04 12:52:28 -0800 (Sun, 04 Mar 2007) | 2 lines
Teach setup.py how to find Berkeley DB on Macs using MacPorts.
........
r54125 | skip.montanaro | 2007-03-04 12:54:12 -0800 (Sun, 04 Mar 2007) | 1 line
note MacPorts/BerkDB change in setup.py
........
r54136 | neal.norwitz | 2007-03-04 23:52:01 -0800 (Sun, 04 Mar 2007) | 1 line
Added Pete for 3101 too
........
r54138 | facundo.batista | 2007-03-05 08:31:54 -0800 (Mon, 05 Mar 2007) | 1 line
Minor corrections to docs, and an explanation comentary
........
r54139 | georg.brandl | 2007-03-05 14:28:08 -0800 (Mon, 05 Mar 2007) | 3 lines
Patch #1674228: when assigning a slice (old-style), check for the
sq_ass_slice instead of the sq_slice slot.
........
r54149 | georg.brandl | 2007-03-06 01:33:01 -0800 (Tue, 06 Mar 2007) | 3 lines
Nit: a struct field is set to GenericAlloc, not GenericAlloc().
........
r54150 | georg.brandl | 2007-03-06 02:02:47 -0800 (Tue, 06 Mar 2007) | 3 lines
Patch #1671450: add a section about subclassing builtin types to the
"extending and embedding" tutorial.
........
r54152 | martin.v.loewis | 2007-03-06 02:41:24 -0800 (Tue, 06 Mar 2007) | 2 lines
Patch #1121142: Implement ZipFile.open.
........
r54154 | georg.brandl | 2007-03-06 03:51:14 -0800 (Tue, 06 Mar 2007) | 2 lines
A test case for the fix in #1674228.
........
r54156 | georg.brandl | 2007-03-06 03:52:24 -0800 (Tue, 06 Mar 2007) | 2 lines
Patch #1672481: fix bug in idlelib.MultiCall.
........
r54159 | georg.brandl | 2007-03-06 04:17:50 -0800 (Tue, 06 Mar 2007) | 1 line
Bug #1674503: close the file opened by execfile() in an error condition.
........
r54160 | georg.brandl | 2007-03-06 05:32:52 -0800 (Tue, 06 Mar 2007) | 3 lines
Fix another reincarnation of bug #1576657 in defaultdict.
........
r54162 | georg.brandl | 2007-03-06 05:35:00 -0800 (Tue, 06 Mar 2007) | 2 lines
A test case for the defaultdict KeyError bug.
........
r54164 | georg.brandl | 2007-03-06 05:37:45 -0800 (Tue, 06 Mar 2007) | 3 lines
Patch #1663234: you can now run doctest on test files and modules
using "python -m doctest [-v] filename ...".
........
r54165 | martin.v.loewis | 2007-03-06 06:43:00 -0800 (Tue, 06 Mar 2007) | 3 lines
Patch #912410: Replace HTML entity references for attribute values
in HTMLParser.
........
r54166 | skip.montanaro | 2007-03-06 07:41:38 -0800 (Tue, 06 Mar 2007) | 1 line
patch 1673619 - identify extension modules which cannot be built
........
r54167 | guido.van.rossum | 2007-03-06 07:50:01 -0800 (Tue, 06 Mar 2007) | 5 lines
Patch #1646728: datetime.fromtimestamp fails with negative
fractional times. With unittest.
Somebody please backport to 2.5.
........
r54169 | georg.brandl | 2007-03-06 09:49:14 -0800 (Tue, 06 Mar 2007) | 2 lines
Fix cmp vs. key argument for list.sort.
........
r54170 | georg.brandl | 2007-03-06 10:21:32 -0800 (Tue, 06 Mar 2007) | 2 lines
Small nit, found by Neal.
........
r54171 | georg.brandl | 2007-03-06 10:29:58 -0800 (Tue, 06 Mar 2007) | 3 lines
Patch #1602128: clarify that richcmp methods can return NotImplemented
and should return True or False otherwise.
........
r54173 | georg.brandl | 2007-03-06 10:41:12 -0800 (Tue, 06 Mar 2007) | 2 lines
Patch #1638879: don't accept strings with embedded NUL bytes in long().
........
r54175 | georg.brandl | 2007-03-06 10:47:31 -0800 (Tue, 06 Mar 2007) | 2 lines
Patch #1673121: update README wrt. OSX default shell.
........
r54177 | georg.brandl | 2007-03-06 10:59:11 -0800 (Tue, 06 Mar 2007) | 3 lines
Patch #1654417: make operator.{get,set,del}slice use the full range
of Py_ssize_t.
........
r54180 | walter.doerwald | 2007-03-06 12:38:57 -0800 (Tue, 06 Mar 2007) | 4 lines
Patch for bug #1633621: if curses.resizeterm() or
curses.resize_term() is called, update _curses.LINES,
_curses.COLS, curses.LINES and curses.COLS.
........
r54182 | walter.doerwald | 2007-03-06 13:15:24 -0800 (Tue, 06 Mar 2007) | 2 lines
Document change to curses.
........
r54188 | georg.brandl | 2007-03-06 16:34:46 -0800 (Tue, 06 Mar 2007) | 5 lines
Variant of patch #697613: don't exit the interpreter on a SystemExit
exception if the -i command line option or PYTHONINSPECT environment
variable is given, but break into the interactive interpreter just like
on other exceptions or normal program exit.
(backport)
........
r54189 | georg.brandl | 2007-03-06 16:40:28 -0800 (Tue, 06 Mar 2007) | 4 lines
Patch #703779: unset __file__ in __main__ after running a file. This
makes the filenames the warning module prints much more sensible when
a PYTHONSTARTUP file is used.
........
r54192 | george.yoshida | 2007-03-06 20:21:18 -0800 (Tue, 06 Mar 2007) | 2 lines
add versionadded info
........
r54195 | georg.brandl | 2007-03-06 23:39:06 -0800 (Tue, 06 Mar 2007) | 2 lines
Patch #812285: allow multiple auth schemes in AbstractBasicAuthHandler.
........
r54197 | georg.brandl | 2007-03-07 00:31:51 -0800 (Wed, 07 Mar 2007) | 3 lines
Patch #1001604: glob.glob() now returns unicode filenames if it was
given a unicode argument and os.listdir() returns unicode filenames.
........
r54199 | georg.brandl | 2007-03-07 01:09:40 -0800 (Wed, 07 Mar 2007) | 3 lines
Patches #1550273, #1550272: fix a few bugs in unittest and add a
comprehensive test suite for the module.
........
r54201 | georg.brandl | 2007-03-07 01:21:06 -0800 (Wed, 07 Mar 2007) | 3 lines
Patch #787789: allow to pass custom TestRunner instances to unittest's
main() function.
........
r54202 | georg.brandl | 2007-03-07 01:34:45 -0800 (Wed, 07 Mar 2007) | 2 lines
Patch #1669331: clarify shutil.copyfileobj() behavior wrt. file position.
........
r54204 | martin.v.loewis | 2007-03-07 03:04:33 -0800 (Wed, 07 Mar 2007) | 2 lines
Bug #1115886: os.path.splitext('.cshrc') gives now ('.cshrc', '').
........
r54206 | georg.brandl | 2007-03-07 03:37:42 -0800 (Wed, 07 Mar 2007) | 2 lines
Patch #1675471: convert test_pty to unittest.
........
r54207 | georg.brandl | 2007-03-07 03:54:49 -0800 (Wed, 07 Mar 2007) | 4 lines
Add some sanity checks to unittest.TestSuite's addTest(s) methods.
Fixes #878275.
........
r54209 | guido.van.rossum | 2007-03-07 07:16:29 -0800 (Wed, 07 Mar 2007) | 3 lines
Windows doesn't support negative timestamps. Skip the tests involving them
if os.name == "nt".
........
r54219 | martin.v.loewis | 2007-03-08 05:42:43 -0800 (Thu, 08 Mar 2007) | 2 lines
Add missing ) in parenthical remark.
........
r54220 | georg.brandl | 2007-03-08 09:49:06 -0800 (Thu, 08 Mar 2007) | 2 lines
Fix #1676656: \em is different from \emph...
........
r54222 | georg.brandl | 2007-03-08 10:37:31 -0800 (Thu, 08 Mar 2007) | 2 lines
Add a NEWS entry for rev. 54207,8.
........
r54225 | raymond.hettinger | 2007-03-08 11:24:27 -0800 (Thu, 08 Mar 2007) | 1 line
SF 1676321: empty() returned wrong result
........
r54227 | collin.winter | 2007-03-08 11:58:14 -0800 (Thu, 08 Mar 2007) | 1 line
Backported r54226 from p3yk: Move test_unittest, test_doctest and test_doctest2 higher up in the testing order.
........
r54230 | raymond.hettinger | 2007-03-08 13:33:47 -0800 (Thu, 08 Mar 2007) | 1 line
SF #1637850: make_table in difflib did not work with unicode
........
r54232 | collin.winter | 2007-03-08 14:16:25 -0800 (Thu, 08 Mar 2007) | 1 line
Patch #1668482: don't use '-' in mkstemp
........
r54233 | brett.cannon | 2007-03-08 15:58:11 -0800 (Thu, 08 Mar 2007) | 10 lines
Introduce test.test_support.TransientResource. It's a context manager to
surround calls to resources that may or may not be available. Specifying the
expected exception and attributes to be raised if the resource is not available
prevents overly broad catching of exceptions.
This is meant to help suppress spurious failures by raising
test.test_support.ResourceDenied if the exception matches. It would probably
be good to go through the various network tests and surround the calls to catch
connection timeouts (as done with test_socket_ssl in this commit).
........
r54234 | collin.winter | 2007-03-08 19:15:56 -0800 (Thu, 08 Mar 2007) | 1 line
Patch #1481079: Support of HTTP_REFERER in CGIHTTPServer.py
........
r54235 | collin.winter | 2007-03-08 19:26:32 -0800 (Thu, 08 Mar 2007) | 1 line
Add NEWS item for patch #1481079 (r54234).
........
r54237 | neal.norwitz | 2007-03-08 21:59:01 -0800 (Thu, 08 Mar 2007) | 1 line
Fix SF #1676971, Complex OverflowError has a typo
........
r54239 | georg.brandl | 2007-03-09 04:58:41 -0800 (Fri, 09 Mar 2007) | 2 lines
Typo.
........
r54240 | martin.v.loewis | 2007-03-09 07:35:55 -0800 (Fri, 09 Mar 2007) | 2 lines
Patch #957003: Implement smtplib.LMTP.
........
r54243 | collin.winter | 2007-03-09 10:09:10 -0800 (Fri, 09 Mar 2007) | 2 lines
Bug #1629566: clarify the docs on the return values of parsedate() and parsedate_tz() in email.utils and rfc822.
........
r54244 | thomas.heller | 2007-03-09 11:21:28 -0800 (Fri, 09 Mar 2007) | 3 lines
Fix bug #1646630: ctypes.string_at(buf, 0) and ctypes.wstring_at(buf, 0)
returned string up to the first NUL character.
........
r54245 | martin.v.loewis | 2007-03-09 11:36:01 -0800 (Fri, 09 Mar 2007) | 2 lines
Add Ziga Seilnacht.
........
r54247 | collin.winter | 2007-03-09 12:33:07 -0800 (Fri, 09 Mar 2007) | 2 lines
Patch #1491866: change the complex() constructor to allow parthensized forms. This means complex(repr(x)) now works instead of raising a ValueError.
........
r54248 | thomas.heller | 2007-03-09 12:39:22 -0800 (Fri, 09 Mar 2007) | 7 lines
Bug #1651235: When a tuple was passed to a ctypes function call,
Python would crash instead of raising an error.
The crash was caused by a section of code that should have been
removed long ago, at that time ctypes had other ways to pass
parameters to function calls.
........
r54250 | collin.winter | 2007-03-09 15:30:39 -0800 (Fri, 09 Mar 2007) | 1 line
Hashing simplification pointed out by Thomas Wouters.
........
r54252 | collin.winter | 2007-03-09 18:23:40 -0800 (Fri, 09 Mar 2007) | 5 lines
* Unlink test files before and after each test; hopefully this will cut down on recent buildbot failures in test_islink.
* Drop safe_remove() in favor of test_support.unlink().
* Fix the indentation of test_samefile so that it runs.
........
r54253 | collin.winter | 2007-03-09 18:51:26 -0800 (Fri, 09 Mar 2007) | 3 lines
Bug #1531963: Make SocketServer.TCPServer's server_address always be equal to calling getsockname() on the server's socket.
Will backport.
........
r54254 | neal.norwitz | 2007-03-09 19:19:18 -0800 (Fri, 09 Mar 2007) | 4 lines
Simplify a little by handling the TCP case first.
Update to use predominant style of spaces around = in args list
and print to stderr if debugging.
........
r54256 | collin.winter | 2007-03-09 19:35:34 -0800 (Fri, 09 Mar 2007) | 1 line
Add proper attribution for a bug fix.
........
r54257 | georg.brandl | 2007-03-09 23:38:14 -0800 (Fri, 09 Mar 2007) | 2 lines
Typos.
........
r54260 | collin.winter | 2007-03-10 06:33:32 -0800 (Sat, 10 Mar 2007) | 1 line
Convert an assert to a raise so it works even in the presence of -O.
........
r54262 | collin.winter | 2007-03-10 06:41:48 -0800 (Sat, 10 Mar 2007) | 2 lines
Patch #1599845: Add an option to disable the implicit calls to server_bind() and server_activate() in the constructors for TCPServer, SimpleXMLRPCServer and DocXMLRPCServer.
........
r54268 | georg.brandl | 2007-03-11 00:28:46 -0800 (Sun, 11 Mar 2007) | 2 lines
Add missing "return" statements in exception handler.
........
r54270 | ziga.seilnacht | 2007-03-11 08:54:54 -0700 (Sun, 11 Mar 2007) | 3 lines
Patch #1675981: remove unreachable code from type.__new__() method.
__dict__ and __weakref__ are removed from the slots tuple earlier
in the code, in the loop that mangles slot names. Will backport.
........
r54271 | collin.winter | 2007-03-11 09:00:20 -0700 (Sun, 11 Mar 2007) | 3 lines
Patch #1192590: Fix pdb's "ignore" and "condition" commands so they trap the IndexError caused by passing in an invalid breakpoint number.
Will backport.
........
r54274 | vinay.sajip | 2007-03-11 11:32:07 -0700 (Sun, 11 Mar 2007) | 1 line
Fix resource leak reported in SF #1516995.
........
r54278 | collin.winter | 2007-03-11 18:55:54 -0700 (Sun, 11 Mar 2007) | 4 lines
Patch #1678662: ftp.python.org does not exist. So the testcode in urllib.py must use a more
stable FTP.
Will backport.
........
r54280 | barry.warsaw | 2007-03-11 20:20:01 -0700 (Sun, 11 Mar 2007) | 8 lines
Tokio Kikuchi's fix for SF bug #1629369; folding whitespace allowed in the
display name of an email address, e.g.
Foo
\tBar <foo@example.com>
Test case added by Barry.
........
r54282 | skip.montanaro | 2007-03-11 20:30:50 -0700 (Sun, 11 Mar 2007) | 4 lines
Sane humans would call these invalid tests, but Andrew McNamara pointed out
that given the inputs in these tests Excel does indeed produce the output
these tests expect. Document that for future confused folks.
........
r54283 | martin.v.loewis | 2007-03-12 03:50:39 -0700 (Mon, 12 Mar 2007) | 2 lines
Bug #1675511: Use -Kpic instead of -xcode=pic32 on Solaris/x86.
........
r54285 | martin.v.loewis | 2007-03-12 04:01:10 -0700 (Mon, 12 Mar 2007) | 2 lines
Patch #1677862: Require a space or tab after import in .pth files.
........
r54287 | georg.brandl | 2007-03-12 06:17:36 -0700 (Mon, 12 Mar 2007) | 8 lines
Backport from Py3k branch:
Patch #1591665: implement the __dir__() special function lookup in PyObject_Dir.
Had to change a few bits of the patch because classobjs and __methods__ are still
in Py2.6.
........
r54288 | georg.brandl | 2007-03-12 07:30:05 -0700 (Mon, 12 Mar 2007) | 3 lines
Bug #1678647: write a newline after printing an exception in any
case, even when converting the value to a string failed.
........
r54290 | collin.winter | 2007-03-12 08:57:19 -0700 (Mon, 12 Mar 2007) | 1 line
Patch #1678088: convert test_operations to use unittest, fold the result into test_dict.
........
r54291 | collin.winter | 2007-03-12 09:11:39 -0700 (Mon, 12 Mar 2007) | 3 lines
Bug #742342: make Python stop segfaulting on infinitely-recursive reload()s. Fixed by patch #922167.
Will backport.
........
r54292 | georg.brandl | 2007-03-12 09:15:09 -0700 (Mon, 12 Mar 2007) | 2 lines
Typo fix.
........
r54295 | collin.winter | 2007-03-12 10:24:07 -0700 (Mon, 12 Mar 2007) | 1 line
Patch #1670993: Refactor test_threadedtempfile.py to use unittest.
........
r54296 | tim.peters | 2007-03-12 11:07:52 -0700 (Mon, 12 Mar 2007) | 2 lines
Whitespace normalization.
........
r54297 | tim.peters | 2007-03-12 11:09:22 -0700 (Mon, 12 Mar 2007) | 2 lines
Set missing svn:eol-style property on text files.
........
r54315 | brett.cannon | 2007-03-12 19:34:09 -0700 (Mon, 12 Mar 2007) | 8 lines
Add test.test_support.transient_internet . Returns a context manager that
nests test.test_support.TransientResource context managers that capture
exceptions raised when the Internet connection is flaky.
Initially using in test_socket_ssl but should probably be expanded to cover any
test that should not raise the captured exceptions if the Internet connection
works.
........
r54316 | brett.cannon | 2007-03-12 20:05:40 -0700 (Mon, 12 Mar 2007) | 2 lines
Fix a typo where the variable name was not updated.
........
r54318 | neal.norwitz | 2007-03-12 21:59:58 -0700 (Mon, 12 Mar 2007) | 1 line
Add Jerry Seutter for a bunch of his recent patches refactoring tests
........
r54319 | neal.norwitz | 2007-03-12 22:07:14 -0700 (Mon, 12 Mar 2007) | 7 lines
Add some other acks for recent checkins:
Brian Leair - 922167
Tomer Filiba - 1591665
Jeremy Jones - 1192590
........
r54321 | neal.norwitz | 2007-03-12 22:31:38 -0700 (Mon, 12 Mar 2007) | 9 lines
Fix some style nits:
* lines too long
* wrong indentation
* space after a function name
* wrong function name in error string
* simplifying some logic
Also add an error check to PyDict_SetItemString.
........
r54322 | georg.brandl | 2007-03-13 00:23:16 -0700 (Tue, 13 Mar 2007) | 2 lines
Typo and grammar fixes.
........
r54323 | georg.brandl | 2007-03-13 00:50:57 -0700 (Tue, 13 Mar 2007) | 2 lines
Patch #1679379: add documentation for fnmatch.translate().
........
r54325 | georg.brandl | 2007-03-13 00:57:51 -0700 (Tue, 13 Mar 2007) | 2 lines
Patch #1642844: comments to clarify the complexobject constructor.
........
r54326 | georg.brandl | 2007-03-13 01:14:27 -0700 (Tue, 13 Mar 2007) | 3 lines
Patch #1668100: urllib2 now correctly raises URLError instead of
OSError if accessing a local file via the file:// protocol fails.
........
r54327 | georg.brandl | 2007-03-13 02:32:11 -0700 (Tue, 13 Mar 2007) | 4 lines
Patch #1635454: the csv.DictWriter class now includes the offending
field names in its exception message if you try to write a record with
a dictionary containing fields not in the CSV field names list.
........
r54328 | georg.brandl | 2007-03-13 02:41:31 -0700 (Tue, 13 Mar 2007) | 3 lines
Patch #1555098: use str.join() instead of repeated string
concatenation in robotparser.
........
r54329 | georg.brandl | 2007-03-13 03:06:48 -0700 (Tue, 13 Mar 2007) | 3 lines
Patch #1542681: add entries for "with", "as" and "CONTEXTMANAGERS" to
pydoc's help keywords.
........
r54331 | georg.brandl | 2007-03-13 03:19:22 -0700 (Tue, 13 Mar 2007) | 3 lines
Patch #1569798: fix a bug in distutils when building Python from a
directory within sys.exec_prefix.
........
r54333 | martin.v.loewis | 2007-03-13 03:24:00 -0700 (Tue, 13 Mar 2007) | 4 lines
Patch #1449244: Support Unicode strings in
email.message.Message.{set_charset,get_content_charset}.
Will backport.
........
r54335 | lars.gustaebel | 2007-03-13 03:47:19 -0700 (Tue, 13 Mar 2007) | 34 lines
This is the implementation of POSIX.1-2001 (pax) format read/write
support.
The TarInfo class now contains all necessary logic to process and
create tar header data which has been moved there from the TarFile
class. The fromtarfile() method was added. The new path and linkpath
properties are aliases for the name and linkname attributes in
correspondence to the pax naming scheme.
The TarFile constructor and classmethods now accept a number of
keyword arguments which could only be set as attributes before (e.g.
dereference, ignore_zeros). The encoding and pax_headers arguments
were added for pax support. There is a new tarinfo keyword argument
that allows using subclassed TarInfo objects in TarFile.
The boolean TarFile.posix attribute is deprecated, because now three
tar formats are supported. Instead, the desired format for writing is
specified using the constants USTAR_FORMAT, GNU_FORMAT and PAX_FORMAT
as the format keyword argument. This change affects TarInfo.tobuf()
as well.
The test suite has been heavily reorganized and partially rewritten.
A new testtar.tar was added that contains sample data in many formats
from 4 different tar programs.
Some bugs and quirks that also have been fixed:
Directory names do no longer have a trailing slash in TarInfo.name or
TarFile.getnames().
Adding the same file twice does not create a hardlink file member.
The TarFile constructor does no longer need a name argument.
The TarFile._mode attribute was renamed to mode and contains either
'r', 'w' or 'a'.
........
r54336 | georg.brandl | 2007-03-13 05:34:25 -0700 (Tue, 13 Mar 2007) | 3 lines
Bug #1622896: fix a rare corner case where the bz2 module raised an
error in spite of a succesful compression.
........
r54338 | lars.gustaebel | 2007-03-13 08:47:07 -0700 (Tue, 13 Mar 2007) | 3 lines
Quick fix for tests that fail on systems with an encoding other
than 'iso8859-1'.
........
r54339 | georg.brandl | 2007-03-13 10:43:32 -0700 (Tue, 13 Mar 2007) | 4 lines
Patch #1603688: ConfigParser.SafeConfigParser now checks values that
are set for invalid interpolation sequences that would lead to errors
on reading back those values.
........
r54341 | georg.brandl | 2007-03-13 11:15:41 -0700 (Tue, 13 Mar 2007) | 3 lines
Patch #1581073: add a flag to textwrap that prevents the dropping of
whitespace while wrapping.
........
r54343 | georg.brandl | 2007-03-13 11:24:40 -0700 (Tue, 13 Mar 2007) | 2 lines
Patch #1605192: list allowed states in error messages for imaplib.
........
r54344 | georg.brandl | 2007-03-13 11:31:49 -0700 (Tue, 13 Mar 2007) | 4 lines
Patch #1537850: tempfile.NamedTemporaryFile now has a "delete" parameter
which can be set to False to prevent the default delete-on-close
behavior.
........
r54345 | collin.winter | 2007-03-13 11:53:04 -0700 (Tue, 13 Mar 2007) | 9 lines
Add acks for recent patch checkins:
Arvin Schnell - 1668482
S?\195?\169bastien Martini - 1481079
Heiko Wundram - 1491866
Damon Kohler - 1545011
Peter Parente - 1599845
Bjorn Lindqvist - 1678662
........
r54346 | georg.brandl | 2007-03-13 12:00:36 -0700 (Tue, 13 Mar 2007) | 2 lines
Acks for recent patches.
........
r54347 | georg.brandl | 2007-03-13 12:18:18 -0700 (Tue, 13 Mar 2007) | 3 lines
Fix a tab.
........
r54348 | georg.brandl | 2007-03-13 12:32:21 -0700 (Tue, 13 Mar 2007) | 4 lines
Patch #1533909: the timeit module now accepts callables in addition to
strings for the code to time and the setup code. Also added two
convenience functions for instantiating a Timer and calling its methods.
........
r54352 | georg.brandl | 2007-03-13 13:02:57 -0700 (Tue, 13 Mar 2007) | 3 lines
Patch #1530482: add pydoc.render_doc() which returns the documentation
for a thing instead of paging it to stdout, which pydoc.doc() does.
........
r54357 | thomas.heller | 2007-03-13 13:42:52 -0700 (Tue, 13 Mar 2007) | 1 line
Patch #1649190: Adding support for _Bool to ctypes as c_bool, by David Remahl.
........
r54358 | georg.brandl | 2007-03-13 13:46:32 -0700 (Tue, 13 Mar 2007) | 2 lines
Patch #1444529: the builtin compile() now accepts keyword arguments.
(backport)
........
r54359 | thomas.heller | 2007-03-13 14:01:39 -0700 (Tue, 13 Mar 2007) | 1 line
Add versionadded marker for ctypes.c_bool.
........
r54360 | georg.brandl | 2007-03-13 14:08:15 -0700 (Tue, 13 Mar 2007) | 3 lines
Patch #1393667: pdb now has a "run" command which restarts the debugged
Python program, optionally with different arguments.
........
r54361 | georg.brandl | 2007-03-13 14:32:01 -0700 (Tue, 13 Mar 2007) | 3 lines
Deprecate commands.getstatus().
........
r54362 | georg.brandl | 2007-03-13 14:32:56 -0700 (Tue, 13 Mar 2007) | 2 lines
NEWS entry for getstatus() deprecation.
........
r54363 | georg.brandl | 2007-03-13 14:58:44 -0700 (Tue, 13 Mar 2007) | 4 lines
Patch #1429539: pdb now correctly initializes the __main__ module for
the debugged script, which means that imports from __main__ work
correctly now.
........
r54364 | georg.brandl | 2007-03-13 15:07:36 -0700 (Tue, 13 Mar 2007) | 4 lines
Patch #957650: "%var%" environment variable references are now properly
expanded in ntpath.expandvars(), also "~user" home directory references
are recognized and handled on Windows.
........
r54365 | georg.brandl | 2007-03-13 15:16:30 -0700 (Tue, 13 Mar 2007) | 2 lines
Patch #1194449: correctly detect unbound methods in pydoc.
........
r54367 | georg.brandl | 2007-03-13 15:49:43 -0700 (Tue, 13 Mar 2007) | 5 lines
Patch #1185447: binascii.b2a_qp() now correctly quotes binary characters
with ASCII value less than 32. Also, it correctly quotes dots only if
they occur on a single line, as opposed to the previous behavior of
quoting dots if they are the second character of any line.
........
r54368 | collin.winter | 2007-03-13 16:02:15 -0700 (Tue, 13 Mar 2007) | 1 line
Inline PyImport_GetModulesReloading().
........
r54371 | barry.warsaw | 2007-03-13 21:59:50 -0700 (Tue, 13 Mar 2007) | 6 lines
SF bug #1582282; decode_header() incorrectly splits not-conformant RFC
2047-like headers where there is no whitespace between encoded words. This
fix changes the matching regexp to include a trailing lookahead assertion that
the closing ?= must be followed by whitespace, newline, or end-of-string.
This also changes the regexp to add the MULTILINE flag.
........
r54372 | gregory.p.smith | 2007-03-14 00:17:40 -0700 (Wed, 14 Mar 2007) | 2 lines
correct order and names of the less often used keyword parameters.
........
r54373 | gregory.p.smith | 2007-03-14 00:19:50 -0700 (Wed, 14 Mar 2007) | 5 lines
Its time to stop listing (Unix, Windows) when we really mean "everything but Mac OS 9"
now that nobody is likely to use Python on Mac OS 9 and most of the (Mac) platform
items are all OS X special API specific since OS X is unixy enough for these modules
to be available out of the box.
........
r54376 | georg.brandl | 2007-03-14 01:27:52 -0700 (Wed, 14 Mar 2007) | 4 lines
Bug #767111: fix long-standing bug in urllib which caused an
AttributeError instead of an IOError when the server's response didn't
contain a valid HTTP status line.
........
r54378 | ziga.seilnacht | 2007-03-14 05:24:09 -0700 (Wed, 14 Mar 2007) | 4 lines
Patch #1680015: Don't modify __slots__ tuple if it contains an unicode
name. Remove a reference leak that happened if the name could not be
converted to string. Will backport.
........
r54386 | martin.v.loewis | 2007-03-14 13:02:31 -0700 (Wed, 14 Mar 2007) | 3 lines
Patch #1559413: Fix test_cmd_line if sys.executable contains a space.
Will backport.
........
r54389 | brett.cannon | 2007-03-14 14:40:13 -0700 (Wed, 14 Mar 2007) | 3 lines
Note how test_socket_ssl has various exceptions that deal with a flaky Net
connection are silenced.
........
r54390 | brett.cannon | 2007-03-14 14:44:15 -0700 (Wed, 14 Mar 2007) | 2 lines
Raise ResourceDenied in test_urllib2net when the Net connection goes bad.
........
r54391 | neal.norwitz | 2007-03-14 21:41:20 -0700 (Wed, 14 Mar 2007) | 1 line
Wrap a long line and fix a typo (is -> if)
........
r54392 | georg.brandl | 2007-03-15 00:38:14 -0700 (Thu, 15 Mar 2007) | 3 lines
Patch #1680978: consistently use "alive" instead of "active" in the
thread lib doc.
........
r54394 | georg.brandl | 2007-03-15 00:41:30 -0700 (Thu, 15 Mar 2007) | 3 lines
Patch #1681153: the wave module now closes a file object it opened if
initialization failed.
........
r54397 | ziga.seilnacht | 2007-03-15 04:44:55 -0700 (Thu, 15 Mar 2007) | 3 lines
Patch #1462488: prevent a segfault in object_reduce_ex() by splitting
the implementation for __reduce__ and __reduce_ex__ into two separate
functions. Fixes bug #931877. Will backport.
........
r54404 | collin.winter | 2007-03-15 21:11:30 -0700 (Thu, 15 Mar 2007) | 3 lines
Patch #1642547: Fix an error/crash when encountering syntax errors in complex if statements.
Will backport.
........
r54406 | georg.brandl | 2007-03-16 00:55:09 -0700 (Fri, 16 Mar 2007) | 5 lines
Bug #1681228: the webbrowser module now correctly uses the default
GNOME or KDE browser, depending on whether there is a session of one
of those present. Also, it tries the Windows default browser before
trying Mozilla variants.
(backport)
........
r54407 | georg.brandl | 2007-03-16 01:22:40 -0700 (Fri, 16 Mar 2007) | 4 lines
Patch #1273829: os.walk() now has a "followlinks" parameter. If set to
True (which is not the default), it visits symlinks pointing to
directories.
........
r54408 | georg.brandl | 2007-03-16 01:24:21 -0700 (Fri, 16 Mar 2007) | 2 lines
Add \versionadded tag.
........
r54409 | georg.brandl | 2007-03-16 01:33:47 -0700 (Fri, 16 Mar 2007) | 2 lines
RFE #1670167: fix in isinstance() docs.
........
r54412 | ziga.seilnacht | 2007-03-16 04:59:38 -0700 (Fri, 16 Mar 2007) | 3 lines
Patch #1623563: allow __class__ assignment for classes with __slots__.
The old and the new class are still required to have the same slot
names, but the order in which they are specified is not relevant.
........
r54413 | ziga.seilnacht | 2007-03-16 05:11:11 -0700 (Fri, 16 Mar 2007) | 2 lines
Whitespace cleanup. Also remove the empty lines
from the previous check in.
........
r54414 | jeremy.hylton | 2007-03-16 07:49:11 -0700 (Fri, 16 Mar 2007) | 2 lines
Remove warning: funcion declaration isn't a prototype
........
r54415 | jeremy.hylton | 2007-03-16 08:59:47 -0700 (Fri, 16 Mar 2007) | 11 lines
Clean up formatting of this file.
The file should now follow PEP 7, except that it uses 4 space indents
(in the style of Py3k). This particular code would be really hard to
read with the regular tab idents.
Other changes:
- reflow long lines
- change multi-line conditionals to have test at end of line
........
r54417 | collin.winter | 2007-03-16 14:13:35 -0700 (Fri, 16 Mar 2007) | 1 line
Patch #1676994: Refactor test_popen2 to use unittest.
........
r54418 | collin.winter | 2007-03-16 14:15:35 -0700 (Fri, 16 Mar 2007) | 1 line
Remove test/output/test_popen2 (missed in r54417).
........
r54419 | collin.winter | 2007-03-16 15:16:08 -0700 (Fri, 16 Mar 2007) | 1 line
Patch 1339796: add a relpath() function to os.path.
........
r54421 | georg.brandl | 2007-03-17 09:08:45 -0700 (Sat, 17 Mar 2007) | 5 lines
Patch #1675423: PyComplex_AsCComplex() now tries to convert an object
to complex using its __complex__() method before falling back to the
__float__() method. Therefore, the functions in the cmath module now
can operate on objects that define a __complex__() method.
(backport)
........
r54423 | gregory.p.smith | 2007-03-17 15:33:35 -0700 (Sat, 17 Mar 2007) | 2 lines
move note to the correct section
........
r54426 | georg.brandl | 2007-03-18 01:25:00 -0700 (Sun, 18 Mar 2007) | 2 lines
Patch #1682878: the new socket methods are recv_into and recvfrom_into, not *_buf.
........
r54432 | georg.brandl | 2007-03-18 11:28:25 -0700 (Sun, 18 Mar 2007) | 2 lines
Patch #1678339: test case for bug in difflib.
........
r54439 | collin.winter | 2007-03-19 11:52:08 -0700 (Mon, 19 Mar 2007) | 1 line
Patch #1630118: add a SpooledTemporaryFile class to tempfile.
........
r54441 | georg.brandl | 2007-03-19 12:02:48 -0700 (Mon, 19 Mar 2007) | 2 lines
Patch #1683328: fixes and enhancements for "unparse" demo.
........
r54456 | neal.norwitz | 2007-03-19 22:07:28 -0700 (Mon, 19 Mar 2007) | 1 line
Add some doc that was left out from some change to platform.py
........
r54457 | neal.norwitz | 2007-03-19 22:08:23 -0700 (Mon, 19 Mar 2007) | 1 line
Add a comment about 3k migration
........
r54458 | neal.norwitz | 2007-03-19 22:21:21 -0700 (Mon, 19 Mar 2007) | 1 line
Get rid of deprecation warning when testing commands.getstatus()
........
r54459 | neal.norwitz | 2007-03-19 22:23:09 -0700 (Mon, 19 Mar 2007) | 4 lines
Try backing out 54407 to see if it corrects the problems on the Windows
buildbots. This rev was backported, so we will need to keep both branches
in sync, pending the outcome of the test after this checkin.
........
r54460 | neal.norwitz | 2007-03-19 23:13:25 -0700 (Mon, 19 Mar 2007) | 1 line
Try to make this test more resistant to dropping from previous runs (ie, files that may exist but cause the test to fail). Should be backported (assuming it works :-)
........
r54461 | neal.norwitz | 2007-03-19 23:16:26 -0700 (Mon, 19 Mar 2007) | 1 line
Try to make this test more resistant to dropping from previous runs (ie, files that may exist but cause the test to fail). Should be backported (assuming it works :-)
........
r54462 | neal.norwitz | 2007-03-19 23:53:17 -0700 (Mon, 19 Mar 2007) | 5 lines
Try to be a little more resilient to errors. This might help the test
pass, but my guess is that it won't. I'm guessing that some other
test is leaving this file open which means it can't be removed
under Windows AFAIK.
........
r54463 | neal.norwitz | 2007-03-20 01:14:57 -0700 (Tue, 20 Mar 2007) | 8 lines
Try to get test_urllib to pass on Windows by closing the file.
I'm guessing that's the problem. h.getfile() must be called *after*
h.getreply() and the fp can be None.
I'm not entirely convinced this is the best fix (or even correct).
The buildbots will tell us if things improve or not. I don't
know if this needs to be backported (assuming it actually works).
........
r54465 | raymond.hettinger | 2007-03-20 14:27:24 -0700 (Tue, 20 Mar 2007) | 1 line
Extend work on rev 52962 and 53829 eliminating redundant PyObject_Hash() calls and fixing set/dict interoperability.
........
r54468 | georg.brandl | 2007-03-20 16:05:14 -0700 (Tue, 20 Mar 2007) | 2 lines
Fix for glob.py if filesystem encoding is None.
........
r54479 | neal.norwitz | 2007-03-20 23:39:48 -0700 (Tue, 20 Mar 2007) | 1 line
Remove unused file spotted by Paul Hankin
........
r54480 | georg.brandl | 2007-03-21 02:00:39 -0700 (Wed, 21 Mar 2007) | 3 lines
Patch #1682205: a TypeError while unpacking an iterable is no longer
masked by a generic one with the message "unpack non-sequence".
........
r54482 | georg.brandl | 2007-03-21 02:10:29 -0700 (Wed, 21 Mar 2007) | 2 lines
New test for rev. 54407 which only uses directories under TESTFN.
........
r54483 | georg.brandl | 2007-03-21 02:16:53 -0700 (Wed, 21 Mar 2007) | 2 lines
Patch #1684834: document some utility C API functions.
........
r54485 | georg.brandl | 2007-03-21 04:51:25 -0700 (Wed, 21 Mar 2007) | 2 lines
Fix #1684254: split BROWSER contents with shlex to avoid displaying 'URL'.
........
r54487 | andrew.kuchling | 2007-03-21 07:32:43 -0700 (Wed, 21 Mar 2007) | 1 line
Add comments on maintenance of this file
........
r54489 | andrew.kuchling | 2007-03-21 09:57:32 -0700 (Wed, 21 Mar 2007) | 1 line
Fix sentence, and fix typo in example
........
r54490 | andrew.kuchling | 2007-03-21 09:59:20 -0700 (Wed, 21 Mar 2007) | 1 line
Put code examples at left margin instead of indenting them
........
r54491 | facundo.batista | 2007-03-21 12:41:24 -0700 (Wed, 21 Mar 2007) | 1 line
Minor clarification, saying that blocking means no timeout (from bug #882297)
........
r54492 | ziga.seilnacht | 2007-03-21 13:07:56 -0700 (Wed, 21 Mar 2007) | 2 lines
Bug #1675967: re patterns pickled with older Python versions can
now be unpickled. Will backport.
........
r54495 | raymond.hettinger | 2007-03-21 13:33:57 -0700 (Wed, 21 Mar 2007) | 1 line
Add test and fix for fromkeys() optional argument.
........
r54524 | georg.brandl | 2007-03-22 01:05:45 -0700 (Thu, 22 Mar 2007) | 2 lines
Bug #1685704: use -m switch in timeit docs.
........
r54533 | thomas.heller | 2007-03-22 12:44:31 -0700 (Thu, 22 Mar 2007) | 5 lines
Back out "Patch #1643874: memory leak in ctypes fixed."
The code in this patch leaves no way to give up the ownership of a
BSTR instance.
........
r54538 | thomas.heller | 2007-03-22 13:34:37 -0700 (Thu, 22 Mar 2007) | 2 lines
Explain the purpose of the b_needsfree flag (forward ported from release25-maint).
........
r54539 | guido.van.rossum | 2007-03-22 21:58:42 -0700 (Thu, 22 Mar 2007) | 12 lines
- Bug #1683368: The object.__init__() and object.__new__() methods are
now stricter in rejecting excess arguments. The only time when
either allows excess arguments is when it is not overridden and the
other one is. For backwards compatibility, when both are
overridden, it is a deprecation warning (for now; maybe a Py3k
warning later).
When merging this into 3.0, the warnings should become errors.
Note: without the change to string.py, lots of spurious warnings happen.
What's going on there?
........
r54540 | neal.norwitz | 2007-03-22 22:17:23 -0700 (Thu, 22 Mar 2007) | 1 line
Add Mark Dickinson for SF # 1675423.
........
r54541 | martin.v.loewis | 2007-03-23 03:35:49 -0700 (Fri, 23 Mar 2007) | 3 lines
Patch #1686451: Fix return type for PySequence_{Count,Index,Fast_GET_SIZE}.
Will backport.
........
r54543 | martin.v.loewis | 2007-03-23 06:27:15 -0700 (Fri, 23 Mar 2007) | 3 lines
Bug #978833: Revert r50844, as it broke _socketobject.dup.
Will backport.
........
r54545 | guido.van.rossum | 2007-03-23 11:53:03 -0700 (Fri, 23 Mar 2007) | 8 lines
Add a type.__init__() method that enforces the same signature as
type.__new__(), and then calls object.__init__(cls), just to be anal.
This allows us to restore the code in string.py's _TemplateMetaclass
that called super(...).__init__(name, bases, dct), which I commented
out yesterday since it broke due to the stricter argument checking
added to object.__init__().
........
r54546 | facundo.batista | 2007-03-23 11:54:07 -0700 (Fri, 23 Mar 2007) | 4 lines
Added a 'create_connect()' function to socket.py, which creates a
connection with an optional timeout, and modified httplib.py to
use this function in HTTPConnection. Applies patch 1676823.
........
r54547 | guido.van.rossum | 2007-03-23 12:39:01 -0700 (Fri, 23 Mar 2007) | 2 lines
Add note about type.__init__().
........
r54553 | thomas.heller | 2007-03-23 12:55:27 -0700 (Fri, 23 Mar 2007) | 5 lines
Prevent creation (followed by a segfault) of array types when the size
overflows the valid Py_ssize_t range. Check return values of
PyMem_Malloc.
Will backport to release25-maint.
........
r54555 | facundo.batista | 2007-03-23 13:23:08 -0700 (Fri, 23 Mar 2007) | 6 lines
Surrounded with try/finally to socket's default timeout setting
changes in the tests, so failing one test won't produce strange
results in others. Also relaxed the timeout settings in the test
(where actually the value didn't mean anything).
........
r54556 | collin.winter | 2007-03-23 15:24:39 -0700 (Fri, 23 Mar 2007) | 1 line
Make test_relpath() pass on Windows.
........
r54559 | ziga.seilnacht | 2007-03-24 07:24:26 -0700 (Sat, 24 Mar 2007) | 6 lines
Patch #1489771: update syntax rules in Python Reference Manual.
Python 2.5 added support for explicit relative import statements and
yield expressions, which were missing in the manual.
Also fix grammar productions that used the names from the Grammar file,
markup that broke the generated grammar.txt, and wrap some lines that
broke the pdf output. Will backport.
........
r54565 | georg.brandl | 2007-03-24 15:20:34 -0700 (Sat, 24 Mar 2007) | 2 lines
Remove typo accent.
........
r54566 | georg.brandl | 2007-03-24 15:27:56 -0700 (Sat, 24 Mar 2007) | 2 lines
Revert accidental change.
........
r54567 | brett.cannon | 2007-03-24 18:32:36 -0700 (Sat, 24 Mar 2007) | 3 lines
Change the docs to no longer claim that unittest is preferred over doctest for
regression tests.
........
r54568 | facundo.batista | 2007-03-24 18:53:21 -0700 (Sat, 24 Mar 2007) | 4 lines
Redone the tests, using the infrastructure already present
for threading and socket serving.
........
r54570 | facundo.batista | 2007-03-24 20:20:05 -0700 (Sat, 24 Mar 2007) | 3 lines
Closing the HTTP connection after each test, and listening more.
........
r54572 | georg.brandl | 2007-03-25 11:44:35 -0700 (Sun, 25 Mar 2007) | 2 lines
Markup fix.
........
r54573 | georg.brandl | 2007-03-25 12:04:55 -0700 (Sun, 25 Mar 2007) | 2 lines
Markup fix.
........
r54580 | facundo.batista | 2007-03-26 13:18:31 -0700 (Mon, 26 Mar 2007) | 5 lines
Added an optional timeout to FTP class. Also I started a test_ftplib.py
file to test the ftp lib (right now I included a basic test, the timeout
one, and nothing else).
........
r54581 | georg.brandl | 2007-03-26 13:28:28 -0700 (Mon, 26 Mar 2007) | 2 lines
Some nits.
........
r54582 | facundo.batista | 2007-03-26 13:56:09 -0700 (Mon, 26 Mar 2007) | 4 lines
Forgot to add the file before the previous commit, here go
the ftplib tests.
........
r54585 | facundo.batista | 2007-03-27 11:23:21 -0700 (Tue, 27 Mar 2007) | 5 lines
Added an optional timeout to poplib.POP3. Also created a
test_poplib.py file with a basic test and the timeout
ones. Docs are also updated.
........
r54586 | facundo.batista | 2007-03-27 11:50:29 -0700 (Tue, 27 Mar 2007) | 3 lines
The basic test cases of poplib.py.
........
r54594 | facundo.batista | 2007-03-27 20:45:20 -0700 (Tue, 27 Mar 2007) | 4 lines
Bug 1688393. Adds a control of negative values in
socket.recvfrom, which caused an ugly crash.
........
r54599 | facundo.batista | 2007-03-28 11:25:54 -0700 (Wed, 28 Mar 2007) | 5 lines
Added timeout to smtplib (to SMTP and SMTP_SSL). Also created
the test_smtplib.py file, with a basic test and the timeout
ones. Docs are updated too.
........
r54603 | collin.winter | 2007-03-28 16:34:06 -0700 (Wed, 28 Mar 2007) | 3 lines
Consolidate patches #1690164, 1683397, and 1690169, all of which refactor XML-related test suites. The patches are applied together because they use a common output/xmltests file.
Thanks to Jerry Seutter for all three patches.
........
r54604 | collin.winter | 2007-03-28 19:28:16 -0700 (Wed, 28 Mar 2007) | 1 line
Make test_zipfile clean up its temporary files properly.
........
r54605 | georg.brandl | 2007-03-29 00:41:32 -0700 (Thu, 29 Mar 2007) | 2 lines
These are actually methods.
........
r54606 | georg.brandl | 2007-03-29 05:42:07 -0700 (Thu, 29 Mar 2007) | 4 lines
In Windows' time.clock(), when QueryPerformanceFrequency() fails,
the C lib's clock() is used, but it must be divided by CLOCKS_PER_SEC
as for the POSIX implementation (thanks to #pypy).
........
r54608 | facundo.batista | 2007-03-29 11:22:35 -0700 (Thu, 29 Mar 2007) | 5 lines
Added timout parameter to telnetlib.Telnet. Also created
test_telnetlib.py with a basic test and timeout ones.
Docs are also updated.
........
r54613 | facundo.batista | 2007-03-30 06:00:35 -0700 (Fri, 30 Mar 2007) | 4 lines
Added the posibility to pass the timeout to FTP.connect, not only when
instantiating the class. Docs and tests are updated.
........
r54614 | collin.winter | 2007-03-30 07:01:25 -0700 (Fri, 30 Mar 2007) | 1 line
Bug #1688274: add documentation for C-level class objects.
........
r54615 | marc-andre.lemburg | 2007-03-30 08:01:42 -0700 (Fri, 30 Mar 2007) | 4 lines
Bump the patch level version of distutils since there were a few bug fixes since
the 2.5.0 release.
........
r54617 | georg.brandl | 2007-03-30 08:49:05 -0700 (Fri, 30 Mar 2007) | 2 lines
Markup fix.
........
r54618 | georg.brandl | 2007-03-30 10:39:39 -0700 (Fri, 30 Mar 2007) | 2 lines
Label name fix.
........
r54619 | georg.brandl | 2007-03-30 10:47:21 -0700 (Fri, 30 Mar 2007) | 2 lines
Duplicate label fix.
........
r54620 | georg.brandl | 2007-03-30 10:48:39 -0700 (Fri, 30 Mar 2007) | 2 lines
Markup fix.
........
r54623 | andrew.kuchling | 2007-03-30 11:00:15 -0700 (Fri, 30 Mar 2007) | 1 line
Add item. (Oops, accidentally checked this in on my branch)
........
r54624 | georg.brandl | 2007-03-30 12:01:38 -0700 (Fri, 30 Mar 2007) | 2 lines
Duplicate label fix.
........
r54625 | georg.brandl | 2007-03-30 12:14:02 -0700 (Fri, 30 Mar 2007) | 2 lines
Markup fix.
........
r54629 | georg.brandl | 2007-03-31 03:17:31 -0700 (Sat, 31 Mar 2007) | 2 lines
repair string literal.
........
r54630 | georg.brandl | 2007-03-31 04:54:58 -0700 (Sat, 31 Mar 2007) | 2 lines
Markup fix.
........
r54631 | georg.brandl | 2007-03-31 04:58:36 -0700 (Sat, 31 Mar 2007) | 2 lines
Duplicate label fix.
........
r54632 | georg.brandl | 2007-03-31 04:59:54 -0700 (Sat, 31 Mar 2007) | 2 lines
Typo fix.
........
r54633 | neal.norwitz | 2007-03-31 11:54:18 -0700 (Sat, 31 Mar 2007) | 1 line
Fix method names. Will backport.
........
r54634 | georg.brandl | 2007-03-31 11:56:11 -0700 (Sat, 31 Mar 2007) | 4 lines
Bug #1655392: don't add -L/usr/lib/pythonX.Y/config to the LDFLAGS
returned by python-config if Python was built with --enable-shared
because that prevented the shared library from being used.
........
r54637 | collin.winter | 2007-03-31 12:31:34 -0700 (Sat, 31 Mar 2007) | 1 line
Shut up an occaisonal buildbot error due to test files being left around.
........
r54644 | neal.norwitz | 2007-04-01 11:24:22 -0700 (Sun, 01 Apr 2007) | 11 lines
SF #1685563, MSVCCompiler creates redundant and long PATH strings
If MSVCCompiler.initialize() was called multiple times, the path
would get duplicated. On Windows, this is a problem because the
path is limited to 4k. There's no benefit in adding a path multiple
times, so prevent that from occuring. We also normalize the path
before checking for duplicates so things like /a and /a/ won't both
be stored.
Will backport.
........
r54646 | brett.cannon | 2007-04-01 11:47:27 -0700 (Sun, 01 Apr 2007) | 8 lines
time.strptime's caching of its locale object was being recreated when the
locale changed but not used during the function call it was recreated during.
The test in this checkin is untested (OS X does not have the proper locale
support for me to test), although the fix for the bug this deals with
was tested by the OP (#1290505). Once the buildbots verify the test at least
doesn't fail it becomes a backport candidate.
........
r54647 | brett.cannon | 2007-04-01 12:46:19 -0700 (Sun, 01 Apr 2007) | 3 lines
Fix the test for recreating the locale cache object by not worrying about if
one of the test locales cannot be set.
........
r54649 | georg.brandl | 2007-04-01 14:29:15 -0700 (Sun, 01 Apr 2007) | 2 lines
Fix a lot of markup and meta-information glitches.
........
r54650 | georg.brandl | 2007-04-01 14:39:52 -0700 (Sun, 01 Apr 2007) | 2 lines
Another fix.
........
r54651 | georg.brandl | 2007-04-01 15:39:10 -0700 (Sun, 01 Apr 2007) | 2 lines
Lots of explicit class names for method and member descs.
........
r54652 | georg.brandl | 2007-04-01 15:40:12 -0700 (Sun, 01 Apr 2007) | 2 lines
Explicit class names.
........
r54653 | georg.brandl | 2007-04-01 15:47:31 -0700 (Sun, 01 Apr 2007) | 2 lines
Some semantic fixes.
........
r54654 | georg.brandl | 2007-04-01 16:29:10 -0700 (Sun, 01 Apr 2007) | 2 lines
Remove bogus entry.
........
r54655 | georg.brandl | 2007-04-01 16:31:30 -0700 (Sun, 01 Apr 2007) | 2 lines
Fix the class name of strings.
........
r54658 | raymond.hettinger | 2007-04-02 10:29:30 -0700 (Mon, 02 Apr 2007) | 1 line
SF #1693079: Cannot save empty array in shelve
........
r54663 | raymond.hettinger | 2007-04-02 15:54:21 -0700 (Mon, 02 Apr 2007) | 3 lines
Array module's buffer interface can now handle empty arrays.
........
r54664 | guido.van.rossum | 2007-04-02 16:55:37 -0700 (Mon, 02 Apr 2007) | 5 lines
Fix warnings about object.__init__() signature.
Two (test_array and test_descr) were bug IMO; the third (copy_reg)
is a work-around which recognizes that object.__init__() doesn't do
anything.
........
r54666 | raymond.hettinger | 2007-04-02 17:02:11 -0700 (Mon, 02 Apr 2007) | 1 line
SF 1602378 Clarify docstrings for bisect
........
r54668 | raymond.hettinger | 2007-04-02 18:39:43 -0700 (Mon, 02 Apr 2007) | 3 lines
SF #1382213: Tutorial section 9.5.1 ignores MRO for new-style classes
........
r54669 | matthias.klose | 2007-04-02 21:35:59 -0700 (Mon, 02 Apr 2007) | 4 lines
- Fix an off-by-one bug in locale.strxfrm().
patch taken from http://bugs.debian.org/416934.
........
r54671 | georg.brandl | 2007-04-03 00:04:27 -0700 (Tue, 03 Apr 2007) | 9 lines
Fix the strange case of
\begin{methoddesc}[NNTP]{...}
where
\ifx#1\@undefined ended up comparing N and N, therefore executing
the true part of the conditional, blowing up at \@undefined.
........
r54672 | facundo.batista | 2007-04-03 07:05:08 -0700 (Tue, 03 Apr 2007) | 4 lines
Now using unittest for the tests infraestructure. Also split the
tests in those who need the network, and that who doesn't.
........
r54673 | walter.doerwald | 2007-04-03 09:08:10 -0700 (Tue, 03 Apr 2007) | 4 lines
Move the functionality for catching warnings in test_warnings.py into a separate
class to that reusing the functionality in test_structmembers.py doesn't rerun
the tests from test_warnings.py.
........
r54674 | walter.doerwald | 2007-04-03 09:16:24 -0700 (Tue, 03 Apr 2007) | 2 lines
Document that CatchWarningTests is reused by test_structmembers.py.
........
r54675 | walter.doerwald | 2007-04-03 09:53:43 -0700 (Tue, 03 Apr 2007) | 4 lines
Add tests for the filename.
Test that the stacklevel is handled correctly.
........
r54676 | facundo.batista | 2007-04-03 10:29:48 -0700 (Tue, 03 Apr 2007) | 6 lines
Added a SSL server to test_socket_ssl.py to be able to test
locally. Now, it checks if have openssl available and run
those specific tests (it starts openssl at the beggining of
all the tests and then kills it at the end).
........
r54677 | walter.doerwald | 2007-04-03 11:33:29 -0700 (Tue, 03 Apr 2007) | 6 lines
Implement a contextmanager test.test_support.catch_warning that can
be used to catch the last warning issued by the warning framework.
Change test_warnings.py and test_structmembers.py to use this
new contextmanager.
........
r54678 | facundo.batista | 2007-04-03 14:15:34 -0700 (Tue, 03 Apr 2007) | 4 lines
Changed the whole structure of startup and checking if the
server is available. Hope to not get more false alarms.
........
r54681 | facundo.batista | 2007-04-04 07:10:40 -0700 (Wed, 04 Apr 2007) | 4 lines
Fixed the way that the .pem files are looked for, and changed
how to kill the process in win32 to use the _handle attribute.
........
r54682 | guido.van.rossum | 2007-04-04 10:43:02 -0700 (Wed, 04 Apr 2007) | 4 lines
Fix a race condition in this test -- instead of assuming that it will take
the test server thread at most 0.5 seconds to get ready, use an event
variable.
........
r54683 | collin.winter | 2007-04-04 11:14:17 -0700 (Wed, 04 Apr 2007) | 1 line
Clean up imports.
........
r54684 | collin.winter | 2007-04-04 11:16:24 -0700 (Wed, 04 Apr 2007) | 1 line
Stop using test_support.verify().
........
r54685 | martin.v.loewis | 2007-04-04 11:30:36 -0700 (Wed, 04 Apr 2007) | 2 lines
Bug #1686475: Support stat'ing open files on Windows again.
Will backport to 2.5.
........
r54687 | collin.winter | 2007-04-04 11:33:40 -0700 (Wed, 04 Apr 2007) | 1 line
Make test_getopt use unittest.
........
r54688 | collin.winter | 2007-04-04 11:36:30 -0700 (Wed, 04 Apr 2007) | 1 line
Make test_softspace use unittest.
........
r54689 | ziga.seilnacht | 2007-04-04 11:38:47 -0700 (Wed, 04 Apr 2007) | 2 lines
Fix WalkTests.test_traversal() on Windows. The cleanup in
MakedirTests.setUp() can now be removed.
........
r54695 | raymond.hettinger | 2007-04-05 11:00:03 -0700 (Thu, 05 Apr 2007) | 3 lines
Bug #1563759: struct.unpack doens't support buffer protocol objects
........
r54697 | collin.winter | 2007-04-05 13:05:07 -0700 (Thu, 05 Apr 2007) | 1 line
Convert test_long_future to use unittest.
........
r54698 | collin.winter | 2007-04-05 13:08:56 -0700 (Thu, 05 Apr 2007) | 1 line
Convert test_normalization to use unittest.
........
r54699 | andrew.kuchling | 2007-04-05 18:11:58 -0700 (Thu, 05 Apr 2007) | 1 line
Some grammar fixes
........
r54704 | collin.winter | 2007-04-06 12:27:40 -0700 (Fri, 06 Apr 2007) | 1 line
Convert test_stringprep to use unittest.
........
r54705 | collin.winter | 2007-04-06 12:32:32 -0700 (Fri, 06 Apr 2007) | 1 line
Import cleanup in test_crypt.
........
r54706 | collin.winter | 2007-04-06 13:00:05 -0700 (Fri, 06 Apr 2007) | 1 line
Convert test_gc to use unittest.
........
r54707 | collin.winter | 2007-04-06 13:03:11 -0700 (Fri, 06 Apr 2007) | 1 line
Convert test_module to use unittest.
........
r54711 | collin.winter | 2007-04-06 21:40:43 -0700 (Fri, 06 Apr 2007) | 1 line
Convert test_fileinput to use unittest.
........
r54712 | brett.cannon | 2007-04-07 21:29:32 -0700 (Sat, 07 Apr 2007) | 5 lines
Doc that file.next() has undefined behaviour when called on a file opened with
'w'. Closes bug #1569057.
To be backported once 2.5 branch is unfrozen.
........
r54726 | vinay.sajip | 2007-04-09 09:16:10 -0700 (Mon, 09 Apr 2007) | 1 line
Added optional timeout to SocketHandler.makeSocket (SF #1695948)
........
r54727 | ziga.seilnacht | 2007-04-09 12:10:29 -0700 (Mon, 09 Apr 2007) | 3 lines
Patch #1695862: remove old test directory that causes test_urllib failures
on Windows buildbots. The change is a one time fix and will be removed
after a successful buildbot run.
........
r54729 | facundo.batista | 2007-04-09 20:00:37 -0700 (Mon, 09 Apr 2007) | 3 lines
Minor fix to the tests pass ok even with -O.
........
r54730 | collin.winter | 2007-04-09 21:44:49 -0700 (Mon, 09 Apr 2007) | 1 line
Typo fix.
........
r54732 | facundo.batista | 2007-04-10 05:58:45 -0700 (Tue, 10 Apr 2007) | 5 lines
General clean-up. Lot of margin corrections, comments, some typos.
Exceptions now are raised in the new style. And a mockup class is
now also new style. Thanks Santiago Pereson.
........
r54741 | georg.brandl | 2007-04-10 14:39:38 -0700 (Tue, 10 Apr 2007) | 2 lines
Repair a duplicate label and some obsolete uses of \setindexsubitem.
........
r54746 | andrew.kuchling | 2007-04-11 06:39:00 -0700 (Wed, 11 Apr 2007) | 1 line
Add window.chgat() method, submitted via e-mail by Fabian Kreutz
........
r54747 | andrew.kuchling | 2007-04-11 06:42:25 -0700 (Wed, 11 Apr 2007) | 1 line
Point readers at the patch submission instructions
........
r54748 | andrew.kuchling | 2007-04-11 06:47:13 -0700 (Wed, 11 Apr 2007) | 1 line
Describe undocumented third argument to touchline()
........
r54757 | georg.brandl | 2007-04-11 10:16:24 -0700 (Wed, 11 Apr 2007) | 3 lines
Add some missing NULL checks which trigger crashes on low-memory conditions.
Found by Victor Stinner. Will backport when 2.5 branch is unfrozen.
........
r54760 | raymond.hettinger | 2007-04-11 11:40:58 -0700 (Wed, 11 Apr 2007) | 1 line
SF 1191699: Make slices picklable
........
r54762 | georg.brandl | 2007-04-11 12:25:11 -0700 (Wed, 11 Apr 2007) | 2 lines
Exceptions are no longer old-style instances. Fix accordingly.
........
r54763 | georg.brandl | 2007-04-11 16:28:44 -0700 (Wed, 11 Apr 2007) | 2 lines
Repair missing spaces after \UNIX.
........
r54772 | raymond.hettinger | 2007-04-11 21:10:00 -0700 (Wed, 11 Apr 2007) | 1 line
SF 1193128: Let str.translate(None) be an identity transformation
........
r54784 | georg.brandl | 2007-04-12 00:01:19 -0700 (Thu, 12 Apr 2007) | 2 lines
Patch #1698951: clarify deprecation message in rexec and Bastion
........
r54785 | ziga.seilnacht | 2007-04-12 01:46:51 -0700 (Thu, 12 Apr 2007) | 2 lines
Patch #1695862: remove the cleanup code, now that Windows buildbots are green
again.
........
r54786 | walter.doerwald | 2007-04-12 03:35:00 -0700 (Thu, 12 Apr 2007) | 3 lines
Fix utf-8-sig incremental decoder, which didn't recognise a BOM when the
first chunk fed to the decoder started with a BOM, but was longer than 3 bytes.
........
r54807 | barry.warsaw | 2007-04-13 11:47:14 -0700 (Fri, 13 Apr 2007) | 8 lines
Port r54805 from python25-maint branch:
Add code to read from master_fd in the parent, breaking when we get an OSError
(EIO can occur on Linux) or there's no more data to read. Without this,
test_pty.py can hang on the waitpid() because the child is blocking on the
stdout write. This will definitely happen on Mac OS X and could potentially
happen on other platforms. See the comment for details.
........
r54812 | kristjan.jonsson | 2007-04-13 15:07:33 -0700 (Fri, 13 Apr 2007) | 1 line
Fix a bug when using the __lltrace__ opcode tracer, and a problem sith signed chars in frameobject.c which can occur with opcodes > 127
........
r54814 | kristjan.jonsson | 2007-04-13 15:20:13 -0700 (Fri, 13 Apr 2007) | 1 line
Fix potential crash in path manipulation on windows
........
r54816 | trent.mick | 2007-04-13 16:22:05 -0700 (Fri, 13 Apr 2007) | 4 lines
Add the necessary dependency for the Windows VC6 build to ensure 'pythoncore'
is built before '_ctypes' is attempted.
Will backport to 2.5 once it is unfrozen for 2.5.1.
........
r54825 | neal.norwitz | 2007-04-13 22:25:50 -0700 (Fri, 13 Apr 2007) | 3 lines
When __slots__ are set to a unicode string, make it work the same as
setting a plain string, ie don't expand to single letter identifiers.
........
r54841 | neal.norwitz | 2007-04-16 00:37:55 -0700 (Mon, 16 Apr 2007) | 1 line
SF #1701207, Fix bogus assertion (and test it!)
........
r54844 | collin.winter | 2007-04-16 15:10:32 -0700 (Mon, 16 Apr 2007) | 1 line
Check the availability of the urlfetch resource earlier than before.
........
r54849 | martin.v.loewis | 2007-04-16 22:02:01 -0700 (Mon, 16 Apr 2007) | 2 lines
Add Travis Oliphant.
........
r54873 | brett.cannon | 2007-04-18 20:44:17 -0700 (Wed, 18 Apr 2007) | 2 lines
Silence a compiler warning about incompatible pointer types.
........
r54874 | neal.norwitz | 2007-04-18 22:52:37 -0700 (Wed, 18 Apr 2007) | 2 lines
SF #1703270, add missing declaration in readline.c to avoid compiler warning.
........
r54875 | armin.rigo | 2007-04-19 07:44:48 -0700 (Thu, 19 Apr 2007) | 8 lines
Revert r53997 as per
http://mail.python.org/pipermail/python-dev/2007-March/071796.html .
I've kept a couple of still-valid extra tests in test_descr, but didn't
bother to sort through the new comments and refactorings added in r53997
to see if some of them could be kept. If so, they could go in a
follow-up check-in.
........
r54876 | armin.rigo | 2007-04-19 07:56:48 -0700 (Thu, 19 Apr 2007) | 2 lines
Fix a usage of the dangerous pattern decref - modify field - incref.
........
r54884 | neal.norwitz | 2007-04-19 22:20:38 -0700 (Thu, 19 Apr 2007) | 9 lines
Add an optional address to copy the failure mails to.
Detect a conflict in the only file that should have outstanding changes
when this script is run. This doesn't matter on the trunk, but does
when run on a branch. Trunk always has the date set to today in
boilerplate.tex. Each time a release is cut with a different date,
a conflict occurs. (We could copy a known good version, but then
we would lose changes to this file.)
........
r54918 | georg.brandl | 2007-04-21 13:35:38 -0700 (Sat, 21 Apr 2007) | 3 lines
Bug #1704790: bind name "sys" locally in __del__ method so that it is
not cleared before __del__ is run.
........
r54920 | facundo.batista | 2007-04-21 18:18:56 -0700 (Sat, 21 Apr 2007) | 5 lines
Added tests for other methods of SSL object. Now we cover
all the object methods. This is the final step to close
the #451607 bug.
........
r54927 | facundo.batista | 2007-04-23 10:08:31 -0700 (Mon, 23 Apr 2007) | 5 lines
As specified in RFC 2616, 2xx code indicates that the client's
request was successfully received, understood, and accepted.
Now in these cases no error is raised. Also fixed tests.
........
r54929 | collin.winter | 2007-04-23 20:43:46 -0700 (Mon, 23 Apr 2007) | 1 line
Convert PyUnit -> unittest.
........
r54931 | collin.winter | 2007-04-23 21:09:52 -0700 (Mon, 23 Apr 2007) | 1 line
Remove code that hasn't been called in years.
........
r54932 | neal.norwitz | 2007-04-23 21:53:12 -0700 (Mon, 23 Apr 2007) | 1 line
Fix SF #1703110, Incorrect example for add_password() (use uri, not host)
........
r54934 | georg.brandl | 2007-04-24 03:36:42 -0700 (Tue, 24 Apr 2007) | 2 lines
Some new year updates.
........
r54938 | facundo.batista | 2007-04-24 06:54:38 -0700 (Tue, 24 Apr 2007) | 4 lines
Added a comment about last change in urllib2.py (all 2xx responses
are ok now).
........
r54939 | georg.brandl | 2007-04-24 08:10:09 -0700 (Tue, 24 Apr 2007) | 2 lines
Bug #1705717: error in sys.argv docs.
........
r54941 | georg.brandl | 2007-04-24 08:27:13 -0700 (Tue, 24 Apr 2007) | 4 lines
Bug #1706381: Specifying the SWIG option "-c++" in the setup.py file
(as opposed to the command line) will now write file names ending in
".cpp" too.
........
r54944 | raymond.hettinger | 2007-04-24 15:13:43 -0700 (Tue, 24 Apr 2007) | 1 line
Fix markup
........
r54945 | kristjan.jonsson | 2007-04-24 17:10:50 -0700 (Tue, 24 Apr 2007) | 1 line
Merge change 54909 from release25-maint: Fix several minor issues discovered using code analysis in VisualStudio 2005 Team Edition
........
r54947 | kristjan.jonsson | 2007-04-24 17:17:39 -0700 (Tue, 24 Apr 2007) | 1 line
Make pythoncore compile cleanly with VisualStudio 2005. Used an explicit typecast to get a 64 bit integer, and undefined the Yield macro that conflicts with winbase.h
........
r54948 | kristjan.jonsson | 2007-04-24 17:19:26 -0700 (Tue, 24 Apr 2007) | 1 line
Remove obsolete comment. Importing of .dll files has been discontinued, only .pyd files supported on windows now.
........
r54949 | georg.brandl | 2007-04-24 23:24:59 -0700 (Tue, 24 Apr 2007) | 2 lines
Patch #1698768: updated the "using Python on the Mac" intro.
........
r54951 | georg.brandl | 2007-04-24 23:25:55 -0700 (Tue, 24 Apr 2007) | 2 lines
Markup fix.
........
r54953 | neal.norwitz | 2007-04-24 23:30:05 -0700 (Tue, 24 Apr 2007) | 3 lines
Whitespace normalization. Ugh, we really need to do this more often.
You might want to review this change as it's my first time. Be gentle. :-)
........
r54956 | collin.winter | 2007-04-25 10:29:52 -0700 (Wed, 25 Apr 2007) | 1 line
Standardize on test.test_support.run_unittest() (as opposed to a mix of run_unittest() and run_suite()). Also, add functionality to run_unittest() that admits usage of unittest.TestLoader.loadTestsFromModule().
........
r54957 | collin.winter | 2007-04-25 10:37:35 -0700 (Wed, 25 Apr 2007) | 1 line
Remove functionality from test_datetime.test_main() that does reference count checking; 'regrtest.py -R' is the way to do this kind of testing.
........
r54958 | collin.winter | 2007-04-25 10:57:53 -0700 (Wed, 25 Apr 2007) | 1 line
Change test_support.have_unicode to use True/False instead of 1/0.
........
r54959 | tim.peters | 2007-04-25 11:47:18 -0700 (Wed, 25 Apr 2007) | 2 lines
Whitespace normalization.
........
r54960 | tim.peters | 2007-04-25 11:48:35 -0700 (Wed, 25 Apr 2007) | 2 lines
Set missing svn:eol-style property on text files.
........
r54961 | collin.winter | 2007-04-25 11:54:36 -0700 (Wed, 25 Apr 2007) | 1 line
Import and raise statement cleanup.
........
r54969 | collin.winter | 2007-04-25 13:41:34 -0700 (Wed, 25 Apr 2007) | 1 line
Convert test_ossaudiodev to use unittest.
........
r54974 | collin.winter | 2007-04-25 14:50:25 -0700 (Wed, 25 Apr 2007) | 1 line
Fix an issue related to the unittest conversion.
........
r54979 | fred.drake | 2007-04-25 21:42:19 -0700 (Wed, 25 Apr 2007) | 1 line
fix some markup errors
........
r54982 | kristjan.jonsson | 2007-04-26 02:15:08 -0700 (Thu, 26 Apr 2007) | 1 line
Export function sanitize_the_mode from fileobject.c as _PyFile_SanitizeMode(). Use this function in posixmodule.c when implementing fdopen(). This fixes test_subprocess.py for a VisualStudio 2005 compile.
........
r54983 | kristjan.jonsson | 2007-04-26 06:44:16 -0700 (Thu, 26 Apr 2007) | 1 line
The locale "En" appears not to be valid on windows underi VisualStudio.2005. Added "English" to the test_locale.py to make the testsuite pass for that build
........
r54984 | steve.holden | 2007-04-26 07:23:12 -0700 (Thu, 26 Apr 2007) | 1 line
Minor wording change on slicing aide-memoire.
........
r54985 | kristjan.jonsson | 2007-04-26 08:24:54 -0700 (Thu, 26 Apr 2007) | 1 line
Accomodate 64 bit time_t in the _bsddb module.
........
2007-04-27 19:54:29 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
HANDLE hFindFile;
|
|
|
|
|
WIN32_FIND_DATAW FileData;
|
2021-04-22 13:09:56 -07:00
|
|
|
LPCWSTR filename = pszFile;
|
|
|
|
|
size_t n = wcslen(pszFile);
|
|
|
|
|
if (n && (pszFile[n - 1] == L'\\' || pszFile[n - 1] == L'/')) {
|
|
|
|
|
// cannot use PyMem_Malloc here because we do not hold the GIL
|
|
|
|
|
filename = (LPCWSTR)malloc((n + 1) * sizeof(filename[0]));
|
|
|
|
|
wcsncpy_s((LPWSTR)filename, n + 1, pszFile, n);
|
|
|
|
|
while (--n > 0 && (filename[n] == L'\\' || filename[n] == L'/')) {
|
|
|
|
|
((LPWSTR)filename)[n] = L'\0';
|
|
|
|
|
}
|
2021-04-22 16:56:45 -07:00
|
|
|
if (!n || (n == 1 && filename[1] == L':')) {
|
|
|
|
|
// Nothing left to query
|
2021-04-22 13:09:56 -07:00
|
|
|
free((void *)filename);
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
hFindFile = FindFirstFileW(filename, &FileData);
|
|
|
|
|
if (pszFile != filename) {
|
|
|
|
|
free((void *)filename);
|
|
|
|
|
}
|
|
|
|
|
if (hFindFile == INVALID_HANDLE_VALUE) {
|
2010-05-06 00:08:46 +00:00
|
|
|
return FALSE;
|
2021-04-22 13:09:56 -07:00
|
|
|
}
|
2010-05-06 00:08:46 +00:00
|
|
|
FindClose(hFindFile);
|
2016-09-08 10:35:16 -07:00
|
|
|
find_data_to_file_info(&FileData, info, reparse_tag);
|
2010-05-06 00:08:46 +00:00
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-24 13:14:05 +00:00
|
|
|
static int
|
2016-09-08 10:35:16 -07:00
|
|
|
win32_xstat_impl(const wchar_t *path, struct _Py_stat_struct *result,
|
2011-06-13 15:16:04 -05:00
|
|
|
BOOL traverse)
|
2010-07-08 21:39:08 +00:00
|
|
|
{
|
2019-08-21 15:27:33 -07:00
|
|
|
HANDLE hFile;
|
|
|
|
|
BY_HANDLE_FILE_INFORMATION fileInfo;
|
|
|
|
|
FILE_ATTRIBUTE_TAG_INFO tagInfo = { 0 };
|
|
|
|
|
DWORD fileType, error;
|
|
|
|
|
BOOL isUnhandledTag = FALSE;
|
|
|
|
|
int retval = 0;
|
2010-07-08 21:39:08 +00:00
|
|
|
|
2019-08-21 15:27:33 -07:00
|
|
|
DWORD access = FILE_READ_ATTRIBUTES;
|
|
|
|
|
DWORD flags = FILE_FLAG_BACKUP_SEMANTICS; /* Allow opening directories. */
|
|
|
|
|
if (!traverse) {
|
|
|
|
|
flags |= FILE_FLAG_OPEN_REPARSE_POINT;
|
|
|
|
|
}
|
2010-11-24 13:14:05 +00:00
|
|
|
|
2019-08-21 15:27:33 -07:00
|
|
|
hFile = CreateFileW(path, access, 0, NULL, OPEN_EXISTING, flags, NULL);
|
2010-12-04 10:16:05 +00:00
|
|
|
if (hFile == INVALID_HANDLE_VALUE) {
|
2019-08-21 15:27:33 -07:00
|
|
|
/* Either the path doesn't exist, or the caller lacks access. */
|
|
|
|
|
error = GetLastError();
|
|
|
|
|
switch (error) {
|
|
|
|
|
case ERROR_ACCESS_DENIED: /* Cannot sync or read attributes. */
|
|
|
|
|
case ERROR_SHARING_VIOLATION: /* It's a paging file. */
|
|
|
|
|
/* Try reading the parent directory. */
|
|
|
|
|
if (!attributes_from_dir(path, &fileInfo, &tagInfo.ReparseTag)) {
|
|
|
|
|
/* Cannot read the parent directory. */
|
|
|
|
|
SetLastError(error);
|
2010-12-04 10:16:05 +00:00
|
|
|
return -1;
|
|
|
|
|
}
|
2019-08-21 15:27:33 -07:00
|
|
|
if (fileInfo.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
|
|
|
|
|
if (traverse ||
|
|
|
|
|
!IsReparseTagNameSurrogate(tagInfo.ReparseTag)) {
|
|
|
|
|
/* The stat call has to traverse but cannot, so fail. */
|
|
|
|
|
SetLastError(error);
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
2019-02-02 16:08:23 -05:00
|
|
|
}
|
2019-08-21 15:27:33 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ERROR_INVALID_PARAMETER:
|
|
|
|
|
/* \\.\con requires read or write access. */
|
|
|
|
|
hFile = CreateFileW(path, access | GENERIC_READ,
|
|
|
|
|
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
|
|
|
|
|
OPEN_EXISTING, flags, NULL);
|
|
|
|
|
if (hFile == INVALID_HANDLE_VALUE) {
|
|
|
|
|
SetLastError(error);
|
2011-06-13 15:16:04 -05:00
|
|
|
return -1;
|
2019-08-21 15:27:33 -07:00
|
|
|
}
|
|
|
|
|
break;
|
2011-06-13 15:16:04 -05:00
|
|
|
|
2019-08-21 15:27:33 -07:00
|
|
|
case ERROR_CANT_ACCESS_FILE:
|
|
|
|
|
/* bpo37834: open unhandled reparse points if traverse fails. */
|
2010-12-04 10:16:05 +00:00
|
|
|
if (traverse) {
|
2019-08-21 15:27:33 -07:00
|
|
|
traverse = FALSE;
|
|
|
|
|
isUnhandledTag = TRUE;
|
|
|
|
|
hFile = CreateFileW(path, access, 0, NULL, OPEN_EXISTING,
|
|
|
|
|
flags | FILE_FLAG_OPEN_REPARSE_POINT, NULL);
|
|
|
|
|
}
|
|
|
|
|
if (hFile == INVALID_HANDLE_VALUE) {
|
|
|
|
|
SetLastError(error);
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
break;
|
2011-06-13 15:16:04 -05:00
|
|
|
|
2019-08-21 15:27:33 -07:00
|
|
|
default:
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-02-02 16:08:23 -05:00
|
|
|
|
2019-08-21 15:27:33 -07:00
|
|
|
if (hFile != INVALID_HANDLE_VALUE) {
|
|
|
|
|
/* Handle types other than files on disk. */
|
|
|
|
|
fileType = GetFileType(hFile);
|
|
|
|
|
if (fileType != FILE_TYPE_DISK) {
|
|
|
|
|
if (fileType == FILE_TYPE_UNKNOWN && GetLastError() != 0) {
|
|
|
|
|
retval = -1;
|
|
|
|
|
goto cleanup;
|
|
|
|
|
}
|
|
|
|
|
DWORD fileAttributes = GetFileAttributesW(path);
|
|
|
|
|
memset(result, 0, sizeof(*result));
|
|
|
|
|
if (fileAttributes != INVALID_FILE_ATTRIBUTES &&
|
|
|
|
|
fileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
|
|
|
|
|
/* \\.\pipe\ or \\.\mailslot\ */
|
|
|
|
|
result->st_mode = _S_IFDIR;
|
|
|
|
|
} else if (fileType == FILE_TYPE_CHAR) {
|
|
|
|
|
/* \\.\nul */
|
|
|
|
|
result->st_mode = _S_IFCHR;
|
|
|
|
|
} else if (fileType == FILE_TYPE_PIPE) {
|
|
|
|
|
/* \\.\pipe\spam */
|
|
|
|
|
result->st_mode = _S_IFIFO;
|
|
|
|
|
}
|
|
|
|
|
/* FILE_TYPE_UNKNOWN, e.g. \\.\mailslot\waitfor.exe\spam */
|
|
|
|
|
goto cleanup;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Query the reparse tag, and traverse a non-link. */
|
|
|
|
|
if (!traverse) {
|
|
|
|
|
if (!GetFileInformationByHandleEx(hFile, FileAttributeTagInfo,
|
|
|
|
|
&tagInfo, sizeof(tagInfo))) {
|
|
|
|
|
/* Allow devices that do not support FileAttributeTagInfo. */
|
|
|
|
|
switch (GetLastError()) {
|
|
|
|
|
case ERROR_INVALID_PARAMETER:
|
|
|
|
|
case ERROR_INVALID_FUNCTION:
|
|
|
|
|
case ERROR_NOT_SUPPORTED:
|
|
|
|
|
tagInfo.FileAttributes = FILE_ATTRIBUTE_NORMAL;
|
|
|
|
|
tagInfo.ReparseTag = 0;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
retval = -1;
|
|
|
|
|
goto cleanup;
|
2019-02-02 16:08:23 -05:00
|
|
|
}
|
2019-08-21 15:27:33 -07:00
|
|
|
} else if (tagInfo.FileAttributes &
|
|
|
|
|
FILE_ATTRIBUTE_REPARSE_POINT) {
|
|
|
|
|
if (IsReparseTagNameSurrogate(tagInfo.ReparseTag)) {
|
|
|
|
|
if (isUnhandledTag) {
|
|
|
|
|
/* Traversing previously failed for either this link
|
|
|
|
|
or its target. */
|
|
|
|
|
SetLastError(ERROR_CANT_ACCESS_FILE);
|
|
|
|
|
retval = -1;
|
|
|
|
|
goto cleanup;
|
|
|
|
|
}
|
|
|
|
|
/* Traverse a non-link, but not if traversing already failed
|
|
|
|
|
for an unhandled tag. */
|
|
|
|
|
} else if (!isUnhandledTag) {
|
|
|
|
|
CloseHandle(hFile);
|
|
|
|
|
return win32_xstat_impl(path, result, TRUE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-06-13 15:16:04 -05:00
|
|
|
|
2019-08-21 15:27:33 -07:00
|
|
|
if (!GetFileInformationByHandle(hFile, &fileInfo)) {
|
|
|
|
|
switch (GetLastError()) {
|
|
|
|
|
case ERROR_INVALID_PARAMETER:
|
|
|
|
|
case ERROR_INVALID_FUNCTION:
|
|
|
|
|
case ERROR_NOT_SUPPORTED:
|
2019-09-04 14:42:54 -07:00
|
|
|
/* Volumes and physical disks are block devices, e.g.
|
|
|
|
|
\\.\C: and \\.\PhysicalDrive0. */
|
|
|
|
|
memset(result, 0, sizeof(*result));
|
|
|
|
|
result->st_mode = 0x6000; /* S_IFBLK */
|
2019-08-21 15:27:33 -07:00
|
|
|
goto cleanup;
|
2010-07-08 21:39:08 +00:00
|
|
|
}
|
2019-09-04 14:42:54 -07:00
|
|
|
retval = -1;
|
2019-08-21 15:27:33 -07:00
|
|
|
goto cleanup;
|
|
|
|
|
}
|
2010-11-24 13:14:05 +00:00
|
|
|
}
|
2010-07-08 21:39:08 +00:00
|
|
|
|
2019-08-21 15:27:33 -07:00
|
|
|
_Py_attribute_data_to_stat(&fileInfo, tagInfo.ReparseTag, result);
|
|
|
|
|
|
|
|
|
|
if (!(fileInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
|
|
|
|
|
/* Fix the file execute permissions. This hack sets S_IEXEC if
|
|
|
|
|
the filename has an extension that is commonly used by files
|
|
|
|
|
that CreateProcessW can execute. A real implementation calls
|
|
|
|
|
GetSecurityInfo, OpenThreadToken/OpenProcessToken, and
|
|
|
|
|
AccessCheck to check for generic read, write, and execute
|
|
|
|
|
access. */
|
|
|
|
|
const wchar_t *fileExtension = wcsrchr(path, '.');
|
|
|
|
|
if (fileExtension) {
|
|
|
|
|
if (_wcsicmp(fileExtension, L".exe") == 0 ||
|
|
|
|
|
_wcsicmp(fileExtension, L".bat") == 0 ||
|
|
|
|
|
_wcsicmp(fileExtension, L".cmd") == 0 ||
|
|
|
|
|
_wcsicmp(fileExtension, L".com") == 0) {
|
|
|
|
|
result->st_mode |= 0111;
|
|
|
|
|
}
|
|
|
|
|
}
|
2010-09-21 18:19:07 +00:00
|
|
|
}
|
2019-08-21 15:27:33 -07:00
|
|
|
|
|
|
|
|
cleanup:
|
|
|
|
|
if (hFile != INVALID_HANDLE_VALUE) {
|
2019-09-04 14:42:54 -07:00
|
|
|
/* Preserve last error if we are failing */
|
|
|
|
|
error = retval ? GetLastError() : 0;
|
|
|
|
|
if (!CloseHandle(hFile)) {
|
|
|
|
|
retval = -1;
|
|
|
|
|
} else if (retval) {
|
|
|
|
|
/* Restore last error */
|
|
|
|
|
SetLastError(error);
|
|
|
|
|
}
|
2019-08-21 15:27:33 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return retval;
|
2010-12-04 10:16:05 +00:00
|
|
|
}
|
2010-11-24 13:14:05 +00:00
|
|
|
|
2010-12-04 10:16:05 +00:00
|
|
|
static int
|
2016-09-08 10:35:16 -07:00
|
|
|
win32_xstat(const wchar_t *path, struct _Py_stat_struct *result, BOOL traverse)
|
2010-12-04 10:16:05 +00:00
|
|
|
{
|
2010-11-24 13:14:05 +00:00
|
|
|
/* Protocol violation: we explicitly clear errno, instead of
|
|
|
|
|
setting it to a POSIX error. Callers should use GetLastError. */
|
2011-06-13 15:16:04 -05:00
|
|
|
int code = win32_xstat_impl(path, result, traverse);
|
2010-11-24 13:14:05 +00:00
|
|
|
errno = 0;
|
2010-12-04 10:16:05 +00:00
|
|
|
return code;
|
2010-07-08 21:39:08 +00:00
|
|
|
}
|
2011-06-13 15:16:04 -05:00
|
|
|
/* About the following functions: win32_lstat_w, win32_stat, win32_stat_w
|
2010-07-08 21:39:08 +00:00
|
|
|
|
2010-11-24 13:14:05 +00:00
|
|
|
In Posix, stat automatically traverses symlinks and returns the stat
|
|
|
|
|
structure for the target. In Windows, the equivalent GetFileAttributes by
|
|
|
|
|
default does not traverse symlinks and instead returns attributes for
|
|
|
|
|
the symlink.
|
2010-07-08 21:39:08 +00:00
|
|
|
|
2019-08-21 15:27:33 -07:00
|
|
|
Instead, we will open the file (which *does* traverse symlinks by default)
|
|
|
|
|
and GetFileInformationByHandle(). */
|
2010-11-24 13:14:05 +00:00
|
|
|
|
2011-02-25 14:39:16 +00:00
|
|
|
static int
|
2016-09-08 10:35:16 -07:00
|
|
|
win32_lstat(const wchar_t* path, struct _Py_stat_struct *result)
|
2010-11-24 13:14:05 +00:00
|
|
|
{
|
2010-12-04 10:16:05 +00:00
|
|
|
return win32_xstat(path, result, FALSE);
|
2010-11-24 13:14:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
2016-09-08 10:35:16 -07:00
|
|
|
win32_stat(const wchar_t* path, struct _Py_stat_struct *result)
|
2010-11-24 13:14:05 +00:00
|
|
|
{
|
2010-12-04 10:16:05 +00:00
|
|
|
return win32_xstat(path, result, TRUE);
|
2010-11-24 13:14:05 +00:00
|
|
|
}
|
|
|
|
|
|
2006-02-03 12:54:16 +00:00
|
|
|
#endif /* MS_WINDOWS */
|
|
|
|
|
|
2002-06-13 20:33:02 +00:00
|
|
|
PyDoc_STRVAR(stat_result__doc__,
|
2012-06-22 16:30:09 -07:00
|
|
|
"stat_result: Result from stat, fstat, or lstat.\n\n\
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
This object may be accessed either as a tuple of\n\
|
2002-06-20 18:31:21 +00:00
|
|
|
(mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime)\n\
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
or via the attributes st_mode, st_ino, st_dev, st_nlink, st_uid, and so on.\n\
|
|
|
|
|
\n\
|
2005-06-02 13:09:30 +00:00
|
|
|
Posix/windows: If your platform supports st_blksize, st_blocks, st_rdev,\n\
|
|
|
|
|
or st_flags, they are available as attributes only.\n\
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
\n\
|
2002-06-13 20:33:02 +00:00
|
|
|
See os.stat for more information.");
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
|
|
|
|
|
static PyStructSequence_Field stat_result_fields[] = {
|
2010-05-06 00:08:46 +00:00
|
|
|
{"st_mode", "protection bits"},
|
|
|
|
|
{"st_ino", "inode"},
|
|
|
|
|
{"st_dev", "device"},
|
|
|
|
|
{"st_nlink", "number of hard links"},
|
|
|
|
|
{"st_uid", "user ID of owner"},
|
|
|
|
|
{"st_gid", "group ID of owner"},
|
|
|
|
|
{"st_size", "total size, in bytes"},
|
|
|
|
|
/* The NULL is replaced with PyStructSequence_UnnamedField later. */
|
|
|
|
|
{NULL, "integer time of last access"},
|
|
|
|
|
{NULL, "integer time of last modification"},
|
|
|
|
|
{NULL, "integer time of last change"},
|
|
|
|
|
{"st_atime", "time of last access"},
|
|
|
|
|
{"st_mtime", "time of last modification"},
|
|
|
|
|
{"st_ctime", "time of last change"},
|
2012-04-19 15:07:49 -07:00
|
|
|
{"st_atime_ns", "time of last access in nanoseconds"},
|
|
|
|
|
{"st_mtime_ns", "time of last modification in nanoseconds"},
|
|
|
|
|
{"st_ctime_ns", "time of last change in nanoseconds"},
|
2002-10-16 20:28:25 +00:00
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
|
2010-05-06 00:08:46 +00:00
|
|
|
{"st_blksize", "blocksize for filesystem I/O"},
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
#endif
|
2002-10-16 20:28:25 +00:00
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"st_blocks", "number of blocks allocated"},
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
#endif
|
2002-10-16 20:28:25 +00:00
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_RDEV
|
2010-05-06 00:08:46 +00:00
|
|
|
{"st_rdev", "device type (if inode device)"},
|
2005-06-02 13:09:30 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_FLAGS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"st_flags", "user defined flags for file"},
|
2005-08-09 15:00:59 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_GEN
|
2010-05-06 00:08:46 +00:00
|
|
|
{"st_gen", "generation number"},
|
2005-08-09 15:00:59 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_BIRTHTIME
|
2010-05-06 00:08:46 +00:00
|
|
|
{"st_birthtime", "time of creation"},
|
2014-06-19 09:46:37 -05:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_FILE_ATTRIBUTES
|
|
|
|
|
{"st_file_attributes", "Windows file attribute bits"},
|
2018-01-28 14:00:08 +01:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_FSTYPE
|
|
|
|
|
{"st_fstype", "Type of filesystem"},
|
2019-08-21 15:27:33 -07:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_REPARSE_TAG
|
|
|
|
|
{"st_reparse_tag", "Windows reparse tag"},
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
#endif
|
2010-05-06 00:08:46 +00:00
|
|
|
{0}
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
};
|
|
|
|
|
|
2002-10-16 20:28:25 +00:00
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
|
2012-04-19 15:07:49 -07:00
|
|
|
#define ST_BLKSIZE_IDX 16
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
#else
|
2012-04-19 15:07:49 -07:00
|
|
|
#define ST_BLKSIZE_IDX 15
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
#endif
|
|
|
|
|
|
2002-10-16 20:28:25 +00:00
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
#define ST_BLOCKS_IDX (ST_BLKSIZE_IDX+1)
|
|
|
|
|
#else
|
|
|
|
|
#define ST_BLOCKS_IDX ST_BLKSIZE_IDX
|
|
|
|
|
#endif
|
|
|
|
|
|
2002-10-16 20:28:25 +00:00
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_RDEV
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
#define ST_RDEV_IDX (ST_BLOCKS_IDX+1)
|
|
|
|
|
#else
|
|
|
|
|
#define ST_RDEV_IDX ST_BLOCKS_IDX
|
|
|
|
|
#endif
|
|
|
|
|
|
2005-06-02 13:09:30 +00:00
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_FLAGS
|
|
|
|
|
#define ST_FLAGS_IDX (ST_RDEV_IDX+1)
|
|
|
|
|
#else
|
|
|
|
|
#define ST_FLAGS_IDX ST_RDEV_IDX
|
|
|
|
|
#endif
|
|
|
|
|
|
2005-08-09 15:00:59 +00:00
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_GEN
|
2005-08-14 21:42:34 +00:00
|
|
|
#define ST_GEN_IDX (ST_FLAGS_IDX+1)
|
2005-08-09 15:00:59 +00:00
|
|
|
#else
|
2005-08-14 21:42:34 +00:00
|
|
|
#define ST_GEN_IDX ST_FLAGS_IDX
|
2005-08-09 15:00:59 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_BIRTHTIME
|
|
|
|
|
#define ST_BIRTHTIME_IDX (ST_GEN_IDX+1)
|
|
|
|
|
#else
|
|
|
|
|
#define ST_BIRTHTIME_IDX ST_GEN_IDX
|
|
|
|
|
#endif
|
|
|
|
|
|
2014-06-19 09:46:37 -05:00
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_FILE_ATTRIBUTES
|
|
|
|
|
#define ST_FILE_ATTRIBUTES_IDX (ST_BIRTHTIME_IDX+1)
|
|
|
|
|
#else
|
|
|
|
|
#define ST_FILE_ATTRIBUTES_IDX ST_BIRTHTIME_IDX
|
|
|
|
|
#endif
|
|
|
|
|
|
2018-01-28 14:00:08 +01:00
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_FSTYPE
|
|
|
|
|
#define ST_FSTYPE_IDX (ST_FILE_ATTRIBUTES_IDX+1)
|
|
|
|
|
#else
|
|
|
|
|
#define ST_FSTYPE_IDX ST_FILE_ATTRIBUTES_IDX
|
|
|
|
|
#endif
|
|
|
|
|
|
2019-08-21 15:27:33 -07:00
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_REPARSE_TAG
|
|
|
|
|
#define ST_REPARSE_TAG_IDX (ST_FSTYPE_IDX+1)
|
|
|
|
|
#else
|
|
|
|
|
#define ST_REPARSE_TAG_IDX ST_FSTYPE_IDX
|
|
|
|
|
#endif
|
|
|
|
|
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
static PyStructSequence_Desc stat_result_desc = {
|
2010-05-06 00:08:46 +00:00
|
|
|
"stat_result", /* name */
|
|
|
|
|
stat_result__doc__, /* doc */
|
|
|
|
|
stat_result_fields,
|
|
|
|
|
10
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
};
|
|
|
|
|
|
2002-06-13 20:33:02 +00:00
|
|
|
PyDoc_STRVAR(statvfs_result__doc__,
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
"statvfs_result: Result from statvfs or fstatvfs.\n\n\
|
|
|
|
|
This object may be accessed either as a tuple of\n\
|
2002-06-20 18:31:21 +00:00
|
|
|
(bsize, frsize, blocks, bfree, bavail, files, ffree, favail, flag, namemax),\n\
|
2001-10-18 20:53:15 +00:00
|
|
|
or via the attributes f_bsize, f_frsize, f_blocks, f_bfree, and so on.\n\
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
\n\
|
2002-06-13 20:33:02 +00:00
|
|
|
See os.statvfs for more information.");
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
|
|
|
|
|
static PyStructSequence_Field statvfs_result_fields[] = {
|
2010-05-06 00:08:46 +00:00
|
|
|
{"f_bsize", },
|
|
|
|
|
{"f_frsize", },
|
|
|
|
|
{"f_blocks", },
|
|
|
|
|
{"f_bfree", },
|
|
|
|
|
{"f_bavail", },
|
|
|
|
|
{"f_files", },
|
|
|
|
|
{"f_ffree", },
|
|
|
|
|
{"f_favail", },
|
|
|
|
|
{"f_flag", },
|
|
|
|
|
{"f_namemax",},
|
2017-12-14 23:46:46 +01:00
|
|
|
{"f_fsid", },
|
2010-05-06 00:08:46 +00:00
|
|
|
{0}
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static PyStructSequence_Desc statvfs_result_desc = {
|
2010-05-06 00:08:46 +00:00
|
|
|
"statvfs_result", /* name */
|
|
|
|
|
statvfs_result__doc__, /* doc */
|
|
|
|
|
statvfs_result_fields,
|
|
|
|
|
10
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
};
|
|
|
|
|
|
2011-03-17 20:20:30 +02:00
|
|
|
#if defined(HAVE_WAITID) && !defined(__APPLE__)
|
|
|
|
|
PyDoc_STRVAR(waitid_result__doc__,
|
|
|
|
|
"waitid_result: Result from waitid.\n\n\
|
|
|
|
|
This object may be accessed either as a tuple of\n\
|
|
|
|
|
(si_pid, si_uid, si_signo, si_status, si_code),\n\
|
|
|
|
|
or via the attributes si_pid, si_uid, and so on.\n\
|
|
|
|
|
\n\
|
|
|
|
|
See os.waitid for more information.");
|
|
|
|
|
|
|
|
|
|
static PyStructSequence_Field waitid_result_fields[] = {
|
|
|
|
|
{"si_pid", },
|
|
|
|
|
{"si_uid", },
|
|
|
|
|
{"si_signo", },
|
|
|
|
|
{"si_status", },
|
|
|
|
|
{"si_code", },
|
|
|
|
|
{0}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static PyStructSequence_Desc waitid_result_desc = {
|
|
|
|
|
"waitid_result", /* name */
|
|
|
|
|
waitid_result__doc__, /* doc */
|
|
|
|
|
waitid_result_fields,
|
|
|
|
|
5
|
|
|
|
|
};
|
2011-08-02 18:42:14 -05:00
|
|
|
#endif
|
2002-10-16 18:27:39 +00:00
|
|
|
static newfunc structseq_new;
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
statresult_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
PyStructSequence *result;
|
|
|
|
|
int i;
|
2002-10-16 18:27:39 +00:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
result = (PyStructSequence*)structseq_new(type, args, kwds);
|
|
|
|
|
if (!result)
|
|
|
|
|
return NULL;
|
|
|
|
|
/* If we have been initialized from a tuple,
|
|
|
|
|
st_?time might be set to None. Initialize it
|
|
|
|
|
from the int slots. */
|
|
|
|
|
for (i = 7; i <= 9; i++) {
|
|
|
|
|
if (result->ob_item[i+3] == Py_None) {
|
|
|
|
|
Py_DECREF(Py_None);
|
|
|
|
|
Py_INCREF(result->ob_item[i]);
|
|
|
|
|
result->ob_item[i+3] = result->ob_item[i];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return (PyObject*)result;
|
2002-10-16 18:27:39 +00:00
|
|
|
}
|
|
|
|
|
|
2019-11-05 07:16:14 -08:00
|
|
|
static int
|
|
|
|
|
_posix_clear(PyObject *module)
|
|
|
|
|
{
|
2020-05-14 18:05:58 +02:00
|
|
|
_posixstate *state = get_posix_state(module);
|
|
|
|
|
Py_CLEAR(state->billion);
|
|
|
|
|
Py_CLEAR(state->DirEntryType);
|
|
|
|
|
Py_CLEAR(state->ScandirIteratorType);
|
2019-11-05 07:16:14 -08:00
|
|
|
#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM)
|
2020-05-14 18:05:58 +02:00
|
|
|
Py_CLEAR(state->SchedParamType);
|
2019-11-05 07:16:14 -08:00
|
|
|
#endif
|
2020-05-14 18:05:58 +02:00
|
|
|
Py_CLEAR(state->StatResultType);
|
|
|
|
|
Py_CLEAR(state->StatVFSResultType);
|
|
|
|
|
Py_CLEAR(state->TerminalSizeType);
|
|
|
|
|
Py_CLEAR(state->TimesResultType);
|
|
|
|
|
Py_CLEAR(state->UnameResultType);
|
2019-11-05 07:16:14 -08:00
|
|
|
#if defined(HAVE_WAITID) && !defined(__APPLE__)
|
2020-05-14 18:05:58 +02:00
|
|
|
Py_CLEAR(state->WaitidResultType);
|
2019-11-05 07:16:14 -08:00
|
|
|
#endif
|
|
|
|
|
#if defined(HAVE_WAIT3) || defined(HAVE_WAIT4)
|
2020-05-14 18:05:58 +02:00
|
|
|
Py_CLEAR(state->struct_rusage);
|
2019-11-05 07:16:14 -08:00
|
|
|
#endif
|
2020-05-14 18:05:58 +02:00
|
|
|
Py_CLEAR(state->st_mode);
|
2019-11-05 07:16:14 -08:00
|
|
|
return 0;
|
|
|
|
|
}
|
2002-10-16 18:27:39 +00:00
|
|
|
|
2019-11-05 07:16:14 -08:00
|
|
|
static int
|
|
|
|
|
_posix_traverse(PyObject *module, visitproc visit, void *arg)
|
|
|
|
|
{
|
2020-05-14 18:05:58 +02:00
|
|
|
_posixstate *state = get_posix_state(module);
|
|
|
|
|
Py_VISIT(state->billion);
|
|
|
|
|
Py_VISIT(state->DirEntryType);
|
|
|
|
|
Py_VISIT(state->ScandirIteratorType);
|
2019-11-05 07:16:14 -08:00
|
|
|
#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM)
|
2020-05-14 18:05:58 +02:00
|
|
|
Py_VISIT(state->SchedParamType);
|
2019-11-05 07:16:14 -08:00
|
|
|
#endif
|
2020-05-14 18:05:58 +02:00
|
|
|
Py_VISIT(state->StatResultType);
|
|
|
|
|
Py_VISIT(state->StatVFSResultType);
|
|
|
|
|
Py_VISIT(state->TerminalSizeType);
|
|
|
|
|
Py_VISIT(state->TimesResultType);
|
|
|
|
|
Py_VISIT(state->UnameResultType);
|
2019-11-05 07:16:14 -08:00
|
|
|
#if defined(HAVE_WAITID) && !defined(__APPLE__)
|
2020-05-14 18:05:58 +02:00
|
|
|
Py_VISIT(state->WaitidResultType);
|
2019-11-05 07:16:14 -08:00
|
|
|
#endif
|
|
|
|
|
#if defined(HAVE_WAIT3) || defined(HAVE_WAIT4)
|
2020-05-14 18:05:58 +02:00
|
|
|
Py_VISIT(state->struct_rusage);
|
2019-11-05 07:16:14 -08:00
|
|
|
#endif
|
2020-05-14 18:05:58 +02:00
|
|
|
Py_VISIT(state->st_mode);
|
2019-11-05 07:16:14 -08:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
_posix_free(void *module)
|
|
|
|
|
{
|
|
|
|
|
_posix_clear((PyObject *)module);
|
|
|
|
|
}
|
2012-04-19 15:07:49 -07:00
|
|
|
|
2002-09-09 14:24:16 +00:00
|
|
|
static void
|
2020-05-10 11:05:29 +02:00
|
|
|
fill_time(PyObject *module, PyObject *v, int index, time_t sec, unsigned long nsec)
|
2002-09-09 14:24:16 +00:00
|
|
|
{
|
2012-04-19 15:07:49 -07:00
|
|
|
PyObject *s = _PyLong_FromTime_t(sec);
|
|
|
|
|
PyObject *ns_fractional = PyLong_FromUnsignedLong(nsec);
|
|
|
|
|
PyObject *s_in_ns = NULL;
|
|
|
|
|
PyObject *ns_total = NULL;
|
|
|
|
|
PyObject *float_s = NULL;
|
|
|
|
|
|
|
|
|
|
if (!(s && ns_fractional))
|
|
|
|
|
goto exit;
|
|
|
|
|
|
2020-05-10 11:05:29 +02:00
|
|
|
s_in_ns = PyNumber_Multiply(s, get_posix_state(module)->billion);
|
2012-04-19 15:07:49 -07:00
|
|
|
if (!s_in_ns)
|
|
|
|
|
goto exit;
|
|
|
|
|
|
|
|
|
|
ns_total = PyNumber_Add(s_in_ns, ns_fractional);
|
|
|
|
|
if (!ns_total)
|
|
|
|
|
goto exit;
|
|
|
|
|
|
2017-10-24 02:02:00 -07:00
|
|
|
float_s = PyFloat_FromDouble(sec + 1e-9*nsec);
|
|
|
|
|
if (!float_s) {
|
|
|
|
|
goto exit;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2012-04-19 15:07:49 -07:00
|
|
|
|
|
|
|
|
PyStructSequence_SET_ITEM(v, index, s);
|
|
|
|
|
PyStructSequence_SET_ITEM(v, index+3, float_s);
|
|
|
|
|
PyStructSequence_SET_ITEM(v, index+6, ns_total);
|
|
|
|
|
s = NULL;
|
|
|
|
|
float_s = NULL;
|
|
|
|
|
ns_total = NULL;
|
|
|
|
|
exit:
|
|
|
|
|
Py_XDECREF(s);
|
|
|
|
|
Py_XDECREF(ns_fractional);
|
|
|
|
|
Py_XDECREF(s_in_ns);
|
|
|
|
|
Py_XDECREF(ns_total);
|
|
|
|
|
Py_XDECREF(float_s);
|
2002-09-09 14:24:16 +00:00
|
|
|
}
|
|
|
|
|
|
2002-01-30 05:46:57 +00:00
|
|
|
/* pack a system stat C structure into the Python stat tuple
|
2000-06-29 21:12:41 +00:00
|
|
|
(used by posix_stat() and posix_fstat()) */
|
|
|
|
|
static PyObject*
|
2020-05-10 11:05:29 +02:00
|
|
|
_pystat_fromstructstat(PyObject *module, STRUCT_STAT *st)
|
2000-06-29 21:12:41 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
unsigned long ansec, mnsec, cnsec;
|
2020-05-10 11:05:29 +02:00
|
|
|
PyObject *StatResultType = get_posix_state(module)->StatResultType;
|
2019-11-05 07:16:14 -08:00
|
|
|
PyObject *v = PyStructSequence_New((PyTypeObject *)StatResultType);
|
2010-05-06 00:08:46 +00:00
|
|
|
if (v == NULL)
|
|
|
|
|
return NULL;
|
2000-06-29 21:12:41 +00:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
PyStructSequence_SET_ITEM(v, 0, PyLong_FromLong((long)st->st_mode));
|
2017-03-09 17:34:28 +01:00
|
|
|
Py_BUILD_ASSERT(sizeof(unsigned long long) >= sizeof(st->st_ino));
|
2017-05-22 11:15:08 +02:00
|
|
|
PyStructSequence_SET_ITEM(v, 1, PyLong_FromUnsignedLongLong(st->st_ino));
|
2013-01-02 18:22:23 +02:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
PyStructSequence_SET_ITEM(v, 2, PyLong_FromUnsignedLong(st->st_dev));
|
2000-06-29 21:12:41 +00:00
|
|
|
#else
|
2015-01-18 11:12:11 +02:00
|
|
|
PyStructSequence_SET_ITEM(v, 2, _PyLong_FromDev(st->st_dev));
|
2000-06-29 21:12:41 +00:00
|
|
|
#endif
|
2010-05-06 00:08:46 +00:00
|
|
|
PyStructSequence_SET_ITEM(v, 3, PyLong_FromLong((long)st->st_nlink));
|
2013-02-10 21:56:49 +02:00
|
|
|
#if defined(MS_WINDOWS)
|
|
|
|
|
PyStructSequence_SET_ITEM(v, 4, PyLong_FromLong(0));
|
|
|
|
|
PyStructSequence_SET_ITEM(v, 5, PyLong_FromLong(0));
|
|
|
|
|
#else
|
|
|
|
|
PyStructSequence_SET_ITEM(v, 4, _PyLong_FromUid(st->st_uid));
|
|
|
|
|
PyStructSequence_SET_ITEM(v, 5, _PyLong_FromGid(st->st_gid));
|
|
|
|
|
#endif
|
2017-05-22 11:15:08 +02:00
|
|
|
Py_BUILD_ASSERT(sizeof(long long) >= sizeof(st->st_size));
|
|
|
|
|
PyStructSequence_SET_ITEM(v, 6, PyLong_FromLongLong(st->st_size));
|
2006-02-03 12:54:16 +00:00
|
|
|
|
|
|
|
|
#if defined(HAVE_STAT_TV_NSEC)
|
2010-05-06 00:08:46 +00:00
|
|
|
ansec = st->st_atim.tv_nsec;
|
|
|
|
|
mnsec = st->st_mtim.tv_nsec;
|
|
|
|
|
cnsec = st->st_ctim.tv_nsec;
|
2006-02-03 12:54:16 +00:00
|
|
|
#elif defined(HAVE_STAT_TV_NSEC2)
|
2010-05-06 00:08:46 +00:00
|
|
|
ansec = st->st_atimespec.tv_nsec;
|
|
|
|
|
mnsec = st->st_mtimespec.tv_nsec;
|
|
|
|
|
cnsec = st->st_ctimespec.tv_nsec;
|
2006-02-03 12:54:16 +00:00
|
|
|
#elif defined(HAVE_STAT_NSEC)
|
2010-05-06 00:08:46 +00:00
|
|
|
ansec = st->st_atime_nsec;
|
|
|
|
|
mnsec = st->st_mtime_nsec;
|
|
|
|
|
cnsec = st->st_ctime_nsec;
|
2000-06-29 21:12:41 +00:00
|
|
|
#else
|
2010-05-06 00:08:46 +00:00
|
|
|
ansec = mnsec = cnsec = 0;
|
2005-08-09 15:00:59 +00:00
|
|
|
#endif
|
2020-05-10 11:05:29 +02:00
|
|
|
fill_time(module, v, 7, st->st_atime, ansec);
|
|
|
|
|
fill_time(module, v, 8, st->st_mtime, mnsec);
|
|
|
|
|
fill_time(module, v, 9, st->st_ctime, cnsec);
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
|
2002-10-16 20:28:25 +00:00
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
|
2010-05-06 00:08:46 +00:00
|
|
|
PyStructSequence_SET_ITEM(v, ST_BLKSIZE_IDX,
|
|
|
|
|
PyLong_FromLong((long)st->st_blksize));
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
#endif
|
2002-10-16 20:28:25 +00:00
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
|
2010-05-06 00:08:46 +00:00
|
|
|
PyStructSequence_SET_ITEM(v, ST_BLOCKS_IDX,
|
|
|
|
|
PyLong_FromLong((long)st->st_blocks));
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
#endif
|
2002-10-16 20:28:25 +00:00
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_RDEV
|
2010-05-06 00:08:46 +00:00
|
|
|
PyStructSequence_SET_ITEM(v, ST_RDEV_IDX,
|
|
|
|
|
PyLong_FromLong((long)st->st_rdev));
|
2000-06-29 21:12:41 +00:00
|
|
|
#endif
|
2005-08-09 15:00:59 +00:00
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_GEN
|
2010-05-06 00:08:46 +00:00
|
|
|
PyStructSequence_SET_ITEM(v, ST_GEN_IDX,
|
|
|
|
|
PyLong_FromLong((long)st->st_gen));
|
2005-08-09 15:00:59 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_BIRTHTIME
|
2010-05-06 00:08:46 +00:00
|
|
|
{
|
2012-02-08 23:03:19 +01:00
|
|
|
PyObject *val;
|
|
|
|
|
unsigned long bsec,bnsec;
|
|
|
|
|
bsec = (long)st->st_birthtime;
|
2005-08-09 15:00:59 +00:00
|
|
|
#ifdef HAVE_STAT_TV_NSEC2
|
2012-02-08 23:03:19 +01:00
|
|
|
bnsec = st->st_birthtimespec.tv_nsec;
|
2005-08-09 15:00:59 +00:00
|
|
|
#else
|
2012-02-08 23:03:19 +01:00
|
|
|
bnsec = 0;
|
2010-05-06 00:08:46 +00:00
|
|
|
#endif
|
2017-10-24 02:02:00 -07:00
|
|
|
val = PyFloat_FromDouble(bsec + 1e-9*bnsec);
|
2012-02-08 23:03:19 +01:00
|
|
|
PyStructSequence_SET_ITEM(v, ST_BIRTHTIME_IDX,
|
|
|
|
|
val);
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2005-08-09 15:00:59 +00:00
|
|
|
#endif
|
2005-06-02 13:09:30 +00:00
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_FLAGS
|
2010-05-06 00:08:46 +00:00
|
|
|
PyStructSequence_SET_ITEM(v, ST_FLAGS_IDX,
|
|
|
|
|
PyLong_FromLong((long)st->st_flags));
|
2005-06-02 13:09:30 +00:00
|
|
|
#endif
|
2014-06-19 09:46:37 -05:00
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_FILE_ATTRIBUTES
|
|
|
|
|
PyStructSequence_SET_ITEM(v, ST_FILE_ATTRIBUTES_IDX,
|
|
|
|
|
PyLong_FromUnsignedLong(st->st_file_attributes));
|
|
|
|
|
#endif
|
2018-01-28 14:00:08 +01:00
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_FSTYPE
|
|
|
|
|
PyStructSequence_SET_ITEM(v, ST_FSTYPE_IDX,
|
|
|
|
|
PyUnicode_FromString(st->st_fstype));
|
|
|
|
|
#endif
|
2019-08-21 15:27:33 -07:00
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_REPARSE_TAG
|
|
|
|
|
PyStructSequence_SET_ITEM(v, ST_REPARSE_TAG_IDX,
|
|
|
|
|
PyLong_FromUnsignedLong(st->st_reparse_tag));
|
|
|
|
|
#endif
|
2000-06-29 21:12:41 +00:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
if (PyErr_Occurred()) {
|
|
|
|
|
Py_DECREF(v);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2000-06-29 21:12:41 +00:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
return v;
|
2000-06-29 21:12:41 +00:00
|
|
|
}
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
/* POSIX methods */
|
|
|
|
|
|
|
|
|
|
|
1996-12-10 23:23:01 +00:00
|
|
|
static PyObject *
|
2020-05-10 11:05:29 +02:00
|
|
|
posix_do_stat(PyObject *module, const char *function_name, path_t *path,
|
2012-06-22 16:30:09 -07:00
|
|
|
int dir_fd, int follow_symlinks)
|
1990-10-14 12:07:46 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
STRUCT_STAT st;
|
2012-06-22 16:30:09 -07:00
|
|
|
int result;
|
2010-05-06 00:08:46 +00:00
|
|
|
|
2020-11-22 11:18:40 +01:00
|
|
|
#ifdef HAVE_FSTATAT
|
|
|
|
|
int fstatat_unavailable = 0;
|
|
|
|
|
#endif
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
#if !defined(MS_WINDOWS) && !defined(HAVE_FSTATAT) && !defined(HAVE_LSTAT)
|
|
|
|
|
if (follow_symlinks_specified(function_name, follow_symlinks))
|
|
|
|
|
return NULL;
|
2010-05-06 00:08:46 +00:00
|
|
|
#endif
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
if (path_and_dir_fd_invalid("stat", path, dir_fd) ||
|
|
|
|
|
dir_fd_and_fd_invalid("stat", dir_fd, path->fd) ||
|
|
|
|
|
fd_and_follow_symlinks_invalid("stat", path->fd, follow_symlinks))
|
2010-05-06 00:08:46 +00:00
|
|
|
return NULL;
|
2012-06-22 16:30:09 -07:00
|
|
|
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
if (path->fd != -1)
|
|
|
|
|
result = FSTAT(path->fd, &st);
|
2011-11-15 22:27:41 +01:00
|
|
|
#ifdef MS_WINDOWS
|
2016-09-08 10:41:50 -07:00
|
|
|
else if (follow_symlinks)
|
2016-09-08 10:35:16 -07:00
|
|
|
result = win32_stat(path->wide, &st);
|
2012-06-22 16:30:09 -07:00
|
|
|
else
|
2016-09-08 10:35:16 -07:00
|
|
|
result = win32_lstat(path->wide, &st);
|
|
|
|
|
#else
|
|
|
|
|
else
|
|
|
|
|
#if defined(HAVE_LSTAT)
|
2012-06-22 16:30:09 -07:00
|
|
|
if ((!follow_symlinks) && (dir_fd == DEFAULT_DIR_FD))
|
|
|
|
|
result = LSTAT(path->narrow, &st);
|
|
|
|
|
else
|
2016-09-08 10:35:16 -07:00
|
|
|
#endif /* HAVE_LSTAT */
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef HAVE_FSTATAT
|
2020-11-22 11:18:40 +01:00
|
|
|
if ((dir_fd != DEFAULT_DIR_FD) || !follow_symlinks) {
|
|
|
|
|
if (HAVE_FSTATAT_RUNTIME) {
|
|
|
|
|
result = fstatat(dir_fd, path->narrow, &st,
|
2012-06-22 16:30:09 -07:00
|
|
|
follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW);
|
2020-11-22 11:18:40 +01:00
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
fstatat_unavailable = 1;
|
|
|
|
|
}
|
|
|
|
|
} else
|
2016-09-08 10:35:16 -07:00
|
|
|
#endif /* HAVE_FSTATAT */
|
2012-06-22 16:30:09 -07:00
|
|
|
result = STAT(path->narrow, &st);
|
2016-09-08 10:35:16 -07:00
|
|
|
#endif /* MS_WINDOWS */
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_END_ALLOW_THREADS
|
1990-10-14 12:07:46 +00:00
|
|
|
|
2020-11-22 11:18:40 +01:00
|
|
|
#ifdef HAVE_FSTATAT
|
|
|
|
|
if (fstatat_unavailable) {
|
|
|
|
|
argument_unavailable_error("stat", "dir_fd");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2012-10-30 02:17:38 +01:00
|
|
|
if (result != 0) {
|
|
|
|
|
return path_error(path);
|
|
|
|
|
}
|
1990-10-14 12:07:46 +00:00
|
|
|
|
2020-05-10 11:05:29 +02:00
|
|
|
return _pystat_fromstructstat(module, &st);
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
1999-01-06 18:42:14 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[python input]
|
|
|
|
|
|
|
|
|
|
for s in """
|
|
|
|
|
|
|
|
|
|
FACCESSAT
|
|
|
|
|
FCHMODAT
|
|
|
|
|
FCHOWNAT
|
|
|
|
|
FSTATAT
|
|
|
|
|
LINKAT
|
|
|
|
|
MKDIRAT
|
|
|
|
|
MKFIFOAT
|
|
|
|
|
MKNODAT
|
|
|
|
|
OPENAT
|
|
|
|
|
READLINKAT
|
|
|
|
|
SYMLINKAT
|
|
|
|
|
UNLINKAT
|
|
|
|
|
|
|
|
|
|
""".strip().split():
|
|
|
|
|
s = s.strip()
|
|
|
|
|
print("""
|
|
|
|
|
#ifdef HAVE_{s}
|
|
|
|
|
#define {s}_DIR_FD_CONVERTER dir_fd_converter
|
|
|
|
|
#else
|
|
|
|
|
#define {s}_DIR_FD_CONVERTER dir_fd_unavailable
|
|
|
|
|
#endif
|
|
|
|
|
""".rstrip().format(s=s))
|
|
|
|
|
|
|
|
|
|
for s in """
|
|
|
|
|
|
|
|
|
|
FCHDIR
|
|
|
|
|
FCHMOD
|
|
|
|
|
FCHOWN
|
|
|
|
|
FDOPENDIR
|
|
|
|
|
FEXECVE
|
|
|
|
|
FPATHCONF
|
|
|
|
|
FSTATVFS
|
|
|
|
|
FTRUNCATE
|
|
|
|
|
|
|
|
|
|
""".strip().split():
|
|
|
|
|
s = s.strip()
|
|
|
|
|
print("""
|
|
|
|
|
#ifdef HAVE_{s}
|
|
|
|
|
#define PATH_HAVE_{s} 1
|
|
|
|
|
#else
|
|
|
|
|
#define PATH_HAVE_{s} 0
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
""".rstrip().format(s=s))
|
|
|
|
|
[python start generated code]*/
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FACCESSAT
|
|
|
|
|
#define FACCESSAT_DIR_FD_CONVERTER dir_fd_converter
|
|
|
|
|
#else
|
|
|
|
|
#define FACCESSAT_DIR_FD_CONVERTER dir_fd_unavailable
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FCHMODAT
|
|
|
|
|
#define FCHMODAT_DIR_FD_CONVERTER dir_fd_converter
|
|
|
|
|
#else
|
|
|
|
|
#define FCHMODAT_DIR_FD_CONVERTER dir_fd_unavailable
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FCHOWNAT
|
|
|
|
|
#define FCHOWNAT_DIR_FD_CONVERTER dir_fd_converter
|
|
|
|
|
#else
|
|
|
|
|
#define FCHOWNAT_DIR_FD_CONVERTER dir_fd_unavailable
|
|
|
|
|
#endif
|
|
|
|
|
|
2013-10-19 00:09:25 -07:00
|
|
|
#ifdef HAVE_FSTATAT
|
2014-08-05 14:04:04 +10:00
|
|
|
#define FSTATAT_DIR_FD_CONVERTER dir_fd_converter
|
|
|
|
|
#else
|
|
|
|
|
#define FSTATAT_DIR_FD_CONVERTER dir_fd_unavailable
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_LINKAT
|
|
|
|
|
#define LINKAT_DIR_FD_CONVERTER dir_fd_converter
|
|
|
|
|
#else
|
|
|
|
|
#define LINKAT_DIR_FD_CONVERTER dir_fd_unavailable
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_MKDIRAT
|
|
|
|
|
#define MKDIRAT_DIR_FD_CONVERTER dir_fd_converter
|
|
|
|
|
#else
|
|
|
|
|
#define MKDIRAT_DIR_FD_CONVERTER dir_fd_unavailable
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_MKFIFOAT
|
|
|
|
|
#define MKFIFOAT_DIR_FD_CONVERTER dir_fd_converter
|
|
|
|
|
#else
|
|
|
|
|
#define MKFIFOAT_DIR_FD_CONVERTER dir_fd_unavailable
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_MKNODAT
|
|
|
|
|
#define MKNODAT_DIR_FD_CONVERTER dir_fd_converter
|
|
|
|
|
#else
|
|
|
|
|
#define MKNODAT_DIR_FD_CONVERTER dir_fd_unavailable
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_OPENAT
|
|
|
|
|
#define OPENAT_DIR_FD_CONVERTER dir_fd_converter
|
|
|
|
|
#else
|
|
|
|
|
#define OPENAT_DIR_FD_CONVERTER dir_fd_unavailable
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_READLINKAT
|
|
|
|
|
#define READLINKAT_DIR_FD_CONVERTER dir_fd_converter
|
|
|
|
|
#else
|
|
|
|
|
#define READLINKAT_DIR_FD_CONVERTER dir_fd_unavailable
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SYMLINKAT
|
|
|
|
|
#define SYMLINKAT_DIR_FD_CONVERTER dir_fd_converter
|
|
|
|
|
#else
|
|
|
|
|
#define SYMLINKAT_DIR_FD_CONVERTER dir_fd_unavailable
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_UNLINKAT
|
|
|
|
|
#define UNLINKAT_DIR_FD_CONVERTER dir_fd_converter
|
|
|
|
|
#else
|
|
|
|
|
#define UNLINKAT_DIR_FD_CONVERTER dir_fd_unavailable
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FCHDIR
|
|
|
|
|
#define PATH_HAVE_FCHDIR 1
|
|
|
|
|
#else
|
|
|
|
|
#define PATH_HAVE_FCHDIR 0
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FCHMOD
|
|
|
|
|
#define PATH_HAVE_FCHMOD 1
|
|
|
|
|
#else
|
|
|
|
|
#define PATH_HAVE_FCHMOD 0
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FCHOWN
|
|
|
|
|
#define PATH_HAVE_FCHOWN 1
|
|
|
|
|
#else
|
|
|
|
|
#define PATH_HAVE_FCHOWN 0
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FDOPENDIR
|
|
|
|
|
#define PATH_HAVE_FDOPENDIR 1
|
|
|
|
|
#else
|
|
|
|
|
#define PATH_HAVE_FDOPENDIR 0
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FEXECVE
|
|
|
|
|
#define PATH_HAVE_FEXECVE 1
|
|
|
|
|
#else
|
|
|
|
|
#define PATH_HAVE_FEXECVE 0
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FPATHCONF
|
|
|
|
|
#define PATH_HAVE_FPATHCONF 1
|
|
|
|
|
#else
|
|
|
|
|
#define PATH_HAVE_FPATHCONF 0
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FSTATVFS
|
|
|
|
|
#define PATH_HAVE_FSTATVFS 1
|
|
|
|
|
#else
|
|
|
|
|
#define PATH_HAVE_FSTATVFS 0
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FTRUNCATE
|
|
|
|
|
#define PATH_HAVE_FTRUNCATE 1
|
2013-10-19 00:09:25 -07:00
|
|
|
#else
|
2014-08-05 14:04:04 +10:00
|
|
|
#define PATH_HAVE_FTRUNCATE 0
|
2013-10-19 00:09:25 -07:00
|
|
|
#endif
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[python end generated code: output=4bd4f6f7d41267f1 input=80b4c890b6774ea5]*/
|
2013-10-19 00:09:25 -07:00
|
|
|
|
2015-03-20 19:50:46 -07:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
#undef PATH_HAVE_FTRUNCATE
|
|
|
|
|
#define PATH_HAVE_FTRUNCATE 1
|
|
|
|
|
#endif
|
2013-10-19 00:09:25 -07:00
|
|
|
|
2014-01-07 12:41:53 -08:00
|
|
|
/*[python input]
|
2013-10-19 00:09:25 -07:00
|
|
|
|
|
|
|
|
class path_t_converter(CConverter):
|
|
|
|
|
|
|
|
|
|
type = "path_t"
|
|
|
|
|
impl_by_reference = True
|
|
|
|
|
parse_by_reference = True
|
|
|
|
|
|
|
|
|
|
converter = 'path_converter'
|
|
|
|
|
|
|
|
|
|
def converter_init(self, *, allow_fd=False, nullable=False):
|
|
|
|
|
# right now path_t doesn't support default values.
|
|
|
|
|
# to support a default value, you'll need to override initialize().
|
2014-08-05 14:04:04 +10:00
|
|
|
if self.default not in (unspecified, None):
|
2014-01-31 22:03:12 -08:00
|
|
|
fail("Can't specify a default to the path_t converter!")
|
2013-10-19 00:09:25 -07:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
if self.c_default not in (None, 'Py_None'):
|
|
|
|
|
raise RuntimeError("Can't specify a c_default to the path_t converter!")
|
2013-10-19 00:09:25 -07:00
|
|
|
|
|
|
|
|
self.nullable = nullable
|
|
|
|
|
self.allow_fd = allow_fd
|
|
|
|
|
|
2014-01-31 22:03:12 -08:00
|
|
|
def pre_render(self):
|
|
|
|
|
def strify(value):
|
2014-08-05 14:04:04 +10:00
|
|
|
if isinstance(value, str):
|
|
|
|
|
return value
|
2014-01-31 22:03:12 -08:00
|
|
|
return str(int(bool(value)))
|
|
|
|
|
|
|
|
|
|
# add self.py_name here when merging with posixmodule conversion
|
2014-08-05 14:04:04 +10:00
|
|
|
self.c_default = 'PATH_T_INITIALIZE("{}", "{}", {}, {})'.format(
|
2013-10-19 00:09:25 -07:00
|
|
|
self.function.name,
|
2014-08-05 14:04:04 +10:00
|
|
|
self.name,
|
2014-01-31 22:03:12 -08:00
|
|
|
strify(self.nullable),
|
|
|
|
|
strify(self.allow_fd),
|
2013-10-19 00:09:25 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
def cleanup(self):
|
|
|
|
|
return "path_cleanup(&" + self.name + ");\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class dir_fd_converter(CConverter):
|
|
|
|
|
type = 'int'
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
def converter_init(self, requires=None):
|
2013-10-19 00:09:25 -07:00
|
|
|
if self.default in (unspecified, None):
|
|
|
|
|
self.c_default = 'DEFAULT_DIR_FD'
|
2014-08-05 14:04:04 +10:00
|
|
|
if isinstance(requires, str):
|
|
|
|
|
self.converter = requires.upper() + '_DIR_FD_CONVERTER'
|
|
|
|
|
else:
|
|
|
|
|
self.converter = 'dir_fd_converter'
|
|
|
|
|
|
|
|
|
|
class fildes_converter(CConverter):
|
|
|
|
|
type = 'int'
|
|
|
|
|
converter = 'fildes_converter'
|
|
|
|
|
|
|
|
|
|
class uid_t_converter(CConverter):
|
|
|
|
|
type = "uid_t"
|
|
|
|
|
converter = '_Py_Uid_Converter'
|
|
|
|
|
|
|
|
|
|
class gid_t_converter(CConverter):
|
|
|
|
|
type = "gid_t"
|
|
|
|
|
converter = '_Py_Gid_Converter'
|
|
|
|
|
|
2015-01-18 11:17:39 +02:00
|
|
|
class dev_t_converter(CConverter):
|
|
|
|
|
type = 'dev_t'
|
|
|
|
|
converter = '_Py_Dev_Converter'
|
|
|
|
|
|
|
|
|
|
class dev_t_return_converter(unsigned_long_return_converter):
|
|
|
|
|
type = 'dev_t'
|
|
|
|
|
conversion_fn = '_PyLong_FromDev'
|
|
|
|
|
unsigned_cast = '(dev_t)'
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
class FSConverter_converter(CConverter):
|
|
|
|
|
type = 'PyObject *'
|
|
|
|
|
converter = 'PyUnicode_FSConverter'
|
|
|
|
|
def converter_init(self):
|
|
|
|
|
if self.default is not unspecified:
|
|
|
|
|
fail("FSConverter_converter does not support default values")
|
|
|
|
|
self.c_default = 'NULL'
|
|
|
|
|
|
|
|
|
|
def cleanup(self):
|
|
|
|
|
return "Py_XDECREF(" + self.name + ");\n"
|
|
|
|
|
|
|
|
|
|
class pid_t_converter(CConverter):
|
|
|
|
|
type = 'pid_t'
|
|
|
|
|
format_unit = '" _Py_PARSE_PID "'
|
|
|
|
|
|
|
|
|
|
class idtype_t_converter(int_converter):
|
|
|
|
|
type = 'idtype_t'
|
|
|
|
|
|
|
|
|
|
class id_t_converter(CConverter):
|
|
|
|
|
type = 'id_t'
|
|
|
|
|
format_unit = '" _Py_PARSE_PID "'
|
|
|
|
|
|
2016-09-06 13:47:26 -07:00
|
|
|
class intptr_t_converter(CConverter):
|
|
|
|
|
type = 'intptr_t'
|
2014-08-05 14:04:04 +10:00
|
|
|
format_unit = '" _Py_PARSE_INTPTR "'
|
2013-10-19 00:09:25 -07:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
class Py_off_t_converter(CConverter):
|
|
|
|
|
type = 'Py_off_t'
|
|
|
|
|
converter = 'Py_off_t_converter'
|
|
|
|
|
|
|
|
|
|
class Py_off_t_return_converter(long_return_converter):
|
|
|
|
|
type = 'Py_off_t'
|
|
|
|
|
conversion_fn = 'PyLong_FromPy_off_t'
|
|
|
|
|
|
|
|
|
|
class path_confname_converter(CConverter):
|
|
|
|
|
type="int"
|
|
|
|
|
converter="conv_path_confname"
|
|
|
|
|
|
|
|
|
|
class confstr_confname_converter(path_confname_converter):
|
|
|
|
|
converter='conv_confstr_confname'
|
|
|
|
|
|
|
|
|
|
class sysconf_confname_converter(path_confname_converter):
|
|
|
|
|
converter="conv_sysconf_confname"
|
|
|
|
|
|
2014-01-07 12:41:53 -08:00
|
|
|
[python start generated code]*/
|
2020-05-10 11:05:29 +02:00
|
|
|
/*[python end generated code: output=da39a3ee5e6b4b0d input=f1c8ae8d744f6c8b]*/
|
2013-10-19 00:09:25 -07:00
|
|
|
|
2014-01-07 12:41:53 -08:00
|
|
|
/*[clinic input]
|
2013-10-19 00:09:25 -07:00
|
|
|
|
2014-01-16 11:32:01 -08:00
|
|
|
os.stat
|
2013-10-19 00:09:25 -07:00
|
|
|
|
|
|
|
|
path : path_t(allow_fd=True)
|
2018-11-02 15:20:19 +00:00
|
|
|
Path to be examined; can be string, bytes, a path-like object or
|
2017-01-22 13:04:17 +08:00
|
|
|
open-file-descriptor int.
|
2013-10-19 00:09:25 -07:00
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
dir_fd : dir_fd(requires='fstatat') = None
|
2013-10-19 00:09:25 -07:00
|
|
|
If not None, it should be a file descriptor open to a directory,
|
|
|
|
|
and path should be a relative string; path will then be relative to
|
|
|
|
|
that directory.
|
|
|
|
|
|
|
|
|
|
follow_symlinks: bool = True
|
|
|
|
|
If False, and the last element of the path is a symbolic link,
|
|
|
|
|
stat will examine the symbolic link itself instead of the file
|
|
|
|
|
the link points to.
|
|
|
|
|
|
|
|
|
|
Perform a stat system call on the given path.
|
|
|
|
|
|
|
|
|
|
dir_fd and follow_symlinks may not be implemented
|
|
|
|
|
on your platform. If they are unavailable, using them will raise a
|
|
|
|
|
NotImplementedError.
|
|
|
|
|
|
|
|
|
|
It's an error to use dir_fd or follow_symlinks when specifying path as
|
|
|
|
|
an open file descriptor.
|
|
|
|
|
|
2014-01-07 12:41:53 -08:00
|
|
|
[clinic start generated code]*/
|
2013-10-19 00:09:25 -07:00
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_stat_impl(PyObject *module, path_t *path, int dir_fd, int follow_symlinks)
|
2018-11-02 15:20:19 +00:00
|
|
|
/*[clinic end generated code: output=7d4976e6f18a59c5 input=01d362ebcc06996b]*/
|
2013-10-19 00:09:25 -07:00
|
|
|
{
|
2020-05-10 11:05:29 +02:00
|
|
|
return posix_do_stat(module, "stat", path, dir_fd, follow_symlinks);
|
2013-10-19 00:09:25 -07:00
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.lstat
|
|
|
|
|
|
|
|
|
|
path : path_t
|
|
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
|
|
dir_fd : dir_fd(requires='fstatat') = None
|
|
|
|
|
|
|
|
|
|
Perform a stat system call on the given path, without following symbolic links.
|
|
|
|
|
|
|
|
|
|
Like stat(), but do not follow symbolic links.
|
|
|
|
|
Equivalent to stat(path, follow_symlinks=False).
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_lstat_impl(PyObject *module, path_t *path, int dir_fd)
|
|
|
|
|
/*[clinic end generated code: output=ef82a5d35ce8ab37 input=0b7474765927b925]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
int follow_symlinks = 0;
|
2020-05-10 11:05:29 +02:00
|
|
|
return posix_do_stat(module, "lstat", path, dir_fd, follow_symlinks);
|
2014-08-05 14:04:04 +10:00
|
|
|
}
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2014-01-07 12:41:53 -08:00
|
|
|
/*[clinic input]
|
2014-08-05 14:04:04 +10:00
|
|
|
os.access -> bool
|
2013-10-19 00:09:25 -07:00
|
|
|
|
2016-09-05 15:29:33 -07:00
|
|
|
path: path_t
|
2018-11-02 15:20:19 +00:00
|
|
|
Path to be tested; can be string, bytes, or a path-like object.
|
2013-10-19 00:09:25 -07:00
|
|
|
|
|
|
|
|
mode: int
|
|
|
|
|
Operating-system mode bitfield. Can be F_OK to test existence,
|
|
|
|
|
or the inclusive-OR of R_OK, W_OK, and X_OK.
|
|
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
dir_fd : dir_fd(requires='faccessat') = None
|
2013-10-19 00:09:25 -07:00
|
|
|
If not None, it should be a file descriptor open to a directory,
|
|
|
|
|
and path should be relative; path will then be relative to that
|
|
|
|
|
directory.
|
|
|
|
|
|
|
|
|
|
effective_ids: bool = False
|
|
|
|
|
If True, access will use the effective uid/gid instead of
|
|
|
|
|
the real uid/gid.
|
|
|
|
|
|
|
|
|
|
follow_symlinks: bool = True
|
|
|
|
|
If False, and the last element of the path is a symbolic link,
|
|
|
|
|
access will examine the symbolic link itself instead of the file
|
|
|
|
|
the link points to.
|
|
|
|
|
|
|
|
|
|
Use the real uid/gid to test for access to a path.
|
|
|
|
|
|
|
|
|
|
{parameters}
|
|
|
|
|
dir_fd, effective_ids, and follow_symlinks may not be implemented
|
|
|
|
|
on your platform. If they are unavailable, using them will raise a
|
|
|
|
|
NotImplementedError.
|
|
|
|
|
|
|
|
|
|
Note that most operations will use the effective uid/gid, therefore this
|
|
|
|
|
routine can be used in a suid/sgid environment to test if the invoking user
|
|
|
|
|
has the specified access to the path.
|
|
|
|
|
|
2014-01-07 12:41:53 -08:00
|
|
|
[clinic start generated code]*/
|
2013-10-19 00:09:25 -07:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
static int
|
2016-07-07 17:35:15 +03:00
|
|
|
os_access_impl(PyObject *module, path_t *path, int mode, int dir_fd,
|
2015-04-14 18:07:59 -04:00
|
|
|
int effective_ids, int follow_symlinks)
|
2018-11-02 15:20:19 +00:00
|
|
|
/*[clinic end generated code: output=cf84158bc90b1a77 input=3ffe4e650ee3bf20]*/
|
2013-10-19 00:09:25 -07:00
|
|
|
{
|
2014-08-05 14:04:04 +10:00
|
|
|
int return_value;
|
2010-05-06 00:08:46 +00:00
|
|
|
|
2009-05-17 04:21:53 +00:00
|
|
|
#ifdef MS_WINDOWS
|
2010-05-06 00:08:46 +00:00
|
|
|
DWORD attr;
|
2012-06-22 16:30:09 -07:00
|
|
|
#else
|
|
|
|
|
int result;
|
|
|
|
|
#endif
|
|
|
|
|
|
2020-11-22 11:18:40 +01:00
|
|
|
#ifdef HAVE_FACCESSAT
|
|
|
|
|
int faccessat_unavailable = 0;
|
|
|
|
|
#endif
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifndef HAVE_FACCESSAT
|
|
|
|
|
if (follow_symlinks_specified("access", follow_symlinks))
|
2014-08-05 14:04:04 +10:00
|
|
|
return -1;
|
2012-06-22 16:30:09 -07:00
|
|
|
|
|
|
|
|
if (effective_ids) {
|
|
|
|
|
argument_unavailable_error("access", "effective_ids");
|
2014-08-05 14:04:04 +10:00
|
|
|
return -1;
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef MS_WINDOWS
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2016-09-08 10:35:16 -07:00
|
|
|
attr = GetFileAttributesW(path->wide);
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
2012-06-22 16:30:09 -07:00
|
|
|
|
|
|
|
|
/*
|
2012-06-24 13:58:31 +02:00
|
|
|
* Access is possible if
|
2012-06-22 16:30:09 -07:00
|
|
|
* * we didn't get a -1, and
|
|
|
|
|
* * write access wasn't requested,
|
|
|
|
|
* * or the file isn't read-only,
|
|
|
|
|
* * or it's a directory.
|
|
|
|
|
* (Directories cannot be read-only on Windows.)
|
|
|
|
|
*/
|
2014-08-05 14:04:04 +10:00
|
|
|
return_value = (attr != INVALID_FILE_ATTRIBUTES) &&
|
2012-06-23 12:48:40 +02:00
|
|
|
(!(mode & 2) ||
|
2012-06-22 16:30:09 -07:00
|
|
|
!(attr & FILE_ATTRIBUTE_READONLY) ||
|
2014-08-05 14:04:04 +10:00
|
|
|
(attr & FILE_ATTRIBUTE_DIRECTORY));
|
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Inherits test_gzip/test_tarfile failures on 64-bit platforms from the trunk,
but I don't want the merge to hang around too long (even though the regular
p3yk-contributors are/have been busy with other things.)
Merged revisions 45621-46490 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r45621 | george.yoshida | 2006-04-21 18:34:17 +0200 (Fri, 21 Apr 2006) | 2 lines
Correct the grammar
........
r45622 | tim.peters | 2006-04-21 18:34:54 +0200 (Fri, 21 Apr 2006) | 2 lines
Whitespace normalization.
........
r45624 | thomas.heller | 2006-04-21 18:48:56 +0200 (Fri, 21 Apr 2006) | 1 line
Merge in changes from ctypes 0.9.9.6 upstream version.
........
r45625 | thomas.heller | 2006-04-21 18:51:04 +0200 (Fri, 21 Apr 2006) | 1 line
Merge in changes from ctypes 0.9.9.6 upstream version.
........
r45630 | thomas.heller | 2006-04-21 20:29:17 +0200 (Fri, 21 Apr 2006) | 8 lines
Documentation for ctypes.
I think that 'generic operating system services' is the best category.
Note that the Doc/lib/libctypes.latex file is generated from reST sources.
You are welcome to make typo fixes, and I'll try to keep the reST sources
in sync, but markup changes would be lost - they should be fixed in the tool
that creates the latex file.
The conversion script is external/ctypes/docs/manual/mkpydoc.py.
........
r45631 | tim.peters | 2006-04-21 23:18:10 +0200 (Fri, 21 Apr 2006) | 24 lines
SF bug #1473760 TempFile can hang on Windows.
Python 2.4 changed ntpath.abspath to do an import
inside the function. As a result, due to Python's
import lock, anything calling abspath on Windows
(directly, or indirectly like tempfile.TemporaryFile)
hung when it was called from a thread spawned as a
side effect of importing a module.
This is a depressingly frequent problem, and
deserves a more general fix. I'm settling for
a micro-fix here because this specific one accounts
for a report of Zope Corp's ZEO hanging on Windows,
and it was an odd way to change abspath to begin
with (ntpath needs a different implementation
depending on whether we're actually running on
Windows, and the _obvious_ way to arrange for that
is not to bury a possibly-failing import _inside_
the function).
Note that if/when other micro-fixes of this kind
get made, the new Lib/test/threaded_import_hangers.py
is a convenient place to add tests for them.
........
r45634 | phillip.eby | 2006-04-21 23:53:37 +0200 (Fri, 21 Apr 2006) | 2 lines
Guido wrote contextlib, not me, but thanks anyway. ;)
........
r45636 | andrew.kuchling | 2006-04-22 03:51:41 +0200 (Sat, 22 Apr 2006) | 1 line
Typo fixes
........
r45638 | andrew.kuchling | 2006-04-22 03:58:40 +0200 (Sat, 22 Apr 2006) | 1 line
Fix comment typo
........
r45639 | andrew.kuchling | 2006-04-22 04:06:03 +0200 (Sat, 22 Apr 2006) | 8 lines
Make copy of test_mailbox.py. We'll still want to check the backward
compatibility classes in the new mailbox.py that I'll be committing in
a few minutes.
One change has been made: the tests use len(mbox) instead of len(mbox.boxes).
The 'boxes' attribute was never documented and contains some internal state
that seems unlikely to have been useful.
........
r45640 | andrew.kuchling | 2006-04-22 04:32:43 +0200 (Sat, 22 Apr 2006) | 16 lines
Add Gregory K. Johnson's revised version of mailbox.py (funded by
the 2005 Summer of Code).
The revision adds a number of new mailbox classes that support adding
and removing messages; these classes also support mailbox locking and
default to using email.Message instead of rfc822.Message.
The old mailbox classes are largely left alone for backward compatibility.
The exception is the Maildir class, which was present in the old module
and now inherits from the new classes. The Maildir class's interface
is pretty simple, though, so I think it'll be compatible with existing
code.
(The change to the NEWS file also adds a missing word to a different
news item, which unfortunately required rewrapping the line.)
........
r45641 | tim.peters | 2006-04-22 07:52:59 +0200 (Sat, 22 Apr 2006) | 2 lines
Whitespace normalization.
........
r45642 | neal.norwitz | 2006-04-22 08:07:46 +0200 (Sat, 22 Apr 2006) | 1 line
Add libctypes as a dep
........
r45643 | martin.v.loewis | 2006-04-22 13:15:41 +0200 (Sat, 22 Apr 2006) | 1 line
Fix more ssize_t problems.
........
r45644 | martin.v.loewis | 2006-04-22 13:40:03 +0200 (Sat, 22 Apr 2006) | 1 line
Fix more ssize_t issues.
........
r45645 | george.yoshida | 2006-04-22 17:10:49 +0200 (Sat, 22 Apr 2006) | 2 lines
Typo fixes
........
r45647 | martin.v.loewis | 2006-04-22 17:19:54 +0200 (Sat, 22 Apr 2006) | 1 line
Port to Python 2.5. Drop .DEF file. Change output file names to .pyd.
........
r45648 | george.yoshida | 2006-04-22 17:27:14 +0200 (Sat, 22 Apr 2006) | 3 lines
- add versionadded tag
- make arbitrary arguments come last
........
r45649 | hyeshik.chang | 2006-04-22 17:48:15 +0200 (Sat, 22 Apr 2006) | 3 lines
Remove $CJKCodecs$ RCS tags. The CJKCodecs isn't maintained outside
anymore.
........
r45654 | greg.ward | 2006-04-23 05:47:58 +0200 (Sun, 23 Apr 2006) | 2 lines
Update optparse to Optik 1.5.1.
........
r45658 | george.yoshida | 2006-04-23 11:27:10 +0200 (Sun, 23 Apr 2006) | 2 lines
wrap SyntaxError with \exception{}
........
r45660 | ronald.oussoren | 2006-04-23 13:59:25 +0200 (Sun, 23 Apr 2006) | 6 lines
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.
........
r45661 | ronald.oussoren | 2006-04-23 14:36:23 +0200 (Sun, 23 Apr 2006) | 5 lines
Patch 1471761 - test for broken poll at runtime
This patch checks if poll is broken when the select module is loaded instead
of doing so at configure-time. This functionality is only active on Mac OS X.
........
r45662 | nick.coghlan | 2006-04-23 17:13:32 +0200 (Sun, 23 Apr 2006) | 1 line
Add a Context Types section to parallel the Iterator Types section (uses the same terminology as the 2.5a1 implementation)
........
r45663 | nick.coghlan | 2006-04-23 17:14:37 +0200 (Sun, 23 Apr 2006) | 1 line
Update contextlib documentation to use the same terminology as the module implementation
........
r45664 | gerhard.haering | 2006-04-23 17:24:26 +0200 (Sun, 23 Apr 2006) | 2 lines
Updated the sqlite3 module to the external pysqlite 2.2.2 version.
........
r45666 | nick.coghlan | 2006-04-23 17:39:16 +0200 (Sun, 23 Apr 2006) | 1 line
Update with statement documentation to use same terminology as 2.5a1 implementation
........
r45667 | nick.coghlan | 2006-04-23 18:05:04 +0200 (Sun, 23 Apr 2006) | 1 line
Add a (very) brief mention of the with statement to the end of chapter 8
........
r45668 | nick.coghlan | 2006-04-23 18:35:19 +0200 (Sun, 23 Apr 2006) | 1 line
Take 2 on mentioning the with statement, this time without inadvertently killing the Unicode examples
........
r45669 | nick.coghlan | 2006-04-23 19:04:07 +0200 (Sun, 23 Apr 2006) | 1 line
Backdated NEWS entry to record the implementation of PEP 338 for alpha 1
........
r45670 | tim.peters | 2006-04-23 20:13:45 +0200 (Sun, 23 Apr 2006) | 2 lines
Whitespace normalization.
........
r45671 | skip.montanaro | 2006-04-23 21:14:27 +0200 (Sun, 23 Apr 2006) | 1 line
first cut at trace module doc
........
r45672 | skip.montanaro | 2006-04-23 21:26:33 +0200 (Sun, 23 Apr 2006) | 1 line
minor tweak
........
r45673 | skip.montanaro | 2006-04-23 21:30:50 +0200 (Sun, 23 Apr 2006) | 1 line
it's always helpful if the example works...
........
r45674 | skip.montanaro | 2006-04-23 21:32:14 +0200 (Sun, 23 Apr 2006) | 1 line
correct example
........
r45675 | andrew.kuchling | 2006-04-23 23:01:04 +0200 (Sun, 23 Apr 2006) | 1 line
Edits to the PEP 343 section
........
r45676 | andrew.kuchling | 2006-04-23 23:51:10 +0200 (Sun, 23 Apr 2006) | 1 line
Add two items
........
r45677 | tim.peters | 2006-04-24 04:03:16 +0200 (Mon, 24 Apr 2006) | 5 lines
Bug #1337990: clarified that `doctest` does not support examples
requiring both expected output and an exception.
I'll backport to 2.4 next.
........
r45679 | nick.coghlan | 2006-04-24 05:04:43 +0200 (Mon, 24 Apr 2006) | 1 line
Note changes made to PEP 343 related documentation
........
r45681 | nick.coghlan | 2006-04-24 06:17:02 +0200 (Mon, 24 Apr 2006) | 1 line
Change PEP 343 related documentation to use the term context specifier instead of context object
........
r45682 | nick.coghlan | 2006-04-24 06:32:47 +0200 (Mon, 24 Apr 2006) | 1 line
Add unit tests for the -m and -c command line switches
........
r45683 | nick.coghlan | 2006-04-24 06:37:15 +0200 (Mon, 24 Apr 2006) | 1 line
Fix contextlib.nested to cope with exit methods raising and handling exceptions
........
r45685 | nick.coghlan | 2006-04-24 06:59:28 +0200 (Mon, 24 Apr 2006) | 1 line
Fix broken contextlib test from last checkin (I'd've sworn I tested that before checking it in. . .)
........
r45686 | nick.coghlan | 2006-04-24 07:24:26 +0200 (Mon, 24 Apr 2006) | 1 line
Back out new command line tests (broke buildbot)
........
r45687 | nick.coghlan | 2006-04-24 07:52:15 +0200 (Mon, 24 Apr 2006) | 1 line
More reliable version of new command line tests that just checks the exit codes
........
r45688 | thomas.wouters | 2006-04-24 13:37:13 +0200 (Mon, 24 Apr 2006) | 4 lines
Stop test_tcl's testLoadTk from leaking the Tk commands 'loadtk' registers.
........
r45690 | andrew.kuchling | 2006-04-24 16:30:47 +0200 (Mon, 24 Apr 2006) | 2 lines
Edits, using the new term
'context specifier' in a few places
........
r45697 | phillip.eby | 2006-04-24 22:53:13 +0200 (Mon, 24 Apr 2006) | 2 lines
Revert addition of setuptools
........
r45698 | tim.peters | 2006-04-25 00:45:13 +0200 (Tue, 25 Apr 2006) | 2 lines
Whitespace normalization.
........
r45700 | trent.mick | 2006-04-25 02:34:50 +0200 (Tue, 25 Apr 2006) | 4 lines
Put break at correct level so *all* root HKEYs acutally get checked for
an installed VC6. Otherwise only the first such tree gets checked and this
warning doesn't get displayed.
........
r45701 | tim.peters | 2006-04-25 05:31:36 +0200 (Tue, 25 Apr 2006) | 3 lines
Patch #1475231: add a new SKIP doctest option, thanks to
Edward Loper.
........
r45702 | neal.norwitz | 2006-04-25 07:04:35 +0200 (Tue, 25 Apr 2006) | 1 line
versionadded for SKIP
........
r45703 | neal.norwitz | 2006-04-25 07:05:03 +0200 (Tue, 25 Apr 2006) | 1 line
Restore Walters name
........
r45704 | neal.norwitz | 2006-04-25 07:49:42 +0200 (Tue, 25 Apr 2006) | 1 line
Revert previous change, SKIP had a versionadded elsewhere
........
r45706 | nick.coghlan | 2006-04-25 12:56:51 +0200 (Tue, 25 Apr 2006) | 31 lines
Move the PEP 343 documentation and implementation closer to the
terminology in the alpha 1 documentation.
- "context manager" reverts to its alpha 1 definition
- the term "context specifier" goes away entirely
- contextlib.GeneratorContextManager is renamed GeneratorContext
There are still a number of changes relative to alpha 1:
- the expression in the with statement is explicitly called the
"context expression" in the language reference
- the terms 'with statement context', 'context object' or 'with
statement context' are used in several places instead of a bare
'context'. The aim of this is to avoid ambiguity in relation to the
runtime context set up when the block is executed, and the context
objects that already exist in various application domains (such as
decimal.Context)
- contextlib.contextmanager is renamed to contextfactory
This best reflects the nature of the function resulting from the
use of that decorator
- decimal.ContextManager is renamed to WithStatementContext
Simple dropping the 'Manager' part wasn't possible due to the
fact that decimal.Context already exists and means something
different. WithStatementContext is ugly but workable.
A technically unrelated change snuck into this commit:
contextlib.closing now avoids the overhead of creating a
generator, since it's trivial to implement that particular
context manager directly.
........
r45707 | nick.coghlan | 2006-04-25 13:05:56 +0200 (Tue, 25 Apr 2006) | 1 line
Fix latex typo
........
r45708 | thomas.wouters | 2006-04-25 14:28:56 +0200 (Tue, 25 Apr 2006) | 4 lines
Fix markup glitch in unittest docs. Will backport.
........
r45710 | andrew.kuchling | 2006-04-25 14:31:38 +0200 (Tue, 25 Apr 2006) | 1 line
Add two items; easy_install is now off the table, though pkgutil still is
........
r45711 | andrew.kuchling | 2006-04-25 14:47:25 +0200 (Tue, 25 Apr 2006) | 1 line
Rework context terminology
........
r45712 | thomas.wouters | 2006-04-25 15:53:23 +0200 (Tue, 25 Apr 2006) | 9 lines
SF bug/patch #1433877: string parameter to ioctl not null terminated
The new char-array used in ioctl calls wasn't explicitly NUL-terminated;
quite probably the cause for the test_pty failures on Solaris that we
circumvented earlier. (I wasn't able to reproduce it with this patch, but it
has been somewhat elusive to start with.)
........
r45713 | george.yoshida | 2006-04-25 16:09:58 +0200 (Tue, 25 Apr 2006) | 2 lines
minor tweak
........
r45714 | thomas.wouters | 2006-04-25 17:08:10 +0200 (Tue, 25 Apr 2006) | 7 lines
Fix SF bug #1476111: SystemError in socket sendto. The AF_INET6 and
AF_PACKET cases in getsockaddrarg were missing their own checks for
tuple-ness of the address argument, which means a confusing SystemError was
raised by PyArg_ParseTuple instead.
........
r45715 | thomas.wouters | 2006-04-25 17:29:46 +0200 (Tue, 25 Apr 2006) | 10 lines
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.
........
r45717 | thomas.heller | 2006-04-25 20:26:08 +0200 (Tue, 25 Apr 2006) | 3 lines
Fix compiler warnings on Darwin.
Patch by Brett Canon, see
https://sourceforge.net/tracker/?func=detail&atid=532156&aid=1475959&group_id=71702
........
r45718 | guido.van.rossum | 2006-04-25 22:12:45 +0200 (Tue, 25 Apr 2006) | 4 lines
Implement MvL's improvement on __context__ in Condition;
this can just call __context__ on the underlying lock.
(The same change for Semaphore does *not* work!)
........
r45721 | tim.peters | 2006-04-26 03:15:53 +0200 (Wed, 26 Apr 2006) | 13 lines
Rev 45706 renamed stuff in contextlib.py, but didn't rename
uses of it in test_with.py. As a result, test_with has been skipped
(due to failing imports) on all buildbot boxes since. Alas, that's
not a test failure -- you have to pay attention to the
1 skip unexpected on PLATFORM:
test_with
kinds of output at the ends of test runs to notice that this got
broken.
It's likely that more renaming in test_with.py would be desirable.
........
r45722 | fred.drake | 2006-04-26 07:15:41 +0200 (Wed, 26 Apr 2006) | 1 line
markup fixes, cleanup
........
r45723 | fred.drake | 2006-04-26 07:19:39 +0200 (Wed, 26 Apr 2006) | 1 line
minor adjustment suggested by Peter Gephardt
........
r45724 | neal.norwitz | 2006-04-26 07:34:03 +0200 (Wed, 26 Apr 2006) | 10 lines
Patch from Aldo Cortesi (OpenBSD buildbot owner).
After the patch (45590) to add extra debug stats to the gc module, Python
was crashing on OpenBSD due to:
Fatal Python error: Interpreter not initialized (version mismatch?)
This seems to occur due to calling collect() when initialized (in pythonrun.c)
is set to 0. Now, the import will occur in the init function which
shouldn't suffer this problem.
........
r45725 | neal.norwitz | 2006-04-26 08:26:12 +0200 (Wed, 26 Apr 2006) | 3 lines
Fix this test on Solaris. There can be embedded \r, so don't just replace
the one at the end.
........
r45727 | nick.coghlan | 2006-04-26 13:50:04 +0200 (Wed, 26 Apr 2006) | 1 line
Fix an error in the last contextlib.closing example
........
r45728 | andrew.kuchling | 2006-04-26 14:21:06 +0200 (Wed, 26 Apr 2006) | 1 line
[Bug #1475080] Fix example
........
r45729 | andrew.kuchling | 2006-04-26 14:23:39 +0200 (Wed, 26 Apr 2006) | 1 line
Add labels to all sections
........
r45730 | thomas.wouters | 2006-04-26 17:53:30 +0200 (Wed, 26 Apr 2006) | 7 lines
The result of SF patch #1471578: big-memory tests for strings, lists and
tuples. Lots to be added, still, but this will give big-memory people
something to play with in 2.5 alpha 2, and hopefully get more people to
write these tests.
........
r45731 | tim.peters | 2006-04-26 19:11:16 +0200 (Wed, 26 Apr 2006) | 2 lines
Whitespace normalization.
........
r45732 | martin.v.loewis | 2006-04-26 19:19:44 +0200 (Wed, 26 Apr 2006) | 1 line
Use GS- and bufferoverlowU.lib where appropriate, for AMD64.
........
r45733 | thomas.wouters | 2006-04-26 20:46:01 +0200 (Wed, 26 Apr 2006) | 5 lines
Add tests for += and *= on strings, and fix the memory-use estimate for the
list.extend tests (they were estimating half the actual use.)
........
r45734 | thomas.wouters | 2006-04-26 21:14:46 +0200 (Wed, 26 Apr 2006) | 5 lines
Some more test-size-estimate fixes: test_append and test_insert trigger a
list resize, which overallocates.
........
r45735 | hyeshik.chang | 2006-04-26 21:20:26 +0200 (Wed, 26 Apr 2006) | 3 lines
Fix build on MIPS for libffi. I haven't tested this yet because I
don't have an access on MIPS machines. Will be tested by buildbot. :)
........
r45737 | fred.drake | 2006-04-27 01:40:32 +0200 (Thu, 27 Apr 2006) | 1 line
one more place to use the current Python version
........
r45738 | fred.drake | 2006-04-27 02:02:24 +0200 (Thu, 27 Apr 2006) | 3 lines
- update version numbers in file names again, until we have a better way
- elaborate instructions for Cygwin support (closes SF #839709)
........
r45739 | fred.drake | 2006-04-27 02:20:14 +0200 (Thu, 27 Apr 2006) | 1 line
add missing word
........
r45740 | anthony.baxter | 2006-04-27 04:11:24 +0200 (Thu, 27 Apr 2006) | 2 lines
2.5a2
........
r45741 | anthony.baxter | 2006-04-27 04:13:13 +0200 (Thu, 27 Apr 2006) | 1 line
2.5a2
........
r45749 | andrew.kuchling | 2006-04-27 14:22:37 +0200 (Thu, 27 Apr 2006) | 1 line
Now that 2.5a2 is out, revert to the current date
........
r45750 | andrew.kuchling | 2006-04-27 14:23:07 +0200 (Thu, 27 Apr 2006) | 1 line
Bump document version
........
r45751 | andrew.kuchling | 2006-04-27 14:34:39 +0200 (Thu, 27 Apr 2006) | 6 lines
[Bug #1477102] Add necessary import to example
This may be a useful style question for the docs -- should examples show
the necessary imports, or should it be assumed that the reader will
figure it out? In the What's New, I'm not consistent but usually opt
for omitting the imports.
........
r45753 | andrew.kuchling | 2006-04-27 14:38:35 +0200 (Thu, 27 Apr 2006) | 1 line
[Bug #1477140] Import Error base class
........
r45754 | andrew.kuchling | 2006-04-27 14:42:54 +0200 (Thu, 27 Apr 2006) | 1 line
Mention the xmlrpclib.Error base class, which is used in one of the examples
........
r45756 | george.yoshida | 2006-04-27 15:41:07 +0200 (Thu, 27 Apr 2006) | 2 lines
markup fix
........
r45757 | thomas.wouters | 2006-04-27 15:46:59 +0200 (Thu, 27 Apr 2006) | 4 lines
Some more size-estimate fixes, for large-list-tests.
........
r45758 | thomas.heller | 2006-04-27 17:50:42 +0200 (Thu, 27 Apr 2006) | 3 lines
Rerun the libffi configuration if any of the files used for that
are newer then fficonfig.py.
........
r45766 | thomas.wouters | 2006-04-28 00:37:50 +0200 (Fri, 28 Apr 2006) | 6 lines
Some style fixes and size-calculation fixes. Also do the small-memory run
using a prime number, rather than a convenient power-of-2-and-multiple-of-5,
so incorrect testing algorithms fail more easily.
........
r45767 | thomas.wouters | 2006-04-28 00:38:32 +0200 (Fri, 28 Apr 2006) | 6 lines
Do the small-memory run of big-meormy tests using a prime number, rather
than a convenient power-of-2-and-multiple-of-5, so incorrect testing
algorithms fail more easily.
........
r45768 | david.goodger | 2006-04-28 00:53:05 +0200 (Fri, 28 Apr 2006) | 1 line
Added SVN access for Steven Bethard and Talin, for PEP updating.
........
r45770 | thomas.wouters | 2006-04-28 01:13:20 +0200 (Fri, 28 Apr 2006) | 16 lines
- Add new Warning class, ImportWarning
- Warn-raise ImportWarning when importing would have picked up a directory
as package, if only it'd had an __init__.py. This swaps two tests (for
case-ness and __init__-ness), but case-test is not really more expensive,
and it's not in a speed-critical section.
- Test for the new warning by importing a common non-package directory on
sys.path: site-packages
- In regrtest.py, silence warnings generated by the build-environment
because Modules/ (which is added to sys.path for Setup-created modules)
has 'zlib' and '_ctypes' directories without __init__.py's.
........
r45771 | thomas.wouters | 2006-04-28 01:41:27 +0200 (Fri, 28 Apr 2006) | 6 lines
Add more ignores of ImportWarnings; these are all just potential triggers
(since they won't trigger if zlib is already sucessfully imported); they
were found by grepping .py files, instead of looking at warning output :)
........
r45773 | neal.norwitz | 2006-04-28 06:32:20 +0200 (Fri, 28 Apr 2006) | 1 line
Add some whitespace to be more consistent.
........
r45774 | neal.norwitz | 2006-04-28 06:34:43 +0200 (Fri, 28 Apr 2006) | 5 lines
Try to really fix the slow buildbots this time.
Printing to stdout, doesn't mean the data was actually written.
It depends on the buffering, so we need to flush. This will hopefully
really fix the buildbots getting killed due to no output on the slow bots.
........
r45775 | neal.norwitz | 2006-04-28 07:28:05 +0200 (Fri, 28 Apr 2006) | 1 line
Fix some warnings on Mac OS X 10.4
........
r45776 | neal.norwitz | 2006-04-28 07:28:30 +0200 (Fri, 28 Apr 2006) | 1 line
Fix a warning on alpha
........
r45777 | neal.norwitz | 2006-04-28 07:28:54 +0200 (Fri, 28 Apr 2006) | 1 line
Fix a warning on ppc (debian)
........
r45778 | george.yoshida | 2006-04-28 18:09:45 +0200 (Fri, 28 Apr 2006) | 2 lines
fix markup glitch
........
r45780 | georg.brandl | 2006-04-28 18:31:17 +0200 (Fri, 28 Apr 2006) | 3 lines
Add SeaMonkey to the list of Mozilla browsers.
........
r45781 | georg.brandl | 2006-04-28 18:36:55 +0200 (Fri, 28 Apr 2006) | 2 lines
Bug #1475009: clarify ntpath.join behavior with absolute components
........
r45783 | george.yoshida | 2006-04-28 18:40:14 +0200 (Fri, 28 Apr 2006) | 2 lines
correct a dead link
........
r45785 | georg.brandl | 2006-04-28 18:54:25 +0200 (Fri, 28 Apr 2006) | 4 lines
Bug #1472949: stringify IOErrors in shutil.copytree when appending
them to the Error errors list.
........
r45786 | georg.brandl | 2006-04-28 18:58:52 +0200 (Fri, 28 Apr 2006) | 3 lines
Bug #1478326: don't allow '/' in distutils.util.get_platform machine names
since this value is used to name the build directory.
........
r45788 | thomas.heller | 2006-04-28 19:02:18 +0200 (Fri, 28 Apr 2006) | 1 line
Remove a duplicated test (the same test is in test_incomplete.py).
........
r45792 | georg.brandl | 2006-04-28 21:09:24 +0200 (Fri, 28 Apr 2006) | 3 lines
Bug #1478429: make datetime.datetime.fromtimestamp accept every float,
possibly "rounding up" to the next whole second.
........
r45796 | george.yoshida | 2006-04-29 04:43:30 +0200 (Sat, 29 Apr 2006) | 2 lines
grammar fix
........
r45800 | ronald.oussoren | 2006-04-29 13:31:35 +0200 (Sat, 29 Apr 2006) | 2 lines
Patch 1471883: --enable-universalsdk on Mac OS X
........
r45801 | andrew.kuchling | 2006-04-29 13:53:15 +0200 (Sat, 29 Apr 2006) | 1 line
Add item
........
r45802 | andrew.kuchling | 2006-04-29 14:10:28 +0200 (Sat, 29 Apr 2006) | 1 line
Make case of 'ZIP' consistent
........
r45803 | andrew.kuchling | 2006-04-29 14:10:43 +0200 (Sat, 29 Apr 2006) | 1 line
Add item
........
r45808 | martin.v.loewis | 2006-04-29 14:37:25 +0200 (Sat, 29 Apr 2006) | 3 lines
Further changes for #1471883: Edit Misc/NEWS, and
add expat_config.h.
........
r45809 | brett.cannon | 2006-04-29 23:29:50 +0200 (Sat, 29 Apr 2006) | 2 lines
Fix docstring for contextfactory; mentioned old contextmanager name.
........
r45810 | gerhard.haering | 2006-04-30 01:12:41 +0200 (Sun, 30 Apr 2006) | 3 lines
This is the start of documentation for the sqlite3 module. Please feel free to
find a better place for the link to it than alongside bsddb & friends.
........
r45811 | andrew.kuchling | 2006-04-30 03:07:09 +0200 (Sun, 30 Apr 2006) | 1 line
Add two items
........
r45814 | george.yoshida | 2006-04-30 05:49:56 +0200 (Sun, 30 Apr 2006) | 2 lines
Use \versionchanged instead of \versionadded for new parameter support.
........
r45815 | georg.brandl | 2006-04-30 09:06:11 +0200 (Sun, 30 Apr 2006) | 2 lines
Patch #1470846: fix urllib2 ProxyBasicAuthHandler.
........
r45817 | georg.brandl | 2006-04-30 10:57:35 +0200 (Sun, 30 Apr 2006) | 3 lines
In stdlib, use hashlib instead of deprecated md5 and sha modules.
........
r45819 | georg.brandl | 2006-04-30 11:23:59 +0200 (Sun, 30 Apr 2006) | 3 lines
Patch #1470976: don't NLST files when retrieving over FTP.
........
r45821 | georg.brandl | 2006-04-30 13:13:56 +0200 (Sun, 30 Apr 2006) | 6 lines
Bug #1473625: stop cPickle making float dumps locale dependent in protocol 0.
On the way, add a decorator to test_support to facilitate running single
test functions in different locales with automatic cleanup.
........
r45822 | phillip.eby | 2006-04-30 17:59:26 +0200 (Sun, 30 Apr 2006) | 2 lines
Fix infinite regress when inspecting <string> or <stdin> frames.
........
r45824 | georg.brandl | 2006-04-30 19:42:26 +0200 (Sun, 30 Apr 2006) | 3 lines
Fix another problem in inspect: if the module for an object cannot be found, don't try to give its __dict__ to linecache.
........
r45825 | georg.brandl | 2006-04-30 20:14:54 +0200 (Sun, 30 Apr 2006) | 3 lines
Patch #1472854: make the rlcompleter.Completer class usable on non-
UNIX platforms.
........
r45826 | georg.brandl | 2006-04-30 21:34:19 +0200 (Sun, 30 Apr 2006) | 3 lines
Patch #1479438: add \keyword markup for "with".
........
r45827 | andrew.kuchling | 2006-04-30 23:19:31 +0200 (Sun, 30 Apr 2006) | 1 line
Add urllib2 HOWTO from Michael Foord
........
r45828 | andrew.kuchling | 2006-04-30 23:19:49 +0200 (Sun, 30 Apr 2006) | 1 line
Add item
........
r45830 | barry.warsaw | 2006-05-01 05:03:02 +0200 (Mon, 01 May 2006) | 11 lines
Port forward from 2.4 branch:
Patch #1464708 from William McVey: fixed handling of nested comments in mail
addresses. E.g.
"Foo ((Foo Bar)) <foo@example.com>"
Fixes for both rfc822.py and email package. This patch needs to be back
ported to Python 2.3 for email 2.5.
........
r45832 | fred.drake | 2006-05-01 08:25:58 +0200 (Mon, 01 May 2006) | 4 lines
- minor clarification in section title
- markup adjustments
(there is clearly much to be done in this section)
........
r45833 | martin.v.loewis | 2006-05-01 08:28:01 +0200 (Mon, 01 May 2006) | 2 lines
Work around deadlock risk. Will backport.
........
r45836 | andrew.kuchling | 2006-05-01 14:45:02 +0200 (Mon, 01 May 2006) | 1 line
Some ElementTree fixes: import from xml, not xmlcore; fix case of module name; mention list() instead of getchildren()
........
r45837 | gerhard.haering | 2006-05-01 17:14:48 +0200 (Mon, 01 May 2006) | 3 lines
Further integration of the documentation for the sqlite3 module. There's still
quite some content to move over from the pysqlite manual, but it's a start now.
........
r45838 | martin.v.loewis | 2006-05-01 17:56:03 +0200 (Mon, 01 May 2006) | 2 lines
Rename uisample to text, drop all non-text tables.
........
r45839 | martin.v.loewis | 2006-05-01 18:12:44 +0200 (Mon, 01 May 2006) | 2 lines
Add msilib documentation.
........
r45840 | martin.v.loewis | 2006-05-01 18:14:16 +0200 (Mon, 01 May 2006) | 4 lines
Rename parameters to match the documentation (which
in turn matches Microsoft's documentation).
Drop unused parameter in CAB.append.
........
r45841 | fred.drake | 2006-05-01 18:28:54 +0200 (Mon, 01 May 2006) | 1 line
add dependency
........
r45842 | andrew.kuchling | 2006-05-01 18:30:25 +0200 (Mon, 01 May 2006) | 1 line
Markup fixes; add some XXX comments noting problems
........
r45843 | andrew.kuchling | 2006-05-01 18:32:49 +0200 (Mon, 01 May 2006) | 1 line
Add item
........
r45844 | andrew.kuchling | 2006-05-01 19:06:54 +0200 (Mon, 01 May 2006) | 1 line
Markup fixes
........
r45850 | neal.norwitz | 2006-05-02 06:43:14 +0200 (Tue, 02 May 2006) | 3 lines
SF #1479181: split open() and file() from being aliases for each other.
........
r45852 | neal.norwitz | 2006-05-02 08:23:22 +0200 (Tue, 02 May 2006) | 1 line
Try to fix breakage caused by patch #1479181, r45850
........
r45853 | fred.drake | 2006-05-02 08:53:59 +0200 (Tue, 02 May 2006) | 3 lines
SF #1479988: add methods to allow access to weakrefs for the
weakref.WeakKeyDictionary and weakref.WeakValueDictionary
........
r45854 | neal.norwitz | 2006-05-02 09:27:47 +0200 (Tue, 02 May 2006) | 5 lines
Fix breakage from patch 1471883 (r45800 & r45808) on OSF/1.
The problem was that pyconfig.h was being included before some system headers
which caused redefinitions and other breakage. This moves system headers
after expat_config.h which includes pyconfig.h.
........
r45855 | vinay.sajip | 2006-05-02 10:35:36 +0200 (Tue, 02 May 2006) | 1 line
Replaced my dumb way of calculating seconds to midnight with Tim Peters' much more sensible suggestion. What was I thinking ?!?
........
r45856 | andrew.kuchling | 2006-05-02 13:30:03 +0200 (Tue, 02 May 2006) | 1 line
Provide encoding as keyword argument; soften warning paragraph about encodings
........
r45858 | guido.van.rossum | 2006-05-02 19:36:09 +0200 (Tue, 02 May 2006) | 2 lines
Fix the formatting of KeyboardInterrupt -- a bad issubclass() call.
........
r45862 | guido.van.rossum | 2006-05-02 21:47:52 +0200 (Tue, 02 May 2006) | 7 lines
Get rid of __context__, per the latest changes to PEP 343 and python-dev
discussion.
There are two places of documentation that still mention __context__:
Doc/lib/libstdtypes.tex -- I wasn't quite sure how to rewrite that without
spending a whole lot of time thinking about it; and whatsnew, which Andrew
usually likes to change himself.
........
r45863 | armin.rigo | 2006-05-02 21:52:32 +0200 (Tue, 02 May 2006) | 4 lines
Documentation bug: PySet_Pop() returns a new reference (because the
caller becomes the owner of that reference).
........
r45864 | guido.van.rossum | 2006-05-02 22:47:36 +0200 (Tue, 02 May 2006) | 4 lines
Hopefully this will fix the spurious failures of test_mailbox.py that I'm
experiencing. (This code and mailbox.py itself are full of calls to file()
that should be calls to open() -- but I'm not fixing those.)
........
r45865 | andrew.kuchling | 2006-05-02 23:44:33 +0200 (Tue, 02 May 2006) | 1 line
Use open() instead of file()
........
r45866 | andrew.kuchling | 2006-05-03 00:47:49 +0200 (Wed, 03 May 2006) | 1 line
Update context manager section for removal of __context__
........
r45867 | fred.drake | 2006-05-03 03:46:52 +0200 (Wed, 03 May 2006) | 1 line
remove unnecessary assignment
........
r45868 | fred.drake | 2006-05-03 03:48:24 +0200 (Wed, 03 May 2006) | 4 lines
tell LaTeX2HTML to:
- use UTF-8 output
- not mess with the >>> prompt!
........
r45869 | fred.drake | 2006-05-03 04:04:40 +0200 (Wed, 03 May 2006) | 3 lines
avoid ugly markup based on the unfortunate conversions of ">>" and "<<" to
guillemets; no need for magic here
........
r45870 | fred.drake | 2006-05-03 04:12:47 +0200 (Wed, 03 May 2006) | 1 line
at least comment on why curly-quotes are not enabled
........
r45871 | fred.drake | 2006-05-03 04:27:40 +0200 (Wed, 03 May 2006) | 1 line
one more place to avoid extra markup
........
r45872 | fred.drake | 2006-05-03 04:29:09 +0200 (Wed, 03 May 2006) | 1 line
one more place to avoid extra markup (how many will there be?)
........
r45873 | fred.drake | 2006-05-03 04:29:39 +0200 (Wed, 03 May 2006) | 1 line
fix up whitespace in prompt strings
........
r45876 | tim.peters | 2006-05-03 06:46:14 +0200 (Wed, 03 May 2006) | 2 lines
Whitespace normalization.
........
r45877 | martin.v.loewis | 2006-05-03 06:52:04 +0200 (Wed, 03 May 2006) | 2 lines
Correct some formulations, fix XXX comments.
........
r45879 | georg.brandl | 2006-05-03 07:05:02 +0200 (Wed, 03 May 2006) | 2 lines
Patch #1480067: don't redirect HTTP digest auth in urllib2
........
r45881 | georg.brandl | 2006-05-03 07:15:10 +0200 (Wed, 03 May 2006) | 3 lines
Move network tests from test_urllib2 to test_urllib2net.
........
r45887 | nick.coghlan | 2006-05-03 15:02:47 +0200 (Wed, 03 May 2006) | 1 line
Finish bringing SVN into line with latest version of PEP 343 by getting rid of all remaining references to context objects that I could find. Without a __context__() method context objects no longer exist. Also get test_with working again, and adopt a suggestion from Neal for decimal.Context.get_manager()
........
r45888 | nick.coghlan | 2006-05-03 15:17:49 +0200 (Wed, 03 May 2006) | 1 line
Get rid of a couple more context object references, fix some markup and clarify what happens when a generator context function swallows an exception.
........
r45889 | georg.brandl | 2006-05-03 19:46:13 +0200 (Wed, 03 May 2006) | 3 lines
Add seamonkey to list of Windows browsers too.
........
r45890 | georg.brandl | 2006-05-03 20:03:22 +0200 (Wed, 03 May 2006) | 3 lines
RFE #1472176: In httplib, don't encode the netloc and hostname with "idna" if not necessary.
........
r45891 | georg.brandl | 2006-05-03 20:12:33 +0200 (Wed, 03 May 2006) | 2 lines
Bug #1472191: convert breakpoint indices to ints before comparing them to ints
........
r45893 | georg.brandl | 2006-05-03 20:18:32 +0200 (Wed, 03 May 2006) | 3 lines
Bug #1385040: don't allow "def foo(a=1, b): pass" in the compiler package.
........
r45894 | thomas.heller | 2006-05-03 20:35:39 +0200 (Wed, 03 May 2006) | 1 line
Don't fail the tests when libglut.so or libgle.so cannot be loaded.
........
r45895 | georg.brandl | 2006-05-04 07:08:10 +0200 (Thu, 04 May 2006) | 2 lines
Bug #1481530: allow "from os.path import ..." with imputil
........
r45897 | martin.v.loewis | 2006-05-04 07:51:03 +0200 (Thu, 04 May 2006) | 2 lines
Patch #1475845: Raise IndentationError for unexpected indent.
........
r45898 | martin.v.loewis | 2006-05-04 12:08:42 +0200 (Thu, 04 May 2006) | 1 line
Implement os.{chdir,rename,rmdir,remove} using Win32 directly.
........
r45899 | martin.v.loewis | 2006-05-04 14:04:27 +0200 (Thu, 04 May 2006) | 2 lines
Drop now-unnecessary arguments to posix_2str.
........
r45900 | martin.v.loewis | 2006-05-04 16:27:52 +0200 (Thu, 04 May 2006) | 1 line
Update checks to consider Windows error numbers.
........
r45913 | thomas.heller | 2006-05-05 20:42:14 +0200 (Fri, 05 May 2006) | 2 lines
Export the 'free' standard C function for use in the test suite.
........
r45914 | thomas.heller | 2006-05-05 20:43:24 +0200 (Fri, 05 May 2006) | 3 lines
Fix memory leaks in the ctypes test suite, reported by valgrind, by
free()ing the memory we allocate.
........
r45915 | thomas.heller | 2006-05-05 20:46:27 +0200 (Fri, 05 May 2006) | 1 line
oops - the function is exported as 'my_free', not 'free'.
........
r45916 | thomas.heller | 2006-05-05 21:14:24 +0200 (Fri, 05 May 2006) | 2 lines
Clean up.
........
r45920 | george.yoshida | 2006-05-06 15:09:45 +0200 (Sat, 06 May 2006) | 2 lines
describe optional arguments for DocFileSuite
........
r45924 | george.yoshida | 2006-05-06 16:16:51 +0200 (Sat, 06 May 2006) | 2 lines
Use \versionchanged for the feature change
........
r45925 | martin.v.loewis | 2006-05-06 18:32:54 +0200 (Sat, 06 May 2006) | 1 line
Port access, chmod, parts of getcwdu, mkdir, and utime to direct Win32 API.
........
r45926 | martin.v.loewis | 2006-05-06 22:04:08 +0200 (Sat, 06 May 2006) | 2 lines
Handle ERROR_ALREADY_EXISTS.
........
r45931 | andrew.kuchling | 2006-05-07 19:12:12 +0200 (Sun, 07 May 2006) | 1 line
[Patch #1479977] Revised version of urllib2 HOWTO, edited by John J. Lee
........
r45932 | andrew.kuchling | 2006-05-07 19:14:53 +0200 (Sun, 07 May 2006) | 1 line
Minor language edit
........
r45934 | georg.brandl | 2006-05-07 22:44:34 +0200 (Sun, 07 May 2006) | 3 lines
Patch #1483395: add new TLDs to cookielib
........
r45936 | martin.v.loewis | 2006-05-08 07:25:56 +0200 (Mon, 08 May 2006) | 2 lines
Add missing PyMem_Free.
........
r45938 | georg.brandl | 2006-05-08 19:28:47 +0200 (Mon, 08 May 2006) | 3 lines
Add test for rev. 45934.
........
r45939 | georg.brandl | 2006-05-08 19:36:08 +0200 (Mon, 08 May 2006) | 3 lines
Patch #1479302: Make urllib2 digest auth and basic auth play together.
........
r45940 | georg.brandl | 2006-05-08 19:48:01 +0200 (Mon, 08 May 2006) | 3 lines
Patch #1478993: take advantage of BaseException/Exception split in cookielib
........
r45941 | neal.norwitz | 2006-05-09 07:38:56 +0200 (Tue, 09 May 2006) | 5 lines
Micro optimization. In the first case, we know that frame->f_exc_type
is NULL, so there's no reason to do anything with it. In the second case,
we know frame->f_exc_type is not NULL, so we can just do an INCREF.
........
r45943 | thomas.heller | 2006-05-09 22:20:15 +0200 (Tue, 09 May 2006) | 2 lines
Disable a test that is unreliable.
........
r45944 | tim.peters | 2006-05-10 04:43:01 +0200 (Wed, 10 May 2006) | 4 lines
Variant of patch #1478292. doctest.register_optionflag(name)
shouldn't create a new flag when `name` is already the name of
an option flag.
........
r45947 | neal.norwitz | 2006-05-10 08:57:58 +0200 (Wed, 10 May 2006) | 14 lines
Fix problems found by Coverity.
longobject.c: also fix an ssize_t problem
<a> could have been NULL, so hoist the size calc to not use <a>.
_ssl.c: under fail: self is DECREF'd, but it would have been NULL.
_elementtree.c: delete self if there was an error.
_csv.c: I'm not sure if lineterminator could have been anything other than
a string. However, other string method calls are checked, so check this
one too.
........
r45948 | thomas.wouters | 2006-05-10 17:04:11 +0200 (Wed, 10 May 2006) | 4 lines
Ignore reflog.txt, too.
........
r45949 | georg.brandl | 2006-05-10 17:59:06 +0200 (Wed, 10 May 2006) | 3 lines
Bug #1482988: indicate more prominently that the Stats class is in the pstats module.
........
r45950 | georg.brandl | 2006-05-10 18:09:03 +0200 (Wed, 10 May 2006) | 2 lines
Bug #1485447: subprocess: document that the "cwd" parameter isn't used to find the executable. Misc. other markup fixes.
........
r45952 | georg.brandl | 2006-05-10 18:11:44 +0200 (Wed, 10 May 2006) | 2 lines
Bug #1484978: curses.panel: clarify that Panel objects are destroyed on garbage collection.
........
r45954 | georg.brandl | 2006-05-10 18:26:03 +0200 (Wed, 10 May 2006) | 4 lines
Patch #1484695: Update the tarfile module to version 0.8. This fixes
a couple of issues, notably handling of long file names using the
GNU LONGNAME extension.
........
r45955 | georg.brandl | 2006-05-10 19:13:20 +0200 (Wed, 10 May 2006) | 4 lines
Patch #721464: pdb.Pdb instances can now be given explicit stdin and
stdout arguments, making it possible to redirect input and output
for remote debugging.
........
r45956 | andrew.kuchling | 2006-05-10 19:19:04 +0200 (Wed, 10 May 2006) | 1 line
Clarify description of exception handling
........
r45957 | georg.brandl | 2006-05-10 22:09:23 +0200 (Wed, 10 May 2006) | 2 lines
Fix two small errors in argument lists.
........
r45960 | brett.cannon | 2006-05-11 07:11:33 +0200 (Thu, 11 May 2006) | 5 lines
Detect if %zd is supported by printf() during configure and sets
PY_FORMAT_SIZE_T appropriately. Removes warnings on
OS X under gcc 4.0.1 when PY_FORMAT_SIZE_T is set to "" instead of "z" as is
needed.
........
r45963 | neal.norwitz | 2006-05-11 09:51:59 +0200 (Thu, 11 May 2006) | 1 line
Don't mask a no memory error with a less meaningful one as discussed on python-checkins
........
r45964 | martin.v.loewis | 2006-05-11 15:28:43 +0200 (Thu, 11 May 2006) | 3 lines
Change WindowsError to carry the Win32 error code in winerror,
and the DOS error code in errno. Revert changes where
WindowsError catch blocks unnecessarily special-case OSError.
........
r45965 | george.yoshida | 2006-05-11 17:53:27 +0200 (Thu, 11 May 2006) | 2 lines
Grammar fix
........
r45967 | andrew.kuchling | 2006-05-11 18:32:24 +0200 (Thu, 11 May 2006) | 1 line
typo fix
........
r45968 | tim.peters | 2006-05-11 18:37:42 +0200 (Thu, 11 May 2006) | 5 lines
BaseThreadedTestCase.setup(): stop special-casing WindowsError.
Rev 45964 fiddled with WindowsError, and broke test_bsddb3 on all
the Windows buildbot slaves as a result. This should repair it.
........
r45969 | georg.brandl | 2006-05-11 21:57:09 +0200 (Thu, 11 May 2006) | 2 lines
Typo fix.
........
r45970 | tim.peters | 2006-05-12 03:57:59 +0200 (Fri, 12 May 2006) | 5 lines
SF patch #1473132: Improve docs for tp_clear and tp_traverse,
by Collin Winter.
Bugfix candidate (but I'm not going to bother).
........
r45974 | martin.v.loewis | 2006-05-12 14:27:28 +0200 (Fri, 12 May 2006) | 4 lines
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.
........
r45975 | martin.v.loewis | 2006-05-12 15:57:36 +0200 (Fri, 12 May 2006) | 1 line
Move icon files into DLLs dir. Fixes #1477968.
........
r45976 | george.yoshida | 2006-05-12 18:40:11 +0200 (Fri, 12 May 2006) | 2 lines
At first there were 6 steps, but one was removed after that.
........
r45977 | martin.v.loewis | 2006-05-12 19:22:04 +0200 (Fri, 12 May 2006) | 1 line
Fix alignment error on Itanium.
........
r45978 | george.yoshida | 2006-05-12 19:25:26 +0200 (Fri, 12 May 2006) | 3 lines
Duplicated description about the illegal continue usage can be found in nearly the same place.
They are same, so keep the original one and remove the later-added one.
........
r45980 | thomas.heller | 2006-05-12 20:16:03 +0200 (Fri, 12 May 2006) | 2 lines
Add missing svn properties.
........
r45981 | thomas.heller | 2006-05-12 20:47:35 +0200 (Fri, 12 May 2006) | 1 line
set svn properties
........
r45982 | thomas.heller | 2006-05-12 21:31:46 +0200 (Fri, 12 May 2006) | 1 line
add svn:eol-style native svn:keywords Id
........
r45987 | gerhard.haering | 2006-05-13 01:49:49 +0200 (Sat, 13 May 2006) | 3 lines
Integrated the rest of the pysqlite reference manual into the Python
documentation. Ready to be reviewed and improved upon.
........
r45988 | george.yoshida | 2006-05-13 08:53:31 +0200 (Sat, 13 May 2006) | 2 lines
Add \exception markup
........
r45990 | martin.v.loewis | 2006-05-13 15:34:04 +0200 (Sat, 13 May 2006) | 2 lines
Revert 43315: Printing of %zd must be signed.
........
r45992 | tim.peters | 2006-05-14 01:28:20 +0200 (Sun, 14 May 2006) | 11 lines
Teach PyString_FromFormat, PyErr_Format, and PyString_FromFormatV
about "%u", "%lu" and "%zu" formats.
Since PyString_FromFormat and PyErr_Format have exactly the same rules
(both inherited from PyString_FromFormatV), it would be good if someone
with more LaTeX Fu changed one of them to just point to the other.
Their docs were way out of synch before this patch, and I just did a
mass copy+paste to repair that.
Not a backport candidate (this is a new feature).
........
r45993 | tim.peters | 2006-05-14 01:31:05 +0200 (Sun, 14 May 2006) | 2 lines
Typo repair.
........
r45994 | tim.peters | 2006-05-14 01:33:19 +0200 (Sun, 14 May 2006) | 2 lines
Remove lie in new comment.
........
r45995 | ronald.oussoren | 2006-05-14 21:56:34 +0200 (Sun, 14 May 2006) | 11 lines
Rework the build system for osx applications:
* Don't use xcodebuild for building PythonLauncher, but use a normal unix
makefile. This makes it a lot easier to use the same build flags as for the
rest of python (e.g. make a universal version of python launcher)
* Convert the mac makefile-s to makefile.in-s and use configure to set makefile
variables instead of forwarding them as command-line arguments
* Add a C version of pythonw, that we you can use '#!/usr/local/bin/pythonw'
* Build IDLE.app using bundlebuilder instead of BuildApplet, that will allow
easier modification of the bundle contents later on.
........
r45996 | ronald.oussoren | 2006-05-14 22:35:41 +0200 (Sun, 14 May 2006) | 6 lines
A first cut at replacing the icons on MacOS X. This replaces all icons by icons
based on the new python.org logo. These are also the first icons that are
"proper" OSX icons.
These icons were created by Jacob Rus.
........
r45997 | ronald.oussoren | 2006-05-14 23:07:41 +0200 (Sun, 14 May 2006) | 3 lines
I missed one small detail in my rewrite of the osx build files: the path
to the Python.app template.
........
r45998 | martin.v.loewis | 2006-05-15 07:51:36 +0200 (Mon, 15 May 2006) | 2 lines
Fix memory leak.
........
r45999 | neal.norwitz | 2006-05-15 08:48:14 +0200 (Mon, 15 May 2006) | 1 line
Move items implemented after a2 into the new a3 section
........
r46000 | neal.norwitz | 2006-05-15 09:04:36 +0200 (Mon, 15 May 2006) | 5 lines
- Bug #1487966: Fix SystemError with conditional expression in assignment
Most of the test_syntax changes are just updating the numbers.
........
r46001 | neal.norwitz | 2006-05-15 09:17:23 +0200 (Mon, 15 May 2006) | 1 line
Patch #1488312, Fix memory alignment problem on SPARC in unicode. Will backport
........
r46003 | martin.v.loewis | 2006-05-15 11:22:27 +0200 (Mon, 15 May 2006) | 3 lines
Remove bogus DECREF of self.
Change __str__() functions to METH_O.
Change WindowsError__str__ to use PyTuple_Pack.
........
r46005 | georg.brandl | 2006-05-15 21:30:35 +0200 (Mon, 15 May 2006) | 3 lines
[ 1488881 ] tarfile.py: support for file-objects and bz2 (cp. #1488634)
........
r46007 | tim.peters | 2006-05-15 22:44:10 +0200 (Mon, 15 May 2006) | 9 lines
ReadDetectFileobjTest: repair Windows disasters by opening
the file object in binary mode.
The Windows buildbot slaves shouldn't swap themselves to death
anymore. However, test_tarfile may still fail because of a
temp directory left behind from a previous failing run.
Windows buildbot owners may need to remove that directory
by hand.
........
r46009 | tim.peters | 2006-05-15 23:32:25 +0200 (Mon, 15 May 2006) | 3 lines
test_directory(): Remove the leftover temp directory that's making
the Windows buildbots fail test_tarfile.
........
r46010 | martin.v.loewis | 2006-05-16 09:05:37 +0200 (Tue, 16 May 2006) | 4 lines
- 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
........
r46012 | georg.brandl | 2006-05-16 09:38:27 +0200 (Tue, 16 May 2006) | 3 lines
Patch #1435422: zlib's compress and decompress objects now have a
copy() method.
........
r46015 | andrew.kuchling | 2006-05-16 18:11:54 +0200 (Tue, 16 May 2006) | 1 line
Add item
........
r46016 | andrew.kuchling | 2006-05-16 18:27:31 +0200 (Tue, 16 May 2006) | 3 lines
PEP 243 has been withdrawn, so don't refer to it any more.
The PyPI upload material has been moved into the section on PEP314.
........
r46017 | george.yoshida | 2006-05-16 19:42:16 +0200 (Tue, 16 May 2006) | 2 lines
Update for 'ImportWarning'
........
r46018 | george.yoshida | 2006-05-16 20:07:00 +0200 (Tue, 16 May 2006) | 4 lines
Mention that Exception is now a subclass of BaseException.
Remove a sentence that says that BaseException inherits from BaseException.
(I guess this is just a copy & paste mistake.)
........
r46019 | george.yoshida | 2006-05-16 20:26:10 +0200 (Tue, 16 May 2006) | 2 lines
Document ImportWarning
........
r46020 | tim.peters | 2006-05-17 01:22:20 +0200 (Wed, 17 May 2006) | 2 lines
Whitespace normalization.
........
r46021 | tim.peters | 2006-05-17 01:24:08 +0200 (Wed, 17 May 2006) | 2 lines
Text files missing the SVN eol-style property.
........
r46022 | tim.peters | 2006-05-17 03:30:11 +0200 (Wed, 17 May 2006) | 2 lines
PyZlib_copy(), PyZlib_uncopy(): Repair leaks on the normal-case path.
........
r46023 | georg.brandl | 2006-05-17 16:06:07 +0200 (Wed, 17 May 2006) | 3 lines
Remove misleading comment about type-class unification.
........
r46024 | georg.brandl | 2006-05-17 16:11:36 +0200 (Wed, 17 May 2006) | 3 lines
Apply patch #1489784 from Michael Foord.
........
r46025 | georg.brandl | 2006-05-17 16:18:20 +0200 (Wed, 17 May 2006) | 3 lines
Fix typo in os.utime docstring (patch #1490189)
........
r46026 | georg.brandl | 2006-05-17 16:26:50 +0200 (Wed, 17 May 2006) | 3 lines
Patch #1490224: set time.altzone correctly on Cygwin.
........
r46027 | georg.brandl | 2006-05-17 16:45:06 +0200 (Wed, 17 May 2006) | 4 lines
Add global debug flag to cookielib to avoid heavy dependency on the logging module.
Resolves #1484758.
........
r46028 | georg.brandl | 2006-05-17 16:56:04 +0200 (Wed, 17 May 2006) | 3 lines
Patch #1486962: Several bugs in the turtle Tk demo module were fixed
and several features added, such as speed and geometry control.
........
r46029 | georg.brandl | 2006-05-17 17:17:00 +0200 (Wed, 17 May 2006) | 4 lines
Delay-import some large modules to speed up urllib2 import.
(fixes #1484793).
........
r46030 | georg.brandl | 2006-05-17 17:51:16 +0200 (Wed, 17 May 2006) | 3 lines
Patch #1180296: improve locale string formatting functions
........
r46032 | tim.peters | 2006-05-18 04:06:40 +0200 (Thu, 18 May 2006) | 2 lines
Whitespace normalization.
........
r46033 | georg.brandl | 2006-05-18 08:11:19 +0200 (Thu, 18 May 2006) | 3 lines
Amendments to patch #1484695.
........
r46034 | georg.brandl | 2006-05-18 08:18:06 +0200 (Thu, 18 May 2006) | 3 lines
Remove unused import.
........
r46035 | georg.brandl | 2006-05-18 08:33:27 +0200 (Thu, 18 May 2006) | 3 lines
Fix test_locale for platforms without a default thousands separator.
........
r46036 | neal.norwitz | 2006-05-18 08:51:46 +0200 (Thu, 18 May 2006) | 1 line
Little cleanup
........
r46037 | georg.brandl | 2006-05-18 09:01:27 +0200 (Thu, 18 May 2006) | 4 lines
Bug #1462152: file() now checks more thoroughly for invalid mode
strings and removes a possible "U" before passing the mode to the
C library function.
........
r46038 | georg.brandl | 2006-05-18 09:20:05 +0200 (Thu, 18 May 2006) | 3 lines
Bug #1490688: properly document %e, %f, %g format subtleties.
........
r46039 | vinay.sajip | 2006-05-18 09:28:58 +0200 (Thu, 18 May 2006) | 1 line
Changed status from "beta" to "production"; since logging has been part of the stdlib since 2.3, it should be safe to make this assertion ;-)
........
r46040 | ronald.oussoren | 2006-05-18 11:04:15 +0200 (Thu, 18 May 2006) | 2 lines
Fix some minor issues with the generated application bundles on MacOSX
........
r46041 | andrew.kuchling | 2006-05-19 02:03:55 +0200 (Fri, 19 May 2006) | 1 line
Typo fix; add clarifying word
........
r46044 | neal.norwitz | 2006-05-19 08:31:23 +0200 (Fri, 19 May 2006) | 3 lines
Fix #132 from Coverity, retval could have been derefed
if a continue inside a try failed.
........
r46045 | neal.norwitz | 2006-05-19 08:43:50 +0200 (Fri, 19 May 2006) | 2 lines
Fix #1474677, non-keyword argument following keyword.
........
r46046 | neal.norwitz | 2006-05-19 09:00:58 +0200 (Fri, 19 May 2006) | 4 lines
Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
I suppose this could be backported if anyone cares.
........
r46047 | neal.norwitz | 2006-05-19 09:05:01 +0200 (Fri, 19 May 2006) | 7 lines
Oops, I forgot to include this file in the last commit (46046):
Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
I suppose this could be backported if anyone cares.
........
r46050 | ronald.oussoren | 2006-05-19 20:17:31 +0200 (Fri, 19 May 2006) | 6 lines
* Change working directory to the users home
directory, that makes the file open/save
dialogs more useable.
* Don't use argv emulator, its not needed
for idle.
........
r46052 | tim.peters | 2006-05-19 21:16:34 +0200 (Fri, 19 May 2006) | 2 lines
Whitespace normalization.
........
r46054 | ronald.oussoren | 2006-05-20 08:17:01 +0200 (Sat, 20 May 2006) | 9 lines
Fix bug #1000914 (again).
This patches a file that is generated by bgen, however the code is now the
same as a current copy of bgen would generate. Without this patch most types
in the Carbon.CF module are unusable.
I haven't managed to coax bgen into generating a complete copy of _CFmodule.c
yet :-(, hence the manual patching.
........
r46055 | george.yoshida | 2006-05-20 17:36:19 +0200 (Sat, 20 May 2006) | 3 lines
- markup fix
- add clarifying words
........
r46057 | george.yoshida | 2006-05-20 18:29:14 +0200 (Sat, 20 May 2006) | 3 lines
- Add 'as' and 'with' as new keywords in 2.5.
- Regenerate keyword lists with reswords.py.
........
r46058 | george.yoshida | 2006-05-20 20:07:26 +0200 (Sat, 20 May 2006) | 2 lines
Apply patch #1492147 from Mike Foord.
........
r46059 | andrew.kuchling | 2006-05-20 21:25:16 +0200 (Sat, 20 May 2006) | 1 line
Minor edits
........
r46061 | george.yoshida | 2006-05-21 06:22:59 +0200 (Sun, 21 May 2006) | 2 lines
Fix the TeX compile error.
........
r46062 | george.yoshida | 2006-05-21 06:40:32 +0200 (Sun, 21 May 2006) | 2 lines
Apply patch #1492255 from Mike Foord.
........
r46063 | martin.v.loewis | 2006-05-22 10:48:14 +0200 (Mon, 22 May 2006) | 1 line
Patch 1490384: New Icons for the PC build.
........
r46064 | martin.v.loewis | 2006-05-22 11:15:18 +0200 (Mon, 22 May 2006) | 1 line
Patch #1492356: Port to Windows CE (patch set 1).
........
r46065 | tim.peters | 2006-05-22 13:29:41 +0200 (Mon, 22 May 2006) | 4 lines
Define SIZEOF_{DOUBLE,FLOAT} on Windows. Else
Michael Hudson's nice gimmicks for IEEE special
values (infinities, NaNs) don't work.
........
r46070 | bob.ippolito | 2006-05-22 16:31:24 +0200 (Mon, 22 May 2006) | 2 lines
GzipFile.readline performance improvement (~30-40%), patch #1281707
........
r46071 | bob.ippolito | 2006-05-22 17:22:46 +0200 (Mon, 22 May 2006) | 1 line
Revert gzip readline performance patch #1281707 until a more generic performance improvement can be found
........
r46073 | fredrik.lundh | 2006-05-22 17:35:12 +0200 (Mon, 22 May 2006) | 4 lines
docstring tweaks: count counts non-overlapping substrings, not
total number of occurences
........
r46075 | bob.ippolito | 2006-05-22 17:59:12 +0200 (Mon, 22 May 2006) | 1 line
Apply revised patch for GzipFile.readline performance #1281707
........
r46076 | fredrik.lundh | 2006-05-22 18:29:30 +0200 (Mon, 22 May 2006) | 3 lines
needforspeed: speed up unicode repeat, unicode string copy
........
r46079 | fredrik.lundh | 2006-05-22 19:12:58 +0200 (Mon, 22 May 2006) | 4 lines
needforspeed: use memcpy for "long" strings; use a better algorithm
for long repeats.
........
r46084 | tim.peters | 2006-05-22 21:17:04 +0200 (Mon, 22 May 2006) | 7 lines
PyUnicode_Join(): Recent code changes introduced new
compiler warnings on Windows (signed vs unsigned mismatch
in comparisons). Cleaned that up by switching more locals
to Py_ssize_t. Simplified overflow checking (it can _be_
simpler because while these things are declared as
Py_ssize_t, then should in fact never be negative).
........
r46085 | tim.peters | 2006-05-23 07:47:16 +0200 (Tue, 23 May 2006) | 3 lines
unicode_repeat(): Change type of local to Py_ssize_t,
since that's what it should be.
........
r46094 | fredrik.lundh | 2006-05-23 12:10:57 +0200 (Tue, 23 May 2006) | 3 lines
needforspeed: check first *and* last character before doing a full memcmp
........
r46095 | fredrik.lundh | 2006-05-23 12:12:21 +0200 (Tue, 23 May 2006) | 4 lines
needforspeed: fixed unicode "in" operator to use same implementation
approach as find/index
........
r46096 | richard.jones | 2006-05-23 12:37:38 +0200 (Tue, 23 May 2006) | 7 lines
Merge from rjones-funccall branch.
Applied patch zombie-frames-2.diff from sf patch 876206 with updates for
Python 2.5 and also modified to retain the free_list to avoid the 67%
slow-down in pybench recursion test. 5% speed up in function call pybench.
........
r46098 | ronald.oussoren | 2006-05-23 13:04:24 +0200 (Tue, 23 May 2006) | 2 lines
Avoid creating a mess when installing a framework for the second time.
........
r46101 | georg.brandl | 2006-05-23 13:17:21 +0200 (Tue, 23 May 2006) | 3 lines
PyErr_NewException now accepts a tuple of base classes as its
"base" parameter.
........
r46103 | ronald.oussoren | 2006-05-23 13:47:16 +0200 (Tue, 23 May 2006) | 3 lines
Disable linking extensions with -lpython2.5 for darwin. This should fix bug
#1487105.
........
r46104 | ronald.oussoren | 2006-05-23 14:01:11 +0200 (Tue, 23 May 2006) | 6 lines
Patch #1488098.
This patchs makes it possible to create a universal build on OSX 10.4 and use
the result to build extensions on 10.3. It also makes it possible to override
the '-arch' and '-isysroot' compiler arguments for specific extensions.
........
r46108 | andrew.kuchling | 2006-05-23 14:44:36 +0200 (Tue, 23 May 2006) | 1 line
Add some items; mention the sprint
........
r46109 | andrew.kuchling | 2006-05-23 14:47:01 +0200 (Tue, 23 May 2006) | 1 line
Mention string improvements
........
r46110 | andrew.kuchling | 2006-05-23 14:49:35 +0200 (Tue, 23 May 2006) | 4 lines
Use 'speed' instead of 'performance', because I agree with the argument
at http://zestyping.livejournal.com/193260.html that 'erformance' really means
something more general.
........
r46113 | ronald.oussoren | 2006-05-23 17:09:57 +0200 (Tue, 23 May 2006) | 2 lines
An improved script for building the binary distribution on MacOSX.
........
r46128 | richard.jones | 2006-05-23 20:28:17 +0200 (Tue, 23 May 2006) | 3 lines
Applied patch 1337051 by Neal Norwitz, saving 4 ints on frame objects.
........
r46129 | richard.jones | 2006-05-23 20:32:11 +0200 (Tue, 23 May 2006) | 1 line
fix broken merge
........
r46130 | bob.ippolito | 2006-05-23 20:41:17 +0200 (Tue, 23 May 2006) | 1 line
Update Misc/NEWS for gzip patch #1281707
........
r46131 | bob.ippolito | 2006-05-23 20:43:47 +0200 (Tue, 23 May 2006) | 1 line
Update Misc/NEWS for gzip patch #1281707
........
r46132 | fredrik.lundh | 2006-05-23 20:44:25 +0200 (Tue, 23 May 2006) | 7 lines
needforspeed: use append+reverse for rsplit, use "bloom filters" to
speed up splitlines and strip with charsets; etc. rsplit is now as
fast as split in all our tests (reverse takes no time at all), and
splitlines() is nearly as fast as a plain split("\n") in our tests.
and we're not done yet... ;-)
........
r46133 | tim.peters | 2006-05-23 20:45:30 +0200 (Tue, 23 May 2006) | 38 lines
Bug #1334662 / patch #1335972: int(string, base) wrong answers.
In rare cases of strings specifying true values near sys.maxint,
and oddball bases (not decimal or a power of 2), int(string, base)
could deliver insane answers. This repairs all such problems, and
also speeds string->int significantly. On my box, here are %
speedups for decimal strings of various lengths:
length speedup
------ -------
1 12.4%
2 15.7%
3 20.6%
4 28.1%
5 33.2%
6 37.5%
7 41.9%
8 46.3%
9 51.2%
10 19.5%
11 19.9%
12 23.9%
13 23.7%
14 23.3%
15 24.9%
16 25.3%
17 28.3%
18 27.9%
19 35.7%
Note that the difference between 9 and 10 is the difference between
short and long Python ints on a 32-bit box. The patch doesn't
actually do anything to speed conversion to long: the speedup is
due to detecting "unsigned long" overflow more quickly.
This is a bugfix candidate, but it's a non-trivial patch and it
would be painful to separate the "bug fix" from the "speed up" parts.
........
r46134 | bob.ippolito | 2006-05-23 20:46:41 +0200 (Tue, 23 May 2006) | 1 line
Patch #1493701: performance enhancements for struct module.
........
r46136 | andrew.kuchling | 2006-05-23 21:00:45 +0200 (Tue, 23 May 2006) | 1 line
Remove duplicate item
........
r46141 | bob.ippolito | 2006-05-23 21:09:51 +0200 (Tue, 23 May 2006) | 1 line
revert #1493701
........
r46142 | bob.ippolito | 2006-05-23 21:11:34 +0200 (Tue, 23 May 2006) | 1 line
patch #1493701: performance enhancements for struct module
........
r46144 | bob.ippolito | 2006-05-23 21:12:41 +0200 (Tue, 23 May 2006) | 1 line
patch #1493701: performance enhancements for struct module
........
r46148 | bob.ippolito | 2006-05-23 21:25:52 +0200 (Tue, 23 May 2006) | 1 line
fix linking issue, warnings, in struct
........
r46149 | andrew.kuchling | 2006-05-23 21:29:38 +0200 (Tue, 23 May 2006) | 1 line
Add two items
........
r46150 | bob.ippolito | 2006-05-23 21:31:23 +0200 (Tue, 23 May 2006) | 1 line
forward declaration for PyStructType
........
r46151 | bob.ippolito | 2006-05-23 21:32:25 +0200 (Tue, 23 May 2006) | 1 line
fix typo in _struct
........
r46152 | andrew.kuchling | 2006-05-23 21:32:35 +0200 (Tue, 23 May 2006) | 1 line
Add item
........
r46153 | tim.peters | 2006-05-23 21:34:37 +0200 (Tue, 23 May 2006) | 3 lines
Get the Windows build working again (recover from
`struct` module changes).
........
r46155 | fredrik.lundh | 2006-05-23 21:47:35 +0200 (Tue, 23 May 2006) | 3 lines
return 0 on misses, not -1.
........
r46156 | tim.peters | 2006-05-23 23:51:35 +0200 (Tue, 23 May 2006) | 4 lines
test_struct grew weird behavior under regrtest.py -R,
due to a module-level cache. Clearing the cache should
make it stop showing up in refleak reports.
........
r46157 | tim.peters | 2006-05-23 23:54:23 +0200 (Tue, 23 May 2006) | 2 lines
Whitespace normalization.
........
r46158 | tim.peters | 2006-05-23 23:55:53 +0200 (Tue, 23 May 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46161 | fredrik.lundh | 2006-05-24 12:20:36 +0200 (Wed, 24 May 2006) | 3 lines
use Py_ssize_t for string indexes (thanks, neal!)
........
r46173 | fredrik.lundh | 2006-05-24 16:28:11 +0200 (Wed, 24 May 2006) | 14 lines
needforspeed: use "fastsearch" for count and findstring helpers. this
results in a 2.5x speedup on the stringbench count tests, and a 20x (!)
speedup on the stringbench search/find/contains test, compared to 2.5a2.
for more on the algorithm, see:
http://effbot.org/zone/stringlib.htm
if you get weird results, you can disable the new algoritm by undefining
USE_FAST in Objects/unicodeobject.c.
enjoy /F
........
r46182 | fredrik.lundh | 2006-05-24 17:11:01 +0200 (Wed, 24 May 2006) | 3 lines
needforspeedindeed: use fastsearch also for __contains__
........
r46184 | bob.ippolito | 2006-05-24 17:32:06 +0200 (Wed, 24 May 2006) | 1 line
refactor unpack, add unpack_from
........
r46189 | fredrik.lundh | 2006-05-24 18:35:18 +0200 (Wed, 24 May 2006) | 4 lines
needforspeed: refactored the replace code slightly; special-case
constant-length changes; use fastsearch to locate the first match.
........
r46198 | andrew.dalke | 2006-05-24 20:55:37 +0200 (Wed, 24 May 2006) | 10 lines
Added a slew of test for string replace, based various corner cases from
the Need For Speed sprint coding. Includes commented out overflow tests
which will be uncommented once the code is fixed.
This test will break the 8-bit string tests because
"".replace("", "A") == "" when it should == "A"
We have a fix for it, which should be added tomorrow.
........
r46200 | tim.peters | 2006-05-24 22:27:18 +0200 (Wed, 24 May 2006) | 2 lines
We can't leave the checked-in tests broken.
........
r46201 | tim.peters | 2006-05-24 22:29:44 +0200 (Wed, 24 May 2006) | 2 lines
Whitespace normalization.
........
r46202 | tim.peters | 2006-05-24 23:00:45 +0200 (Wed, 24 May 2006) | 4 lines
Disable the damn empty-string replace test -- it can't
be make to pass now for unicode if it passes for str, or
vice versa.
........
r46203 | tim.peters | 2006-05-24 23:10:40 +0200 (Wed, 24 May 2006) | 58 lines
Heavily fiddled variant of patch #1442927: PyLong_FromString optimization.
``long(str, base)`` is now up to 6x faster for non-power-of-2 bases. The
largest speedup is for inputs with about 1000 decimal digits. Conversion
from non-power-of-2 bases remains quadratic-time in the number of input
digits (it was and remains linear-time for bases 2, 4, 8, 16 and 32).
Speedups at various lengths for decimal inputs, comparing 2.4.3 with
current trunk. Note that it's actually a bit slower for 1-digit strings:
len speedup
---- -------
1 -4.5%
2 4.6%
3 8.3%
4 12.7%
5 16.9%
6 28.6%
7 35.5%
8 44.3%
9 46.6%
10 55.3%
11 65.7%
12 77.7%
13 73.4%
14 75.3%
15 85.2%
16 103.0%
17 95.1%
18 112.8%
19 117.9%
20 128.3%
30 174.5%
40 209.3%
50 236.3%
60 254.3%
70 262.9%
80 295.8%
90 297.3%
100 324.5%
200 374.6%
300 403.1%
400 391.1%
500 388.7%
600 440.6%
700 468.7%
800 498.0%
900 507.2%
1000 501.2%
2000 450.2%
3000 463.2%
4000 452.5%
5000 440.6%
6000 439.6%
7000 424.8%
8000 418.1%
9000 417.7%
........
r46204 | andrew.kuchling | 2006-05-25 02:23:03 +0200 (Thu, 25 May 2006) | 1 line
Minor edits; add an item
........
r46205 | fred.drake | 2006-05-25 04:42:25 +0200 (Thu, 25 May 2006) | 3 lines
fix broken links in PDF
(SF patch #1281291, contributed by Rory Yorke)
........
r46208 | walter.doerwald | 2006-05-25 10:53:28 +0200 (Thu, 25 May 2006) | 2 lines
Replace tab inside comment with space.
........
r46209 | thomas.wouters | 2006-05-25 13:25:51 +0200 (Thu, 25 May 2006) | 4 lines
Fix #1488915, Multiple dots in relative import statement raise SyntaxError.
........
r46210 | thomas.wouters | 2006-05-25 13:26:25 +0200 (Thu, 25 May 2006) | 5 lines
Update graminit.c for the fix for #1488915, Multiple dots in relative import
statement raise SyntaxError, and add testcase.
........
r46211 | andrew.kuchling | 2006-05-25 14:27:59 +0200 (Thu, 25 May 2006) | 1 line
Add entry; and fix a typo
........
r46214 | fredrik.lundh | 2006-05-25 17:22:03 +0200 (Thu, 25 May 2006) | 7 lines
needforspeed: speed up upper and lower for 8-bit string objects.
(the unicode versions of these are still 2x faster on windows,
though...)
based on work by Andrew Dalke, with tweaks by yours truly.
........
r46216 | fredrik.lundh | 2006-05-25 17:49:45 +0200 (Thu, 25 May 2006) | 5 lines
needforspeed: make new upper/lower work properly for single-character
strings too... (thanks to georg brandl for spotting the exact problem
faster than anyone else)
........
r46217 | kristjan.jonsson | 2006-05-25 17:53:30 +0200 (Thu, 25 May 2006) | 1 line
Added a new macro, Py_IS_FINITE(X). On windows there is an intrinsic for this and it is more efficient than to use !Py_IS_INFINITE(X) && !Py_IS_NAN(X). No change on other platforms
........
r46219 | fredrik.lundh | 2006-05-25 18:10:12 +0200 (Thu, 25 May 2006) | 4 lines
needforspeed: _toupper/_tolower is a SUSv2 thing; fall back on ISO C
versions if they're not defined.
........
r46220 | andrew.kuchling | 2006-05-25 18:23:15 +0200 (Thu, 25 May 2006) | 1 line
Fix comment typos
........
r46221 | andrew.dalke | 2006-05-25 18:30:52 +0200 (Thu, 25 May 2006) | 2 lines
Added tests for implementation error we came up with in the need for speed sprint.
........
r46222 | andrew.kuchling | 2006-05-25 18:34:54 +0200 (Thu, 25 May 2006) | 1 line
Fix another typo
........
r46223 | kristjan.jonsson | 2006-05-25 18:39:27 +0200 (Thu, 25 May 2006) | 1 line
Fix incorrect documentation for the Py_IS_FINITE(X) macro.
........
r46224 | fredrik.lundh | 2006-05-25 18:46:54 +0200 (Thu, 25 May 2006) | 3 lines
needforspeed: check for overflow in replace (from Andrew Dalke)
........
r46226 | fredrik.lundh | 2006-05-25 19:08:14 +0200 (Thu, 25 May 2006) | 5 lines
needforspeed: new replace implementation by Andrew Dalke. replace is
now about 3x faster on my machine, for the replace tests from string-
bench.
........
r46227 | tim.peters | 2006-05-25 19:34:03 +0200 (Thu, 25 May 2006) | 5 lines
A new table to help string->integer conversion was added yesterday to
both mystrtoul.c and longobject.c. Share the table instead. Also
cut its size by 64 entries (they had been used for an inscrutable
trick originally, but the code no longer tries to use that trick).
........
r46229 | andrew.dalke | 2006-05-25 19:53:00 +0200 (Thu, 25 May 2006) | 11 lines
Fixed problem identified by Georg. The special-case in-place code for replace
made a copy of the string using PyString_FromStringAndSize(s, n) and modify
the copied string in-place. However, 1 (and 0) character strings are shared
from a cache. This cause "A".replace("A", "a") to change the cached version
of "A" -- used by everyone.
Now may the copy with NULL as the string and do the memcpy manually. I've
added regression tests to check if this happens in the future. Perhaps
there should be a PyString_Copy for this case?
........
r46230 | fredrik.lundh | 2006-05-25 19:55:31 +0200 (Thu, 25 May 2006) | 4 lines
needforspeed: use "fastsearch" for count. this results in a 3x speedup
for the related stringbench tests.
........
r46231 | andrew.dalke | 2006-05-25 20:03:25 +0200 (Thu, 25 May 2006) | 4 lines
Code had returned an ssize_t, upcast to long, then converted with PyInt_FromLong.
Now using PyInt_FromSsize_t.
........
r46233 | andrew.kuchling | 2006-05-25 20:11:16 +0200 (Thu, 25 May 2006) | 1 line
Comment typo
........
r46234 | andrew.dalke | 2006-05-25 20:18:39 +0200 (Thu, 25 May 2006) | 4 lines
Added overflow test for adding two (very) large strings where the
new string is over max Py_ssize_t. I have no way to test it on my
box or any box I have access to. At least it doesn't break anything.
........
r46235 | bob.ippolito | 2006-05-25 20:20:23 +0200 (Thu, 25 May 2006) | 1 line
Faster path for PyLong_FromLongLong, using PyLong_FromLong algorithm
........
r46238 | georg.brandl | 2006-05-25 20:44:09 +0200 (Thu, 25 May 2006) | 3 lines
Guard the _active.remove() call to avoid errors when there is no _active list.
........
r46239 | fredrik.lundh | 2006-05-25 20:44:29 +0200 (Thu, 25 May 2006) | 4 lines
needforspeed: use fastsearch also for find/index and contains. the
related tests are now about 10x faster.
........
r46240 | bob.ippolito | 2006-05-25 20:44:50 +0200 (Thu, 25 May 2006) | 1 line
Struct now unpacks to PY_LONG_LONG directly when possible, also include #ifdef'ed out code that will return int instead of long when in bounds (not active since it's an API and doc change)
........
r46241 | jack.diederich | 2006-05-25 20:47:15 +0200 (Thu, 25 May 2006) | 1 line
* eliminate warning by reverting tmp_s type to 'const char*'
........
r46242 | bob.ippolito | 2006-05-25 21:03:19 +0200 (Thu, 25 May 2006) | 1 line
Fix Cygwin compiler issue
........
r46243 | bob.ippolito | 2006-05-25 21:15:27 +0200 (Thu, 25 May 2006) | 1 line
fix a struct regression where long would be returned for short unsigned integers
........
r46244 | georg.brandl | 2006-05-25 21:15:31 +0200 (Thu, 25 May 2006) | 4 lines
Replace PyObject_CallFunction calls with only object args
with PyObject_CallFunctionObjArgs, which is 30% faster.
........
r46245 | fredrik.lundh | 2006-05-25 21:19:05 +0200 (Thu, 25 May 2006) | 3 lines
needforspeed: use insert+reverse instead of append
........
r46246 | bob.ippolito | 2006-05-25 21:33:38 +0200 (Thu, 25 May 2006) | 1 line
Use LONG_MIN and LONG_MAX to check Python integer bounds instead of the incorrect INT_MIN and INT_MAX
........
r46248 | bob.ippolito | 2006-05-25 21:56:56 +0200 (Thu, 25 May 2006) | 1 line
Use faster struct pack/unpack functions for the endian table that matches the host's
........
r46249 | bob.ippolito | 2006-05-25 21:59:56 +0200 (Thu, 25 May 2006) | 1 line
enable darwin/x86 support for libffi and hence ctypes (doesn't yet support --enable-universalsdk)
........
r46252 | georg.brandl | 2006-05-25 22:28:10 +0200 (Thu, 25 May 2006) | 4 lines
Someone seems to just have copy-pasted the docs of
tp_compare to tp_richcompare ;)
........
r46253 | brett.cannon | 2006-05-25 22:44:08 +0200 (Thu, 25 May 2006) | 2 lines
Swap out bare malloc()/free() use for PyMem_MALLOC()/PyMem_FREE() .
........
r46254 | bob.ippolito | 2006-05-25 22:52:38 +0200 (Thu, 25 May 2006) | 1 line
squelch gcc4 darwin/x86 compiler warnings
........
r46255 | bob.ippolito | 2006-05-25 23:09:45 +0200 (Thu, 25 May 2006) | 1 line
fix test_float regression and 64-bit size mismatch issue
........
r46256 | georg.brandl | 2006-05-25 23:11:56 +0200 (Thu, 25 May 2006) | 3 lines
Add a x-ref to newer calling APIs.
........
r46257 | ronald.oussoren | 2006-05-25 23:30:54 +0200 (Thu, 25 May 2006) | 2 lines
Fix minor typo in prep_cif.c
........
r46259 | brett.cannon | 2006-05-25 23:33:11 +0200 (Thu, 25 May 2006) | 4 lines
Change test_values so that it compares the lowercasing of group names since getgrall() can return all lowercase names while getgrgid() returns proper casing.
Discovered on Ubuntu 5.04 (custom).
........
r46261 | tim.peters | 2006-05-25 23:50:17 +0200 (Thu, 25 May 2006) | 7 lines
Some Win64 pre-release in 2000 didn't support
QueryPerformanceCounter(), but we believe Win64 does
support it now. So use in time.clock().
It would be peachy if someone with a Win64 box tried
this ;-)
........
r46262 | tim.peters | 2006-05-25 23:52:19 +0200 (Thu, 25 May 2006) | 2 lines
Whitespace normalization.
........
r46263 | bob.ippolito | 2006-05-25 23:58:05 +0200 (Thu, 25 May 2006) | 1 line
Add missing files from x86 darwin ctypes patch
........
r46264 | brett.cannon | 2006-05-26 00:00:14 +0200 (Fri, 26 May 2006) | 2 lines
Move over to use of METH_O and METH_NOARGS.
........
r46265 | tim.peters | 2006-05-26 00:25:25 +0200 (Fri, 26 May 2006) | 3 lines
Repair idiot typo, and complete the job of trying to
use the Windows time.clock() implementation on Win64.
........
r46266 | tim.peters | 2006-05-26 00:28:46 +0200 (Fri, 26 May 2006) | 9 lines
Patch #1494387: SVN longobject.c compiler warnings
The SIGCHECK macro defined here has always been bizarre, but
it apparently causes compiler warnings on "Sun Studio 11".
I believe the warnings are bogus, but it doesn't hurt to make
the macro definition saner.
Bugfix candidate (but I'm not going to bother).
........
r46268 | fredrik.lundh | 2006-05-26 01:27:53 +0200 (Fri, 26 May 2006) | 8 lines
needforspeed: partition for 8-bit strings. for some simple tests,
this is on par with a corresponding find, and nearly twice as fast
as split(sep, 1)
full tests, a unicode version, and documentation will follow to-
morrow.
........
r46271 | andrew.kuchling | 2006-05-26 03:46:22 +0200 (Fri, 26 May 2006) | 1 line
Add Soc student
........
r46272 | ronald.oussoren | 2006-05-26 10:41:25 +0200 (Fri, 26 May 2006) | 3 lines
Without this patch OSX users couldn't add new help sources because the code
tried to update one item in a tuple.
........
r46273 | fredrik.lundh | 2006-05-26 10:54:28 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: partition implementation, part two.
feel free to improve the documentation and the docstrings.
........
r46274 | georg.brandl | 2006-05-26 11:05:54 +0200 (Fri, 26 May 2006) | 3 lines
Clarify docs for str.partition().
........
r46278 | fredrik.lundh | 2006-05-26 11:46:59 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: use METH_O for argument handling, which made partition some
~15% faster for the current tests (which is noticable faster than a corre-
sponding find call). thanks to neal-who-never-sleeps for the tip.
........
r46280 | fredrik.lundh | 2006-05-26 12:27:17 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: use Py_ssize_t for the fastsearch counter and skip
length (thanks, neal!). and yes, I've verified that this doesn't
slow things down ;-)
........
r46285 | andrew.dalke | 2006-05-26 13:11:38 +0200 (Fri, 26 May 2006) | 2 lines
Added a few more test cases for whitespace split. These strings have leading whitespace.
........
r46286 | jack.diederich | 2006-05-26 13:15:17 +0200 (Fri, 26 May 2006) | 1 line
use Py_ssize_t in places that may need it
........
r46287 | andrew.dalke | 2006-05-26 13:15:22 +0200 (Fri, 26 May 2006) | 2 lines
Added split whitespace checks for characters other than space.
........
r46288 | ronald.oussoren | 2006-05-26 13:17:55 +0200 (Fri, 26 May 2006) | 2 lines
Fix buglet in postinstall script, it would generate an invalid .cshrc file.
........
r46290 | georg.brandl | 2006-05-26 13:26:11 +0200 (Fri, 26 May 2006) | 3 lines
Add "partition" to UserString.
........
r46291 | fredrik.lundh | 2006-05-26 13:29:39 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: added Py_LOCAL macro, based on the LOCAL macro used
for SRE and others. applied Py_LOCAL to relevant portion of ceval,
which gives a 1-2% speedup on my machine. ymmv.
........
r46292 | jack.diederich | 2006-05-26 13:37:20 +0200 (Fri, 26 May 2006) | 1 line
when generating python code prefer to generate valid python code
........
r46293 | fredrik.lundh | 2006-05-26 13:38:15 +0200 (Fri, 26 May 2006) | 3 lines
use Py_LOCAL also for string and unicode objects
........
r46294 | ronald.oussoren | 2006-05-26 13:38:39 +0200 (Fri, 26 May 2006) | 12 lines
- Search the sqlite specific search directories
after the normal include directories when looking
for the version of sqlite to use.
- On OSX:
* Extract additional include and link directories
from the CFLAGS and LDFLAGS, if the user has
bothered to specify them we might as wel use them.
* Add '-Wl,-search_paths_first' to the extra_link_args
for readline and sqlite. This makes it possible to
use a static library to override the system provided
dynamic library.
........
r46295 | ronald.oussoren | 2006-05-26 13:43:26 +0200 (Fri, 26 May 2006) | 6 lines
Integrate installing a framework in the 'make install'
target. Until now users had to use 'make frameworkinstall'
to install python when it is configured with '--enable-framework'.
This tends to confuse users that don't hunt for readme files
hidden in platform specific directories :-)
........
r46297 | fredrik.lundh | 2006-05-26 13:54:04 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: added PY_LOCAL_AGGRESSIVE macro to enable "aggressive"
LOCAL inlining; also added some missing whitespace
........
r46298 | andrew.kuchling | 2006-05-26 14:01:44 +0200 (Fri, 26 May 2006) | 1 line
Typo fixes
........
r46299 | fredrik.lundh | 2006-05-26 14:01:49 +0200 (Fri, 26 May 2006) | 4 lines
Py_LOCAL shouldn't be used for data; it works for some .NET 2003 compilers,
but Trent's copy thinks that it's an anachronism...
........
r46300 | martin.blais | 2006-05-26 14:03:27 +0200 (Fri, 26 May 2006) | 12 lines
Support for buffer protocol for socket and struct.
* Added socket.recv_buf() and socket.recvfrom_buf() methods, that use the buffer
protocol (send and sendto already did).
* Added struct.pack_to(), that is the corresponding buffer compatible method to
unpack_from().
* Fixed minor typos in arraymodule.
........
r46302 | ronald.oussoren | 2006-05-26 14:23:20 +0200 (Fri, 26 May 2006) | 6 lines
- Remove previous version of the binary distribution script for OSX
- Some small bugfixes for the IDLE.app wrapper
- Tweaks to build-installer to ensure that python gets build in the right way,
including sqlite3.
- Updated readme files
........
r46305 | tim.peters | 2006-05-26 14:26:21 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46307 | andrew.dalke | 2006-05-26 14:28:15 +0200 (Fri, 26 May 2006) | 7 lines
I like tests.
The new split functions use a preallocated list. Added tests which exceed
the preallocation size, to exercise list appends/resizes.
Also added more edge case tests.
........
r46308 | andrew.dalke | 2006-05-26 14:31:00 +0200 (Fri, 26 May 2006) | 2 lines
Test cases for off-by-one errors in string split with multicharacter pattern.
........
r46309 | tim.peters | 2006-05-26 14:31:20 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46313 | andrew.kuchling | 2006-05-26 14:39:48 +0200 (Fri, 26 May 2006) | 1 line
Add str.partition()
........
r46314 | bob.ippolito | 2006-05-26 14:52:53 +0200 (Fri, 26 May 2006) | 1 line
quick hack to fix busted binhex test
........
r46316 | andrew.dalke | 2006-05-26 15:05:55 +0200 (Fri, 26 May 2006) | 2 lines
Added more rstrip tests, including for prealloc'ed arrays
........
r46320 | bob.ippolito | 2006-05-26 15:15:44 +0200 (Fri, 26 May 2006) | 1 line
fix #1229380 No struct.pack exception for some out of range integers
........
r46325 | tim.peters | 2006-05-26 15:39:17 +0200 (Fri, 26 May 2006) | 2 lines
Use open() to open files (was using file()).
........
r46327 | andrew.dalke | 2006-05-26 16:00:45 +0200 (Fri, 26 May 2006) | 37 lines
Changes to string.split/rsplit on whitespace to preallocate space in the
results list.
Originally it allocated 0 items and used the list growth during append. Now
it preallocates 12 items so the first few appends don't need list reallocs.
("Here are some words ."*2).split(None, 1) is 7% faster
("Here are some words ."*2).split() is is 15% faster
(Your milage may vary, see dealership for details.)
File parsing like this
for line in f:
count += len(line.split())
is also about 15% faster. There is a slowdown of about 3% for large
strings because of the additional overhead of checking if the append is
to a preallocated region of the list or not. This will be the rare case.
It could be improved with special case code but we decided it was not
useful enough.
There is a cost of 12*sizeof(PyObject *) bytes per list. For the normal
case of file parsing this is not a problem because of the lists have
a short lifetime. We have not come up with cases where this is a problem
in real life.
I chose 12 because human text averages about 11 words per line in books,
one of my data sets averages 6.2 words with a final peak at 11 words per
line, and I work with a tab delimited data set with 8 tabs per line (or
9 words per line). 12 encompasses all of these.
Also changed the last rstrip code to append then reverse, rather than
doing insert(0). The strip() and rstrip() times are now comparable.
........
r46328 | tim.peters | 2006-05-26 16:02:05 +0200 (Fri, 26 May 2006) | 5 lines
Explicitly close files. I'm trying to stop the frequent spurious test_tarfile
failures on Windows buildbots, but it's hard to know how since the regrtest
failure output is useless here, and it never fails when a buildbot slave runs
test_tarfile the second time in verbose mode.
........
r46329 | andrew.kuchling | 2006-05-26 16:03:41 +0200 (Fri, 26 May 2006) | 1 line
Add buffer support for struct, socket
........
r46330 | andrew.kuchling | 2006-05-26 16:04:19 +0200 (Fri, 26 May 2006) | 1 line
Typo fix
........
r46331 | bob.ippolito | 2006-05-26 16:07:23 +0200 (Fri, 26 May 2006) | 1 line
Fix distutils so that libffi will cross-compile between darwin/x86 and darwin/ppc
........
r46333 | bob.ippolito | 2006-05-26 16:23:21 +0200 (Fri, 26 May 2006) | 1 line
Fix _struct typo that broke some 64-bit platforms
........
r46335 | bob.ippolito | 2006-05-26 16:29:35 +0200 (Fri, 26 May 2006) | 1 line
Enable PY_USE_INT_WHEN_POSSIBLE in struct
........
r46343 | andrew.dalke | 2006-05-26 17:21:01 +0200 (Fri, 26 May 2006) | 2 lines
Eeked out another 3% or so performance in split whitespace by cleaning up the algorithm.
........
r46352 | andrew.dalke | 2006-05-26 18:22:52 +0200 (Fri, 26 May 2006) | 3 lines
Test for more edge strip cases; leading and trailing separator gets removed
even with strip(..., 0)
........
r46354 | bob.ippolito | 2006-05-26 18:23:28 +0200 (Fri, 26 May 2006) | 1 line
fix signed/unsigned mismatch in struct
........
r46355 | steve.holden | 2006-05-26 18:27:59 +0200 (Fri, 26 May 2006) | 5 lines
Add -t option to allow easy test selection.
Action verbose option correctly.
Tweak operation counts. Add empty and new instances tests.
Enable comparisons across different warp factors. Change version.
........
r46356 | fredrik.lundh | 2006-05-26 18:32:42 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: use Py_LOCAL on a few more locals in stringobject.c
........
r46357 | thomas.heller | 2006-05-26 18:42:44 +0200 (Fri, 26 May 2006) | 4 lines
For now, I gave up with automatic conversion of reST to Python-latex,
so I'm writing this in latex now.
Skeleton for the ctypes reference.
........
r46358 | tim.peters | 2006-05-26 18:49:28 +0200 (Fri, 26 May 2006) | 3 lines
Repair Windows compiler warnings about mixing
signed and unsigned integral types in comparisons.
........
r46359 | tim.peters | 2006-05-26 18:52:04 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46360 | tim.peters | 2006-05-26 18:53:04 +0200 (Fri, 26 May 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46362 | fredrik.lundh | 2006-05-26 19:04:58 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: stringlib refactoring (in progress)
........
r46363 | thomas.heller | 2006-05-26 19:18:33 +0200 (Fri, 26 May 2006) | 1 line
Write some docs.
........
r46364 | fredrik.lundh | 2006-05-26 19:22:38 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: stringlib refactoring (in progress)
........
r46366 | fredrik.lundh | 2006-05-26 19:26:39 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: cleanup
........
r46367 | fredrik.lundh | 2006-05-26 19:31:41 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: remove remaining USE_FAST macros; if fastsearch was
broken, someone would have noticed by now ;-)
........
r46368 | steve.holden | 2006-05-26 19:41:32 +0200 (Fri, 26 May 2006) | 5 lines
Use minimum calibration time rather than avergae to avoid
the illusion of negative run times. Halt with an error if
run times go below 10 ms, indicating that results will be
unreliable.
........
r46370 | thomas.heller | 2006-05-26 19:47:40 +0200 (Fri, 26 May 2006) | 2 lines
Reordered, and wrote more docs.
........
r46372 | georg.brandl | 2006-05-26 20:03:31 +0200 (Fri, 26 May 2006) | 9 lines
Need for speed: Patch #921466 : sys.path_importer_cache is now used to cache valid and
invalid file paths for the built-in import machinery which leads to
fewer open calls on startup.
Also fix issue with PEP 302 style import hooks which lead to more open()
calls than necessary.
........
r46373 | fredrik.lundh | 2006-05-26 20:05:34 +0200 (Fri, 26 May 2006) | 3 lines
removed unnecessary include
........
r46377 | fredrik.lundh | 2006-05-26 20:15:38 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: added rpartition implementation
........
r46380 | fredrik.lundh | 2006-05-26 20:24:15 +0200 (Fri, 26 May 2006) | 5 lines
needspeed: rpartition documentation, tests, and a bug fixes.
feel free to add more tests and improve the documentation.
........
r46381 | steve.holden | 2006-05-26 20:26:21 +0200 (Fri, 26 May 2006) | 4 lines
Revert tests to MAL's original round sizes to retiain comparability
from long ago and far away. Stop calling this pybench 1.4 because it
isn't. Remove the empty test, which was a bad idea.
........
r46387 | andrew.kuchling | 2006-05-26 20:41:18 +0200 (Fri, 26 May 2006) | 1 line
Add rpartition() and path caching
........
r46388 | andrew.dalke | 2006-05-26 21:02:09 +0200 (Fri, 26 May 2006) | 10 lines
substring split now uses /F's fast string matching algorithm.
(If compiled without FAST search support, changed the pre-memcmp test
to check the last character as well as the first. This gave a 25%
speedup for my test case.)
Rewrote the split algorithms so they stop when maxsplit gets to 0.
Previously they did a string match first then checked if the maxsplit
was reached. The new way prevents a needless string search.
........
r46391 | brett.cannon | 2006-05-26 21:04:47 +0200 (Fri, 26 May 2006) | 2 lines
Change C spacing to 4 spaces by default to match PEP 7 for new C files.
........
r46392 | georg.brandl | 2006-05-26 21:04:47 +0200 (Fri, 26 May 2006) | 3 lines
Exception isn't the root of all exception classes anymore.
........
r46397 | fredrik.lundh | 2006-05-26 21:23:21 +0200 (Fri, 26 May 2006) | 3 lines
added rpartition method to UserString class
........
r46398 | fredrik.lundh | 2006-05-26 21:24:53 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: stringlib refactoring, continued. added count and
find helpers; updated unicodeobject to use stringlib_count
........
r46400 | fredrik.lundh | 2006-05-26 21:29:05 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: stringlib refactoring: use stringlib/find for unicode
find
........
r46403 | fredrik.lundh | 2006-05-26 21:33:03 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: use a macro to fix slice indexes
........
r46404 | thomas.heller | 2006-05-26 21:43:45 +0200 (Fri, 26 May 2006) | 1 line
Write more docs.
........
r46406 | fredrik.lundh | 2006-05-26 21:48:07 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: stringlib refactoring: use stringlib/find for string find
........
r46407 | andrew.kuchling | 2006-05-26 21:51:10 +0200 (Fri, 26 May 2006) | 1 line
Comment typo
........
r46409 | georg.brandl | 2006-05-26 22:04:44 +0200 (Fri, 26 May 2006) | 3 lines
Replace Py_BuildValue("OO") by PyTuple_Pack.
........
r46411 | georg.brandl | 2006-05-26 22:14:47 +0200 (Fri, 26 May 2006) | 2 lines
Patch #1492218: document None being a constant.
........
r46415 | georg.brandl | 2006-05-26 22:22:50 +0200 (Fri, 26 May 2006) | 3 lines
Simplify calling.
........
r46416 | andrew.dalke | 2006-05-26 22:25:22 +0200 (Fri, 26 May 2006) | 4 lines
Added limits to the replace code so it does not count all of the matching
patterns in a string, only the number needed by the max limit.
........
r46417 | bob.ippolito | 2006-05-26 22:25:23 +0200 (Fri, 26 May 2006) | 1 line
enable all of the struct tests, use ssize_t, fix some whitespace
........
r46418 | tim.peters | 2006-05-26 22:56:56 +0200 (Fri, 26 May 2006) | 2 lines
Record Iceland sprint attendees.
........
r46421 | tim.peters | 2006-05-26 23:51:13 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46422 | steve.holden | 2006-05-27 00:17:54 +0200 (Sat, 27 May 2006) | 2 lines
Add Richard Tew to developers
........
r46423 | steve.holden | 2006-05-27 00:33:20 +0200 (Sat, 27 May 2006) | 2 lines
Update help text and documentaition.
........
r46424 | steve.holden | 2006-05-27 00:39:27 +0200 (Sat, 27 May 2006) | 2 lines
Blasted typos ...
........
r46425 | andrew.dalke | 2006-05-27 00:49:03 +0200 (Sat, 27 May 2006) | 2 lines
Added description of why splitlines doesn't use the prealloc strategy
........
r46426 | tim.peters | 2006-05-27 01:14:37 +0200 (Sat, 27 May 2006) | 19 lines
Patch 1145039.
set_exc_info(), reset_exc_info(): By exploiting the
likely (who knows?) invariant that when an exception's
`type` is NULL, its `value` and `traceback` are also NULL,
save some cycles in heavily-executed code.
This is a "a kronar saved is a kronar earned" patch: the
speedup isn't reliably measurable, but it obviously does
reduce the operation count in the normal (no exception
raised) path through PyEval_EvalFrameEx().
The tim-exc_sanity branch tries to push this harder, but
is still blowing up (at least in part due to pre-existing
subtle bugs that appear to have no other visible
consequences!).
Not a bugfix candidate.
........
r46429 | steve.holden | 2006-05-27 02:51:52 +0200 (Sat, 27 May 2006) | 2 lines
Reinstate new-style object tests.
........
r46430 | neal.norwitz | 2006-05-27 07:18:57 +0200 (Sat, 27 May 2006) | 1 line
Fix compiler warning (and whitespace) on Mac OS 10.4. (A lot of this code looked duplicated, I wonder if a utility function could help reduce the duplication here.)
........
r46431 | neal.norwitz | 2006-05-27 07:21:30 +0200 (Sat, 27 May 2006) | 4 lines
Fix Coverity warnings.
- Check the correct variable (str_obj, not str) for NULL
- sep_len was already verified it wasn't 0
........
r46432 | martin.v.loewis | 2006-05-27 10:36:52 +0200 (Sat, 27 May 2006) | 2 lines
Patch 1494554: Update numeric properties to Unicode 4.1.
........
r46433 | martin.v.loewis | 2006-05-27 10:54:29 +0200 (Sat, 27 May 2006) | 2 lines
Explain why 'consumed' is initialized.
........
r46436 | fredrik.lundh | 2006-05-27 12:05:10 +0200 (Sat, 27 May 2006) | 3 lines
needforspeed: more stringlib refactoring
........
r46438 | fredrik.lundh | 2006-05-27 12:39:48 +0200 (Sat, 27 May 2006) | 5 lines
needforspeed: backed out the Py_LOCAL-isation of ceval; the massive in-
lining killed performance on certain Intel boxes, and the "aggressive"
macro itself gives most of the benefits on others.
........
r46439 | andrew.dalke | 2006-05-27 13:04:36 +0200 (Sat, 27 May 2006) | 2 lines
fixed typo
........
r46440 | martin.v.loewis | 2006-05-27 13:07:49 +0200 (Sat, 27 May 2006) | 2 lines
Revert bogus change committed in 46432 to this file.
........
r46444 | andrew.kuchling | 2006-05-27 13:26:33 +0200 (Sat, 27 May 2006) | 1 line
Add Py_LOCAL macros
........
r46450 | bob.ippolito | 2006-05-27 13:47:12 +0200 (Sat, 27 May 2006) | 1 line
Remove the range checking and int usage #defines from _struct and strip out the now-dead code
........
r46454 | bob.ippolito | 2006-05-27 14:11:36 +0200 (Sat, 27 May 2006) | 1 line
Fix up struct docstrings, add struct.pack_to function for symmetry
........
r46456 | richard.jones | 2006-05-27 14:29:24 +0200 (Sat, 27 May 2006) | 2 lines
Conversion of exceptions over from faked-up classes to new-style C types.
........
r46457 | georg.brandl | 2006-05-27 14:30:25 +0200 (Sat, 27 May 2006) | 3 lines
Add news item for new-style exception class branch merge.
........
r46458 | tim.peters | 2006-05-27 14:36:53 +0200 (Sat, 27 May 2006) | 3 lines
More random thrashing trying to understand spurious
Windows failures. Who's keeping a bz2 file open?
........
r46460 | andrew.kuchling | 2006-05-27 15:44:37 +0200 (Sat, 27 May 2006) | 1 line
Mention new-style exceptions
........
r46461 | richard.jones | 2006-05-27 15:50:42 +0200 (Sat, 27 May 2006) | 1 line
credit where credit is due
........
r46462 | georg.brandl | 2006-05-27 16:02:03 +0200 (Sat, 27 May 2006) | 3 lines
Always close BZ2Proxy object. Remove unnecessary struct usage.
........
r46463 | tim.peters | 2006-05-27 16:13:13 +0200 (Sat, 27 May 2006) | 2 lines
The cheery optimism of old age.
........
r46464 | andrew.dalke | 2006-05-27 16:16:40 +0200 (Sat, 27 May 2006) | 2 lines
cleanup - removed trailing whitespace
........
r46465 | georg.brandl | 2006-05-27 16:41:55 +0200 (Sat, 27 May 2006) | 3 lines
Remove spurious semicolons after macro invocations.
........
r46468 | fredrik.lundh | 2006-05-27 16:58:20 +0200 (Sat, 27 May 2006) | 4 lines
needforspeed: replace improvements, changed to Py_LOCAL_INLINE
where appropriate
........
r46469 | fredrik.lundh | 2006-05-27 17:20:22 +0200 (Sat, 27 May 2006) | 4 lines
needforspeed: stringlib refactoring: changed find_obj to find_slice,
to enable use from stringobject
........
r46470 | fredrik.lundh | 2006-05-27 17:26:19 +0200 (Sat, 27 May 2006) | 3 lines
needforspeed: stringlib refactoring: use find_slice for stringobject
........
r46472 | kristjan.jonsson | 2006-05-27 17:41:31 +0200 (Sat, 27 May 2006) | 1 line
Add a PCBuild8 build directory for building with Visual Studio .NET 2005. Contains a special project to perform profile guided optimizations on the pythoncore.dll, by instrumenting and running pybench.py
........
r46473 | jack.diederich | 2006-05-27 17:44:34 +0200 (Sat, 27 May 2006) | 3 lines
needforspeed: use PyObject_MALLOC instead of system malloc for small
allocations. Use PyMem_MALLOC for larger (1k+) chunks. 1%-2% speedup.
........
r46474 | bob.ippolito | 2006-05-27 17:53:49 +0200 (Sat, 27 May 2006) | 1 line
fix struct regression on 64-bit platforms
........
r46475 | richard.jones | 2006-05-27 18:07:28 +0200 (Sat, 27 May 2006) | 1 line
doc string additions and tweaks
........
r46477 | richard.jones | 2006-05-27 18:15:11 +0200 (Sat, 27 May 2006) | 1 line
move semicolons
........
r46478 | george.yoshida | 2006-05-27 18:32:44 +0200 (Sat, 27 May 2006) | 2 lines
minor markup nits
........
r46488 | george.yoshida | 2006-05-27 18:51:43 +0200 (Sat, 27 May 2006) | 3 lines
End of Ch.3 is now about "with statement".
Avoid obsolescence by directly referring to the section.
........
r46489 | george.yoshida | 2006-05-27 19:09:17 +0200 (Sat, 27 May 2006) | 2 lines
fix typo
........
2006-05-27 19:21:47 +00:00
|
|
|
#else
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2012-05-05 21:22:14 -04:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef HAVE_FACCESSAT
|
|
|
|
|
if ((dir_fd != DEFAULT_DIR_FD) ||
|
|
|
|
|
effective_ids ||
|
|
|
|
|
!follow_symlinks) {
|
2020-11-22 11:18:40 +01:00
|
|
|
|
|
|
|
|
if (HAVE_FACCESSAT_RUNTIME) {
|
|
|
|
|
int flags = 0;
|
|
|
|
|
if (!follow_symlinks)
|
|
|
|
|
flags |= AT_SYMLINK_NOFOLLOW;
|
|
|
|
|
if (effective_ids)
|
|
|
|
|
flags |= AT_EACCESS;
|
|
|
|
|
result = faccessat(dir_fd, path->narrow, mode, flags);
|
|
|
|
|
} else {
|
|
|
|
|
faccessat_unavailable = 1;
|
|
|
|
|
}
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
#endif
|
2013-10-19 00:09:25 -07:00
|
|
|
result = access(path->narrow, mode);
|
2012-05-05 21:22:14 -04:00
|
|
|
Py_END_ALLOW_THREADS
|
2020-11-22 11:18:40 +01:00
|
|
|
|
|
|
|
|
#ifdef HAVE_FACCESSAT
|
|
|
|
|
if (faccessat_unavailable) {
|
|
|
|
|
if (dir_fd != DEFAULT_DIR_FD) {
|
|
|
|
|
argument_unavailable_error("access", "dir_fd");
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
if (follow_symlinks_specified("access", follow_symlinks))
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
if (effective_ids) {
|
|
|
|
|
argument_unavailable_error("access", "effective_ids");
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
/* should be unreachable */
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2014-08-05 14:04:04 +10:00
|
|
|
return_value = !result;
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
return return_value;
|
1999-01-06 18:42:14 +00:00
|
|
|
}
|
|
|
|
|
|
1999-01-25 16:12:23 +00:00
|
|
|
#ifndef F_OK
|
|
|
|
|
#define F_OK 0
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef R_OK
|
|
|
|
|
#define R_OK 4
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef W_OK
|
|
|
|
|
#define W_OK 2
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef X_OK
|
|
|
|
|
#define X_OK 1
|
|
|
|
|
#endif
|
|
|
|
|
|
2013-10-19 00:09:25 -07:00
|
|
|
|
1999-01-25 16:12:23 +00:00
|
|
|
#ifdef HAVE_TTYNAME
|
2014-01-07 12:41:53 -08:00
|
|
|
/*[clinic input]
|
2018-12-17 16:47:45 +02:00
|
|
|
os.ttyname
|
2013-10-19 00:09:25 -07:00
|
|
|
|
|
|
|
|
fd: int
|
|
|
|
|
Integer file descriptor handle.
|
|
|
|
|
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Return the name of the terminal device connected to 'fd'.
|
2014-01-07 12:41:53 -08:00
|
|
|
[clinic start generated code]*/
|
2013-10-19 00:09:25 -07:00
|
|
|
|
2018-12-17 16:47:45 +02:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_ttyname_impl(PyObject *module, int fd)
|
2018-12-17 16:47:45 +02:00
|
|
|
/*[clinic end generated code: output=c424d2e9d1cd636a input=9ff5a58b08115c55]*/
|
2013-10-19 00:09:25 -07:00
|
|
|
{
|
1999-01-06 18:42:14 +00:00
|
|
|
|
2019-10-09 04:19:48 +02:00
|
|
|
long size = sysconf(_SC_TTY_NAME_MAX);
|
|
|
|
|
if (size == -1) {
|
|
|
|
|
return posix_error();
|
|
|
|
|
}
|
|
|
|
|
char *buffer = (char *)PyMem_RawMalloc(size);
|
|
|
|
|
if (buffer == NULL) {
|
|
|
|
|
return PyErr_NoMemory();
|
|
|
|
|
}
|
|
|
|
|
int ret = ttyname_r(fd, buffer, size);
|
|
|
|
|
if (ret != 0) {
|
|
|
|
|
PyMem_RawFree(buffer);
|
|
|
|
|
errno = ret;
|
2018-12-17 16:47:45 +02:00
|
|
|
return posix_error();
|
|
|
|
|
}
|
2019-10-09 04:19:48 +02:00
|
|
|
PyObject *res = PyUnicode_DecodeFSDefault(buffer);
|
|
|
|
|
PyMem_RawFree(buffer);
|
|
|
|
|
return res;
|
1999-01-06 18:42:14 +00:00
|
|
|
}
|
1999-01-25 16:12:23 +00:00
|
|
|
#endif
|
1999-01-06 18:42:14 +00:00
|
|
|
|
1999-12-09 21:13:07 +00:00
|
|
|
#ifdef HAVE_CTERMID
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.ctermid
|
|
|
|
|
|
|
|
|
|
Return the name of the controlling terminal for this process.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
1999-12-09 21:13:07 +00:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_ctermid_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=02f017e6c9e620db input=3b87fdd52556382d]*/
|
1999-12-09 21:13:07 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
char *ret;
|
|
|
|
|
char buffer[L_ctermid];
|
1999-12-09 21:13:07 +00:00
|
|
|
|
2000-03-01 21:51:56 +00:00
|
|
|
#ifdef USE_CTERMID_R
|
2010-05-06 00:08:46 +00:00
|
|
|
ret = ctermid_r(buffer);
|
1999-12-09 21:13:07 +00:00
|
|
|
#else
|
2010-05-06 00:08:46 +00:00
|
|
|
ret = ctermid(buffer);
|
1999-12-09 21:13:07 +00:00
|
|
|
#endif
|
2010-05-06 00:08:46 +00:00
|
|
|
if (ret == NULL)
|
|
|
|
|
return posix_error();
|
2010-08-15 09:12:51 +00:00
|
|
|
return PyUnicode_DecodeFSDefault(buffer);
|
1999-12-09 21:13:07 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_CTERMID */
|
1999-12-09 21:13:07 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.chdir
|
|
|
|
|
|
|
|
|
|
path: path_t(allow_fd='PATH_HAVE_FCHDIR')
|
|
|
|
|
|
|
|
|
|
Change the current working directory to the specified path.
|
|
|
|
|
|
|
|
|
|
path may always be specified as a string.
|
|
|
|
|
On some platforms, path may also be specified as an open file descriptor.
|
|
|
|
|
If this functionality is unavailable, using it raises an exception.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_chdir_impl(PyObject *module, path_t *path)
|
|
|
|
|
/*[clinic end generated code: output=3be6400eee26eaae input=1a4a15b4d12cb15d]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
int result;
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.chdir", "(O)", path->object) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2002-10-03 05:10:39 +00:00
|
|
|
#ifdef MS_WINDOWS
|
2016-09-08 10:35:16 -07:00
|
|
|
/* on unix, success = 0, on windows, success = !0 */
|
|
|
|
|
result = !win32_wchdir(path->wide);
|
2002-03-03 03:07:07 +00:00
|
|
|
#else
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef HAVE_FCHDIR
|
2014-08-05 14:04:04 +10:00
|
|
|
if (path->fd != -1)
|
|
|
|
|
result = fchdir(path->fd);
|
2012-06-22 16:30:09 -07:00
|
|
|
else
|
|
|
|
|
#endif
|
2014-08-05 14:04:04 +10:00
|
|
|
result = chdir(path->narrow);
|
2002-03-03 03:07:07 +00:00
|
|
|
#endif
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
|
|
|
|
|
if (result) {
|
2014-08-05 14:04:04 +10:00
|
|
|
return path_error(path);
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FCHDIR
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.fchdir
|
|
|
|
|
|
|
|
|
|
fd: fildes
|
|
|
|
|
|
|
|
|
|
Change to the directory of the given file descriptor.
|
|
|
|
|
|
|
|
|
|
fd must be opened on a directory, not a file.
|
|
|
|
|
Equivalent to os.chdir(fd).
|
|
|
|
|
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
2002-04-15 19:40:07 +00:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_fchdir_impl(PyObject *module, int fd)
|
|
|
|
|
/*[clinic end generated code: output=42e064ec4dc00ab0 input=18e816479a2fa985]*/
|
2002-04-15 19:40:07 +00:00
|
|
|
{
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.chdir", "(i)", fd) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
return posix_fildes_fd(fd, fchdir);
|
2002-04-15 19:40:07 +00:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_FCHDIR */
|
|
|
|
|
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.chmod
|
|
|
|
|
|
|
|
|
|
path: path_t(allow_fd='PATH_HAVE_FCHMOD')
|
2018-11-02 15:20:19 +00:00
|
|
|
Path to be modified. May always be specified as a str, bytes, or a path-like object.
|
2014-08-05 14:04:04 +10:00
|
|
|
On some platforms, path may also be specified as an open file descriptor.
|
|
|
|
|
If this functionality is unavailable, using it raises an exception.
|
|
|
|
|
|
|
|
|
|
mode: int
|
|
|
|
|
Operating-system mode bitfield.
|
|
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
|
|
dir_fd : dir_fd(requires='fchmodat') = None
|
|
|
|
|
If not None, it should be a file descriptor open to a directory,
|
|
|
|
|
and path should be relative; path will then be relative to that
|
|
|
|
|
directory.
|
|
|
|
|
|
|
|
|
|
follow_symlinks: bool = True
|
|
|
|
|
If False, and the last element of the path is a symbolic link,
|
|
|
|
|
chmod will modify the symbolic link itself instead of the file
|
|
|
|
|
the link points to.
|
|
|
|
|
|
|
|
|
|
Change the access permissions of a file.
|
|
|
|
|
|
|
|
|
|
It is an error to use dir_fd or follow_symlinks when specifying path as
|
|
|
|
|
an open file descriptor.
|
|
|
|
|
dir_fd and follow_symlinks may not be implemented on your platform.
|
|
|
|
|
If they are unavailable, using them will raise a NotImplementedError.
|
|
|
|
|
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_chmod_impl(PyObject *module, path_t *path, int mode, int dir_fd,
|
2015-04-14 18:07:59 -04:00
|
|
|
int follow_symlinks)
|
2018-11-02 15:20:19 +00:00
|
|
|
/*[clinic end generated code: output=5cf6a94915cc7bff input=989081551c00293b]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2012-06-22 16:30:09 -07:00
|
|
|
int result;
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2009-05-17 04:21:53 +00:00
|
|
|
#ifdef MS_WINDOWS
|
2010-05-06 00:08:46 +00:00
|
|
|
DWORD attr;
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
2010-05-06 00:08:46 +00:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef HAVE_FCHMODAT
|
|
|
|
|
int fchmodat_nofollow_unsupported = 0;
|
2020-11-22 11:18:40 +01:00
|
|
|
int fchmodat_unsupported = 0;
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if !(defined(HAVE_FCHMODAT) || defined(HAVE_LCHMOD))
|
|
|
|
|
if (follow_symlinks_specified("chmod", follow_symlinks))
|
2014-08-05 14:04:04 +10:00
|
|
|
return NULL;
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.chmod", "Oii", path->object, mode,
|
|
|
|
|
dir_fd == DEFAULT_DIR_FD ? -1 : dir_fd) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef MS_WINDOWS
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2016-09-08 10:35:16 -07:00
|
|
|
attr = GetFileAttributesW(path->wide);
|
2013-10-25 11:22:37 +01:00
|
|
|
if (attr == INVALID_FILE_ATTRIBUTES)
|
2012-06-22 16:30:09 -07:00
|
|
|
result = 0;
|
|
|
|
|
else {
|
|
|
|
|
if (mode & _S_IWRITE)
|
2010-05-06 00:08:46 +00:00
|
|
|
attr &= ~FILE_ATTRIBUTE_READONLY;
|
|
|
|
|
else
|
|
|
|
|
attr |= FILE_ATTRIBUTE_READONLY;
|
2016-09-08 10:35:16 -07:00
|
|
|
result = SetFileAttributesW(path->wide, attr);
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
|
|
|
|
Py_END_ALLOW_THREADS
|
2012-06-22 16:30:09 -07:00
|
|
|
|
|
|
|
|
if (!result) {
|
2014-08-05 14:04:04 +10:00
|
|
|
return path_error(path);
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2009-05-17 04:21:53 +00:00
|
|
|
#else /* MS_WINDOWS */
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef HAVE_FCHMOD
|
2014-08-05 14:04:04 +10:00
|
|
|
if (path->fd != -1)
|
|
|
|
|
result = fchmod(path->fd, mode);
|
2012-06-22 16:30:09 -07:00
|
|
|
else
|
2020-11-22 11:18:40 +01:00
|
|
|
#endif /* HAVE_CHMOD */
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef HAVE_LCHMOD
|
|
|
|
|
if ((!follow_symlinks) && (dir_fd == DEFAULT_DIR_FD))
|
2014-08-05 14:04:04 +10:00
|
|
|
result = lchmod(path->narrow, mode);
|
2012-06-22 16:30:09 -07:00
|
|
|
else
|
2020-11-22 11:18:40 +01:00
|
|
|
#endif /* HAVE_LCHMOD */
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef HAVE_FCHMODAT
|
|
|
|
|
if ((dir_fd != DEFAULT_DIR_FD) || !follow_symlinks) {
|
2020-11-22 11:18:40 +01:00
|
|
|
if (HAVE_FCHMODAT_RUNTIME) {
|
|
|
|
|
/*
|
|
|
|
|
* fchmodat() doesn't currently support AT_SYMLINK_NOFOLLOW!
|
|
|
|
|
* The documentation specifically shows how to use it,
|
|
|
|
|
* and then says it isn't implemented yet.
|
|
|
|
|
* (true on linux with glibc 2.15, and openindiana 3.x)
|
|
|
|
|
*
|
|
|
|
|
* Once it is supported, os.chmod will automatically
|
|
|
|
|
* support dir_fd and follow_symlinks=False. (Hopefully.)
|
|
|
|
|
* Until then, we need to be careful what exception we raise.
|
|
|
|
|
*/
|
|
|
|
|
result = fchmodat(dir_fd, path->narrow, mode,
|
|
|
|
|
follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW);
|
|
|
|
|
/*
|
|
|
|
|
* But wait! We can't throw the exception without allowing threads,
|
|
|
|
|
* and we can't do that in this nested scope. (Macro trickery, sigh.)
|
|
|
|
|
*/
|
|
|
|
|
fchmodat_nofollow_unsupported =
|
|
|
|
|
result &&
|
|
|
|
|
((errno == ENOTSUP) || (errno == EOPNOTSUPP)) &&
|
|
|
|
|
!follow_symlinks;
|
|
|
|
|
} else {
|
|
|
|
|
fchmodat_unsupported = 1;
|
|
|
|
|
fchmodat_nofollow_unsupported = 1;
|
|
|
|
|
|
|
|
|
|
result = -1;
|
|
|
|
|
}
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
else
|
2020-11-22 11:18:40 +01:00
|
|
|
#endif /* HAVE_FHCMODAT */
|
2014-08-05 14:04:04 +10:00
|
|
|
result = chmod(path->narrow, mode);
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
2012-06-22 16:30:09 -07:00
|
|
|
|
|
|
|
|
if (result) {
|
|
|
|
|
#ifdef HAVE_FCHMODAT
|
2020-11-22 11:18:40 +01:00
|
|
|
if (fchmodat_unsupported) {
|
|
|
|
|
if (dir_fd != DEFAULT_DIR_FD) {
|
|
|
|
|
argument_unavailable_error("chmod", "dir_fd");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
if (fchmodat_nofollow_unsupported) {
|
|
|
|
|
if (dir_fd != DEFAULT_DIR_FD)
|
|
|
|
|
dir_fd_and_follow_symlinks_invalid("chmod",
|
|
|
|
|
dir_fd, follow_symlinks);
|
|
|
|
|
else
|
|
|
|
|
follow_symlinks_specified("chmod", follow_symlinks);
|
2017-12-14 08:57:55 -08:00
|
|
|
return NULL;
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
else
|
2020-11-22 11:18:40 +01:00
|
|
|
#endif /* HAVE_FCHMODAT */
|
2014-08-05 14:04:04 +10:00
|
|
|
return path_error(path);
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
2020-11-22 11:18:40 +01:00
|
|
|
#endif /* MS_WINDOWS */
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
1990-10-14 12:07:46 +00:00
|
|
|
}
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2007-11-30 22:12:06 +00:00
|
|
|
#ifdef HAVE_FCHMOD
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.fchmod
|
|
|
|
|
|
|
|
|
|
fd: int
|
|
|
|
|
mode: int
|
|
|
|
|
|
|
|
|
|
Change the access permissions of the file given by file descriptor fd.
|
|
|
|
|
|
|
|
|
|
Equivalent to os.chmod(fd, mode).
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_fchmod_impl(PyObject *module, int fd, int mode)
|
|
|
|
|
/*[clinic end generated code: output=afd9bc05b4e426b3 input=8ab11975ca01ee5b]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
int res;
|
2015-02-07 13:27:50 +00:00
|
|
|
int async_err = 0;
|
|
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.chmod", "iii", fd, mode, -1) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-07 13:27:50 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
res = fchmod(fd, mode);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (res != 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
|
|
|
|
if (res != 0)
|
|
|
|
|
return (!async_err) ? posix_error() : NULL;
|
|
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_RETURN_NONE;
|
2007-11-30 22:12:06 +00:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_FCHMOD */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2007-11-30 22:12:06 +00:00
|
|
|
#ifdef HAVE_LCHMOD
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.lchmod
|
|
|
|
|
|
|
|
|
|
path: path_t
|
|
|
|
|
mode: int
|
|
|
|
|
|
|
|
|
|
Change the access permissions of a file, without following symbolic links.
|
|
|
|
|
|
|
|
|
|
If path is a symlink, this affects the link itself rather than the target.
|
|
|
|
|
Equivalent to chmod(path, mode, follow_symlinks=False)."
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_lchmod_impl(PyObject *module, path_t *path, int mode)
|
|
|
|
|
/*[clinic end generated code: output=082344022b51a1d5 input=90c5663c7465d24f]*/
|
2007-11-30 22:12:06 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
int res;
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.chmod", "Oii", path->object, mode, -1) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2014-08-05 16:06:16 +10:00
|
|
|
res = lchmod(path->narrow, mode);
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
2012-10-30 02:17:38 +01:00
|
|
|
if (res < 0) {
|
2014-08-05 14:04:04 +10:00
|
|
|
path_error(path);
|
2012-10-30 02:17:38 +01:00
|
|
|
return NULL;
|
|
|
|
|
}
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_RETURN_NONE;
|
2007-11-30 22:12:06 +00:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_LCHMOD */
|
|
|
|
|
|
1997-06-02 22:20:51 +00:00
|
|
|
|
Merged revisions 53623-53858 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r53624 | peter.astrand | 2007-02-02 20:06:36 +0100 (Fri, 02 Feb 2007) | 1 line
We had several if statements checking the value of a fd. This is unsafe, since valid fds might be zero. We should check for not None instead.
........
r53635 | kurt.kaiser | 2007-02-05 07:03:18 +0100 (Mon, 05 Feb 2007) | 2 lines
Add 'raw' support to configHandler. Patch 1650174 Tal Einat.
........
r53641 | kurt.kaiser | 2007-02-06 00:02:16 +0100 (Tue, 06 Feb 2007) | 5 lines
1. Calltips now 'handle' tuples in the argument list (display '<tuple>' :)
Suggested solution by Christos Georgiou, Bug 791968.
2. Clean up tests, were not failing when they should have been.
4. Remove some camelcase and an unneeded try/except block.
........
r53644 | kurt.kaiser | 2007-02-06 04:21:40 +0100 (Tue, 06 Feb 2007) | 2 lines
Clean up ModifiedInterpreter.runcode() structure
........
r53646 | peter.astrand | 2007-02-06 16:37:50 +0100 (Tue, 06 Feb 2007) | 1 line
Applied patch 1124861.3.patch to solve bug #1124861: Automatically create pipes on Windows, if GetStdHandle fails. Will backport.
........
r53648 | lars.gustaebel | 2007-02-06 19:38:13 +0100 (Tue, 06 Feb 2007) | 4 lines
Patch #1652681: create nonexistent files in append mode and
allow appending to empty files.
........
r53649 | kurt.kaiser | 2007-02-06 20:09:43 +0100 (Tue, 06 Feb 2007) | 4 lines
Updated patch (CodeContext.061217.patch) to
[ 1362975 ] CodeContext - Improved text indentation
Tal Einat 16Dec06
........
r53650 | kurt.kaiser | 2007-02-06 20:21:19 +0100 (Tue, 06 Feb 2007) | 2 lines
narrow exception per [ 1540849 ] except too broad
........
r53653 | kurt.kaiser | 2007-02-07 04:39:41 +0100 (Wed, 07 Feb 2007) | 4 lines
[ 1621265 ] Auto-completion list placement
Move AC window below input line unless not enough space, then put it above.
Patch: Tal Einat
........
r53654 | kurt.kaiser | 2007-02-07 09:07:13 +0100 (Wed, 07 Feb 2007) | 2 lines
Handle AttributeError during calltip lookup
........
r53656 | raymond.hettinger | 2007-02-07 21:08:22 +0100 (Wed, 07 Feb 2007) | 3 lines
SF #1615701: make d.update(m) honor __getitem__() and keys() in dict subclasses
........
r53658 | raymond.hettinger | 2007-02-07 22:04:20 +0100 (Wed, 07 Feb 2007) | 1 line
SF: 1397711 Set docs conflated immutable and hashable
........
r53660 | raymond.hettinger | 2007-02-07 22:42:17 +0100 (Wed, 07 Feb 2007) | 1 line
Check for a common user error with defaultdict().
........
r53662 | raymond.hettinger | 2007-02-07 23:24:07 +0100 (Wed, 07 Feb 2007) | 1 line
Bug #1575169: operator.isSequenceType() now returns False for subclasses of dict.
........
r53664 | raymond.hettinger | 2007-02-08 00:49:03 +0100 (Thu, 08 Feb 2007) | 1 line
Silence compiler warning
........
r53666 | raymond.hettinger | 2007-02-08 01:07:32 +0100 (Thu, 08 Feb 2007) | 1 line
Do not let overflows in enumerate() and count() pass silently.
........
r53668 | raymond.hettinger | 2007-02-08 01:50:39 +0100 (Thu, 08 Feb 2007) | 1 line
Bypass set specific optimizations for set and frozenset subclasses.
........
r53670 | raymond.hettinger | 2007-02-08 02:42:35 +0100 (Thu, 08 Feb 2007) | 1 line
Fix docstring bug
........
r53671 | martin.v.loewis | 2007-02-08 10:13:36 +0100 (Thu, 08 Feb 2007) | 3 lines
Bug #1653736: Complain about keyword arguments to time.isoformat.
Will backport to 2.5.
........
r53679 | kurt.kaiser | 2007-02-08 23:58:18 +0100 (Thu, 08 Feb 2007) | 6 lines
Corrected some bugs in AutoComplete. Also, Page Up/Down in ACW implemented;
mouse and cursor selection in ACWindow implemented; double Tab inserts current
selection and closes ACW (similar to double-click and Return); scroll wheel now
works in ACW. Added AutoComplete instructions to IDLE Help.
........
r53689 | martin.v.loewis | 2007-02-09 13:19:32 +0100 (Fri, 09 Feb 2007) | 3 lines
Bug #1653736: Properly discard third argument to slot_nb_inplace_power.
Will backport.
........
r53691 | martin.v.loewis | 2007-02-09 13:36:48 +0100 (Fri, 09 Feb 2007) | 4 lines
Bug #1600860: Search for shared python library in LIBDIR, not
lib/python/config, on "linux" and "gnu" systems.
Will backport.
........
r53693 | martin.v.loewis | 2007-02-09 13:58:49 +0100 (Fri, 09 Feb 2007) | 2 lines
Update broken link. Will backport to 2.5.
........
r53697 | georg.brandl | 2007-02-09 19:48:41 +0100 (Fri, 09 Feb 2007) | 2 lines
Bug #1656078: typo in in profile docs.
........
r53731 | brett.cannon | 2007-02-11 06:36:00 +0100 (Sun, 11 Feb 2007) | 3 lines
Change a very minor inconsistency (that is purely cosmetic) in the AST
definition.
........
r53735 | skip.montanaro | 2007-02-11 19:24:37 +0100 (Sun, 11 Feb 2007) | 1 line
fix trace.py --ignore-dir
........
r53741 | brett.cannon | 2007-02-11 20:44:41 +0100 (Sun, 11 Feb 2007) | 3 lines
Check in changed Python-ast.c from a cosmetic change to Python.asdl (in
r53731).
........
r53751 | brett.cannon | 2007-02-12 04:51:02 +0100 (Mon, 12 Feb 2007) | 5 lines
Modify Parser/asdl_c.py so that the __version__ number for Python/Python-ast.c
is specified at the top of the file. Also add a note that Python/Python-ast.c
needs to be committed separately after a change to the AST grammar to capture
the revision number of the change (which is what __version__ is set to).
........
r53752 | lars.gustaebel | 2007-02-12 10:25:53 +0100 (Mon, 12 Feb 2007) | 3 lines
Bug #1656581: Point out that external file objects are supposed to be
at position 0.
........
r53754 | martin.v.loewis | 2007-02-12 13:21:10 +0100 (Mon, 12 Feb 2007) | 3 lines
Patch 1463026: Support default namespace in XMLGenerator.
Fixes #847665. Will backport.
........
r53757 | armin.rigo | 2007-02-12 17:23:24 +0100 (Mon, 12 Feb 2007) | 4 lines
Fix the line to what is my guess at the original author's meaning.
(The line has no effect anyway, but is present because it's
customary call the base class __init__).
........
r53763 | martin.v.loewis | 2007-02-13 09:34:45 +0100 (Tue, 13 Feb 2007) | 3 lines
Patch #685268: Consider a package's __path__ in imputil.
Will backport.
........
r53765 | martin.v.loewis | 2007-02-13 10:49:38 +0100 (Tue, 13 Feb 2007) | 2 lines
Patch #698833: Support file decryption in zipfile.
........
r53766 | martin.v.loewis | 2007-02-13 11:10:39 +0100 (Tue, 13 Feb 2007) | 3 lines
Patch #1517891: Make 'a' create the file if it doesn't exist.
Fixes #1514451.
........
r53767 | martin.v.loewis | 2007-02-13 13:08:24 +0100 (Tue, 13 Feb 2007) | 3 lines
Bug #1658794: Remove extraneous 'this'.
Will backport to 2.5.
........
r53769 | martin.v.loewis | 2007-02-13 13:14:19 +0100 (Tue, 13 Feb 2007) | 3 lines
Patch #1657276: Make NETLINK_DNRTMSG conditional.
Will backport.
........
r53771 | lars.gustaebel | 2007-02-13 17:09:24 +0100 (Tue, 13 Feb 2007) | 4 lines
Patch #1647484: Renamed GzipFile's filename attribute to name. The
filename attribute is still accessible as a property that emits a
DeprecationWarning.
........
r53772 | lars.gustaebel | 2007-02-13 17:24:00 +0100 (Tue, 13 Feb 2007) | 3 lines
Strip the '.gz' extension from the filename that is written to the
gzip header.
........
r53774 | martin.v.loewis | 2007-02-14 11:07:37 +0100 (Wed, 14 Feb 2007) | 2 lines
Patch #1432399: Add HCI sockets.
........
r53775 | martin.v.loewis | 2007-02-14 12:30:07 +0100 (Wed, 14 Feb 2007) | 2 lines
Update 1432399 to removal of _BT_SOCKADDR_MEMB.
........
r53776 | martin.v.loewis | 2007-02-14 12:30:56 +0100 (Wed, 14 Feb 2007) | 3 lines
Ignore directory time stamps when considering
whether to rerun libffi configure.
........
r53778 | lars.gustaebel | 2007-02-14 15:45:12 +0100 (Wed, 14 Feb 2007) | 4 lines
A missing binary mode in AppendTest caused failures in Windows
Buildbot.
........
r53782 | martin.v.loewis | 2007-02-15 10:51:35 +0100 (Thu, 15 Feb 2007) | 2 lines
Patch #1397848: add the reasoning behind no-resize-on-shrinkage.
........
r53783 | georg.brandl | 2007-02-15 11:37:59 +0100 (Thu, 15 Feb 2007) | 2 lines
Make functools.wraps() docs a bit clearer.
........
r53785 | georg.brandl | 2007-02-15 12:29:04 +0100 (Thu, 15 Feb 2007) | 2 lines
Patch #1494140: Add documentation for the new struct.Struct object.
........
r53787 | georg.brandl | 2007-02-15 12:29:55 +0100 (Thu, 15 Feb 2007) | 2 lines
Add missing \versionadded.
........
r53800 | brett.cannon | 2007-02-15 23:54:39 +0100 (Thu, 15 Feb 2007) | 11 lines
Update the encoding package's search function to use absolute imports when
calling __import__. This helps make the expected search locations for encoding
modules be more explicit.
One could use an explicit value for __path__ when making the call to __import__
to force the exact location searched for encodings. This would give the most
strict search path possible if one is worried about malicious code being
imported. The unfortunate side-effect of that is that if __path__ was modified
on 'encodings' on purpose in a safe way it would not be picked up in future
__import__ calls.
........
r53801 | brett.cannon | 2007-02-16 20:33:01 +0100 (Fri, 16 Feb 2007) | 2 lines
Make the __import__ call in encodings.__init__ absolute with a level 0 call.
........
r53809 | vinay.sajip | 2007-02-16 23:36:24 +0100 (Fri, 16 Feb 2007) | 1 line
Minor fix for currentframe (SF #1652788).
........
r53818 | raymond.hettinger | 2007-02-19 03:03:19 +0100 (Mon, 19 Feb 2007) | 3 lines
Extend work on revision 52962: Eliminate redundant calls to PyObject_Hash().
........
r53820 | raymond.hettinger | 2007-02-19 05:08:43 +0100 (Mon, 19 Feb 2007) | 1 line
Add merge() function to heapq.
........
r53821 | raymond.hettinger | 2007-02-19 06:28:28 +0100 (Mon, 19 Feb 2007) | 1 line
Add tie-breaker count to preserve sort stability.
........
r53822 | raymond.hettinger | 2007-02-19 07:59:32 +0100 (Mon, 19 Feb 2007) | 1 line
Use C heapreplace() instead of slower _siftup() in pure python.
........
r53823 | raymond.hettinger | 2007-02-19 08:30:21 +0100 (Mon, 19 Feb 2007) | 1 line
Add test for merge stability
........
r53824 | raymond.hettinger | 2007-02-19 10:14:10 +0100 (Mon, 19 Feb 2007) | 1 line
Provide an example of defaultdict with non-zero constant factory function.
........
r53825 | lars.gustaebel | 2007-02-19 10:54:47 +0100 (Mon, 19 Feb 2007) | 2 lines
Moved misplaced news item.
........
r53826 | martin.v.loewis | 2007-02-19 11:55:19 +0100 (Mon, 19 Feb 2007) | 3 lines
Patch #1490190: posixmodule now includes os.chflags() and os.lchflags()
functions on platforms where the underlying system calls are available.
........
r53827 | raymond.hettinger | 2007-02-19 19:15:04 +0100 (Mon, 19 Feb 2007) | 1 line
Fixup docstrings for merge().
........
r53829 | raymond.hettinger | 2007-02-19 21:44:04 +0100 (Mon, 19 Feb 2007) | 1 line
Fixup set/dict interoperability.
........
r53837 | raymond.hettinger | 2007-02-21 06:20:38 +0100 (Wed, 21 Feb 2007) | 1 line
Add itertools.izip_longest().
........
r53838 | raymond.hettinger | 2007-02-21 18:22:05 +0100 (Wed, 21 Feb 2007) | 1 line
Remove filler struct item and fix leak.
........
2007-02-23 15:07:44 +00:00
|
|
|
#ifdef HAVE_CHFLAGS
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.chflags
|
|
|
|
|
|
|
|
|
|
path: path_t
|
|
|
|
|
flags: unsigned_long(bitwise=True)
|
|
|
|
|
follow_symlinks: bool=True
|
|
|
|
|
|
|
|
|
|
Set file flags.
|
|
|
|
|
|
|
|
|
|
If follow_symlinks is False, and the last element of the path is a symbolic
|
|
|
|
|
link, chflags will change flags on the symbolic link itself instead of the
|
|
|
|
|
file the link points to.
|
|
|
|
|
follow_symlinks may not be implemented on your platform. If it is
|
|
|
|
|
unavailable, using it will raise a NotImplementedError.
|
|
|
|
|
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_chflags_impl(PyObject *module, path_t *path, unsigned long flags,
|
2015-04-14 18:07:59 -04:00
|
|
|
int follow_symlinks)
|
2016-07-07 17:35:15 +03:00
|
|
|
/*[clinic end generated code: output=85571c6737661ce9 input=0327e29feb876236]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
int result;
|
2012-06-22 16:30:09 -07:00
|
|
|
|
|
|
|
|
#ifndef HAVE_LCHFLAGS
|
|
|
|
|
if (follow_symlinks_specified("chflags", follow_symlinks))
|
2014-08-05 14:04:04 +10:00
|
|
|
return NULL;
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.chflags", "Ok", path->object, flags) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef HAVE_LCHFLAGS
|
|
|
|
|
if (!follow_symlinks)
|
2014-08-05 14:04:04 +10:00
|
|
|
result = lchflags(path->narrow, flags);
|
2012-06-22 16:30:09 -07:00
|
|
|
else
|
|
|
|
|
#endif
|
2014-08-05 14:04:04 +10:00
|
|
|
result = chflags(path->narrow, flags);
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
if (result)
|
|
|
|
|
return path_error(path);
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
Merged revisions 53623-53858 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r53624 | peter.astrand | 2007-02-02 20:06:36 +0100 (Fri, 02 Feb 2007) | 1 line
We had several if statements checking the value of a fd. This is unsafe, since valid fds might be zero. We should check for not None instead.
........
r53635 | kurt.kaiser | 2007-02-05 07:03:18 +0100 (Mon, 05 Feb 2007) | 2 lines
Add 'raw' support to configHandler. Patch 1650174 Tal Einat.
........
r53641 | kurt.kaiser | 2007-02-06 00:02:16 +0100 (Tue, 06 Feb 2007) | 5 lines
1. Calltips now 'handle' tuples in the argument list (display '<tuple>' :)
Suggested solution by Christos Georgiou, Bug 791968.
2. Clean up tests, were not failing when they should have been.
4. Remove some camelcase and an unneeded try/except block.
........
r53644 | kurt.kaiser | 2007-02-06 04:21:40 +0100 (Tue, 06 Feb 2007) | 2 lines
Clean up ModifiedInterpreter.runcode() structure
........
r53646 | peter.astrand | 2007-02-06 16:37:50 +0100 (Tue, 06 Feb 2007) | 1 line
Applied patch 1124861.3.patch to solve bug #1124861: Automatically create pipes on Windows, if GetStdHandle fails. Will backport.
........
r53648 | lars.gustaebel | 2007-02-06 19:38:13 +0100 (Tue, 06 Feb 2007) | 4 lines
Patch #1652681: create nonexistent files in append mode and
allow appending to empty files.
........
r53649 | kurt.kaiser | 2007-02-06 20:09:43 +0100 (Tue, 06 Feb 2007) | 4 lines
Updated patch (CodeContext.061217.patch) to
[ 1362975 ] CodeContext - Improved text indentation
Tal Einat 16Dec06
........
r53650 | kurt.kaiser | 2007-02-06 20:21:19 +0100 (Tue, 06 Feb 2007) | 2 lines
narrow exception per [ 1540849 ] except too broad
........
r53653 | kurt.kaiser | 2007-02-07 04:39:41 +0100 (Wed, 07 Feb 2007) | 4 lines
[ 1621265 ] Auto-completion list placement
Move AC window below input line unless not enough space, then put it above.
Patch: Tal Einat
........
r53654 | kurt.kaiser | 2007-02-07 09:07:13 +0100 (Wed, 07 Feb 2007) | 2 lines
Handle AttributeError during calltip lookup
........
r53656 | raymond.hettinger | 2007-02-07 21:08:22 +0100 (Wed, 07 Feb 2007) | 3 lines
SF #1615701: make d.update(m) honor __getitem__() and keys() in dict subclasses
........
r53658 | raymond.hettinger | 2007-02-07 22:04:20 +0100 (Wed, 07 Feb 2007) | 1 line
SF: 1397711 Set docs conflated immutable and hashable
........
r53660 | raymond.hettinger | 2007-02-07 22:42:17 +0100 (Wed, 07 Feb 2007) | 1 line
Check for a common user error with defaultdict().
........
r53662 | raymond.hettinger | 2007-02-07 23:24:07 +0100 (Wed, 07 Feb 2007) | 1 line
Bug #1575169: operator.isSequenceType() now returns False for subclasses of dict.
........
r53664 | raymond.hettinger | 2007-02-08 00:49:03 +0100 (Thu, 08 Feb 2007) | 1 line
Silence compiler warning
........
r53666 | raymond.hettinger | 2007-02-08 01:07:32 +0100 (Thu, 08 Feb 2007) | 1 line
Do not let overflows in enumerate() and count() pass silently.
........
r53668 | raymond.hettinger | 2007-02-08 01:50:39 +0100 (Thu, 08 Feb 2007) | 1 line
Bypass set specific optimizations for set and frozenset subclasses.
........
r53670 | raymond.hettinger | 2007-02-08 02:42:35 +0100 (Thu, 08 Feb 2007) | 1 line
Fix docstring bug
........
r53671 | martin.v.loewis | 2007-02-08 10:13:36 +0100 (Thu, 08 Feb 2007) | 3 lines
Bug #1653736: Complain about keyword arguments to time.isoformat.
Will backport to 2.5.
........
r53679 | kurt.kaiser | 2007-02-08 23:58:18 +0100 (Thu, 08 Feb 2007) | 6 lines
Corrected some bugs in AutoComplete. Also, Page Up/Down in ACW implemented;
mouse and cursor selection in ACWindow implemented; double Tab inserts current
selection and closes ACW (similar to double-click and Return); scroll wheel now
works in ACW. Added AutoComplete instructions to IDLE Help.
........
r53689 | martin.v.loewis | 2007-02-09 13:19:32 +0100 (Fri, 09 Feb 2007) | 3 lines
Bug #1653736: Properly discard third argument to slot_nb_inplace_power.
Will backport.
........
r53691 | martin.v.loewis | 2007-02-09 13:36:48 +0100 (Fri, 09 Feb 2007) | 4 lines
Bug #1600860: Search for shared python library in LIBDIR, not
lib/python/config, on "linux" and "gnu" systems.
Will backport.
........
r53693 | martin.v.loewis | 2007-02-09 13:58:49 +0100 (Fri, 09 Feb 2007) | 2 lines
Update broken link. Will backport to 2.5.
........
r53697 | georg.brandl | 2007-02-09 19:48:41 +0100 (Fri, 09 Feb 2007) | 2 lines
Bug #1656078: typo in in profile docs.
........
r53731 | brett.cannon | 2007-02-11 06:36:00 +0100 (Sun, 11 Feb 2007) | 3 lines
Change a very minor inconsistency (that is purely cosmetic) in the AST
definition.
........
r53735 | skip.montanaro | 2007-02-11 19:24:37 +0100 (Sun, 11 Feb 2007) | 1 line
fix trace.py --ignore-dir
........
r53741 | brett.cannon | 2007-02-11 20:44:41 +0100 (Sun, 11 Feb 2007) | 3 lines
Check in changed Python-ast.c from a cosmetic change to Python.asdl (in
r53731).
........
r53751 | brett.cannon | 2007-02-12 04:51:02 +0100 (Mon, 12 Feb 2007) | 5 lines
Modify Parser/asdl_c.py so that the __version__ number for Python/Python-ast.c
is specified at the top of the file. Also add a note that Python/Python-ast.c
needs to be committed separately after a change to the AST grammar to capture
the revision number of the change (which is what __version__ is set to).
........
r53752 | lars.gustaebel | 2007-02-12 10:25:53 +0100 (Mon, 12 Feb 2007) | 3 lines
Bug #1656581: Point out that external file objects are supposed to be
at position 0.
........
r53754 | martin.v.loewis | 2007-02-12 13:21:10 +0100 (Mon, 12 Feb 2007) | 3 lines
Patch 1463026: Support default namespace in XMLGenerator.
Fixes #847665. Will backport.
........
r53757 | armin.rigo | 2007-02-12 17:23:24 +0100 (Mon, 12 Feb 2007) | 4 lines
Fix the line to what is my guess at the original author's meaning.
(The line has no effect anyway, but is present because it's
customary call the base class __init__).
........
r53763 | martin.v.loewis | 2007-02-13 09:34:45 +0100 (Tue, 13 Feb 2007) | 3 lines
Patch #685268: Consider a package's __path__ in imputil.
Will backport.
........
r53765 | martin.v.loewis | 2007-02-13 10:49:38 +0100 (Tue, 13 Feb 2007) | 2 lines
Patch #698833: Support file decryption in zipfile.
........
r53766 | martin.v.loewis | 2007-02-13 11:10:39 +0100 (Tue, 13 Feb 2007) | 3 lines
Patch #1517891: Make 'a' create the file if it doesn't exist.
Fixes #1514451.
........
r53767 | martin.v.loewis | 2007-02-13 13:08:24 +0100 (Tue, 13 Feb 2007) | 3 lines
Bug #1658794: Remove extraneous 'this'.
Will backport to 2.5.
........
r53769 | martin.v.loewis | 2007-02-13 13:14:19 +0100 (Tue, 13 Feb 2007) | 3 lines
Patch #1657276: Make NETLINK_DNRTMSG conditional.
Will backport.
........
r53771 | lars.gustaebel | 2007-02-13 17:09:24 +0100 (Tue, 13 Feb 2007) | 4 lines
Patch #1647484: Renamed GzipFile's filename attribute to name. The
filename attribute is still accessible as a property that emits a
DeprecationWarning.
........
r53772 | lars.gustaebel | 2007-02-13 17:24:00 +0100 (Tue, 13 Feb 2007) | 3 lines
Strip the '.gz' extension from the filename that is written to the
gzip header.
........
r53774 | martin.v.loewis | 2007-02-14 11:07:37 +0100 (Wed, 14 Feb 2007) | 2 lines
Patch #1432399: Add HCI sockets.
........
r53775 | martin.v.loewis | 2007-02-14 12:30:07 +0100 (Wed, 14 Feb 2007) | 2 lines
Update 1432399 to removal of _BT_SOCKADDR_MEMB.
........
r53776 | martin.v.loewis | 2007-02-14 12:30:56 +0100 (Wed, 14 Feb 2007) | 3 lines
Ignore directory time stamps when considering
whether to rerun libffi configure.
........
r53778 | lars.gustaebel | 2007-02-14 15:45:12 +0100 (Wed, 14 Feb 2007) | 4 lines
A missing binary mode in AppendTest caused failures in Windows
Buildbot.
........
r53782 | martin.v.loewis | 2007-02-15 10:51:35 +0100 (Thu, 15 Feb 2007) | 2 lines
Patch #1397848: add the reasoning behind no-resize-on-shrinkage.
........
r53783 | georg.brandl | 2007-02-15 11:37:59 +0100 (Thu, 15 Feb 2007) | 2 lines
Make functools.wraps() docs a bit clearer.
........
r53785 | georg.brandl | 2007-02-15 12:29:04 +0100 (Thu, 15 Feb 2007) | 2 lines
Patch #1494140: Add documentation for the new struct.Struct object.
........
r53787 | georg.brandl | 2007-02-15 12:29:55 +0100 (Thu, 15 Feb 2007) | 2 lines
Add missing \versionadded.
........
r53800 | brett.cannon | 2007-02-15 23:54:39 +0100 (Thu, 15 Feb 2007) | 11 lines
Update the encoding package's search function to use absolute imports when
calling __import__. This helps make the expected search locations for encoding
modules be more explicit.
One could use an explicit value for __path__ when making the call to __import__
to force the exact location searched for encodings. This would give the most
strict search path possible if one is worried about malicious code being
imported. The unfortunate side-effect of that is that if __path__ was modified
on 'encodings' on purpose in a safe way it would not be picked up in future
__import__ calls.
........
r53801 | brett.cannon | 2007-02-16 20:33:01 +0100 (Fri, 16 Feb 2007) | 2 lines
Make the __import__ call in encodings.__init__ absolute with a level 0 call.
........
r53809 | vinay.sajip | 2007-02-16 23:36:24 +0100 (Fri, 16 Feb 2007) | 1 line
Minor fix for currentframe (SF #1652788).
........
r53818 | raymond.hettinger | 2007-02-19 03:03:19 +0100 (Mon, 19 Feb 2007) | 3 lines
Extend work on revision 52962: Eliminate redundant calls to PyObject_Hash().
........
r53820 | raymond.hettinger | 2007-02-19 05:08:43 +0100 (Mon, 19 Feb 2007) | 1 line
Add merge() function to heapq.
........
r53821 | raymond.hettinger | 2007-02-19 06:28:28 +0100 (Mon, 19 Feb 2007) | 1 line
Add tie-breaker count to preserve sort stability.
........
r53822 | raymond.hettinger | 2007-02-19 07:59:32 +0100 (Mon, 19 Feb 2007) | 1 line
Use C heapreplace() instead of slower _siftup() in pure python.
........
r53823 | raymond.hettinger | 2007-02-19 08:30:21 +0100 (Mon, 19 Feb 2007) | 1 line
Add test for merge stability
........
r53824 | raymond.hettinger | 2007-02-19 10:14:10 +0100 (Mon, 19 Feb 2007) | 1 line
Provide an example of defaultdict with non-zero constant factory function.
........
r53825 | lars.gustaebel | 2007-02-19 10:54:47 +0100 (Mon, 19 Feb 2007) | 2 lines
Moved misplaced news item.
........
r53826 | martin.v.loewis | 2007-02-19 11:55:19 +0100 (Mon, 19 Feb 2007) | 3 lines
Patch #1490190: posixmodule now includes os.chflags() and os.lchflags()
functions on platforms where the underlying system calls are available.
........
r53827 | raymond.hettinger | 2007-02-19 19:15:04 +0100 (Mon, 19 Feb 2007) | 1 line
Fixup docstrings for merge().
........
r53829 | raymond.hettinger | 2007-02-19 21:44:04 +0100 (Mon, 19 Feb 2007) | 1 line
Fixup set/dict interoperability.
........
r53837 | raymond.hettinger | 2007-02-21 06:20:38 +0100 (Wed, 21 Feb 2007) | 1 line
Add itertools.izip_longest().
........
r53838 | raymond.hettinger | 2007-02-21 18:22:05 +0100 (Wed, 21 Feb 2007) | 1 line
Remove filler struct item and fix leak.
........
2007-02-23 15:07:44 +00:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_CHFLAGS */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
Merged revisions 53623-53858 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r53624 | peter.astrand | 2007-02-02 20:06:36 +0100 (Fri, 02 Feb 2007) | 1 line
We had several if statements checking the value of a fd. This is unsafe, since valid fds might be zero. We should check for not None instead.
........
r53635 | kurt.kaiser | 2007-02-05 07:03:18 +0100 (Mon, 05 Feb 2007) | 2 lines
Add 'raw' support to configHandler. Patch 1650174 Tal Einat.
........
r53641 | kurt.kaiser | 2007-02-06 00:02:16 +0100 (Tue, 06 Feb 2007) | 5 lines
1. Calltips now 'handle' tuples in the argument list (display '<tuple>' :)
Suggested solution by Christos Georgiou, Bug 791968.
2. Clean up tests, were not failing when they should have been.
4. Remove some camelcase and an unneeded try/except block.
........
r53644 | kurt.kaiser | 2007-02-06 04:21:40 +0100 (Tue, 06 Feb 2007) | 2 lines
Clean up ModifiedInterpreter.runcode() structure
........
r53646 | peter.astrand | 2007-02-06 16:37:50 +0100 (Tue, 06 Feb 2007) | 1 line
Applied patch 1124861.3.patch to solve bug #1124861: Automatically create pipes on Windows, if GetStdHandle fails. Will backport.
........
r53648 | lars.gustaebel | 2007-02-06 19:38:13 +0100 (Tue, 06 Feb 2007) | 4 lines
Patch #1652681: create nonexistent files in append mode and
allow appending to empty files.
........
r53649 | kurt.kaiser | 2007-02-06 20:09:43 +0100 (Tue, 06 Feb 2007) | 4 lines
Updated patch (CodeContext.061217.patch) to
[ 1362975 ] CodeContext - Improved text indentation
Tal Einat 16Dec06
........
r53650 | kurt.kaiser | 2007-02-06 20:21:19 +0100 (Tue, 06 Feb 2007) | 2 lines
narrow exception per [ 1540849 ] except too broad
........
r53653 | kurt.kaiser | 2007-02-07 04:39:41 +0100 (Wed, 07 Feb 2007) | 4 lines
[ 1621265 ] Auto-completion list placement
Move AC window below input line unless not enough space, then put it above.
Patch: Tal Einat
........
r53654 | kurt.kaiser | 2007-02-07 09:07:13 +0100 (Wed, 07 Feb 2007) | 2 lines
Handle AttributeError during calltip lookup
........
r53656 | raymond.hettinger | 2007-02-07 21:08:22 +0100 (Wed, 07 Feb 2007) | 3 lines
SF #1615701: make d.update(m) honor __getitem__() and keys() in dict subclasses
........
r53658 | raymond.hettinger | 2007-02-07 22:04:20 +0100 (Wed, 07 Feb 2007) | 1 line
SF: 1397711 Set docs conflated immutable and hashable
........
r53660 | raymond.hettinger | 2007-02-07 22:42:17 +0100 (Wed, 07 Feb 2007) | 1 line
Check for a common user error with defaultdict().
........
r53662 | raymond.hettinger | 2007-02-07 23:24:07 +0100 (Wed, 07 Feb 2007) | 1 line
Bug #1575169: operator.isSequenceType() now returns False for subclasses of dict.
........
r53664 | raymond.hettinger | 2007-02-08 00:49:03 +0100 (Thu, 08 Feb 2007) | 1 line
Silence compiler warning
........
r53666 | raymond.hettinger | 2007-02-08 01:07:32 +0100 (Thu, 08 Feb 2007) | 1 line
Do not let overflows in enumerate() and count() pass silently.
........
r53668 | raymond.hettinger | 2007-02-08 01:50:39 +0100 (Thu, 08 Feb 2007) | 1 line
Bypass set specific optimizations for set and frozenset subclasses.
........
r53670 | raymond.hettinger | 2007-02-08 02:42:35 +0100 (Thu, 08 Feb 2007) | 1 line
Fix docstring bug
........
r53671 | martin.v.loewis | 2007-02-08 10:13:36 +0100 (Thu, 08 Feb 2007) | 3 lines
Bug #1653736: Complain about keyword arguments to time.isoformat.
Will backport to 2.5.
........
r53679 | kurt.kaiser | 2007-02-08 23:58:18 +0100 (Thu, 08 Feb 2007) | 6 lines
Corrected some bugs in AutoComplete. Also, Page Up/Down in ACW implemented;
mouse and cursor selection in ACWindow implemented; double Tab inserts current
selection and closes ACW (similar to double-click and Return); scroll wheel now
works in ACW. Added AutoComplete instructions to IDLE Help.
........
r53689 | martin.v.loewis | 2007-02-09 13:19:32 +0100 (Fri, 09 Feb 2007) | 3 lines
Bug #1653736: Properly discard third argument to slot_nb_inplace_power.
Will backport.
........
r53691 | martin.v.loewis | 2007-02-09 13:36:48 +0100 (Fri, 09 Feb 2007) | 4 lines
Bug #1600860: Search for shared python library in LIBDIR, not
lib/python/config, on "linux" and "gnu" systems.
Will backport.
........
r53693 | martin.v.loewis | 2007-02-09 13:58:49 +0100 (Fri, 09 Feb 2007) | 2 lines
Update broken link. Will backport to 2.5.
........
r53697 | georg.brandl | 2007-02-09 19:48:41 +0100 (Fri, 09 Feb 2007) | 2 lines
Bug #1656078: typo in in profile docs.
........
r53731 | brett.cannon | 2007-02-11 06:36:00 +0100 (Sun, 11 Feb 2007) | 3 lines
Change a very minor inconsistency (that is purely cosmetic) in the AST
definition.
........
r53735 | skip.montanaro | 2007-02-11 19:24:37 +0100 (Sun, 11 Feb 2007) | 1 line
fix trace.py --ignore-dir
........
r53741 | brett.cannon | 2007-02-11 20:44:41 +0100 (Sun, 11 Feb 2007) | 3 lines
Check in changed Python-ast.c from a cosmetic change to Python.asdl (in
r53731).
........
r53751 | brett.cannon | 2007-02-12 04:51:02 +0100 (Mon, 12 Feb 2007) | 5 lines
Modify Parser/asdl_c.py so that the __version__ number for Python/Python-ast.c
is specified at the top of the file. Also add a note that Python/Python-ast.c
needs to be committed separately after a change to the AST grammar to capture
the revision number of the change (which is what __version__ is set to).
........
r53752 | lars.gustaebel | 2007-02-12 10:25:53 +0100 (Mon, 12 Feb 2007) | 3 lines
Bug #1656581: Point out that external file objects are supposed to be
at position 0.
........
r53754 | martin.v.loewis | 2007-02-12 13:21:10 +0100 (Mon, 12 Feb 2007) | 3 lines
Patch 1463026: Support default namespace in XMLGenerator.
Fixes #847665. Will backport.
........
r53757 | armin.rigo | 2007-02-12 17:23:24 +0100 (Mon, 12 Feb 2007) | 4 lines
Fix the line to what is my guess at the original author's meaning.
(The line has no effect anyway, but is present because it's
customary call the base class __init__).
........
r53763 | martin.v.loewis | 2007-02-13 09:34:45 +0100 (Tue, 13 Feb 2007) | 3 lines
Patch #685268: Consider a package's __path__ in imputil.
Will backport.
........
r53765 | martin.v.loewis | 2007-02-13 10:49:38 +0100 (Tue, 13 Feb 2007) | 2 lines
Patch #698833: Support file decryption in zipfile.
........
r53766 | martin.v.loewis | 2007-02-13 11:10:39 +0100 (Tue, 13 Feb 2007) | 3 lines
Patch #1517891: Make 'a' create the file if it doesn't exist.
Fixes #1514451.
........
r53767 | martin.v.loewis | 2007-02-13 13:08:24 +0100 (Tue, 13 Feb 2007) | 3 lines
Bug #1658794: Remove extraneous 'this'.
Will backport to 2.5.
........
r53769 | martin.v.loewis | 2007-02-13 13:14:19 +0100 (Tue, 13 Feb 2007) | 3 lines
Patch #1657276: Make NETLINK_DNRTMSG conditional.
Will backport.
........
r53771 | lars.gustaebel | 2007-02-13 17:09:24 +0100 (Tue, 13 Feb 2007) | 4 lines
Patch #1647484: Renamed GzipFile's filename attribute to name. The
filename attribute is still accessible as a property that emits a
DeprecationWarning.
........
r53772 | lars.gustaebel | 2007-02-13 17:24:00 +0100 (Tue, 13 Feb 2007) | 3 lines
Strip the '.gz' extension from the filename that is written to the
gzip header.
........
r53774 | martin.v.loewis | 2007-02-14 11:07:37 +0100 (Wed, 14 Feb 2007) | 2 lines
Patch #1432399: Add HCI sockets.
........
r53775 | martin.v.loewis | 2007-02-14 12:30:07 +0100 (Wed, 14 Feb 2007) | 2 lines
Update 1432399 to removal of _BT_SOCKADDR_MEMB.
........
r53776 | martin.v.loewis | 2007-02-14 12:30:56 +0100 (Wed, 14 Feb 2007) | 3 lines
Ignore directory time stamps when considering
whether to rerun libffi configure.
........
r53778 | lars.gustaebel | 2007-02-14 15:45:12 +0100 (Wed, 14 Feb 2007) | 4 lines
A missing binary mode in AppendTest caused failures in Windows
Buildbot.
........
r53782 | martin.v.loewis | 2007-02-15 10:51:35 +0100 (Thu, 15 Feb 2007) | 2 lines
Patch #1397848: add the reasoning behind no-resize-on-shrinkage.
........
r53783 | georg.brandl | 2007-02-15 11:37:59 +0100 (Thu, 15 Feb 2007) | 2 lines
Make functools.wraps() docs a bit clearer.
........
r53785 | georg.brandl | 2007-02-15 12:29:04 +0100 (Thu, 15 Feb 2007) | 2 lines
Patch #1494140: Add documentation for the new struct.Struct object.
........
r53787 | georg.brandl | 2007-02-15 12:29:55 +0100 (Thu, 15 Feb 2007) | 2 lines
Add missing \versionadded.
........
r53800 | brett.cannon | 2007-02-15 23:54:39 +0100 (Thu, 15 Feb 2007) | 11 lines
Update the encoding package's search function to use absolute imports when
calling __import__. This helps make the expected search locations for encoding
modules be more explicit.
One could use an explicit value for __path__ when making the call to __import__
to force the exact location searched for encodings. This would give the most
strict search path possible if one is worried about malicious code being
imported. The unfortunate side-effect of that is that if __path__ was modified
on 'encodings' on purpose in a safe way it would not be picked up in future
__import__ calls.
........
r53801 | brett.cannon | 2007-02-16 20:33:01 +0100 (Fri, 16 Feb 2007) | 2 lines
Make the __import__ call in encodings.__init__ absolute with a level 0 call.
........
r53809 | vinay.sajip | 2007-02-16 23:36:24 +0100 (Fri, 16 Feb 2007) | 1 line
Minor fix for currentframe (SF #1652788).
........
r53818 | raymond.hettinger | 2007-02-19 03:03:19 +0100 (Mon, 19 Feb 2007) | 3 lines
Extend work on revision 52962: Eliminate redundant calls to PyObject_Hash().
........
r53820 | raymond.hettinger | 2007-02-19 05:08:43 +0100 (Mon, 19 Feb 2007) | 1 line
Add merge() function to heapq.
........
r53821 | raymond.hettinger | 2007-02-19 06:28:28 +0100 (Mon, 19 Feb 2007) | 1 line
Add tie-breaker count to preserve sort stability.
........
r53822 | raymond.hettinger | 2007-02-19 07:59:32 +0100 (Mon, 19 Feb 2007) | 1 line
Use C heapreplace() instead of slower _siftup() in pure python.
........
r53823 | raymond.hettinger | 2007-02-19 08:30:21 +0100 (Mon, 19 Feb 2007) | 1 line
Add test for merge stability
........
r53824 | raymond.hettinger | 2007-02-19 10:14:10 +0100 (Mon, 19 Feb 2007) | 1 line
Provide an example of defaultdict with non-zero constant factory function.
........
r53825 | lars.gustaebel | 2007-02-19 10:54:47 +0100 (Mon, 19 Feb 2007) | 2 lines
Moved misplaced news item.
........
r53826 | martin.v.loewis | 2007-02-19 11:55:19 +0100 (Mon, 19 Feb 2007) | 3 lines
Patch #1490190: posixmodule now includes os.chflags() and os.lchflags()
functions on platforms where the underlying system calls are available.
........
r53827 | raymond.hettinger | 2007-02-19 19:15:04 +0100 (Mon, 19 Feb 2007) | 1 line
Fixup docstrings for merge().
........
r53829 | raymond.hettinger | 2007-02-19 21:44:04 +0100 (Mon, 19 Feb 2007) | 1 line
Fixup set/dict interoperability.
........
r53837 | raymond.hettinger | 2007-02-21 06:20:38 +0100 (Wed, 21 Feb 2007) | 1 line
Add itertools.izip_longest().
........
r53838 | raymond.hettinger | 2007-02-21 18:22:05 +0100 (Wed, 21 Feb 2007) | 1 line
Remove filler struct item and fix leak.
........
2007-02-23 15:07:44 +00:00
|
|
|
#ifdef HAVE_LCHFLAGS
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.lchflags
|
|
|
|
|
|
|
|
|
|
path: path_t
|
|
|
|
|
flags: unsigned_long(bitwise=True)
|
|
|
|
|
|
|
|
|
|
Set file flags.
|
|
|
|
|
|
|
|
|
|
This function will not follow symbolic links.
|
|
|
|
|
Equivalent to chflags(path, flags, follow_symlinks=False).
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_lchflags_impl(PyObject *module, path_t *path, unsigned long flags)
|
|
|
|
|
/*[clinic end generated code: output=30ae958695c07316 input=f9f82ea8b585ca9d]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
int res;
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.chflags", "Ok", path->object, flags) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2014-08-05 16:06:16 +10:00
|
|
|
res = lchflags(path->narrow, flags);
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
2012-10-30 02:17:38 +01:00
|
|
|
if (res < 0) {
|
2014-08-05 14:04:04 +10:00
|
|
|
return path_error(path);
|
2012-10-30 02:17:38 +01:00
|
|
|
}
|
|
|
|
|
Py_RETURN_NONE;
|
Merged revisions 53623-53858 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r53624 | peter.astrand | 2007-02-02 20:06:36 +0100 (Fri, 02 Feb 2007) | 1 line
We had several if statements checking the value of a fd. This is unsafe, since valid fds might be zero. We should check for not None instead.
........
r53635 | kurt.kaiser | 2007-02-05 07:03:18 +0100 (Mon, 05 Feb 2007) | 2 lines
Add 'raw' support to configHandler. Patch 1650174 Tal Einat.
........
r53641 | kurt.kaiser | 2007-02-06 00:02:16 +0100 (Tue, 06 Feb 2007) | 5 lines
1. Calltips now 'handle' tuples in the argument list (display '<tuple>' :)
Suggested solution by Christos Georgiou, Bug 791968.
2. Clean up tests, were not failing when they should have been.
4. Remove some camelcase and an unneeded try/except block.
........
r53644 | kurt.kaiser | 2007-02-06 04:21:40 +0100 (Tue, 06 Feb 2007) | 2 lines
Clean up ModifiedInterpreter.runcode() structure
........
r53646 | peter.astrand | 2007-02-06 16:37:50 +0100 (Tue, 06 Feb 2007) | 1 line
Applied patch 1124861.3.patch to solve bug #1124861: Automatically create pipes on Windows, if GetStdHandle fails. Will backport.
........
r53648 | lars.gustaebel | 2007-02-06 19:38:13 +0100 (Tue, 06 Feb 2007) | 4 lines
Patch #1652681: create nonexistent files in append mode and
allow appending to empty files.
........
r53649 | kurt.kaiser | 2007-02-06 20:09:43 +0100 (Tue, 06 Feb 2007) | 4 lines
Updated patch (CodeContext.061217.patch) to
[ 1362975 ] CodeContext - Improved text indentation
Tal Einat 16Dec06
........
r53650 | kurt.kaiser | 2007-02-06 20:21:19 +0100 (Tue, 06 Feb 2007) | 2 lines
narrow exception per [ 1540849 ] except too broad
........
r53653 | kurt.kaiser | 2007-02-07 04:39:41 +0100 (Wed, 07 Feb 2007) | 4 lines
[ 1621265 ] Auto-completion list placement
Move AC window below input line unless not enough space, then put it above.
Patch: Tal Einat
........
r53654 | kurt.kaiser | 2007-02-07 09:07:13 +0100 (Wed, 07 Feb 2007) | 2 lines
Handle AttributeError during calltip lookup
........
r53656 | raymond.hettinger | 2007-02-07 21:08:22 +0100 (Wed, 07 Feb 2007) | 3 lines
SF #1615701: make d.update(m) honor __getitem__() and keys() in dict subclasses
........
r53658 | raymond.hettinger | 2007-02-07 22:04:20 +0100 (Wed, 07 Feb 2007) | 1 line
SF: 1397711 Set docs conflated immutable and hashable
........
r53660 | raymond.hettinger | 2007-02-07 22:42:17 +0100 (Wed, 07 Feb 2007) | 1 line
Check for a common user error with defaultdict().
........
r53662 | raymond.hettinger | 2007-02-07 23:24:07 +0100 (Wed, 07 Feb 2007) | 1 line
Bug #1575169: operator.isSequenceType() now returns False for subclasses of dict.
........
r53664 | raymond.hettinger | 2007-02-08 00:49:03 +0100 (Thu, 08 Feb 2007) | 1 line
Silence compiler warning
........
r53666 | raymond.hettinger | 2007-02-08 01:07:32 +0100 (Thu, 08 Feb 2007) | 1 line
Do not let overflows in enumerate() and count() pass silently.
........
r53668 | raymond.hettinger | 2007-02-08 01:50:39 +0100 (Thu, 08 Feb 2007) | 1 line
Bypass set specific optimizations for set and frozenset subclasses.
........
r53670 | raymond.hettinger | 2007-02-08 02:42:35 +0100 (Thu, 08 Feb 2007) | 1 line
Fix docstring bug
........
r53671 | martin.v.loewis | 2007-02-08 10:13:36 +0100 (Thu, 08 Feb 2007) | 3 lines
Bug #1653736: Complain about keyword arguments to time.isoformat.
Will backport to 2.5.
........
r53679 | kurt.kaiser | 2007-02-08 23:58:18 +0100 (Thu, 08 Feb 2007) | 6 lines
Corrected some bugs in AutoComplete. Also, Page Up/Down in ACW implemented;
mouse and cursor selection in ACWindow implemented; double Tab inserts current
selection and closes ACW (similar to double-click and Return); scroll wheel now
works in ACW. Added AutoComplete instructions to IDLE Help.
........
r53689 | martin.v.loewis | 2007-02-09 13:19:32 +0100 (Fri, 09 Feb 2007) | 3 lines
Bug #1653736: Properly discard third argument to slot_nb_inplace_power.
Will backport.
........
r53691 | martin.v.loewis | 2007-02-09 13:36:48 +0100 (Fri, 09 Feb 2007) | 4 lines
Bug #1600860: Search for shared python library in LIBDIR, not
lib/python/config, on "linux" and "gnu" systems.
Will backport.
........
r53693 | martin.v.loewis | 2007-02-09 13:58:49 +0100 (Fri, 09 Feb 2007) | 2 lines
Update broken link. Will backport to 2.5.
........
r53697 | georg.brandl | 2007-02-09 19:48:41 +0100 (Fri, 09 Feb 2007) | 2 lines
Bug #1656078: typo in in profile docs.
........
r53731 | brett.cannon | 2007-02-11 06:36:00 +0100 (Sun, 11 Feb 2007) | 3 lines
Change a very minor inconsistency (that is purely cosmetic) in the AST
definition.
........
r53735 | skip.montanaro | 2007-02-11 19:24:37 +0100 (Sun, 11 Feb 2007) | 1 line
fix trace.py --ignore-dir
........
r53741 | brett.cannon | 2007-02-11 20:44:41 +0100 (Sun, 11 Feb 2007) | 3 lines
Check in changed Python-ast.c from a cosmetic change to Python.asdl (in
r53731).
........
r53751 | brett.cannon | 2007-02-12 04:51:02 +0100 (Mon, 12 Feb 2007) | 5 lines
Modify Parser/asdl_c.py so that the __version__ number for Python/Python-ast.c
is specified at the top of the file. Also add a note that Python/Python-ast.c
needs to be committed separately after a change to the AST grammar to capture
the revision number of the change (which is what __version__ is set to).
........
r53752 | lars.gustaebel | 2007-02-12 10:25:53 +0100 (Mon, 12 Feb 2007) | 3 lines
Bug #1656581: Point out that external file objects are supposed to be
at position 0.
........
r53754 | martin.v.loewis | 2007-02-12 13:21:10 +0100 (Mon, 12 Feb 2007) | 3 lines
Patch 1463026: Support default namespace in XMLGenerator.
Fixes #847665. Will backport.
........
r53757 | armin.rigo | 2007-02-12 17:23:24 +0100 (Mon, 12 Feb 2007) | 4 lines
Fix the line to what is my guess at the original author's meaning.
(The line has no effect anyway, but is present because it's
customary call the base class __init__).
........
r53763 | martin.v.loewis | 2007-02-13 09:34:45 +0100 (Tue, 13 Feb 2007) | 3 lines
Patch #685268: Consider a package's __path__ in imputil.
Will backport.
........
r53765 | martin.v.loewis | 2007-02-13 10:49:38 +0100 (Tue, 13 Feb 2007) | 2 lines
Patch #698833: Support file decryption in zipfile.
........
r53766 | martin.v.loewis | 2007-02-13 11:10:39 +0100 (Tue, 13 Feb 2007) | 3 lines
Patch #1517891: Make 'a' create the file if it doesn't exist.
Fixes #1514451.
........
r53767 | martin.v.loewis | 2007-02-13 13:08:24 +0100 (Tue, 13 Feb 2007) | 3 lines
Bug #1658794: Remove extraneous 'this'.
Will backport to 2.5.
........
r53769 | martin.v.loewis | 2007-02-13 13:14:19 +0100 (Tue, 13 Feb 2007) | 3 lines
Patch #1657276: Make NETLINK_DNRTMSG conditional.
Will backport.
........
r53771 | lars.gustaebel | 2007-02-13 17:09:24 +0100 (Tue, 13 Feb 2007) | 4 lines
Patch #1647484: Renamed GzipFile's filename attribute to name. The
filename attribute is still accessible as a property that emits a
DeprecationWarning.
........
r53772 | lars.gustaebel | 2007-02-13 17:24:00 +0100 (Tue, 13 Feb 2007) | 3 lines
Strip the '.gz' extension from the filename that is written to the
gzip header.
........
r53774 | martin.v.loewis | 2007-02-14 11:07:37 +0100 (Wed, 14 Feb 2007) | 2 lines
Patch #1432399: Add HCI sockets.
........
r53775 | martin.v.loewis | 2007-02-14 12:30:07 +0100 (Wed, 14 Feb 2007) | 2 lines
Update 1432399 to removal of _BT_SOCKADDR_MEMB.
........
r53776 | martin.v.loewis | 2007-02-14 12:30:56 +0100 (Wed, 14 Feb 2007) | 3 lines
Ignore directory time stamps when considering
whether to rerun libffi configure.
........
r53778 | lars.gustaebel | 2007-02-14 15:45:12 +0100 (Wed, 14 Feb 2007) | 4 lines
A missing binary mode in AppendTest caused failures in Windows
Buildbot.
........
r53782 | martin.v.loewis | 2007-02-15 10:51:35 +0100 (Thu, 15 Feb 2007) | 2 lines
Patch #1397848: add the reasoning behind no-resize-on-shrinkage.
........
r53783 | georg.brandl | 2007-02-15 11:37:59 +0100 (Thu, 15 Feb 2007) | 2 lines
Make functools.wraps() docs a bit clearer.
........
r53785 | georg.brandl | 2007-02-15 12:29:04 +0100 (Thu, 15 Feb 2007) | 2 lines
Patch #1494140: Add documentation for the new struct.Struct object.
........
r53787 | georg.brandl | 2007-02-15 12:29:55 +0100 (Thu, 15 Feb 2007) | 2 lines
Add missing \versionadded.
........
r53800 | brett.cannon | 2007-02-15 23:54:39 +0100 (Thu, 15 Feb 2007) | 11 lines
Update the encoding package's search function to use absolute imports when
calling __import__. This helps make the expected search locations for encoding
modules be more explicit.
One could use an explicit value for __path__ when making the call to __import__
to force the exact location searched for encodings. This would give the most
strict search path possible if one is worried about malicious code being
imported. The unfortunate side-effect of that is that if __path__ was modified
on 'encodings' on purpose in a safe way it would not be picked up in future
__import__ calls.
........
r53801 | brett.cannon | 2007-02-16 20:33:01 +0100 (Fri, 16 Feb 2007) | 2 lines
Make the __import__ call in encodings.__init__ absolute with a level 0 call.
........
r53809 | vinay.sajip | 2007-02-16 23:36:24 +0100 (Fri, 16 Feb 2007) | 1 line
Minor fix for currentframe (SF #1652788).
........
r53818 | raymond.hettinger | 2007-02-19 03:03:19 +0100 (Mon, 19 Feb 2007) | 3 lines
Extend work on revision 52962: Eliminate redundant calls to PyObject_Hash().
........
r53820 | raymond.hettinger | 2007-02-19 05:08:43 +0100 (Mon, 19 Feb 2007) | 1 line
Add merge() function to heapq.
........
r53821 | raymond.hettinger | 2007-02-19 06:28:28 +0100 (Mon, 19 Feb 2007) | 1 line
Add tie-breaker count to preserve sort stability.
........
r53822 | raymond.hettinger | 2007-02-19 07:59:32 +0100 (Mon, 19 Feb 2007) | 1 line
Use C heapreplace() instead of slower _siftup() in pure python.
........
r53823 | raymond.hettinger | 2007-02-19 08:30:21 +0100 (Mon, 19 Feb 2007) | 1 line
Add test for merge stability
........
r53824 | raymond.hettinger | 2007-02-19 10:14:10 +0100 (Mon, 19 Feb 2007) | 1 line
Provide an example of defaultdict with non-zero constant factory function.
........
r53825 | lars.gustaebel | 2007-02-19 10:54:47 +0100 (Mon, 19 Feb 2007) | 2 lines
Moved misplaced news item.
........
r53826 | martin.v.loewis | 2007-02-19 11:55:19 +0100 (Mon, 19 Feb 2007) | 3 lines
Patch #1490190: posixmodule now includes os.chflags() and os.lchflags()
functions on platforms where the underlying system calls are available.
........
r53827 | raymond.hettinger | 2007-02-19 19:15:04 +0100 (Mon, 19 Feb 2007) | 1 line
Fixup docstrings for merge().
........
r53829 | raymond.hettinger | 2007-02-19 21:44:04 +0100 (Mon, 19 Feb 2007) | 1 line
Fixup set/dict interoperability.
........
r53837 | raymond.hettinger | 2007-02-21 06:20:38 +0100 (Wed, 21 Feb 2007) | 1 line
Add itertools.izip_longest().
........
r53838 | raymond.hettinger | 2007-02-21 18:22:05 +0100 (Wed, 21 Feb 2007) | 1 line
Remove filler struct item and fix leak.
........
2007-02-23 15:07:44 +00:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_LCHFLAGS */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2001-10-04 22:44:26 +00:00
|
|
|
#ifdef HAVE_CHROOT
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.chroot
|
|
|
|
|
path: path_t
|
2001-10-04 22:44:26 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Change root directory to path.
|
|
|
|
|
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_chroot_impl(PyObject *module, path_t *path)
|
|
|
|
|
/*[clinic end generated code: output=de80befc763a4475 input=14822965652c3dc3]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
int res;
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
res = chroot(path->narrow);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
if (res < 0)
|
|
|
|
|
return path_error(path);
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_CHROOT */
|
|
|
|
|
|
2001-10-04 22:44:26 +00:00
|
|
|
|
1999-01-08 21:05:37 +00:00
|
|
|
#ifdef HAVE_FSYNC
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.fsync
|
|
|
|
|
|
|
|
|
|
fd: fildes
|
|
|
|
|
|
|
|
|
|
Force write of fd to disk.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
1999-01-08 21:05:37 +00:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_fsync_impl(PyObject *module, int fd)
|
|
|
|
|
/*[clinic end generated code: output=4a10d773f52b3584 input=21c3645c056967f2]*/
|
1999-01-08 21:05:37 +00:00
|
|
|
{
|
2014-08-05 14:04:04 +10:00
|
|
|
return posix_fildes_fd(fd, fsync);
|
1999-01-08 21:05:37 +00:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_FSYNC */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2011-03-17 20:20:30 +02:00
|
|
|
#ifdef HAVE_SYNC
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.sync
|
|
|
|
|
|
|
|
|
|
Force write of everything to disk.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
2011-03-17 20:20:30 +02:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_sync_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=2796b1f0818cd71c input=84749fe5e9b404ff]*/
|
2011-03-17 20:20:30 +02:00
|
|
|
{
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
sync();
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_SYNC */
|
2011-03-17 20:20:30 +02:00
|
|
|
|
2000-09-22 16:01:05 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
#ifdef HAVE_FDATASYNC
|
2000-09-22 17:26:14 +00:00
|
|
|
#ifdef __hpux
|
2000-09-22 16:01:05 +00:00
|
|
|
extern int fdatasync(int); /* On HP-UX, in libc but not in unistd.h */
|
|
|
|
|
#endif
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.fdatasync
|
|
|
|
|
|
|
|
|
|
fd: fildes
|
|
|
|
|
|
|
|
|
|
Force write of fd to disk without forcing update of metadata.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_fdatasync_impl(PyObject *module, int fd)
|
|
|
|
|
/*[clinic end generated code: output=b4b9698b5d7e26dd input=bc74791ee54dd291]*/
|
1999-01-08 21:05:37 +00:00
|
|
|
{
|
2014-08-05 14:04:04 +10:00
|
|
|
return posix_fildes_fd(fd, fdatasync);
|
1999-01-08 21:05:37 +00:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_FDATASYNC */
|
|
|
|
|
|
|
|
|
|
|
2000-07-10 16:38:09 +00:00
|
|
|
#ifdef HAVE_CHOWN
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.chown
|
|
|
|
|
|
|
|
|
|
path : path_t(allow_fd='PATH_HAVE_FCHOWN')
|
2018-11-02 15:20:19 +00:00
|
|
|
Path to be examined; can be string, bytes, a path-like object, or open-file-descriptor int.
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
uid: uid_t
|
|
|
|
|
|
|
|
|
|
gid: gid_t
|
|
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
|
|
dir_fd : dir_fd(requires='fchownat') = None
|
|
|
|
|
If not None, it should be a file descriptor open to a directory,
|
|
|
|
|
and path should be relative; path will then be relative to that
|
|
|
|
|
directory.
|
|
|
|
|
|
|
|
|
|
follow_symlinks: bool = True
|
|
|
|
|
If False, and the last element of the path is a symbolic link,
|
|
|
|
|
stat will examine the symbolic link itself instead of the file
|
|
|
|
|
the link points to.
|
|
|
|
|
|
|
|
|
|
Change the owner and group id of path to the numeric uid and gid.\
|
|
|
|
|
|
|
|
|
|
path may always be specified as a string.
|
|
|
|
|
On some platforms, path may also be specified as an open file descriptor.
|
|
|
|
|
If this functionality is unavailable, using it raises an exception.
|
|
|
|
|
If dir_fd is not None, it should be a file descriptor open to a directory,
|
|
|
|
|
and path should be relative; path will then be relative to that directory.
|
|
|
|
|
If follow_symlinks is False, and the last element of the path is a symbolic
|
|
|
|
|
link, chown will modify the symbolic link itself instead of the file the
|
|
|
|
|
link points to.
|
|
|
|
|
It is an error to use dir_fd or follow_symlinks when specifying path as
|
|
|
|
|
an open file descriptor.
|
|
|
|
|
dir_fd and follow_symlinks may not be implemented on your platform.
|
|
|
|
|
If they are unavailable, using them will raise a NotImplementedError.
|
|
|
|
|
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_chown_impl(PyObject *module, path_t *path, uid_t uid, gid_t gid,
|
2015-04-14 18:07:59 -04:00
|
|
|
int dir_fd, int follow_symlinks)
|
2018-11-02 15:20:19 +00:00
|
|
|
/*[clinic end generated code: output=4beadab0db5f70cd input=b08c5ec67996a97d]*/
|
2012-06-22 16:30:09 -07:00
|
|
|
{
|
2015-04-03 23:53:51 +03:00
|
|
|
int result;
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2020-11-22 11:18:40 +01:00
|
|
|
#if defined(HAVE_FCHOWNAT)
|
|
|
|
|
int fchownat_unsupported = 0;
|
|
|
|
|
#endif
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
#if !(defined(HAVE_LCHOWN) || defined(HAVE_FCHOWNAT))
|
|
|
|
|
if (follow_symlinks_specified("chown", follow_symlinks))
|
2014-08-05 14:04:04 +10:00
|
|
|
return NULL;
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
2014-08-05 14:04:04 +10:00
|
|
|
if (dir_fd_and_fd_invalid("chown", dir_fd, path->fd) ||
|
|
|
|
|
fd_and_follow_symlinks_invalid("chown", path->fd, follow_symlinks))
|
|
|
|
|
return NULL;
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.chown", "OIIi", path->object, uid, gid,
|
|
|
|
|
dir_fd == DEFAULT_DIR_FD ? -1 : dir_fd) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef HAVE_FCHOWN
|
2014-08-05 14:04:04 +10:00
|
|
|
if (path->fd != -1)
|
|
|
|
|
result = fchown(path->fd, uid, gid);
|
2012-06-22 16:30:09 -07:00
|
|
|
else
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_LCHOWN
|
|
|
|
|
if ((!follow_symlinks) && (dir_fd == DEFAULT_DIR_FD))
|
2014-08-05 14:04:04 +10:00
|
|
|
result = lchown(path->narrow, uid, gid);
|
2012-06-22 16:30:09 -07:00
|
|
|
else
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_FCHOWNAT
|
2020-11-22 11:18:40 +01:00
|
|
|
if ((dir_fd != DEFAULT_DIR_FD) || (!follow_symlinks)) {
|
|
|
|
|
if (HAVE_FCHOWNAT_RUNTIME) {
|
2014-08-05 14:04:04 +10:00
|
|
|
result = fchownat(dir_fd, path->narrow, uid, gid,
|
2012-06-22 16:30:09 -07:00
|
|
|
follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW);
|
2020-11-22 11:18:40 +01:00
|
|
|
} else {
|
|
|
|
|
fchownat_unsupported = 1;
|
|
|
|
|
}
|
|
|
|
|
} else
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
2014-08-05 14:04:04 +10:00
|
|
|
result = chown(path->narrow, uid, gid);
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2020-11-22 11:18:40 +01:00
|
|
|
#ifdef HAVE_FCHOWNAT
|
|
|
|
|
if (fchownat_unsupported) {
|
|
|
|
|
/* This would be incorrect if the current platform
|
|
|
|
|
* doesn't support lchown.
|
|
|
|
|
*/
|
|
|
|
|
argument_unavailable_error(NULL, "dir_fd");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
if (result)
|
|
|
|
|
return path_error(path);
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
1994-08-01 11:34:53 +00:00
|
|
|
}
|
1994-08-18 15:42:46 +00:00
|
|
|
#endif /* HAVE_CHOWN */
|
1994-08-01 11:34:53 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2007-11-30 22:12:06 +00:00
|
|
|
#ifdef HAVE_FCHOWN
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.fchown
|
|
|
|
|
|
|
|
|
|
fd: int
|
|
|
|
|
uid: uid_t
|
|
|
|
|
gid: gid_t
|
|
|
|
|
|
|
|
|
|
Change the owner and group id of the file specified by file descriptor.
|
|
|
|
|
|
|
|
|
|
Equivalent to os.chown(fd, uid, gid).
|
|
|
|
|
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_fchown_impl(PyObject *module, int fd, uid_t uid, gid_t gid)
|
|
|
|
|
/*[clinic end generated code: output=97d21cbd5a4350a6 input=3af544ba1b13a0d7]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
int res;
|
2015-02-07 13:27:50 +00:00
|
|
|
int async_err = 0;
|
|
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.chown", "iIIi", fd, uid, gid, -1) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-07 13:27:50 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
res = fchown(fd, uid, gid);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (res != 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
|
|
|
|
if (res != 0)
|
|
|
|
|
return (!async_err) ? posix_error() : NULL;
|
|
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_RETURN_NONE;
|
2007-11-30 22:12:06 +00:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_FCHOWN */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2002-07-28 16:33:45 +00:00
|
|
|
#ifdef HAVE_LCHOWN
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.lchown
|
|
|
|
|
|
|
|
|
|
path : path_t
|
|
|
|
|
uid: uid_t
|
|
|
|
|
gid: gid_t
|
|
|
|
|
|
|
|
|
|
Change the owner and group id of path to the numeric uid and gid.
|
|
|
|
|
|
|
|
|
|
This function will not follow symbolic links.
|
|
|
|
|
Equivalent to os.chown(path, uid, gid, follow_symlinks=False).
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_lchown_impl(PyObject *module, path_t *path, uid_t uid, gid_t gid)
|
|
|
|
|
/*[clinic end generated code: output=25eaf6af412fdf2f input=b1c6014d563a7161]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
int res;
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.chown", "OIIi", path->object, uid, gid, -1) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2014-08-05 14:04:04 +10:00
|
|
|
res = lchown(path->narrow, uid, gid);
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
2012-10-30 02:17:38 +01:00
|
|
|
if (res < 0) {
|
2014-08-05 14:04:04 +10:00
|
|
|
return path_error(path);
|
2012-10-30 02:17:38 +01:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
2002-07-28 16:33:45 +00:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_LCHOWN */
|
|
|
|
|
|
1997-06-02 22:20:51 +00:00
|
|
|
|
1996-12-10 23:23:01 +00:00
|
|
|
static PyObject *
|
2008-10-02 18:55:37 +00:00
|
|
|
posix_getcwd(int use_bytes)
|
2002-10-03 05:10:39 +00:00
|
|
|
{
|
2009-05-17 04:21:53 +00:00
|
|
|
#ifdef MS_WINDOWS
|
2019-06-26 17:31:12 +02:00
|
|
|
wchar_t wbuf[MAXPATHLEN];
|
|
|
|
|
wchar_t *wbuf2 = wbuf;
|
|
|
|
|
DWORD len;
|
|
|
|
|
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
len = GetCurrentDirectoryW(Py_ARRAY_LENGTH(wbuf), wbuf);
|
|
|
|
|
/* If the buffer is large enough, len does not include the
|
|
|
|
|
terminating \0. If the buffer is too small, len includes
|
|
|
|
|
the space needed for the terminator. */
|
|
|
|
|
if (len >= Py_ARRAY_LENGTH(wbuf)) {
|
2019-06-28 18:01:59 +02:00
|
|
|
if (len <= PY_SSIZE_T_MAX / sizeof(wchar_t)) {
|
2013-07-07 16:21:41 +02:00
|
|
|
wbuf2 = PyMem_RawMalloc(len * sizeof(wchar_t));
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2019-06-26 17:31:12 +02:00
|
|
|
else {
|
|
|
|
|
wbuf2 = NULL;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2019-06-26 17:31:12 +02:00
|
|
|
if (wbuf2) {
|
|
|
|
|
len = GetCurrentDirectoryW(len, wbuf2);
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2019-06-26 17:31:12 +02:00
|
|
|
}
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
|
|
|
|
|
if (!wbuf2) {
|
|
|
|
|
PyErr_NoMemory();
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
if (!len) {
|
2012-10-31 22:24:06 +01:00
|
|
|
if (wbuf2 != wbuf)
|
2013-07-07 16:21:41 +02:00
|
|
|
PyMem_RawFree(wbuf2);
|
2019-06-26 17:31:12 +02:00
|
|
|
return PyErr_SetFromWindowsErr(0);
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2011-11-16 23:43:07 +01:00
|
|
|
|
2019-06-26 17:31:12 +02:00
|
|
|
PyObject *resobj = PyUnicode_FromWideChar(wbuf2, len);
|
|
|
|
|
if (wbuf2 != wbuf) {
|
|
|
|
|
PyMem_RawFree(wbuf2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (use_bytes) {
|
|
|
|
|
if (resobj == NULL) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
Py_SETREF(resobj, PyUnicode_EncodeFSDefault(resobj));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return resobj;
|
|
|
|
|
#else
|
|
|
|
|
const size_t chunk = 1024;
|
|
|
|
|
|
|
|
|
|
char *buf = NULL;
|
|
|
|
|
char *cwd = NULL;
|
|
|
|
|
size_t buflen = 0;
|
2010-05-06 00:08:46 +00:00
|
|
|
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2015-04-25 00:16:10 +02:00
|
|
|
do {
|
2019-06-26 17:31:12 +02:00
|
|
|
char *newbuf;
|
|
|
|
|
if (buflen <= PY_SSIZE_T_MAX - chunk) {
|
|
|
|
|
buflen += chunk;
|
|
|
|
|
newbuf = PyMem_RawRealloc(buf, buflen);
|
2016-03-14 18:07:53 +01:00
|
|
|
}
|
2019-06-26 17:31:12 +02:00
|
|
|
else {
|
|
|
|
|
newbuf = NULL;
|
|
|
|
|
}
|
|
|
|
|
if (newbuf == NULL) {
|
|
|
|
|
PyMem_RawFree(buf);
|
|
|
|
|
buf = NULL;
|
2015-04-25 00:16:10 +02:00
|
|
|
break;
|
2019-06-26 17:31:12 +02:00
|
|
|
}
|
|
|
|
|
buf = newbuf;
|
2015-04-25 00:16:10 +02:00
|
|
|
|
|
|
|
|
cwd = getcwd(buf, buflen);
|
|
|
|
|
} while (cwd == NULL && errno == ERANGE);
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
2015-04-25 00:16:10 +02:00
|
|
|
|
2019-06-26 17:31:12 +02:00
|
|
|
if (buf == NULL) {
|
|
|
|
|
return PyErr_NoMemory();
|
|
|
|
|
}
|
2015-04-25 00:16:10 +02:00
|
|
|
if (cwd == NULL) {
|
|
|
|
|
PyMem_RawFree(buf);
|
2010-05-06 00:08:46 +00:00
|
|
|
return posix_error();
|
2015-04-25 00:16:10 +02:00
|
|
|
}
|
|
|
|
|
|
2019-06-26 17:31:12 +02:00
|
|
|
PyObject *obj;
|
|
|
|
|
if (use_bytes) {
|
2015-04-25 00:16:10 +02:00
|
|
|
obj = PyBytes_FromStringAndSize(buf, strlen(buf));
|
2019-06-26 17:31:12 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2015-04-25 00:16:10 +02:00
|
|
|
obj = PyUnicode_DecodeFSDefault(buf);
|
2019-06-26 17:31:12 +02:00
|
|
|
}
|
2015-04-25 00:16:10 +02:00
|
|
|
PyMem_RawFree(buf);
|
|
|
|
|
|
|
|
|
|
return obj;
|
2019-06-26 17:31:12 +02:00
|
|
|
#endif /* !MS_WINDOWS */
|
2002-10-03 05:10:39 +00:00
|
|
|
}
|
2008-10-02 18:55:37 +00:00
|
|
|
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.getcwd
|
2008-10-02 18:55:37 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Return a unicode string representing the current working directory.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_getcwd_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=21badfae2ea99ddc input=f069211bb70e3d39]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
return posix_getcwd(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.getcwdb
|
|
|
|
|
|
|
|
|
|
Return a bytes string representing the current working directory.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_getcwdb_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=3dd47909480e4824 input=f6f6a378dad3d9cb]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
return posix_getcwd(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
#if ((!defined(HAVE_LINK)) && defined(MS_WINDOWS))
|
|
|
|
|
#define HAVE_LINK 1
|
|
|
|
|
#endif
|
1997-06-02 22:20:51 +00:00
|
|
|
|
1994-08-01 11:34:53 +00:00
|
|
|
#ifdef HAVE_LINK
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
|
|
|
|
|
os.link
|
|
|
|
|
|
|
|
|
|
src : path_t
|
|
|
|
|
dst : path_t
|
|
|
|
|
*
|
|
|
|
|
src_dir_fd : dir_fd = None
|
|
|
|
|
dst_dir_fd : dir_fd = None
|
|
|
|
|
follow_symlinks: bool = True
|
|
|
|
|
|
|
|
|
|
Create a hard link to a file.
|
|
|
|
|
|
|
|
|
|
If either src_dir_fd or dst_dir_fd is not None, it should be a file
|
|
|
|
|
descriptor open to a directory, and the respective path string (src or dst)
|
|
|
|
|
should be relative; the path will then be relative to that directory.
|
|
|
|
|
If follow_symlinks is False, and the last element of src is a symbolic
|
|
|
|
|
link, link will create a link to the symbolic link itself instead of the
|
|
|
|
|
file the link points to.
|
|
|
|
|
src_dir_fd, dst_dir_fd, and follow_symlinks may not be implemented on your
|
|
|
|
|
platform. If they are unavailable, using them will raise a
|
|
|
|
|
NotImplementedError.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_link_impl(PyObject *module, path_t *src, path_t *dst, int src_dir_fd,
|
2015-04-14 18:07:59 -04:00
|
|
|
int dst_dir_fd, int follow_symlinks)
|
2016-07-07 17:35:15 +03:00
|
|
|
/*[clinic end generated code: output=7f00f6007fd5269a input=b0095ebbcbaa7e04]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2010-11-24 20:24:31 +00:00
|
|
|
#ifdef MS_WINDOWS
|
2016-09-08 10:35:16 -07:00
|
|
|
BOOL result = FALSE;
|
2012-06-22 16:30:09 -07:00
|
|
|
#else
|
|
|
|
|
int result;
|
|
|
|
|
#endif
|
2020-11-22 11:18:40 +01:00
|
|
|
#if defined(HAVE_LINKAT)
|
|
|
|
|
int linkat_unavailable = 0;
|
|
|
|
|
#endif
|
2011-11-15 22:27:41 +01:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifndef HAVE_LINKAT
|
|
|
|
|
if ((src_dir_fd != DEFAULT_DIR_FD) || (dst_dir_fd != DEFAULT_DIR_FD)) {
|
|
|
|
|
argument_unavailable_error("link", "src_dir_fd and dst_dir_fd");
|
2014-08-05 14:04:04 +10:00
|
|
|
return NULL;
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
#endif
|
2010-11-28 23:59:46 +00:00
|
|
|
|
2016-09-08 10:35:16 -07:00
|
|
|
#ifndef MS_WINDOWS
|
2014-08-05 14:04:04 +10:00
|
|
|
if ((src->narrow && dst->wide) || (src->wide && dst->narrow)) {
|
2012-06-22 16:30:09 -07:00
|
|
|
PyErr_SetString(PyExc_NotImplementedError,
|
|
|
|
|
"link: src and dst must be the same type");
|
2014-08-05 14:04:04 +10:00
|
|
|
return NULL;
|
2010-11-28 23:59:46 +00:00
|
|
|
}
|
2016-09-08 10:35:16 -07:00
|
|
|
#endif
|
2010-11-28 23:59:46 +00:00
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.link", "OOii", src->object, dst->object,
|
|
|
|
|
src_dir_fd == DEFAULT_DIR_FD ? -1 : src_dir_fd,
|
|
|
|
|
dst_dir_fd == DEFAULT_DIR_FD ? -1 : dst_dir_fd) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2016-11-19 18:41:16 -08:00
|
|
|
result = CreateHardLinkW(dst->wide, src->wide, NULL);
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_END_ALLOW_THREADS
|
2010-11-24 20:24:31 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
if (!result)
|
|
|
|
|
return path_error2(src, dst);
|
2012-06-22 16:30:09 -07:00
|
|
|
#else
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2012-06-22 17:06:48 -07:00
|
|
|
#ifdef HAVE_LINKAT
|
2012-06-22 16:30:09 -07:00
|
|
|
if ((src_dir_fd != DEFAULT_DIR_FD) ||
|
|
|
|
|
(dst_dir_fd != DEFAULT_DIR_FD) ||
|
2020-11-22 11:18:40 +01:00
|
|
|
(!follow_symlinks)) {
|
|
|
|
|
|
|
|
|
|
if (HAVE_LINKAT_RUNTIME) {
|
|
|
|
|
|
|
|
|
|
result = linkat(src_dir_fd, src->narrow,
|
|
|
|
|
dst_dir_fd, dst->narrow,
|
|
|
|
|
follow_symlinks ? AT_SYMLINK_FOLLOW : 0);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#ifdef __APPLE__
|
|
|
|
|
else {
|
|
|
|
|
if (src_dir_fd == DEFAULT_DIR_FD && dst_dir_fd == DEFAULT_DIR_FD) {
|
|
|
|
|
/* See issue 41355: This matches the behaviour of !HAVE_LINKAT */
|
|
|
|
|
result = link(src->narrow, dst->narrow);
|
|
|
|
|
} else {
|
|
|
|
|
linkat_unavailable = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
}
|
2012-06-22 16:30:09 -07:00
|
|
|
else
|
2016-09-08 10:35:16 -07:00
|
|
|
#endif /* HAVE_LINKAT */
|
2014-08-05 14:04:04 +10:00
|
|
|
result = link(src->narrow, dst->narrow);
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_END_ALLOW_THREADS
|
2010-11-24 20:24:31 +00:00
|
|
|
|
2020-11-22 11:18:40 +01:00
|
|
|
#ifdef HAVE_LINKAT
|
|
|
|
|
if (linkat_unavailable) {
|
|
|
|
|
/* Either or both dir_fd arguments were specified */
|
|
|
|
|
if (src_dir_fd != DEFAULT_DIR_FD) {
|
|
|
|
|
argument_unavailable_error("link", "src_dir_fd");
|
|
|
|
|
} else {
|
|
|
|
|
argument_unavailable_error("link", "dst_dir_fd");
|
|
|
|
|
}
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
if (result)
|
|
|
|
|
return path_error2(src, dst);
|
2016-09-08 10:35:16 -07:00
|
|
|
#endif /* MS_WINDOWS */
|
2010-11-24 20:24:31 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
2010-11-24 20:24:31 +00:00
|
|
|
}
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
2010-11-24 20:24:31 +00:00
|
|
|
|
2013-03-20 18:51:33 -07:00
|
|
|
#if defined(MS_WINDOWS) && !defined(HAVE_OPENDIR)
|
1996-12-10 23:23:01 +00:00
|
|
|
static PyObject *
|
2013-03-20 20:52:50 -07:00
|
|
|
_listdir_windows_no_opendir(path_t *path, PyObject *list)
|
1994-08-01 11:34:53 +00:00
|
|
|
{
|
2012-06-22 16:30:09 -07:00
|
|
|
PyObject *v;
|
|
|
|
|
HANDLE hFindFile = INVALID_HANDLE_VALUE;
|
2010-05-06 00:08:46 +00:00
|
|
|
BOOL result;
|
2016-09-08 10:35:16 -07:00
|
|
|
wchar_t namebuf[MAX_PATH+4]; /* Overallocate for "\*.*" */
|
2012-06-22 16:30:09 -07:00
|
|
|
/* only claim to have space for MAX_PATH */
|
2013-11-24 19:23:25 +01:00
|
|
|
Py_ssize_t len = Py_ARRAY_LENGTH(namebuf)-4;
|
2012-06-22 16:30:09 -07:00
|
|
|
wchar_t *wnamebuf = NULL;
|
|
|
|
|
|
2016-09-08 10:35:16 -07:00
|
|
|
WIN32_FIND_DATAW wFileData;
|
|
|
|
|
const wchar_t *po_wchars;
|
2010-05-06 00:08:46 +00:00
|
|
|
|
2016-09-08 10:35:16 -07:00
|
|
|
if (!path->wide) { /* Default arg: "." */
|
|
|
|
|
po_wchars = L".";
|
|
|
|
|
len = 1;
|
|
|
|
|
} else {
|
|
|
|
|
po_wchars = path->wide;
|
|
|
|
|
len = wcslen(path->wide);
|
|
|
|
|
}
|
|
|
|
|
/* The +5 is so we can append "\\*.*\0" */
|
|
|
|
|
wnamebuf = PyMem_New(wchar_t, len + 5);
|
|
|
|
|
if (!wnamebuf) {
|
|
|
|
|
PyErr_NoMemory();
|
2012-06-22 16:30:09 -07:00
|
|
|
goto exit;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2016-09-08 10:35:16 -07:00
|
|
|
wcscpy(wnamebuf, po_wchars);
|
2010-05-06 00:08:46 +00:00
|
|
|
if (len > 0) {
|
2016-09-08 10:35:16 -07:00
|
|
|
wchar_t wch = wnamebuf[len-1];
|
|
|
|
|
if (wch != SEP && wch != ALTSEP && wch != L':')
|
|
|
|
|
wnamebuf[len++] = SEP;
|
|
|
|
|
wcscpy(wnamebuf + len, L"*.*");
|
|
|
|
|
}
|
|
|
|
|
if ((list = PyList_New(0)) == NULL) {
|
|
|
|
|
goto exit;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2010-08-09 23:39:31 +00:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2016-09-08 10:35:16 -07:00
|
|
|
hFindFile = FindFirstFileW(wnamebuf, &wFileData);
|
2010-08-09 23:39:31 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
2010-05-06 00:08:46 +00:00
|
|
|
if (hFindFile == INVALID_HANDLE_VALUE) {
|
|
|
|
|
int error = GetLastError();
|
|
|
|
|
if (error == ERROR_FILE_NOT_FOUND)
|
2012-06-22 16:30:09 -07:00
|
|
|
goto exit;
|
|
|
|
|
Py_DECREF(list);
|
2013-03-20 20:52:50 -07:00
|
|
|
list = path_error(path);
|
2012-06-22 16:30:09 -07:00
|
|
|
goto exit;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
|
|
|
|
do {
|
|
|
|
|
/* Skip over . and .. */
|
2016-09-08 10:35:16 -07:00
|
|
|
if (wcscmp(wFileData.cFileName, L".") != 0 &&
|
|
|
|
|
wcscmp(wFileData.cFileName, L"..") != 0) {
|
|
|
|
|
v = PyUnicode_FromWideChar(wFileData.cFileName,
|
|
|
|
|
wcslen(wFileData.cFileName));
|
|
|
|
|
if (path->narrow && v) {
|
|
|
|
|
Py_SETREF(v, PyUnicode_EncodeFSDefault(v));
|
|
|
|
|
}
|
2010-05-06 00:08:46 +00:00
|
|
|
if (v == NULL) {
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_DECREF(list);
|
|
|
|
|
list = NULL;
|
2010-05-06 00:08:46 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2012-06-22 16:30:09 -07:00
|
|
|
if (PyList_Append(list, v) != 0) {
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_DECREF(v);
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_DECREF(list);
|
|
|
|
|
list = NULL;
|
2010-05-06 00:08:46 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
Py_DECREF(v);
|
|
|
|
|
}
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2016-09-08 10:35:16 -07:00
|
|
|
result = FindNextFileW(hFindFile, &wFileData);
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
/* FindNextFile sets error to ERROR_NO_MORE_FILES if
|
|
|
|
|
it got to the end of the directory. */
|
|
|
|
|
if (!result && GetLastError() != ERROR_NO_MORE_FILES) {
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_DECREF(list);
|
2013-03-20 20:52:50 -07:00
|
|
|
list = path_error(path);
|
2012-06-22 16:30:09 -07:00
|
|
|
goto exit;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
|
|
|
|
} while (result == TRUE);
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
exit:
|
|
|
|
|
if (hFindFile != INVALID_HANDLE_VALUE) {
|
|
|
|
|
if (FindClose(hFindFile) == FALSE) {
|
|
|
|
|
if (list != NULL) {
|
|
|
|
|
Py_DECREF(list);
|
2013-03-20 20:52:50 -07:00
|
|
|
list = path_error(path);
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
}
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2013-07-07 16:21:41 +02:00
|
|
|
PyMem_Free(wnamebuf);
|
2010-05-06 00:08:46 +00:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
return list;
|
2013-03-20 18:51:33 -07:00
|
|
|
} /* end of _listdir_windows_no_opendir */
|
|
|
|
|
|
|
|
|
|
#else /* thus POSIX, ie: not (MS_WINDOWS and not HAVE_OPENDIR) */
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2013-03-20 20:52:50 -07:00
|
|
|
_posix_listdir(path_t *path, PyObject *list)
|
2013-03-20 18:51:33 -07:00
|
|
|
{
|
|
|
|
|
PyObject *v;
|
|
|
|
|
DIR *dirp = NULL;
|
|
|
|
|
struct dirent *ep;
|
|
|
|
|
int return_str; /* if false, return bytes */
|
2013-08-01 18:18:56 -07:00
|
|
|
#ifdef HAVE_FDOPENDIR
|
|
|
|
|
int fd = -1;
|
|
|
|
|
#endif
|
2013-03-20 18:51:33 -07:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
errno = 0;
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef HAVE_FDOPENDIR
|
2013-03-20 20:52:50 -07:00
|
|
|
if (path->fd != -1) {
|
2020-11-22 11:18:40 +01:00
|
|
|
if (HAVE_FDOPENDIR_RUNTIME) {
|
2012-06-22 16:30:09 -07:00
|
|
|
/* closedir() closes the FD, so we duplicate it */
|
2013-08-28 00:53:59 +02:00
|
|
|
fd = _Py_dup(path->fd);
|
2013-12-19 13:24:49 +01:00
|
|
|
if (fd == -1)
|
|
|
|
|
return NULL;
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2012-06-25 04:42:23 -07:00
|
|
|
return_str = 1;
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
dirp = fdopendir(fd);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
2020-11-22 11:18:40 +01:00
|
|
|
} else {
|
|
|
|
|
PyErr_SetString(PyExc_TypeError,
|
|
|
|
|
"listdir: path should be string, bytes, os.PathLike or None, not int");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2012-06-22 16:30:09 -07:00
|
|
|
else
|
|
|
|
|
#endif
|
|
|
|
|
{
|
2016-05-07 16:45:18 +03:00
|
|
|
const char *name;
|
2013-03-20 20:52:50 -07:00
|
|
|
if (path->narrow) {
|
|
|
|
|
name = path->narrow;
|
2017-07-11 06:36:46 +03:00
|
|
|
/* only return bytes if they specified a bytes-like object */
|
|
|
|
|
return_str = !PyObject_CheckBuffer(path->object);
|
2012-06-25 04:42:23 -07:00
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
name = ".";
|
|
|
|
|
return_str = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2010-09-04 17:21:57 +00:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2012-06-22 16:30:09 -07:00
|
|
|
dirp = opendir(name);
|
2010-09-04 17:21:57 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (dirp == NULL) {
|
2013-03-20 20:52:50 -07:00
|
|
|
list = path_error(path);
|
2013-08-01 18:18:56 -07:00
|
|
|
#ifdef HAVE_FDOPENDIR
|
|
|
|
|
if (fd != -1) {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
close(fd);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2012-06-22 16:30:09 -07:00
|
|
|
goto exit;
|
|
|
|
|
}
|
|
|
|
|
if ((list = PyList_New(0)) == NULL) {
|
|
|
|
|
goto exit;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
|
|
|
|
for (;;) {
|
|
|
|
|
errno = 0;
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
ep = readdir(dirp);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
if (ep == NULL) {
|
|
|
|
|
if (errno == 0) {
|
|
|
|
|
break;
|
|
|
|
|
} else {
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_DECREF(list);
|
2013-03-20 20:52:50 -07:00
|
|
|
list = path_error(path);
|
2012-06-22 16:30:09 -07:00
|
|
|
goto exit;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (ep->d_name[0] == '.' &&
|
|
|
|
|
(NAMLEN(ep) == 1 ||
|
|
|
|
|
(ep->d_name[1] == '.' && NAMLEN(ep) == 2)))
|
|
|
|
|
continue;
|
2012-06-25 04:42:23 -07:00
|
|
|
if (return_str)
|
2010-05-14 16:35:39 +00:00
|
|
|
v = PyUnicode_DecodeFSDefaultAndSize(ep->d_name, NAMLEN(ep));
|
|
|
|
|
else
|
|
|
|
|
v = PyBytes_FromStringAndSize(ep->d_name, NAMLEN(ep));
|
2010-05-06 00:08:46 +00:00
|
|
|
if (v == NULL) {
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_CLEAR(list);
|
2010-05-06 00:08:46 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2012-06-22 16:30:09 -07:00
|
|
|
if (PyList_Append(list, v) != 0) {
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_DECREF(v);
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_CLEAR(list);
|
2010-05-06 00:08:46 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
Py_DECREF(v);
|
|
|
|
|
}
|
2011-02-25 23:41:16 +00:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
exit:
|
|
|
|
|
if (dirp != NULL) {
|
2011-02-25 23:41:16 +00:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2013-08-01 18:18:56 -07:00
|
|
|
#ifdef HAVE_FDOPENDIR
|
2012-06-22 16:30:09 -07:00
|
|
|
if (fd > -1)
|
|
|
|
|
rewinddir(dirp);
|
2013-08-01 18:18:56 -07:00
|
|
|
#endif
|
2011-02-25 23:41:16 +00:00
|
|
|
closedir(dirp);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
return list;
|
2013-03-20 18:51:33 -07:00
|
|
|
} /* end of _posix_listdir */
|
|
|
|
|
#endif /* which OS */
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.listdir
|
|
|
|
|
|
|
|
|
|
path : path_t(nullable=True, allow_fd='PATH_HAVE_FDOPENDIR') = None
|
|
|
|
|
|
|
|
|
|
Return a list containing the names of the files in the directory.
|
|
|
|
|
|
2018-11-02 15:20:19 +00:00
|
|
|
path can be specified as either str, bytes, or a path-like object. If path is bytes,
|
2014-08-05 14:04:04 +10:00
|
|
|
the filenames returned will also be bytes; in all other circumstances
|
|
|
|
|
the filenames returned will be str.
|
|
|
|
|
If path is None, uses the path='.'.
|
|
|
|
|
On some platforms, path may also be specified as an open file descriptor;\
|
|
|
|
|
the file descriptor must refer to a directory.
|
|
|
|
|
If this functionality is unavailable, using it raises NotImplementedError.
|
|
|
|
|
|
|
|
|
|
The list is in arbitrary order. It does not include the special
|
|
|
|
|
entries '.' and '..' even if they are present in the directory.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_listdir_impl(PyObject *module, path_t *path)
|
2018-11-02 15:20:19 +00:00
|
|
|
/*[clinic end generated code: output=293045673fcd1a75 input=e3f58030f538295d]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2019-06-24 08:42:54 -07:00
|
|
|
if (PySys_Audit("os.listdir", "O",
|
|
|
|
|
path->object ? path->object : Py_None) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2013-03-20 18:51:33 -07:00
|
|
|
#if defined(MS_WINDOWS) && !defined(HAVE_OPENDIR)
|
2014-08-05 14:04:04 +10:00
|
|
|
return _listdir_windows_no_opendir(path, NULL);
|
2013-03-20 18:51:33 -07:00
|
|
|
#else
|
2014-08-05 14:04:04 +10:00
|
|
|
return _posix_listdir(path, NULL);
|
2013-03-20 18:51:33 -07:00
|
|
|
#endif
|
|
|
|
|
}
|
2011-02-25 23:41:16 +00:00
|
|
|
|
2002-06-30 15:26:10 +00:00
|
|
|
#ifdef MS_WINDOWS
|
2001-05-13 08:04:26 +00:00
|
|
|
/* A helper function for abspath on win32 */
|
2015-05-13 00:52:39 +03:00
|
|
|
/*[clinic input]
|
|
|
|
|
os._getfullpathname
|
|
|
|
|
|
|
|
|
|
path: path_t
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
2001-05-13 08:04:26 +00:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os__getfullpathname_impl(PyObject *module, path_t *path)
|
|
|
|
|
/*[clinic end generated code: output=bb8679d56845bc9b input=332ed537c29d0a3e]*/
|
2001-05-13 08:04:26 +00:00
|
|
|
{
|
2019-06-25 15:02:43 +02:00
|
|
|
wchar_t *abspath;
|
2011-09-30 01:44:27 +02:00
|
|
|
|
2019-06-25 15:02:43 +02:00
|
|
|
/* _Py_abspath() is implemented with GetFullPathNameW() on Windows */
|
|
|
|
|
if (_Py_abspath(path->wide, &abspath) < 0) {
|
|
|
|
|
return win32_error_object("GetFullPathNameW", path->object);
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2019-06-25 15:02:43 +02:00
|
|
|
if (abspath == NULL) {
|
|
|
|
|
return PyErr_NoMemory();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PyObject *str = PyUnicode_FromWideChar(abspath, wcslen(abspath));
|
|
|
|
|
PyMem_RawFree(abspath);
|
|
|
|
|
if (str == NULL) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
if (path->narrow) {
|
|
|
|
|
Py_SETREF(str, PyUnicode_EncodeFSDefault(str));
|
|
|
|
|
}
|
|
|
|
|
return str;
|
2014-08-05 14:04:04 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os._getfinalpathname
|
|
|
|
|
|
2018-02-22 10:39:10 -08:00
|
|
|
path: path_t
|
2014-08-05 14:04:04 +10:00
|
|
|
/
|
|
|
|
|
|
|
|
|
|
A helper function for samepath on windows.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
2010-07-08 21:39:08 +00:00
|
|
|
static PyObject *
|
2018-02-22 10:39:10 -08:00
|
|
|
os__getfinalpathname_impl(PyObject *module, path_t *path)
|
|
|
|
|
/*[clinic end generated code: output=621a3c79bc29ebfa input=2b6b6c7cbad5fb84]*/
|
2010-07-08 21:39:08 +00:00
|
|
|
{
|
|
|
|
|
HANDLE hFile;
|
2018-03-08 19:03:25 +03:00
|
|
|
wchar_t buf[MAXPATHLEN], *target_path = buf;
|
|
|
|
|
int buf_size = Py_ARRAY_LENGTH(buf);
|
2010-07-08 21:39:08 +00:00
|
|
|
int result_length;
|
2014-08-05 14:04:04 +10:00
|
|
|
PyObject *result;
|
2010-07-08 21:39:08 +00:00
|
|
|
|
2018-02-22 10:39:10 -08:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2010-07-08 21:39:08 +00:00
|
|
|
hFile = CreateFileW(
|
2018-02-22 10:39:10 -08:00
|
|
|
path->wide,
|
2010-07-08 21:39:08 +00:00
|
|
|
0, /* desired access */
|
|
|
|
|
0, /* share mode */
|
|
|
|
|
NULL, /* security attributes */
|
|
|
|
|
OPEN_EXISTING,
|
|
|
|
|
/* FILE_FLAG_BACKUP_SEMANTICS is required to open a directory */
|
|
|
|
|
FILE_FLAG_BACKUP_SEMANTICS,
|
|
|
|
|
NULL);
|
2018-03-08 19:03:25 +03:00
|
|
|
Py_END_ALLOW_THREADS
|
2011-02-25 14:39:16 +00:00
|
|
|
|
2018-02-22 10:39:10 -08:00
|
|
|
if (hFile == INVALID_HANDLE_VALUE) {
|
2018-03-08 19:03:25 +03:00
|
|
|
return win32_error_object("CreateFileW", path->object);
|
2018-02-22 10:39:10 -08:00
|
|
|
}
|
2010-07-08 21:39:08 +00:00
|
|
|
|
|
|
|
|
/* We have a good handle to the target, use it to determine the
|
|
|
|
|
target path name. */
|
2018-03-08 19:03:25 +03:00
|
|
|
while (1) {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
result_length = GetFinalPathNameByHandleW(hFile, target_path,
|
|
|
|
|
buf_size, VOLUME_NAME_DOS);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
2010-07-08 21:39:08 +00:00
|
|
|
|
2018-03-08 19:03:25 +03:00
|
|
|
if (!result_length) {
|
|
|
|
|
result = win32_error_object("GetFinalPathNameByHandleW",
|
|
|
|
|
path->object);
|
|
|
|
|
goto cleanup;
|
|
|
|
|
}
|
2010-07-08 21:39:08 +00:00
|
|
|
|
2018-03-08 19:03:25 +03:00
|
|
|
if (result_length < buf_size) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
2010-07-08 21:39:08 +00:00
|
|
|
|
2018-03-08 19:03:25 +03:00
|
|
|
wchar_t *tmp;
|
|
|
|
|
tmp = PyMem_Realloc(target_path != buf ? target_path : NULL,
|
|
|
|
|
result_length * sizeof(*tmp));
|
|
|
|
|
if (!tmp) {
|
|
|
|
|
result = PyErr_NoMemory();
|
|
|
|
|
goto cleanup;
|
|
|
|
|
}
|
2010-07-08 21:39:08 +00:00
|
|
|
|
2018-03-08 19:03:25 +03:00
|
|
|
buf_size = result_length;
|
|
|
|
|
target_path = tmp;
|
2018-02-22 10:39:10 -08:00
|
|
|
}
|
2010-07-08 21:39:08 +00:00
|
|
|
|
2011-11-22 02:27:30 +01:00
|
|
|
result = PyUnicode_FromWideChar(target_path, result_length);
|
2019-08-21 15:27:33 -07:00
|
|
|
if (result && path->narrow) {
|
2018-02-22 10:39:10 -08:00
|
|
|
Py_SETREF(result, PyUnicode_EncodeFSDefault(result));
|
2019-08-21 15:27:33 -07:00
|
|
|
}
|
2018-02-22 10:39:10 -08:00
|
|
|
|
2018-03-08 19:03:25 +03:00
|
|
|
cleanup:
|
|
|
|
|
if (target_path != buf) {
|
|
|
|
|
PyMem_Free(target_path);
|
|
|
|
|
}
|
|
|
|
|
CloseHandle(hFile);
|
|
|
|
|
return result;
|
2014-08-05 14:04:04 +10:00
|
|
|
}
|
2010-09-06 17:07:27 +00:00
|
|
|
|
2013-08-01 12:44:00 +01:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os._getvolumepathname
|
|
|
|
|
|
2018-02-22 10:39:10 -08:00
|
|
|
path: path_t
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
A helper function for ismount on Win32.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2018-02-22 10:39:10 -08:00
|
|
|
os__getvolumepathname_impl(PyObject *module, path_t *path)
|
|
|
|
|
/*[clinic end generated code: output=804c63fd13a1330b input=722b40565fa21552]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
PyObject *result;
|
2016-05-07 16:45:18 +03:00
|
|
|
wchar_t *mountpath=NULL;
|
2013-11-24 19:22:57 +01:00
|
|
|
size_t buflen;
|
2013-08-01 12:44:00 +01:00
|
|
|
BOOL ret;
|
|
|
|
|
|
|
|
|
|
/* Volume path should be shorter than entire path */
|
2018-02-22 10:39:10 -08:00
|
|
|
buflen = Py_MAX(path->length, MAX_PATH);
|
2013-11-24 19:22:57 +01:00
|
|
|
|
2017-10-24 16:53:32 -07:00
|
|
|
if (buflen > PY_DWORD_MAX) {
|
2013-11-24 19:22:57 +01:00
|
|
|
PyErr_SetString(PyExc_OverflowError, "path too long");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-16 13:33:32 +02:00
|
|
|
mountpath = PyMem_New(wchar_t, buflen);
|
2013-08-01 12:44:00 +01:00
|
|
|
if (mountpath == NULL)
|
|
|
|
|
return PyErr_NoMemory();
|
|
|
|
|
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2018-02-22 10:39:10 -08:00
|
|
|
ret = GetVolumePathNameW(path->wide, mountpath,
|
2013-11-24 19:22:57 +01:00
|
|
|
Py_SAFE_DOWNCAST(buflen, size_t, DWORD));
|
2013-08-01 12:44:00 +01:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
|
|
|
|
|
if (!ret) {
|
2018-02-22 10:39:10 -08:00
|
|
|
result = win32_error_object("_getvolumepathname", path->object);
|
2013-08-01 12:44:00 +01:00
|
|
|
goto exit;
|
|
|
|
|
}
|
|
|
|
|
result = PyUnicode_FromWideChar(mountpath, wcslen(mountpath));
|
2018-02-22 10:39:10 -08:00
|
|
|
if (path->narrow)
|
|
|
|
|
Py_SETREF(result, PyUnicode_EncodeFSDefault(result));
|
2013-08-01 12:44:00 +01:00
|
|
|
|
|
|
|
|
exit:
|
|
|
|
|
PyMem_Free(mountpath);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-07 12:35:36 +01:00
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os._path_splitroot
|
|
|
|
|
|
|
|
|
|
path: path_t
|
|
|
|
|
|
|
|
|
|
Removes everything after the root on Win32.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
os__path_splitroot_impl(PyObject *module, path_t *path)
|
|
|
|
|
/*[clinic end generated code: output=ab7f1a88b654581c input=dc93b1d3984cffb6]*/
|
|
|
|
|
{
|
|
|
|
|
wchar_t *buffer;
|
|
|
|
|
wchar_t *end;
|
|
|
|
|
PyObject *result = NULL;
|
|
|
|
|
HRESULT ret;
|
|
|
|
|
|
|
|
|
|
buffer = (wchar_t*)PyMem_Malloc(sizeof(wchar_t) * (wcslen(path->wide) + 1));
|
|
|
|
|
if (!buffer) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
wcscpy(buffer, path->wide);
|
|
|
|
|
for (wchar_t *p = wcschr(buffer, L'/'); p; p = wcschr(p, L'/')) {
|
|
|
|
|
*p = L'\\';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
ret = PathCchSkipRoot(buffer, &end);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
if (FAILED(ret)) {
|
|
|
|
|
result = Py_BuildValue("sO", "", path->object);
|
|
|
|
|
} else if (end != buffer) {
|
|
|
|
|
size_t rootLen = (size_t)(end - buffer);
|
|
|
|
|
result = Py_BuildValue("NN",
|
|
|
|
|
PyUnicode_FromWideChar(path->wide, rootLen),
|
|
|
|
|
PyUnicode_FromWideChar(path->wide + rootLen, -1)
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
result = Py_BuildValue("Os", path->object, "");
|
|
|
|
|
}
|
|
|
|
|
PyMem_Free(buffer);
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-06-30 15:26:10 +00:00
|
|
|
#endif /* MS_WINDOWS */
|
2001-05-13 08:04:26 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.mkdir
|
|
|
|
|
|
|
|
|
|
path : path_t
|
|
|
|
|
|
|
|
|
|
mode: int = 0o777
|
|
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
|
|
dir_fd : dir_fd(requires='mkdirat') = None
|
|
|
|
|
|
|
|
|
|
# "mkdir(path, mode=0o777, *, dir_fd=None)\n\n\
|
|
|
|
|
|
|
|
|
|
Create a directory.
|
|
|
|
|
|
|
|
|
|
If dir_fd is not None, it should be a file descriptor open to a directory,
|
|
|
|
|
and path should be relative; path will then be relative to that directory.
|
|
|
|
|
dir_fd may not be implemented on your platform.
|
|
|
|
|
If it is unavailable, using it will raise a NotImplementedError.
|
|
|
|
|
|
|
|
|
|
The mode argument is ignored on Windows.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_mkdir_impl(PyObject *module, path_t *path, int mode, int dir_fd)
|
|
|
|
|
/*[clinic end generated code: output=a70446903abe821f input=e965f68377e9b1ce]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
int result;
|
2020-11-22 11:18:40 +01:00
|
|
|
#ifdef HAVE_MKDIRAT
|
|
|
|
|
int mkdirat_unavailable = 0;
|
|
|
|
|
#endif
|
2002-10-03 05:10:39 +00:00
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.mkdir", "Oii", path->object, mode,
|
|
|
|
|
dir_fd == DEFAULT_DIR_FD ? -1 : dir_fd) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2009-05-17 04:21:53 +00:00
|
|
|
#ifdef MS_WINDOWS
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2016-09-08 10:35:16 -07:00
|
|
|
result = CreateDirectoryW(path->wide, NULL);
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_END_ALLOW_THREADS
|
2011-09-30 01:44:27 +02:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
if (!result)
|
|
|
|
|
return path_error(path);
|
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Inherits test_gzip/test_tarfile failures on 64-bit platforms from the trunk,
but I don't want the merge to hang around too long (even though the regular
p3yk-contributors are/have been busy with other things.)
Merged revisions 45621-46490 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r45621 | george.yoshida | 2006-04-21 18:34:17 +0200 (Fri, 21 Apr 2006) | 2 lines
Correct the grammar
........
r45622 | tim.peters | 2006-04-21 18:34:54 +0200 (Fri, 21 Apr 2006) | 2 lines
Whitespace normalization.
........
r45624 | thomas.heller | 2006-04-21 18:48:56 +0200 (Fri, 21 Apr 2006) | 1 line
Merge in changes from ctypes 0.9.9.6 upstream version.
........
r45625 | thomas.heller | 2006-04-21 18:51:04 +0200 (Fri, 21 Apr 2006) | 1 line
Merge in changes from ctypes 0.9.9.6 upstream version.
........
r45630 | thomas.heller | 2006-04-21 20:29:17 +0200 (Fri, 21 Apr 2006) | 8 lines
Documentation for ctypes.
I think that 'generic operating system services' is the best category.
Note that the Doc/lib/libctypes.latex file is generated from reST sources.
You are welcome to make typo fixes, and I'll try to keep the reST sources
in sync, but markup changes would be lost - they should be fixed in the tool
that creates the latex file.
The conversion script is external/ctypes/docs/manual/mkpydoc.py.
........
r45631 | tim.peters | 2006-04-21 23:18:10 +0200 (Fri, 21 Apr 2006) | 24 lines
SF bug #1473760 TempFile can hang on Windows.
Python 2.4 changed ntpath.abspath to do an import
inside the function. As a result, due to Python's
import lock, anything calling abspath on Windows
(directly, or indirectly like tempfile.TemporaryFile)
hung when it was called from a thread spawned as a
side effect of importing a module.
This is a depressingly frequent problem, and
deserves a more general fix. I'm settling for
a micro-fix here because this specific one accounts
for a report of Zope Corp's ZEO hanging on Windows,
and it was an odd way to change abspath to begin
with (ntpath needs a different implementation
depending on whether we're actually running on
Windows, and the _obvious_ way to arrange for that
is not to bury a possibly-failing import _inside_
the function).
Note that if/when other micro-fixes of this kind
get made, the new Lib/test/threaded_import_hangers.py
is a convenient place to add tests for them.
........
r45634 | phillip.eby | 2006-04-21 23:53:37 +0200 (Fri, 21 Apr 2006) | 2 lines
Guido wrote contextlib, not me, but thanks anyway. ;)
........
r45636 | andrew.kuchling | 2006-04-22 03:51:41 +0200 (Sat, 22 Apr 2006) | 1 line
Typo fixes
........
r45638 | andrew.kuchling | 2006-04-22 03:58:40 +0200 (Sat, 22 Apr 2006) | 1 line
Fix comment typo
........
r45639 | andrew.kuchling | 2006-04-22 04:06:03 +0200 (Sat, 22 Apr 2006) | 8 lines
Make copy of test_mailbox.py. We'll still want to check the backward
compatibility classes in the new mailbox.py that I'll be committing in
a few minutes.
One change has been made: the tests use len(mbox) instead of len(mbox.boxes).
The 'boxes' attribute was never documented and contains some internal state
that seems unlikely to have been useful.
........
r45640 | andrew.kuchling | 2006-04-22 04:32:43 +0200 (Sat, 22 Apr 2006) | 16 lines
Add Gregory K. Johnson's revised version of mailbox.py (funded by
the 2005 Summer of Code).
The revision adds a number of new mailbox classes that support adding
and removing messages; these classes also support mailbox locking and
default to using email.Message instead of rfc822.Message.
The old mailbox classes are largely left alone for backward compatibility.
The exception is the Maildir class, which was present in the old module
and now inherits from the new classes. The Maildir class's interface
is pretty simple, though, so I think it'll be compatible with existing
code.
(The change to the NEWS file also adds a missing word to a different
news item, which unfortunately required rewrapping the line.)
........
r45641 | tim.peters | 2006-04-22 07:52:59 +0200 (Sat, 22 Apr 2006) | 2 lines
Whitespace normalization.
........
r45642 | neal.norwitz | 2006-04-22 08:07:46 +0200 (Sat, 22 Apr 2006) | 1 line
Add libctypes as a dep
........
r45643 | martin.v.loewis | 2006-04-22 13:15:41 +0200 (Sat, 22 Apr 2006) | 1 line
Fix more ssize_t problems.
........
r45644 | martin.v.loewis | 2006-04-22 13:40:03 +0200 (Sat, 22 Apr 2006) | 1 line
Fix more ssize_t issues.
........
r45645 | george.yoshida | 2006-04-22 17:10:49 +0200 (Sat, 22 Apr 2006) | 2 lines
Typo fixes
........
r45647 | martin.v.loewis | 2006-04-22 17:19:54 +0200 (Sat, 22 Apr 2006) | 1 line
Port to Python 2.5. Drop .DEF file. Change output file names to .pyd.
........
r45648 | george.yoshida | 2006-04-22 17:27:14 +0200 (Sat, 22 Apr 2006) | 3 lines
- add versionadded tag
- make arbitrary arguments come last
........
r45649 | hyeshik.chang | 2006-04-22 17:48:15 +0200 (Sat, 22 Apr 2006) | 3 lines
Remove $CJKCodecs$ RCS tags. The CJKCodecs isn't maintained outside
anymore.
........
r45654 | greg.ward | 2006-04-23 05:47:58 +0200 (Sun, 23 Apr 2006) | 2 lines
Update optparse to Optik 1.5.1.
........
r45658 | george.yoshida | 2006-04-23 11:27:10 +0200 (Sun, 23 Apr 2006) | 2 lines
wrap SyntaxError with \exception{}
........
r45660 | ronald.oussoren | 2006-04-23 13:59:25 +0200 (Sun, 23 Apr 2006) | 6 lines
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.
........
r45661 | ronald.oussoren | 2006-04-23 14:36:23 +0200 (Sun, 23 Apr 2006) | 5 lines
Patch 1471761 - test for broken poll at runtime
This patch checks if poll is broken when the select module is loaded instead
of doing so at configure-time. This functionality is only active on Mac OS X.
........
r45662 | nick.coghlan | 2006-04-23 17:13:32 +0200 (Sun, 23 Apr 2006) | 1 line
Add a Context Types section to parallel the Iterator Types section (uses the same terminology as the 2.5a1 implementation)
........
r45663 | nick.coghlan | 2006-04-23 17:14:37 +0200 (Sun, 23 Apr 2006) | 1 line
Update contextlib documentation to use the same terminology as the module implementation
........
r45664 | gerhard.haering | 2006-04-23 17:24:26 +0200 (Sun, 23 Apr 2006) | 2 lines
Updated the sqlite3 module to the external pysqlite 2.2.2 version.
........
r45666 | nick.coghlan | 2006-04-23 17:39:16 +0200 (Sun, 23 Apr 2006) | 1 line
Update with statement documentation to use same terminology as 2.5a1 implementation
........
r45667 | nick.coghlan | 2006-04-23 18:05:04 +0200 (Sun, 23 Apr 2006) | 1 line
Add a (very) brief mention of the with statement to the end of chapter 8
........
r45668 | nick.coghlan | 2006-04-23 18:35:19 +0200 (Sun, 23 Apr 2006) | 1 line
Take 2 on mentioning the with statement, this time without inadvertently killing the Unicode examples
........
r45669 | nick.coghlan | 2006-04-23 19:04:07 +0200 (Sun, 23 Apr 2006) | 1 line
Backdated NEWS entry to record the implementation of PEP 338 for alpha 1
........
r45670 | tim.peters | 2006-04-23 20:13:45 +0200 (Sun, 23 Apr 2006) | 2 lines
Whitespace normalization.
........
r45671 | skip.montanaro | 2006-04-23 21:14:27 +0200 (Sun, 23 Apr 2006) | 1 line
first cut at trace module doc
........
r45672 | skip.montanaro | 2006-04-23 21:26:33 +0200 (Sun, 23 Apr 2006) | 1 line
minor tweak
........
r45673 | skip.montanaro | 2006-04-23 21:30:50 +0200 (Sun, 23 Apr 2006) | 1 line
it's always helpful if the example works...
........
r45674 | skip.montanaro | 2006-04-23 21:32:14 +0200 (Sun, 23 Apr 2006) | 1 line
correct example
........
r45675 | andrew.kuchling | 2006-04-23 23:01:04 +0200 (Sun, 23 Apr 2006) | 1 line
Edits to the PEP 343 section
........
r45676 | andrew.kuchling | 2006-04-23 23:51:10 +0200 (Sun, 23 Apr 2006) | 1 line
Add two items
........
r45677 | tim.peters | 2006-04-24 04:03:16 +0200 (Mon, 24 Apr 2006) | 5 lines
Bug #1337990: clarified that `doctest` does not support examples
requiring both expected output and an exception.
I'll backport to 2.4 next.
........
r45679 | nick.coghlan | 2006-04-24 05:04:43 +0200 (Mon, 24 Apr 2006) | 1 line
Note changes made to PEP 343 related documentation
........
r45681 | nick.coghlan | 2006-04-24 06:17:02 +0200 (Mon, 24 Apr 2006) | 1 line
Change PEP 343 related documentation to use the term context specifier instead of context object
........
r45682 | nick.coghlan | 2006-04-24 06:32:47 +0200 (Mon, 24 Apr 2006) | 1 line
Add unit tests for the -m and -c command line switches
........
r45683 | nick.coghlan | 2006-04-24 06:37:15 +0200 (Mon, 24 Apr 2006) | 1 line
Fix contextlib.nested to cope with exit methods raising and handling exceptions
........
r45685 | nick.coghlan | 2006-04-24 06:59:28 +0200 (Mon, 24 Apr 2006) | 1 line
Fix broken contextlib test from last checkin (I'd've sworn I tested that before checking it in. . .)
........
r45686 | nick.coghlan | 2006-04-24 07:24:26 +0200 (Mon, 24 Apr 2006) | 1 line
Back out new command line tests (broke buildbot)
........
r45687 | nick.coghlan | 2006-04-24 07:52:15 +0200 (Mon, 24 Apr 2006) | 1 line
More reliable version of new command line tests that just checks the exit codes
........
r45688 | thomas.wouters | 2006-04-24 13:37:13 +0200 (Mon, 24 Apr 2006) | 4 lines
Stop test_tcl's testLoadTk from leaking the Tk commands 'loadtk' registers.
........
r45690 | andrew.kuchling | 2006-04-24 16:30:47 +0200 (Mon, 24 Apr 2006) | 2 lines
Edits, using the new term
'context specifier' in a few places
........
r45697 | phillip.eby | 2006-04-24 22:53:13 +0200 (Mon, 24 Apr 2006) | 2 lines
Revert addition of setuptools
........
r45698 | tim.peters | 2006-04-25 00:45:13 +0200 (Tue, 25 Apr 2006) | 2 lines
Whitespace normalization.
........
r45700 | trent.mick | 2006-04-25 02:34:50 +0200 (Tue, 25 Apr 2006) | 4 lines
Put break at correct level so *all* root HKEYs acutally get checked for
an installed VC6. Otherwise only the first such tree gets checked and this
warning doesn't get displayed.
........
r45701 | tim.peters | 2006-04-25 05:31:36 +0200 (Tue, 25 Apr 2006) | 3 lines
Patch #1475231: add a new SKIP doctest option, thanks to
Edward Loper.
........
r45702 | neal.norwitz | 2006-04-25 07:04:35 +0200 (Tue, 25 Apr 2006) | 1 line
versionadded for SKIP
........
r45703 | neal.norwitz | 2006-04-25 07:05:03 +0200 (Tue, 25 Apr 2006) | 1 line
Restore Walters name
........
r45704 | neal.norwitz | 2006-04-25 07:49:42 +0200 (Tue, 25 Apr 2006) | 1 line
Revert previous change, SKIP had a versionadded elsewhere
........
r45706 | nick.coghlan | 2006-04-25 12:56:51 +0200 (Tue, 25 Apr 2006) | 31 lines
Move the PEP 343 documentation and implementation closer to the
terminology in the alpha 1 documentation.
- "context manager" reverts to its alpha 1 definition
- the term "context specifier" goes away entirely
- contextlib.GeneratorContextManager is renamed GeneratorContext
There are still a number of changes relative to alpha 1:
- the expression in the with statement is explicitly called the
"context expression" in the language reference
- the terms 'with statement context', 'context object' or 'with
statement context' are used in several places instead of a bare
'context'. The aim of this is to avoid ambiguity in relation to the
runtime context set up when the block is executed, and the context
objects that already exist in various application domains (such as
decimal.Context)
- contextlib.contextmanager is renamed to contextfactory
This best reflects the nature of the function resulting from the
use of that decorator
- decimal.ContextManager is renamed to WithStatementContext
Simple dropping the 'Manager' part wasn't possible due to the
fact that decimal.Context already exists and means something
different. WithStatementContext is ugly but workable.
A technically unrelated change snuck into this commit:
contextlib.closing now avoids the overhead of creating a
generator, since it's trivial to implement that particular
context manager directly.
........
r45707 | nick.coghlan | 2006-04-25 13:05:56 +0200 (Tue, 25 Apr 2006) | 1 line
Fix latex typo
........
r45708 | thomas.wouters | 2006-04-25 14:28:56 +0200 (Tue, 25 Apr 2006) | 4 lines
Fix markup glitch in unittest docs. Will backport.
........
r45710 | andrew.kuchling | 2006-04-25 14:31:38 +0200 (Tue, 25 Apr 2006) | 1 line
Add two items; easy_install is now off the table, though pkgutil still is
........
r45711 | andrew.kuchling | 2006-04-25 14:47:25 +0200 (Tue, 25 Apr 2006) | 1 line
Rework context terminology
........
r45712 | thomas.wouters | 2006-04-25 15:53:23 +0200 (Tue, 25 Apr 2006) | 9 lines
SF bug/patch #1433877: string parameter to ioctl not null terminated
The new char-array used in ioctl calls wasn't explicitly NUL-terminated;
quite probably the cause for the test_pty failures on Solaris that we
circumvented earlier. (I wasn't able to reproduce it with this patch, but it
has been somewhat elusive to start with.)
........
r45713 | george.yoshida | 2006-04-25 16:09:58 +0200 (Tue, 25 Apr 2006) | 2 lines
minor tweak
........
r45714 | thomas.wouters | 2006-04-25 17:08:10 +0200 (Tue, 25 Apr 2006) | 7 lines
Fix SF bug #1476111: SystemError in socket sendto. The AF_INET6 and
AF_PACKET cases in getsockaddrarg were missing their own checks for
tuple-ness of the address argument, which means a confusing SystemError was
raised by PyArg_ParseTuple instead.
........
r45715 | thomas.wouters | 2006-04-25 17:29:46 +0200 (Tue, 25 Apr 2006) | 10 lines
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.
........
r45717 | thomas.heller | 2006-04-25 20:26:08 +0200 (Tue, 25 Apr 2006) | 3 lines
Fix compiler warnings on Darwin.
Patch by Brett Canon, see
https://sourceforge.net/tracker/?func=detail&atid=532156&aid=1475959&group_id=71702
........
r45718 | guido.van.rossum | 2006-04-25 22:12:45 +0200 (Tue, 25 Apr 2006) | 4 lines
Implement MvL's improvement on __context__ in Condition;
this can just call __context__ on the underlying lock.
(The same change for Semaphore does *not* work!)
........
r45721 | tim.peters | 2006-04-26 03:15:53 +0200 (Wed, 26 Apr 2006) | 13 lines
Rev 45706 renamed stuff in contextlib.py, but didn't rename
uses of it in test_with.py. As a result, test_with has been skipped
(due to failing imports) on all buildbot boxes since. Alas, that's
not a test failure -- you have to pay attention to the
1 skip unexpected on PLATFORM:
test_with
kinds of output at the ends of test runs to notice that this got
broken.
It's likely that more renaming in test_with.py would be desirable.
........
r45722 | fred.drake | 2006-04-26 07:15:41 +0200 (Wed, 26 Apr 2006) | 1 line
markup fixes, cleanup
........
r45723 | fred.drake | 2006-04-26 07:19:39 +0200 (Wed, 26 Apr 2006) | 1 line
minor adjustment suggested by Peter Gephardt
........
r45724 | neal.norwitz | 2006-04-26 07:34:03 +0200 (Wed, 26 Apr 2006) | 10 lines
Patch from Aldo Cortesi (OpenBSD buildbot owner).
After the patch (45590) to add extra debug stats to the gc module, Python
was crashing on OpenBSD due to:
Fatal Python error: Interpreter not initialized (version mismatch?)
This seems to occur due to calling collect() when initialized (in pythonrun.c)
is set to 0. Now, the import will occur in the init function which
shouldn't suffer this problem.
........
r45725 | neal.norwitz | 2006-04-26 08:26:12 +0200 (Wed, 26 Apr 2006) | 3 lines
Fix this test on Solaris. There can be embedded \r, so don't just replace
the one at the end.
........
r45727 | nick.coghlan | 2006-04-26 13:50:04 +0200 (Wed, 26 Apr 2006) | 1 line
Fix an error in the last contextlib.closing example
........
r45728 | andrew.kuchling | 2006-04-26 14:21:06 +0200 (Wed, 26 Apr 2006) | 1 line
[Bug #1475080] Fix example
........
r45729 | andrew.kuchling | 2006-04-26 14:23:39 +0200 (Wed, 26 Apr 2006) | 1 line
Add labels to all sections
........
r45730 | thomas.wouters | 2006-04-26 17:53:30 +0200 (Wed, 26 Apr 2006) | 7 lines
The result of SF patch #1471578: big-memory tests for strings, lists and
tuples. Lots to be added, still, but this will give big-memory people
something to play with in 2.5 alpha 2, and hopefully get more people to
write these tests.
........
r45731 | tim.peters | 2006-04-26 19:11:16 +0200 (Wed, 26 Apr 2006) | 2 lines
Whitespace normalization.
........
r45732 | martin.v.loewis | 2006-04-26 19:19:44 +0200 (Wed, 26 Apr 2006) | 1 line
Use GS- and bufferoverlowU.lib where appropriate, for AMD64.
........
r45733 | thomas.wouters | 2006-04-26 20:46:01 +0200 (Wed, 26 Apr 2006) | 5 lines
Add tests for += and *= on strings, and fix the memory-use estimate for the
list.extend tests (they were estimating half the actual use.)
........
r45734 | thomas.wouters | 2006-04-26 21:14:46 +0200 (Wed, 26 Apr 2006) | 5 lines
Some more test-size-estimate fixes: test_append and test_insert trigger a
list resize, which overallocates.
........
r45735 | hyeshik.chang | 2006-04-26 21:20:26 +0200 (Wed, 26 Apr 2006) | 3 lines
Fix build on MIPS for libffi. I haven't tested this yet because I
don't have an access on MIPS machines. Will be tested by buildbot. :)
........
r45737 | fred.drake | 2006-04-27 01:40:32 +0200 (Thu, 27 Apr 2006) | 1 line
one more place to use the current Python version
........
r45738 | fred.drake | 2006-04-27 02:02:24 +0200 (Thu, 27 Apr 2006) | 3 lines
- update version numbers in file names again, until we have a better way
- elaborate instructions for Cygwin support (closes SF #839709)
........
r45739 | fred.drake | 2006-04-27 02:20:14 +0200 (Thu, 27 Apr 2006) | 1 line
add missing word
........
r45740 | anthony.baxter | 2006-04-27 04:11:24 +0200 (Thu, 27 Apr 2006) | 2 lines
2.5a2
........
r45741 | anthony.baxter | 2006-04-27 04:13:13 +0200 (Thu, 27 Apr 2006) | 1 line
2.5a2
........
r45749 | andrew.kuchling | 2006-04-27 14:22:37 +0200 (Thu, 27 Apr 2006) | 1 line
Now that 2.5a2 is out, revert to the current date
........
r45750 | andrew.kuchling | 2006-04-27 14:23:07 +0200 (Thu, 27 Apr 2006) | 1 line
Bump document version
........
r45751 | andrew.kuchling | 2006-04-27 14:34:39 +0200 (Thu, 27 Apr 2006) | 6 lines
[Bug #1477102] Add necessary import to example
This may be a useful style question for the docs -- should examples show
the necessary imports, or should it be assumed that the reader will
figure it out? In the What's New, I'm not consistent but usually opt
for omitting the imports.
........
r45753 | andrew.kuchling | 2006-04-27 14:38:35 +0200 (Thu, 27 Apr 2006) | 1 line
[Bug #1477140] Import Error base class
........
r45754 | andrew.kuchling | 2006-04-27 14:42:54 +0200 (Thu, 27 Apr 2006) | 1 line
Mention the xmlrpclib.Error base class, which is used in one of the examples
........
r45756 | george.yoshida | 2006-04-27 15:41:07 +0200 (Thu, 27 Apr 2006) | 2 lines
markup fix
........
r45757 | thomas.wouters | 2006-04-27 15:46:59 +0200 (Thu, 27 Apr 2006) | 4 lines
Some more size-estimate fixes, for large-list-tests.
........
r45758 | thomas.heller | 2006-04-27 17:50:42 +0200 (Thu, 27 Apr 2006) | 3 lines
Rerun the libffi configuration if any of the files used for that
are newer then fficonfig.py.
........
r45766 | thomas.wouters | 2006-04-28 00:37:50 +0200 (Fri, 28 Apr 2006) | 6 lines
Some style fixes and size-calculation fixes. Also do the small-memory run
using a prime number, rather than a convenient power-of-2-and-multiple-of-5,
so incorrect testing algorithms fail more easily.
........
r45767 | thomas.wouters | 2006-04-28 00:38:32 +0200 (Fri, 28 Apr 2006) | 6 lines
Do the small-memory run of big-meormy tests using a prime number, rather
than a convenient power-of-2-and-multiple-of-5, so incorrect testing
algorithms fail more easily.
........
r45768 | david.goodger | 2006-04-28 00:53:05 +0200 (Fri, 28 Apr 2006) | 1 line
Added SVN access for Steven Bethard and Talin, for PEP updating.
........
r45770 | thomas.wouters | 2006-04-28 01:13:20 +0200 (Fri, 28 Apr 2006) | 16 lines
- Add new Warning class, ImportWarning
- Warn-raise ImportWarning when importing would have picked up a directory
as package, if only it'd had an __init__.py. This swaps two tests (for
case-ness and __init__-ness), but case-test is not really more expensive,
and it's not in a speed-critical section.
- Test for the new warning by importing a common non-package directory on
sys.path: site-packages
- In regrtest.py, silence warnings generated by the build-environment
because Modules/ (which is added to sys.path for Setup-created modules)
has 'zlib' and '_ctypes' directories without __init__.py's.
........
r45771 | thomas.wouters | 2006-04-28 01:41:27 +0200 (Fri, 28 Apr 2006) | 6 lines
Add more ignores of ImportWarnings; these are all just potential triggers
(since they won't trigger if zlib is already sucessfully imported); they
were found by grepping .py files, instead of looking at warning output :)
........
r45773 | neal.norwitz | 2006-04-28 06:32:20 +0200 (Fri, 28 Apr 2006) | 1 line
Add some whitespace to be more consistent.
........
r45774 | neal.norwitz | 2006-04-28 06:34:43 +0200 (Fri, 28 Apr 2006) | 5 lines
Try to really fix the slow buildbots this time.
Printing to stdout, doesn't mean the data was actually written.
It depends on the buffering, so we need to flush. This will hopefully
really fix the buildbots getting killed due to no output on the slow bots.
........
r45775 | neal.norwitz | 2006-04-28 07:28:05 +0200 (Fri, 28 Apr 2006) | 1 line
Fix some warnings on Mac OS X 10.4
........
r45776 | neal.norwitz | 2006-04-28 07:28:30 +0200 (Fri, 28 Apr 2006) | 1 line
Fix a warning on alpha
........
r45777 | neal.norwitz | 2006-04-28 07:28:54 +0200 (Fri, 28 Apr 2006) | 1 line
Fix a warning on ppc (debian)
........
r45778 | george.yoshida | 2006-04-28 18:09:45 +0200 (Fri, 28 Apr 2006) | 2 lines
fix markup glitch
........
r45780 | georg.brandl | 2006-04-28 18:31:17 +0200 (Fri, 28 Apr 2006) | 3 lines
Add SeaMonkey to the list of Mozilla browsers.
........
r45781 | georg.brandl | 2006-04-28 18:36:55 +0200 (Fri, 28 Apr 2006) | 2 lines
Bug #1475009: clarify ntpath.join behavior with absolute components
........
r45783 | george.yoshida | 2006-04-28 18:40:14 +0200 (Fri, 28 Apr 2006) | 2 lines
correct a dead link
........
r45785 | georg.brandl | 2006-04-28 18:54:25 +0200 (Fri, 28 Apr 2006) | 4 lines
Bug #1472949: stringify IOErrors in shutil.copytree when appending
them to the Error errors list.
........
r45786 | georg.brandl | 2006-04-28 18:58:52 +0200 (Fri, 28 Apr 2006) | 3 lines
Bug #1478326: don't allow '/' in distutils.util.get_platform machine names
since this value is used to name the build directory.
........
r45788 | thomas.heller | 2006-04-28 19:02:18 +0200 (Fri, 28 Apr 2006) | 1 line
Remove a duplicated test (the same test is in test_incomplete.py).
........
r45792 | georg.brandl | 2006-04-28 21:09:24 +0200 (Fri, 28 Apr 2006) | 3 lines
Bug #1478429: make datetime.datetime.fromtimestamp accept every float,
possibly "rounding up" to the next whole second.
........
r45796 | george.yoshida | 2006-04-29 04:43:30 +0200 (Sat, 29 Apr 2006) | 2 lines
grammar fix
........
r45800 | ronald.oussoren | 2006-04-29 13:31:35 +0200 (Sat, 29 Apr 2006) | 2 lines
Patch 1471883: --enable-universalsdk on Mac OS X
........
r45801 | andrew.kuchling | 2006-04-29 13:53:15 +0200 (Sat, 29 Apr 2006) | 1 line
Add item
........
r45802 | andrew.kuchling | 2006-04-29 14:10:28 +0200 (Sat, 29 Apr 2006) | 1 line
Make case of 'ZIP' consistent
........
r45803 | andrew.kuchling | 2006-04-29 14:10:43 +0200 (Sat, 29 Apr 2006) | 1 line
Add item
........
r45808 | martin.v.loewis | 2006-04-29 14:37:25 +0200 (Sat, 29 Apr 2006) | 3 lines
Further changes for #1471883: Edit Misc/NEWS, and
add expat_config.h.
........
r45809 | brett.cannon | 2006-04-29 23:29:50 +0200 (Sat, 29 Apr 2006) | 2 lines
Fix docstring for contextfactory; mentioned old contextmanager name.
........
r45810 | gerhard.haering | 2006-04-30 01:12:41 +0200 (Sun, 30 Apr 2006) | 3 lines
This is the start of documentation for the sqlite3 module. Please feel free to
find a better place for the link to it than alongside bsddb & friends.
........
r45811 | andrew.kuchling | 2006-04-30 03:07:09 +0200 (Sun, 30 Apr 2006) | 1 line
Add two items
........
r45814 | george.yoshida | 2006-04-30 05:49:56 +0200 (Sun, 30 Apr 2006) | 2 lines
Use \versionchanged instead of \versionadded for new parameter support.
........
r45815 | georg.brandl | 2006-04-30 09:06:11 +0200 (Sun, 30 Apr 2006) | 2 lines
Patch #1470846: fix urllib2 ProxyBasicAuthHandler.
........
r45817 | georg.brandl | 2006-04-30 10:57:35 +0200 (Sun, 30 Apr 2006) | 3 lines
In stdlib, use hashlib instead of deprecated md5 and sha modules.
........
r45819 | georg.brandl | 2006-04-30 11:23:59 +0200 (Sun, 30 Apr 2006) | 3 lines
Patch #1470976: don't NLST files when retrieving over FTP.
........
r45821 | georg.brandl | 2006-04-30 13:13:56 +0200 (Sun, 30 Apr 2006) | 6 lines
Bug #1473625: stop cPickle making float dumps locale dependent in protocol 0.
On the way, add a decorator to test_support to facilitate running single
test functions in different locales with automatic cleanup.
........
r45822 | phillip.eby | 2006-04-30 17:59:26 +0200 (Sun, 30 Apr 2006) | 2 lines
Fix infinite regress when inspecting <string> or <stdin> frames.
........
r45824 | georg.brandl | 2006-04-30 19:42:26 +0200 (Sun, 30 Apr 2006) | 3 lines
Fix another problem in inspect: if the module for an object cannot be found, don't try to give its __dict__ to linecache.
........
r45825 | georg.brandl | 2006-04-30 20:14:54 +0200 (Sun, 30 Apr 2006) | 3 lines
Patch #1472854: make the rlcompleter.Completer class usable on non-
UNIX platforms.
........
r45826 | georg.brandl | 2006-04-30 21:34:19 +0200 (Sun, 30 Apr 2006) | 3 lines
Patch #1479438: add \keyword markup for "with".
........
r45827 | andrew.kuchling | 2006-04-30 23:19:31 +0200 (Sun, 30 Apr 2006) | 1 line
Add urllib2 HOWTO from Michael Foord
........
r45828 | andrew.kuchling | 2006-04-30 23:19:49 +0200 (Sun, 30 Apr 2006) | 1 line
Add item
........
r45830 | barry.warsaw | 2006-05-01 05:03:02 +0200 (Mon, 01 May 2006) | 11 lines
Port forward from 2.4 branch:
Patch #1464708 from William McVey: fixed handling of nested comments in mail
addresses. E.g.
"Foo ((Foo Bar)) <foo@example.com>"
Fixes for both rfc822.py and email package. This patch needs to be back
ported to Python 2.3 for email 2.5.
........
r45832 | fred.drake | 2006-05-01 08:25:58 +0200 (Mon, 01 May 2006) | 4 lines
- minor clarification in section title
- markup adjustments
(there is clearly much to be done in this section)
........
r45833 | martin.v.loewis | 2006-05-01 08:28:01 +0200 (Mon, 01 May 2006) | 2 lines
Work around deadlock risk. Will backport.
........
r45836 | andrew.kuchling | 2006-05-01 14:45:02 +0200 (Mon, 01 May 2006) | 1 line
Some ElementTree fixes: import from xml, not xmlcore; fix case of module name; mention list() instead of getchildren()
........
r45837 | gerhard.haering | 2006-05-01 17:14:48 +0200 (Mon, 01 May 2006) | 3 lines
Further integration of the documentation for the sqlite3 module. There's still
quite some content to move over from the pysqlite manual, but it's a start now.
........
r45838 | martin.v.loewis | 2006-05-01 17:56:03 +0200 (Mon, 01 May 2006) | 2 lines
Rename uisample to text, drop all non-text tables.
........
r45839 | martin.v.loewis | 2006-05-01 18:12:44 +0200 (Mon, 01 May 2006) | 2 lines
Add msilib documentation.
........
r45840 | martin.v.loewis | 2006-05-01 18:14:16 +0200 (Mon, 01 May 2006) | 4 lines
Rename parameters to match the documentation (which
in turn matches Microsoft's documentation).
Drop unused parameter in CAB.append.
........
r45841 | fred.drake | 2006-05-01 18:28:54 +0200 (Mon, 01 May 2006) | 1 line
add dependency
........
r45842 | andrew.kuchling | 2006-05-01 18:30:25 +0200 (Mon, 01 May 2006) | 1 line
Markup fixes; add some XXX comments noting problems
........
r45843 | andrew.kuchling | 2006-05-01 18:32:49 +0200 (Mon, 01 May 2006) | 1 line
Add item
........
r45844 | andrew.kuchling | 2006-05-01 19:06:54 +0200 (Mon, 01 May 2006) | 1 line
Markup fixes
........
r45850 | neal.norwitz | 2006-05-02 06:43:14 +0200 (Tue, 02 May 2006) | 3 lines
SF #1479181: split open() and file() from being aliases for each other.
........
r45852 | neal.norwitz | 2006-05-02 08:23:22 +0200 (Tue, 02 May 2006) | 1 line
Try to fix breakage caused by patch #1479181, r45850
........
r45853 | fred.drake | 2006-05-02 08:53:59 +0200 (Tue, 02 May 2006) | 3 lines
SF #1479988: add methods to allow access to weakrefs for the
weakref.WeakKeyDictionary and weakref.WeakValueDictionary
........
r45854 | neal.norwitz | 2006-05-02 09:27:47 +0200 (Tue, 02 May 2006) | 5 lines
Fix breakage from patch 1471883 (r45800 & r45808) on OSF/1.
The problem was that pyconfig.h was being included before some system headers
which caused redefinitions and other breakage. This moves system headers
after expat_config.h which includes pyconfig.h.
........
r45855 | vinay.sajip | 2006-05-02 10:35:36 +0200 (Tue, 02 May 2006) | 1 line
Replaced my dumb way of calculating seconds to midnight with Tim Peters' much more sensible suggestion. What was I thinking ?!?
........
r45856 | andrew.kuchling | 2006-05-02 13:30:03 +0200 (Tue, 02 May 2006) | 1 line
Provide encoding as keyword argument; soften warning paragraph about encodings
........
r45858 | guido.van.rossum | 2006-05-02 19:36:09 +0200 (Tue, 02 May 2006) | 2 lines
Fix the formatting of KeyboardInterrupt -- a bad issubclass() call.
........
r45862 | guido.van.rossum | 2006-05-02 21:47:52 +0200 (Tue, 02 May 2006) | 7 lines
Get rid of __context__, per the latest changes to PEP 343 and python-dev
discussion.
There are two places of documentation that still mention __context__:
Doc/lib/libstdtypes.tex -- I wasn't quite sure how to rewrite that without
spending a whole lot of time thinking about it; and whatsnew, which Andrew
usually likes to change himself.
........
r45863 | armin.rigo | 2006-05-02 21:52:32 +0200 (Tue, 02 May 2006) | 4 lines
Documentation bug: PySet_Pop() returns a new reference (because the
caller becomes the owner of that reference).
........
r45864 | guido.van.rossum | 2006-05-02 22:47:36 +0200 (Tue, 02 May 2006) | 4 lines
Hopefully this will fix the spurious failures of test_mailbox.py that I'm
experiencing. (This code and mailbox.py itself are full of calls to file()
that should be calls to open() -- but I'm not fixing those.)
........
r45865 | andrew.kuchling | 2006-05-02 23:44:33 +0200 (Tue, 02 May 2006) | 1 line
Use open() instead of file()
........
r45866 | andrew.kuchling | 2006-05-03 00:47:49 +0200 (Wed, 03 May 2006) | 1 line
Update context manager section for removal of __context__
........
r45867 | fred.drake | 2006-05-03 03:46:52 +0200 (Wed, 03 May 2006) | 1 line
remove unnecessary assignment
........
r45868 | fred.drake | 2006-05-03 03:48:24 +0200 (Wed, 03 May 2006) | 4 lines
tell LaTeX2HTML to:
- use UTF-8 output
- not mess with the >>> prompt!
........
r45869 | fred.drake | 2006-05-03 04:04:40 +0200 (Wed, 03 May 2006) | 3 lines
avoid ugly markup based on the unfortunate conversions of ">>" and "<<" to
guillemets; no need for magic here
........
r45870 | fred.drake | 2006-05-03 04:12:47 +0200 (Wed, 03 May 2006) | 1 line
at least comment on why curly-quotes are not enabled
........
r45871 | fred.drake | 2006-05-03 04:27:40 +0200 (Wed, 03 May 2006) | 1 line
one more place to avoid extra markup
........
r45872 | fred.drake | 2006-05-03 04:29:09 +0200 (Wed, 03 May 2006) | 1 line
one more place to avoid extra markup (how many will there be?)
........
r45873 | fred.drake | 2006-05-03 04:29:39 +0200 (Wed, 03 May 2006) | 1 line
fix up whitespace in prompt strings
........
r45876 | tim.peters | 2006-05-03 06:46:14 +0200 (Wed, 03 May 2006) | 2 lines
Whitespace normalization.
........
r45877 | martin.v.loewis | 2006-05-03 06:52:04 +0200 (Wed, 03 May 2006) | 2 lines
Correct some formulations, fix XXX comments.
........
r45879 | georg.brandl | 2006-05-03 07:05:02 +0200 (Wed, 03 May 2006) | 2 lines
Patch #1480067: don't redirect HTTP digest auth in urllib2
........
r45881 | georg.brandl | 2006-05-03 07:15:10 +0200 (Wed, 03 May 2006) | 3 lines
Move network tests from test_urllib2 to test_urllib2net.
........
r45887 | nick.coghlan | 2006-05-03 15:02:47 +0200 (Wed, 03 May 2006) | 1 line
Finish bringing SVN into line with latest version of PEP 343 by getting rid of all remaining references to context objects that I could find. Without a __context__() method context objects no longer exist. Also get test_with working again, and adopt a suggestion from Neal for decimal.Context.get_manager()
........
r45888 | nick.coghlan | 2006-05-03 15:17:49 +0200 (Wed, 03 May 2006) | 1 line
Get rid of a couple more context object references, fix some markup and clarify what happens when a generator context function swallows an exception.
........
r45889 | georg.brandl | 2006-05-03 19:46:13 +0200 (Wed, 03 May 2006) | 3 lines
Add seamonkey to list of Windows browsers too.
........
r45890 | georg.brandl | 2006-05-03 20:03:22 +0200 (Wed, 03 May 2006) | 3 lines
RFE #1472176: In httplib, don't encode the netloc and hostname with "idna" if not necessary.
........
r45891 | georg.brandl | 2006-05-03 20:12:33 +0200 (Wed, 03 May 2006) | 2 lines
Bug #1472191: convert breakpoint indices to ints before comparing them to ints
........
r45893 | georg.brandl | 2006-05-03 20:18:32 +0200 (Wed, 03 May 2006) | 3 lines
Bug #1385040: don't allow "def foo(a=1, b): pass" in the compiler package.
........
r45894 | thomas.heller | 2006-05-03 20:35:39 +0200 (Wed, 03 May 2006) | 1 line
Don't fail the tests when libglut.so or libgle.so cannot be loaded.
........
r45895 | georg.brandl | 2006-05-04 07:08:10 +0200 (Thu, 04 May 2006) | 2 lines
Bug #1481530: allow "from os.path import ..." with imputil
........
r45897 | martin.v.loewis | 2006-05-04 07:51:03 +0200 (Thu, 04 May 2006) | 2 lines
Patch #1475845: Raise IndentationError for unexpected indent.
........
r45898 | martin.v.loewis | 2006-05-04 12:08:42 +0200 (Thu, 04 May 2006) | 1 line
Implement os.{chdir,rename,rmdir,remove} using Win32 directly.
........
r45899 | martin.v.loewis | 2006-05-04 14:04:27 +0200 (Thu, 04 May 2006) | 2 lines
Drop now-unnecessary arguments to posix_2str.
........
r45900 | martin.v.loewis | 2006-05-04 16:27:52 +0200 (Thu, 04 May 2006) | 1 line
Update checks to consider Windows error numbers.
........
r45913 | thomas.heller | 2006-05-05 20:42:14 +0200 (Fri, 05 May 2006) | 2 lines
Export the 'free' standard C function for use in the test suite.
........
r45914 | thomas.heller | 2006-05-05 20:43:24 +0200 (Fri, 05 May 2006) | 3 lines
Fix memory leaks in the ctypes test suite, reported by valgrind, by
free()ing the memory we allocate.
........
r45915 | thomas.heller | 2006-05-05 20:46:27 +0200 (Fri, 05 May 2006) | 1 line
oops - the function is exported as 'my_free', not 'free'.
........
r45916 | thomas.heller | 2006-05-05 21:14:24 +0200 (Fri, 05 May 2006) | 2 lines
Clean up.
........
r45920 | george.yoshida | 2006-05-06 15:09:45 +0200 (Sat, 06 May 2006) | 2 lines
describe optional arguments for DocFileSuite
........
r45924 | george.yoshida | 2006-05-06 16:16:51 +0200 (Sat, 06 May 2006) | 2 lines
Use \versionchanged for the feature change
........
r45925 | martin.v.loewis | 2006-05-06 18:32:54 +0200 (Sat, 06 May 2006) | 1 line
Port access, chmod, parts of getcwdu, mkdir, and utime to direct Win32 API.
........
r45926 | martin.v.loewis | 2006-05-06 22:04:08 +0200 (Sat, 06 May 2006) | 2 lines
Handle ERROR_ALREADY_EXISTS.
........
r45931 | andrew.kuchling | 2006-05-07 19:12:12 +0200 (Sun, 07 May 2006) | 1 line
[Patch #1479977] Revised version of urllib2 HOWTO, edited by John J. Lee
........
r45932 | andrew.kuchling | 2006-05-07 19:14:53 +0200 (Sun, 07 May 2006) | 1 line
Minor language edit
........
r45934 | georg.brandl | 2006-05-07 22:44:34 +0200 (Sun, 07 May 2006) | 3 lines
Patch #1483395: add new TLDs to cookielib
........
r45936 | martin.v.loewis | 2006-05-08 07:25:56 +0200 (Mon, 08 May 2006) | 2 lines
Add missing PyMem_Free.
........
r45938 | georg.brandl | 2006-05-08 19:28:47 +0200 (Mon, 08 May 2006) | 3 lines
Add test for rev. 45934.
........
r45939 | georg.brandl | 2006-05-08 19:36:08 +0200 (Mon, 08 May 2006) | 3 lines
Patch #1479302: Make urllib2 digest auth and basic auth play together.
........
r45940 | georg.brandl | 2006-05-08 19:48:01 +0200 (Mon, 08 May 2006) | 3 lines
Patch #1478993: take advantage of BaseException/Exception split in cookielib
........
r45941 | neal.norwitz | 2006-05-09 07:38:56 +0200 (Tue, 09 May 2006) | 5 lines
Micro optimization. In the first case, we know that frame->f_exc_type
is NULL, so there's no reason to do anything with it. In the second case,
we know frame->f_exc_type is not NULL, so we can just do an INCREF.
........
r45943 | thomas.heller | 2006-05-09 22:20:15 +0200 (Tue, 09 May 2006) | 2 lines
Disable a test that is unreliable.
........
r45944 | tim.peters | 2006-05-10 04:43:01 +0200 (Wed, 10 May 2006) | 4 lines
Variant of patch #1478292. doctest.register_optionflag(name)
shouldn't create a new flag when `name` is already the name of
an option flag.
........
r45947 | neal.norwitz | 2006-05-10 08:57:58 +0200 (Wed, 10 May 2006) | 14 lines
Fix problems found by Coverity.
longobject.c: also fix an ssize_t problem
<a> could have been NULL, so hoist the size calc to not use <a>.
_ssl.c: under fail: self is DECREF'd, but it would have been NULL.
_elementtree.c: delete self if there was an error.
_csv.c: I'm not sure if lineterminator could have been anything other than
a string. However, other string method calls are checked, so check this
one too.
........
r45948 | thomas.wouters | 2006-05-10 17:04:11 +0200 (Wed, 10 May 2006) | 4 lines
Ignore reflog.txt, too.
........
r45949 | georg.brandl | 2006-05-10 17:59:06 +0200 (Wed, 10 May 2006) | 3 lines
Bug #1482988: indicate more prominently that the Stats class is in the pstats module.
........
r45950 | georg.brandl | 2006-05-10 18:09:03 +0200 (Wed, 10 May 2006) | 2 lines
Bug #1485447: subprocess: document that the "cwd" parameter isn't used to find the executable. Misc. other markup fixes.
........
r45952 | georg.brandl | 2006-05-10 18:11:44 +0200 (Wed, 10 May 2006) | 2 lines
Bug #1484978: curses.panel: clarify that Panel objects are destroyed on garbage collection.
........
r45954 | georg.brandl | 2006-05-10 18:26:03 +0200 (Wed, 10 May 2006) | 4 lines
Patch #1484695: Update the tarfile module to version 0.8. This fixes
a couple of issues, notably handling of long file names using the
GNU LONGNAME extension.
........
r45955 | georg.brandl | 2006-05-10 19:13:20 +0200 (Wed, 10 May 2006) | 4 lines
Patch #721464: pdb.Pdb instances can now be given explicit stdin and
stdout arguments, making it possible to redirect input and output
for remote debugging.
........
r45956 | andrew.kuchling | 2006-05-10 19:19:04 +0200 (Wed, 10 May 2006) | 1 line
Clarify description of exception handling
........
r45957 | georg.brandl | 2006-05-10 22:09:23 +0200 (Wed, 10 May 2006) | 2 lines
Fix two small errors in argument lists.
........
r45960 | brett.cannon | 2006-05-11 07:11:33 +0200 (Thu, 11 May 2006) | 5 lines
Detect if %zd is supported by printf() during configure and sets
PY_FORMAT_SIZE_T appropriately. Removes warnings on
OS X under gcc 4.0.1 when PY_FORMAT_SIZE_T is set to "" instead of "z" as is
needed.
........
r45963 | neal.norwitz | 2006-05-11 09:51:59 +0200 (Thu, 11 May 2006) | 1 line
Don't mask a no memory error with a less meaningful one as discussed on python-checkins
........
r45964 | martin.v.loewis | 2006-05-11 15:28:43 +0200 (Thu, 11 May 2006) | 3 lines
Change WindowsError to carry the Win32 error code in winerror,
and the DOS error code in errno. Revert changes where
WindowsError catch blocks unnecessarily special-case OSError.
........
r45965 | george.yoshida | 2006-05-11 17:53:27 +0200 (Thu, 11 May 2006) | 2 lines
Grammar fix
........
r45967 | andrew.kuchling | 2006-05-11 18:32:24 +0200 (Thu, 11 May 2006) | 1 line
typo fix
........
r45968 | tim.peters | 2006-05-11 18:37:42 +0200 (Thu, 11 May 2006) | 5 lines
BaseThreadedTestCase.setup(): stop special-casing WindowsError.
Rev 45964 fiddled with WindowsError, and broke test_bsddb3 on all
the Windows buildbot slaves as a result. This should repair it.
........
r45969 | georg.brandl | 2006-05-11 21:57:09 +0200 (Thu, 11 May 2006) | 2 lines
Typo fix.
........
r45970 | tim.peters | 2006-05-12 03:57:59 +0200 (Fri, 12 May 2006) | 5 lines
SF patch #1473132: Improve docs for tp_clear and tp_traverse,
by Collin Winter.
Bugfix candidate (but I'm not going to bother).
........
r45974 | martin.v.loewis | 2006-05-12 14:27:28 +0200 (Fri, 12 May 2006) | 4 lines
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.
........
r45975 | martin.v.loewis | 2006-05-12 15:57:36 +0200 (Fri, 12 May 2006) | 1 line
Move icon files into DLLs dir. Fixes #1477968.
........
r45976 | george.yoshida | 2006-05-12 18:40:11 +0200 (Fri, 12 May 2006) | 2 lines
At first there were 6 steps, but one was removed after that.
........
r45977 | martin.v.loewis | 2006-05-12 19:22:04 +0200 (Fri, 12 May 2006) | 1 line
Fix alignment error on Itanium.
........
r45978 | george.yoshida | 2006-05-12 19:25:26 +0200 (Fri, 12 May 2006) | 3 lines
Duplicated description about the illegal continue usage can be found in nearly the same place.
They are same, so keep the original one and remove the later-added one.
........
r45980 | thomas.heller | 2006-05-12 20:16:03 +0200 (Fri, 12 May 2006) | 2 lines
Add missing svn properties.
........
r45981 | thomas.heller | 2006-05-12 20:47:35 +0200 (Fri, 12 May 2006) | 1 line
set svn properties
........
r45982 | thomas.heller | 2006-05-12 21:31:46 +0200 (Fri, 12 May 2006) | 1 line
add svn:eol-style native svn:keywords Id
........
r45987 | gerhard.haering | 2006-05-13 01:49:49 +0200 (Sat, 13 May 2006) | 3 lines
Integrated the rest of the pysqlite reference manual into the Python
documentation. Ready to be reviewed and improved upon.
........
r45988 | george.yoshida | 2006-05-13 08:53:31 +0200 (Sat, 13 May 2006) | 2 lines
Add \exception markup
........
r45990 | martin.v.loewis | 2006-05-13 15:34:04 +0200 (Sat, 13 May 2006) | 2 lines
Revert 43315: Printing of %zd must be signed.
........
r45992 | tim.peters | 2006-05-14 01:28:20 +0200 (Sun, 14 May 2006) | 11 lines
Teach PyString_FromFormat, PyErr_Format, and PyString_FromFormatV
about "%u", "%lu" and "%zu" formats.
Since PyString_FromFormat and PyErr_Format have exactly the same rules
(both inherited from PyString_FromFormatV), it would be good if someone
with more LaTeX Fu changed one of them to just point to the other.
Their docs were way out of synch before this patch, and I just did a
mass copy+paste to repair that.
Not a backport candidate (this is a new feature).
........
r45993 | tim.peters | 2006-05-14 01:31:05 +0200 (Sun, 14 May 2006) | 2 lines
Typo repair.
........
r45994 | tim.peters | 2006-05-14 01:33:19 +0200 (Sun, 14 May 2006) | 2 lines
Remove lie in new comment.
........
r45995 | ronald.oussoren | 2006-05-14 21:56:34 +0200 (Sun, 14 May 2006) | 11 lines
Rework the build system for osx applications:
* Don't use xcodebuild for building PythonLauncher, but use a normal unix
makefile. This makes it a lot easier to use the same build flags as for the
rest of python (e.g. make a universal version of python launcher)
* Convert the mac makefile-s to makefile.in-s and use configure to set makefile
variables instead of forwarding them as command-line arguments
* Add a C version of pythonw, that we you can use '#!/usr/local/bin/pythonw'
* Build IDLE.app using bundlebuilder instead of BuildApplet, that will allow
easier modification of the bundle contents later on.
........
r45996 | ronald.oussoren | 2006-05-14 22:35:41 +0200 (Sun, 14 May 2006) | 6 lines
A first cut at replacing the icons on MacOS X. This replaces all icons by icons
based on the new python.org logo. These are also the first icons that are
"proper" OSX icons.
These icons were created by Jacob Rus.
........
r45997 | ronald.oussoren | 2006-05-14 23:07:41 +0200 (Sun, 14 May 2006) | 3 lines
I missed one small detail in my rewrite of the osx build files: the path
to the Python.app template.
........
r45998 | martin.v.loewis | 2006-05-15 07:51:36 +0200 (Mon, 15 May 2006) | 2 lines
Fix memory leak.
........
r45999 | neal.norwitz | 2006-05-15 08:48:14 +0200 (Mon, 15 May 2006) | 1 line
Move items implemented after a2 into the new a3 section
........
r46000 | neal.norwitz | 2006-05-15 09:04:36 +0200 (Mon, 15 May 2006) | 5 lines
- Bug #1487966: Fix SystemError with conditional expression in assignment
Most of the test_syntax changes are just updating the numbers.
........
r46001 | neal.norwitz | 2006-05-15 09:17:23 +0200 (Mon, 15 May 2006) | 1 line
Patch #1488312, Fix memory alignment problem on SPARC in unicode. Will backport
........
r46003 | martin.v.loewis | 2006-05-15 11:22:27 +0200 (Mon, 15 May 2006) | 3 lines
Remove bogus DECREF of self.
Change __str__() functions to METH_O.
Change WindowsError__str__ to use PyTuple_Pack.
........
r46005 | georg.brandl | 2006-05-15 21:30:35 +0200 (Mon, 15 May 2006) | 3 lines
[ 1488881 ] tarfile.py: support for file-objects and bz2 (cp. #1488634)
........
r46007 | tim.peters | 2006-05-15 22:44:10 +0200 (Mon, 15 May 2006) | 9 lines
ReadDetectFileobjTest: repair Windows disasters by opening
the file object in binary mode.
The Windows buildbot slaves shouldn't swap themselves to death
anymore. However, test_tarfile may still fail because of a
temp directory left behind from a previous failing run.
Windows buildbot owners may need to remove that directory
by hand.
........
r46009 | tim.peters | 2006-05-15 23:32:25 +0200 (Mon, 15 May 2006) | 3 lines
test_directory(): Remove the leftover temp directory that's making
the Windows buildbots fail test_tarfile.
........
r46010 | martin.v.loewis | 2006-05-16 09:05:37 +0200 (Tue, 16 May 2006) | 4 lines
- 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
........
r46012 | georg.brandl | 2006-05-16 09:38:27 +0200 (Tue, 16 May 2006) | 3 lines
Patch #1435422: zlib's compress and decompress objects now have a
copy() method.
........
r46015 | andrew.kuchling | 2006-05-16 18:11:54 +0200 (Tue, 16 May 2006) | 1 line
Add item
........
r46016 | andrew.kuchling | 2006-05-16 18:27:31 +0200 (Tue, 16 May 2006) | 3 lines
PEP 243 has been withdrawn, so don't refer to it any more.
The PyPI upload material has been moved into the section on PEP314.
........
r46017 | george.yoshida | 2006-05-16 19:42:16 +0200 (Tue, 16 May 2006) | 2 lines
Update for 'ImportWarning'
........
r46018 | george.yoshida | 2006-05-16 20:07:00 +0200 (Tue, 16 May 2006) | 4 lines
Mention that Exception is now a subclass of BaseException.
Remove a sentence that says that BaseException inherits from BaseException.
(I guess this is just a copy & paste mistake.)
........
r46019 | george.yoshida | 2006-05-16 20:26:10 +0200 (Tue, 16 May 2006) | 2 lines
Document ImportWarning
........
r46020 | tim.peters | 2006-05-17 01:22:20 +0200 (Wed, 17 May 2006) | 2 lines
Whitespace normalization.
........
r46021 | tim.peters | 2006-05-17 01:24:08 +0200 (Wed, 17 May 2006) | 2 lines
Text files missing the SVN eol-style property.
........
r46022 | tim.peters | 2006-05-17 03:30:11 +0200 (Wed, 17 May 2006) | 2 lines
PyZlib_copy(), PyZlib_uncopy(): Repair leaks on the normal-case path.
........
r46023 | georg.brandl | 2006-05-17 16:06:07 +0200 (Wed, 17 May 2006) | 3 lines
Remove misleading comment about type-class unification.
........
r46024 | georg.brandl | 2006-05-17 16:11:36 +0200 (Wed, 17 May 2006) | 3 lines
Apply patch #1489784 from Michael Foord.
........
r46025 | georg.brandl | 2006-05-17 16:18:20 +0200 (Wed, 17 May 2006) | 3 lines
Fix typo in os.utime docstring (patch #1490189)
........
r46026 | georg.brandl | 2006-05-17 16:26:50 +0200 (Wed, 17 May 2006) | 3 lines
Patch #1490224: set time.altzone correctly on Cygwin.
........
r46027 | georg.brandl | 2006-05-17 16:45:06 +0200 (Wed, 17 May 2006) | 4 lines
Add global debug flag to cookielib to avoid heavy dependency on the logging module.
Resolves #1484758.
........
r46028 | georg.brandl | 2006-05-17 16:56:04 +0200 (Wed, 17 May 2006) | 3 lines
Patch #1486962: Several bugs in the turtle Tk demo module were fixed
and several features added, such as speed and geometry control.
........
r46029 | georg.brandl | 2006-05-17 17:17:00 +0200 (Wed, 17 May 2006) | 4 lines
Delay-import some large modules to speed up urllib2 import.
(fixes #1484793).
........
r46030 | georg.brandl | 2006-05-17 17:51:16 +0200 (Wed, 17 May 2006) | 3 lines
Patch #1180296: improve locale string formatting functions
........
r46032 | tim.peters | 2006-05-18 04:06:40 +0200 (Thu, 18 May 2006) | 2 lines
Whitespace normalization.
........
r46033 | georg.brandl | 2006-05-18 08:11:19 +0200 (Thu, 18 May 2006) | 3 lines
Amendments to patch #1484695.
........
r46034 | georg.brandl | 2006-05-18 08:18:06 +0200 (Thu, 18 May 2006) | 3 lines
Remove unused import.
........
r46035 | georg.brandl | 2006-05-18 08:33:27 +0200 (Thu, 18 May 2006) | 3 lines
Fix test_locale for platforms without a default thousands separator.
........
r46036 | neal.norwitz | 2006-05-18 08:51:46 +0200 (Thu, 18 May 2006) | 1 line
Little cleanup
........
r46037 | georg.brandl | 2006-05-18 09:01:27 +0200 (Thu, 18 May 2006) | 4 lines
Bug #1462152: file() now checks more thoroughly for invalid mode
strings and removes a possible "U" before passing the mode to the
C library function.
........
r46038 | georg.brandl | 2006-05-18 09:20:05 +0200 (Thu, 18 May 2006) | 3 lines
Bug #1490688: properly document %e, %f, %g format subtleties.
........
r46039 | vinay.sajip | 2006-05-18 09:28:58 +0200 (Thu, 18 May 2006) | 1 line
Changed status from "beta" to "production"; since logging has been part of the stdlib since 2.3, it should be safe to make this assertion ;-)
........
r46040 | ronald.oussoren | 2006-05-18 11:04:15 +0200 (Thu, 18 May 2006) | 2 lines
Fix some minor issues with the generated application bundles on MacOSX
........
r46041 | andrew.kuchling | 2006-05-19 02:03:55 +0200 (Fri, 19 May 2006) | 1 line
Typo fix; add clarifying word
........
r46044 | neal.norwitz | 2006-05-19 08:31:23 +0200 (Fri, 19 May 2006) | 3 lines
Fix #132 from Coverity, retval could have been derefed
if a continue inside a try failed.
........
r46045 | neal.norwitz | 2006-05-19 08:43:50 +0200 (Fri, 19 May 2006) | 2 lines
Fix #1474677, non-keyword argument following keyword.
........
r46046 | neal.norwitz | 2006-05-19 09:00:58 +0200 (Fri, 19 May 2006) | 4 lines
Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
I suppose this could be backported if anyone cares.
........
r46047 | neal.norwitz | 2006-05-19 09:05:01 +0200 (Fri, 19 May 2006) | 7 lines
Oops, I forgot to include this file in the last commit (46046):
Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
I suppose this could be backported if anyone cares.
........
r46050 | ronald.oussoren | 2006-05-19 20:17:31 +0200 (Fri, 19 May 2006) | 6 lines
* Change working directory to the users home
directory, that makes the file open/save
dialogs more useable.
* Don't use argv emulator, its not needed
for idle.
........
r46052 | tim.peters | 2006-05-19 21:16:34 +0200 (Fri, 19 May 2006) | 2 lines
Whitespace normalization.
........
r46054 | ronald.oussoren | 2006-05-20 08:17:01 +0200 (Sat, 20 May 2006) | 9 lines
Fix bug #1000914 (again).
This patches a file that is generated by bgen, however the code is now the
same as a current copy of bgen would generate. Without this patch most types
in the Carbon.CF module are unusable.
I haven't managed to coax bgen into generating a complete copy of _CFmodule.c
yet :-(, hence the manual patching.
........
r46055 | george.yoshida | 2006-05-20 17:36:19 +0200 (Sat, 20 May 2006) | 3 lines
- markup fix
- add clarifying words
........
r46057 | george.yoshida | 2006-05-20 18:29:14 +0200 (Sat, 20 May 2006) | 3 lines
- Add 'as' and 'with' as new keywords in 2.5.
- Regenerate keyword lists with reswords.py.
........
r46058 | george.yoshida | 2006-05-20 20:07:26 +0200 (Sat, 20 May 2006) | 2 lines
Apply patch #1492147 from Mike Foord.
........
r46059 | andrew.kuchling | 2006-05-20 21:25:16 +0200 (Sat, 20 May 2006) | 1 line
Minor edits
........
r46061 | george.yoshida | 2006-05-21 06:22:59 +0200 (Sun, 21 May 2006) | 2 lines
Fix the TeX compile error.
........
r46062 | george.yoshida | 2006-05-21 06:40:32 +0200 (Sun, 21 May 2006) | 2 lines
Apply patch #1492255 from Mike Foord.
........
r46063 | martin.v.loewis | 2006-05-22 10:48:14 +0200 (Mon, 22 May 2006) | 1 line
Patch 1490384: New Icons for the PC build.
........
r46064 | martin.v.loewis | 2006-05-22 11:15:18 +0200 (Mon, 22 May 2006) | 1 line
Patch #1492356: Port to Windows CE (patch set 1).
........
r46065 | tim.peters | 2006-05-22 13:29:41 +0200 (Mon, 22 May 2006) | 4 lines
Define SIZEOF_{DOUBLE,FLOAT} on Windows. Else
Michael Hudson's nice gimmicks for IEEE special
values (infinities, NaNs) don't work.
........
r46070 | bob.ippolito | 2006-05-22 16:31:24 +0200 (Mon, 22 May 2006) | 2 lines
GzipFile.readline performance improvement (~30-40%), patch #1281707
........
r46071 | bob.ippolito | 2006-05-22 17:22:46 +0200 (Mon, 22 May 2006) | 1 line
Revert gzip readline performance patch #1281707 until a more generic performance improvement can be found
........
r46073 | fredrik.lundh | 2006-05-22 17:35:12 +0200 (Mon, 22 May 2006) | 4 lines
docstring tweaks: count counts non-overlapping substrings, not
total number of occurences
........
r46075 | bob.ippolito | 2006-05-22 17:59:12 +0200 (Mon, 22 May 2006) | 1 line
Apply revised patch for GzipFile.readline performance #1281707
........
r46076 | fredrik.lundh | 2006-05-22 18:29:30 +0200 (Mon, 22 May 2006) | 3 lines
needforspeed: speed up unicode repeat, unicode string copy
........
r46079 | fredrik.lundh | 2006-05-22 19:12:58 +0200 (Mon, 22 May 2006) | 4 lines
needforspeed: use memcpy for "long" strings; use a better algorithm
for long repeats.
........
r46084 | tim.peters | 2006-05-22 21:17:04 +0200 (Mon, 22 May 2006) | 7 lines
PyUnicode_Join(): Recent code changes introduced new
compiler warnings on Windows (signed vs unsigned mismatch
in comparisons). Cleaned that up by switching more locals
to Py_ssize_t. Simplified overflow checking (it can _be_
simpler because while these things are declared as
Py_ssize_t, then should in fact never be negative).
........
r46085 | tim.peters | 2006-05-23 07:47:16 +0200 (Tue, 23 May 2006) | 3 lines
unicode_repeat(): Change type of local to Py_ssize_t,
since that's what it should be.
........
r46094 | fredrik.lundh | 2006-05-23 12:10:57 +0200 (Tue, 23 May 2006) | 3 lines
needforspeed: check first *and* last character before doing a full memcmp
........
r46095 | fredrik.lundh | 2006-05-23 12:12:21 +0200 (Tue, 23 May 2006) | 4 lines
needforspeed: fixed unicode "in" operator to use same implementation
approach as find/index
........
r46096 | richard.jones | 2006-05-23 12:37:38 +0200 (Tue, 23 May 2006) | 7 lines
Merge from rjones-funccall branch.
Applied patch zombie-frames-2.diff from sf patch 876206 with updates for
Python 2.5 and also modified to retain the free_list to avoid the 67%
slow-down in pybench recursion test. 5% speed up in function call pybench.
........
r46098 | ronald.oussoren | 2006-05-23 13:04:24 +0200 (Tue, 23 May 2006) | 2 lines
Avoid creating a mess when installing a framework for the second time.
........
r46101 | georg.brandl | 2006-05-23 13:17:21 +0200 (Tue, 23 May 2006) | 3 lines
PyErr_NewException now accepts a tuple of base classes as its
"base" parameter.
........
r46103 | ronald.oussoren | 2006-05-23 13:47:16 +0200 (Tue, 23 May 2006) | 3 lines
Disable linking extensions with -lpython2.5 for darwin. This should fix bug
#1487105.
........
r46104 | ronald.oussoren | 2006-05-23 14:01:11 +0200 (Tue, 23 May 2006) | 6 lines
Patch #1488098.
This patchs makes it possible to create a universal build on OSX 10.4 and use
the result to build extensions on 10.3. It also makes it possible to override
the '-arch' and '-isysroot' compiler arguments for specific extensions.
........
r46108 | andrew.kuchling | 2006-05-23 14:44:36 +0200 (Tue, 23 May 2006) | 1 line
Add some items; mention the sprint
........
r46109 | andrew.kuchling | 2006-05-23 14:47:01 +0200 (Tue, 23 May 2006) | 1 line
Mention string improvements
........
r46110 | andrew.kuchling | 2006-05-23 14:49:35 +0200 (Tue, 23 May 2006) | 4 lines
Use 'speed' instead of 'performance', because I agree with the argument
at http://zestyping.livejournal.com/193260.html that 'erformance' really means
something more general.
........
r46113 | ronald.oussoren | 2006-05-23 17:09:57 +0200 (Tue, 23 May 2006) | 2 lines
An improved script for building the binary distribution on MacOSX.
........
r46128 | richard.jones | 2006-05-23 20:28:17 +0200 (Tue, 23 May 2006) | 3 lines
Applied patch 1337051 by Neal Norwitz, saving 4 ints on frame objects.
........
r46129 | richard.jones | 2006-05-23 20:32:11 +0200 (Tue, 23 May 2006) | 1 line
fix broken merge
........
r46130 | bob.ippolito | 2006-05-23 20:41:17 +0200 (Tue, 23 May 2006) | 1 line
Update Misc/NEWS for gzip patch #1281707
........
r46131 | bob.ippolito | 2006-05-23 20:43:47 +0200 (Tue, 23 May 2006) | 1 line
Update Misc/NEWS for gzip patch #1281707
........
r46132 | fredrik.lundh | 2006-05-23 20:44:25 +0200 (Tue, 23 May 2006) | 7 lines
needforspeed: use append+reverse for rsplit, use "bloom filters" to
speed up splitlines and strip with charsets; etc. rsplit is now as
fast as split in all our tests (reverse takes no time at all), and
splitlines() is nearly as fast as a plain split("\n") in our tests.
and we're not done yet... ;-)
........
r46133 | tim.peters | 2006-05-23 20:45:30 +0200 (Tue, 23 May 2006) | 38 lines
Bug #1334662 / patch #1335972: int(string, base) wrong answers.
In rare cases of strings specifying true values near sys.maxint,
and oddball bases (not decimal or a power of 2), int(string, base)
could deliver insane answers. This repairs all such problems, and
also speeds string->int significantly. On my box, here are %
speedups for decimal strings of various lengths:
length speedup
------ -------
1 12.4%
2 15.7%
3 20.6%
4 28.1%
5 33.2%
6 37.5%
7 41.9%
8 46.3%
9 51.2%
10 19.5%
11 19.9%
12 23.9%
13 23.7%
14 23.3%
15 24.9%
16 25.3%
17 28.3%
18 27.9%
19 35.7%
Note that the difference between 9 and 10 is the difference between
short and long Python ints on a 32-bit box. The patch doesn't
actually do anything to speed conversion to long: the speedup is
due to detecting "unsigned long" overflow more quickly.
This is a bugfix candidate, but it's a non-trivial patch and it
would be painful to separate the "bug fix" from the "speed up" parts.
........
r46134 | bob.ippolito | 2006-05-23 20:46:41 +0200 (Tue, 23 May 2006) | 1 line
Patch #1493701: performance enhancements for struct module.
........
r46136 | andrew.kuchling | 2006-05-23 21:00:45 +0200 (Tue, 23 May 2006) | 1 line
Remove duplicate item
........
r46141 | bob.ippolito | 2006-05-23 21:09:51 +0200 (Tue, 23 May 2006) | 1 line
revert #1493701
........
r46142 | bob.ippolito | 2006-05-23 21:11:34 +0200 (Tue, 23 May 2006) | 1 line
patch #1493701: performance enhancements for struct module
........
r46144 | bob.ippolito | 2006-05-23 21:12:41 +0200 (Tue, 23 May 2006) | 1 line
patch #1493701: performance enhancements for struct module
........
r46148 | bob.ippolito | 2006-05-23 21:25:52 +0200 (Tue, 23 May 2006) | 1 line
fix linking issue, warnings, in struct
........
r46149 | andrew.kuchling | 2006-05-23 21:29:38 +0200 (Tue, 23 May 2006) | 1 line
Add two items
........
r46150 | bob.ippolito | 2006-05-23 21:31:23 +0200 (Tue, 23 May 2006) | 1 line
forward declaration for PyStructType
........
r46151 | bob.ippolito | 2006-05-23 21:32:25 +0200 (Tue, 23 May 2006) | 1 line
fix typo in _struct
........
r46152 | andrew.kuchling | 2006-05-23 21:32:35 +0200 (Tue, 23 May 2006) | 1 line
Add item
........
r46153 | tim.peters | 2006-05-23 21:34:37 +0200 (Tue, 23 May 2006) | 3 lines
Get the Windows build working again (recover from
`struct` module changes).
........
r46155 | fredrik.lundh | 2006-05-23 21:47:35 +0200 (Tue, 23 May 2006) | 3 lines
return 0 on misses, not -1.
........
r46156 | tim.peters | 2006-05-23 23:51:35 +0200 (Tue, 23 May 2006) | 4 lines
test_struct grew weird behavior under regrtest.py -R,
due to a module-level cache. Clearing the cache should
make it stop showing up in refleak reports.
........
r46157 | tim.peters | 2006-05-23 23:54:23 +0200 (Tue, 23 May 2006) | 2 lines
Whitespace normalization.
........
r46158 | tim.peters | 2006-05-23 23:55:53 +0200 (Tue, 23 May 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46161 | fredrik.lundh | 2006-05-24 12:20:36 +0200 (Wed, 24 May 2006) | 3 lines
use Py_ssize_t for string indexes (thanks, neal!)
........
r46173 | fredrik.lundh | 2006-05-24 16:28:11 +0200 (Wed, 24 May 2006) | 14 lines
needforspeed: use "fastsearch" for count and findstring helpers. this
results in a 2.5x speedup on the stringbench count tests, and a 20x (!)
speedup on the stringbench search/find/contains test, compared to 2.5a2.
for more on the algorithm, see:
http://effbot.org/zone/stringlib.htm
if you get weird results, you can disable the new algoritm by undefining
USE_FAST in Objects/unicodeobject.c.
enjoy /F
........
r46182 | fredrik.lundh | 2006-05-24 17:11:01 +0200 (Wed, 24 May 2006) | 3 lines
needforspeedindeed: use fastsearch also for __contains__
........
r46184 | bob.ippolito | 2006-05-24 17:32:06 +0200 (Wed, 24 May 2006) | 1 line
refactor unpack, add unpack_from
........
r46189 | fredrik.lundh | 2006-05-24 18:35:18 +0200 (Wed, 24 May 2006) | 4 lines
needforspeed: refactored the replace code slightly; special-case
constant-length changes; use fastsearch to locate the first match.
........
r46198 | andrew.dalke | 2006-05-24 20:55:37 +0200 (Wed, 24 May 2006) | 10 lines
Added a slew of test for string replace, based various corner cases from
the Need For Speed sprint coding. Includes commented out overflow tests
which will be uncommented once the code is fixed.
This test will break the 8-bit string tests because
"".replace("", "A") == "" when it should == "A"
We have a fix for it, which should be added tomorrow.
........
r46200 | tim.peters | 2006-05-24 22:27:18 +0200 (Wed, 24 May 2006) | 2 lines
We can't leave the checked-in tests broken.
........
r46201 | tim.peters | 2006-05-24 22:29:44 +0200 (Wed, 24 May 2006) | 2 lines
Whitespace normalization.
........
r46202 | tim.peters | 2006-05-24 23:00:45 +0200 (Wed, 24 May 2006) | 4 lines
Disable the damn empty-string replace test -- it can't
be make to pass now for unicode if it passes for str, or
vice versa.
........
r46203 | tim.peters | 2006-05-24 23:10:40 +0200 (Wed, 24 May 2006) | 58 lines
Heavily fiddled variant of patch #1442927: PyLong_FromString optimization.
``long(str, base)`` is now up to 6x faster for non-power-of-2 bases. The
largest speedup is for inputs with about 1000 decimal digits. Conversion
from non-power-of-2 bases remains quadratic-time in the number of input
digits (it was and remains linear-time for bases 2, 4, 8, 16 and 32).
Speedups at various lengths for decimal inputs, comparing 2.4.3 with
current trunk. Note that it's actually a bit slower for 1-digit strings:
len speedup
---- -------
1 -4.5%
2 4.6%
3 8.3%
4 12.7%
5 16.9%
6 28.6%
7 35.5%
8 44.3%
9 46.6%
10 55.3%
11 65.7%
12 77.7%
13 73.4%
14 75.3%
15 85.2%
16 103.0%
17 95.1%
18 112.8%
19 117.9%
20 128.3%
30 174.5%
40 209.3%
50 236.3%
60 254.3%
70 262.9%
80 295.8%
90 297.3%
100 324.5%
200 374.6%
300 403.1%
400 391.1%
500 388.7%
600 440.6%
700 468.7%
800 498.0%
900 507.2%
1000 501.2%
2000 450.2%
3000 463.2%
4000 452.5%
5000 440.6%
6000 439.6%
7000 424.8%
8000 418.1%
9000 417.7%
........
r46204 | andrew.kuchling | 2006-05-25 02:23:03 +0200 (Thu, 25 May 2006) | 1 line
Minor edits; add an item
........
r46205 | fred.drake | 2006-05-25 04:42:25 +0200 (Thu, 25 May 2006) | 3 lines
fix broken links in PDF
(SF patch #1281291, contributed by Rory Yorke)
........
r46208 | walter.doerwald | 2006-05-25 10:53:28 +0200 (Thu, 25 May 2006) | 2 lines
Replace tab inside comment with space.
........
r46209 | thomas.wouters | 2006-05-25 13:25:51 +0200 (Thu, 25 May 2006) | 4 lines
Fix #1488915, Multiple dots in relative import statement raise SyntaxError.
........
r46210 | thomas.wouters | 2006-05-25 13:26:25 +0200 (Thu, 25 May 2006) | 5 lines
Update graminit.c for the fix for #1488915, Multiple dots in relative import
statement raise SyntaxError, and add testcase.
........
r46211 | andrew.kuchling | 2006-05-25 14:27:59 +0200 (Thu, 25 May 2006) | 1 line
Add entry; and fix a typo
........
r46214 | fredrik.lundh | 2006-05-25 17:22:03 +0200 (Thu, 25 May 2006) | 7 lines
needforspeed: speed up upper and lower for 8-bit string objects.
(the unicode versions of these are still 2x faster on windows,
though...)
based on work by Andrew Dalke, with tweaks by yours truly.
........
r46216 | fredrik.lundh | 2006-05-25 17:49:45 +0200 (Thu, 25 May 2006) | 5 lines
needforspeed: make new upper/lower work properly for single-character
strings too... (thanks to georg brandl for spotting the exact problem
faster than anyone else)
........
r46217 | kristjan.jonsson | 2006-05-25 17:53:30 +0200 (Thu, 25 May 2006) | 1 line
Added a new macro, Py_IS_FINITE(X). On windows there is an intrinsic for this and it is more efficient than to use !Py_IS_INFINITE(X) && !Py_IS_NAN(X). No change on other platforms
........
r46219 | fredrik.lundh | 2006-05-25 18:10:12 +0200 (Thu, 25 May 2006) | 4 lines
needforspeed: _toupper/_tolower is a SUSv2 thing; fall back on ISO C
versions if they're not defined.
........
r46220 | andrew.kuchling | 2006-05-25 18:23:15 +0200 (Thu, 25 May 2006) | 1 line
Fix comment typos
........
r46221 | andrew.dalke | 2006-05-25 18:30:52 +0200 (Thu, 25 May 2006) | 2 lines
Added tests for implementation error we came up with in the need for speed sprint.
........
r46222 | andrew.kuchling | 2006-05-25 18:34:54 +0200 (Thu, 25 May 2006) | 1 line
Fix another typo
........
r46223 | kristjan.jonsson | 2006-05-25 18:39:27 +0200 (Thu, 25 May 2006) | 1 line
Fix incorrect documentation for the Py_IS_FINITE(X) macro.
........
r46224 | fredrik.lundh | 2006-05-25 18:46:54 +0200 (Thu, 25 May 2006) | 3 lines
needforspeed: check for overflow in replace (from Andrew Dalke)
........
r46226 | fredrik.lundh | 2006-05-25 19:08:14 +0200 (Thu, 25 May 2006) | 5 lines
needforspeed: new replace implementation by Andrew Dalke. replace is
now about 3x faster on my machine, for the replace tests from string-
bench.
........
r46227 | tim.peters | 2006-05-25 19:34:03 +0200 (Thu, 25 May 2006) | 5 lines
A new table to help string->integer conversion was added yesterday to
both mystrtoul.c and longobject.c. Share the table instead. Also
cut its size by 64 entries (they had been used for an inscrutable
trick originally, but the code no longer tries to use that trick).
........
r46229 | andrew.dalke | 2006-05-25 19:53:00 +0200 (Thu, 25 May 2006) | 11 lines
Fixed problem identified by Georg. The special-case in-place code for replace
made a copy of the string using PyString_FromStringAndSize(s, n) and modify
the copied string in-place. However, 1 (and 0) character strings are shared
from a cache. This cause "A".replace("A", "a") to change the cached version
of "A" -- used by everyone.
Now may the copy with NULL as the string and do the memcpy manually. I've
added regression tests to check if this happens in the future. Perhaps
there should be a PyString_Copy for this case?
........
r46230 | fredrik.lundh | 2006-05-25 19:55:31 +0200 (Thu, 25 May 2006) | 4 lines
needforspeed: use "fastsearch" for count. this results in a 3x speedup
for the related stringbench tests.
........
r46231 | andrew.dalke | 2006-05-25 20:03:25 +0200 (Thu, 25 May 2006) | 4 lines
Code had returned an ssize_t, upcast to long, then converted with PyInt_FromLong.
Now using PyInt_FromSsize_t.
........
r46233 | andrew.kuchling | 2006-05-25 20:11:16 +0200 (Thu, 25 May 2006) | 1 line
Comment typo
........
r46234 | andrew.dalke | 2006-05-25 20:18:39 +0200 (Thu, 25 May 2006) | 4 lines
Added overflow test for adding two (very) large strings where the
new string is over max Py_ssize_t. I have no way to test it on my
box or any box I have access to. At least it doesn't break anything.
........
r46235 | bob.ippolito | 2006-05-25 20:20:23 +0200 (Thu, 25 May 2006) | 1 line
Faster path for PyLong_FromLongLong, using PyLong_FromLong algorithm
........
r46238 | georg.brandl | 2006-05-25 20:44:09 +0200 (Thu, 25 May 2006) | 3 lines
Guard the _active.remove() call to avoid errors when there is no _active list.
........
r46239 | fredrik.lundh | 2006-05-25 20:44:29 +0200 (Thu, 25 May 2006) | 4 lines
needforspeed: use fastsearch also for find/index and contains. the
related tests are now about 10x faster.
........
r46240 | bob.ippolito | 2006-05-25 20:44:50 +0200 (Thu, 25 May 2006) | 1 line
Struct now unpacks to PY_LONG_LONG directly when possible, also include #ifdef'ed out code that will return int instead of long when in bounds (not active since it's an API and doc change)
........
r46241 | jack.diederich | 2006-05-25 20:47:15 +0200 (Thu, 25 May 2006) | 1 line
* eliminate warning by reverting tmp_s type to 'const char*'
........
r46242 | bob.ippolito | 2006-05-25 21:03:19 +0200 (Thu, 25 May 2006) | 1 line
Fix Cygwin compiler issue
........
r46243 | bob.ippolito | 2006-05-25 21:15:27 +0200 (Thu, 25 May 2006) | 1 line
fix a struct regression where long would be returned for short unsigned integers
........
r46244 | georg.brandl | 2006-05-25 21:15:31 +0200 (Thu, 25 May 2006) | 4 lines
Replace PyObject_CallFunction calls with only object args
with PyObject_CallFunctionObjArgs, which is 30% faster.
........
r46245 | fredrik.lundh | 2006-05-25 21:19:05 +0200 (Thu, 25 May 2006) | 3 lines
needforspeed: use insert+reverse instead of append
........
r46246 | bob.ippolito | 2006-05-25 21:33:38 +0200 (Thu, 25 May 2006) | 1 line
Use LONG_MIN and LONG_MAX to check Python integer bounds instead of the incorrect INT_MIN and INT_MAX
........
r46248 | bob.ippolito | 2006-05-25 21:56:56 +0200 (Thu, 25 May 2006) | 1 line
Use faster struct pack/unpack functions for the endian table that matches the host's
........
r46249 | bob.ippolito | 2006-05-25 21:59:56 +0200 (Thu, 25 May 2006) | 1 line
enable darwin/x86 support for libffi and hence ctypes (doesn't yet support --enable-universalsdk)
........
r46252 | georg.brandl | 2006-05-25 22:28:10 +0200 (Thu, 25 May 2006) | 4 lines
Someone seems to just have copy-pasted the docs of
tp_compare to tp_richcompare ;)
........
r46253 | brett.cannon | 2006-05-25 22:44:08 +0200 (Thu, 25 May 2006) | 2 lines
Swap out bare malloc()/free() use for PyMem_MALLOC()/PyMem_FREE() .
........
r46254 | bob.ippolito | 2006-05-25 22:52:38 +0200 (Thu, 25 May 2006) | 1 line
squelch gcc4 darwin/x86 compiler warnings
........
r46255 | bob.ippolito | 2006-05-25 23:09:45 +0200 (Thu, 25 May 2006) | 1 line
fix test_float regression and 64-bit size mismatch issue
........
r46256 | georg.brandl | 2006-05-25 23:11:56 +0200 (Thu, 25 May 2006) | 3 lines
Add a x-ref to newer calling APIs.
........
r46257 | ronald.oussoren | 2006-05-25 23:30:54 +0200 (Thu, 25 May 2006) | 2 lines
Fix minor typo in prep_cif.c
........
r46259 | brett.cannon | 2006-05-25 23:33:11 +0200 (Thu, 25 May 2006) | 4 lines
Change test_values so that it compares the lowercasing of group names since getgrall() can return all lowercase names while getgrgid() returns proper casing.
Discovered on Ubuntu 5.04 (custom).
........
r46261 | tim.peters | 2006-05-25 23:50:17 +0200 (Thu, 25 May 2006) | 7 lines
Some Win64 pre-release in 2000 didn't support
QueryPerformanceCounter(), but we believe Win64 does
support it now. So use in time.clock().
It would be peachy if someone with a Win64 box tried
this ;-)
........
r46262 | tim.peters | 2006-05-25 23:52:19 +0200 (Thu, 25 May 2006) | 2 lines
Whitespace normalization.
........
r46263 | bob.ippolito | 2006-05-25 23:58:05 +0200 (Thu, 25 May 2006) | 1 line
Add missing files from x86 darwin ctypes patch
........
r46264 | brett.cannon | 2006-05-26 00:00:14 +0200 (Fri, 26 May 2006) | 2 lines
Move over to use of METH_O and METH_NOARGS.
........
r46265 | tim.peters | 2006-05-26 00:25:25 +0200 (Fri, 26 May 2006) | 3 lines
Repair idiot typo, and complete the job of trying to
use the Windows time.clock() implementation on Win64.
........
r46266 | tim.peters | 2006-05-26 00:28:46 +0200 (Fri, 26 May 2006) | 9 lines
Patch #1494387: SVN longobject.c compiler warnings
The SIGCHECK macro defined here has always been bizarre, but
it apparently causes compiler warnings on "Sun Studio 11".
I believe the warnings are bogus, but it doesn't hurt to make
the macro definition saner.
Bugfix candidate (but I'm not going to bother).
........
r46268 | fredrik.lundh | 2006-05-26 01:27:53 +0200 (Fri, 26 May 2006) | 8 lines
needforspeed: partition for 8-bit strings. for some simple tests,
this is on par with a corresponding find, and nearly twice as fast
as split(sep, 1)
full tests, a unicode version, and documentation will follow to-
morrow.
........
r46271 | andrew.kuchling | 2006-05-26 03:46:22 +0200 (Fri, 26 May 2006) | 1 line
Add Soc student
........
r46272 | ronald.oussoren | 2006-05-26 10:41:25 +0200 (Fri, 26 May 2006) | 3 lines
Without this patch OSX users couldn't add new help sources because the code
tried to update one item in a tuple.
........
r46273 | fredrik.lundh | 2006-05-26 10:54:28 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: partition implementation, part two.
feel free to improve the documentation and the docstrings.
........
r46274 | georg.brandl | 2006-05-26 11:05:54 +0200 (Fri, 26 May 2006) | 3 lines
Clarify docs for str.partition().
........
r46278 | fredrik.lundh | 2006-05-26 11:46:59 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: use METH_O for argument handling, which made partition some
~15% faster for the current tests (which is noticable faster than a corre-
sponding find call). thanks to neal-who-never-sleeps for the tip.
........
r46280 | fredrik.lundh | 2006-05-26 12:27:17 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: use Py_ssize_t for the fastsearch counter and skip
length (thanks, neal!). and yes, I've verified that this doesn't
slow things down ;-)
........
r46285 | andrew.dalke | 2006-05-26 13:11:38 +0200 (Fri, 26 May 2006) | 2 lines
Added a few more test cases for whitespace split. These strings have leading whitespace.
........
r46286 | jack.diederich | 2006-05-26 13:15:17 +0200 (Fri, 26 May 2006) | 1 line
use Py_ssize_t in places that may need it
........
r46287 | andrew.dalke | 2006-05-26 13:15:22 +0200 (Fri, 26 May 2006) | 2 lines
Added split whitespace checks for characters other than space.
........
r46288 | ronald.oussoren | 2006-05-26 13:17:55 +0200 (Fri, 26 May 2006) | 2 lines
Fix buglet in postinstall script, it would generate an invalid .cshrc file.
........
r46290 | georg.brandl | 2006-05-26 13:26:11 +0200 (Fri, 26 May 2006) | 3 lines
Add "partition" to UserString.
........
r46291 | fredrik.lundh | 2006-05-26 13:29:39 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: added Py_LOCAL macro, based on the LOCAL macro used
for SRE and others. applied Py_LOCAL to relevant portion of ceval,
which gives a 1-2% speedup on my machine. ymmv.
........
r46292 | jack.diederich | 2006-05-26 13:37:20 +0200 (Fri, 26 May 2006) | 1 line
when generating python code prefer to generate valid python code
........
r46293 | fredrik.lundh | 2006-05-26 13:38:15 +0200 (Fri, 26 May 2006) | 3 lines
use Py_LOCAL also for string and unicode objects
........
r46294 | ronald.oussoren | 2006-05-26 13:38:39 +0200 (Fri, 26 May 2006) | 12 lines
- Search the sqlite specific search directories
after the normal include directories when looking
for the version of sqlite to use.
- On OSX:
* Extract additional include and link directories
from the CFLAGS and LDFLAGS, if the user has
bothered to specify them we might as wel use them.
* Add '-Wl,-search_paths_first' to the extra_link_args
for readline and sqlite. This makes it possible to
use a static library to override the system provided
dynamic library.
........
r46295 | ronald.oussoren | 2006-05-26 13:43:26 +0200 (Fri, 26 May 2006) | 6 lines
Integrate installing a framework in the 'make install'
target. Until now users had to use 'make frameworkinstall'
to install python when it is configured with '--enable-framework'.
This tends to confuse users that don't hunt for readme files
hidden in platform specific directories :-)
........
r46297 | fredrik.lundh | 2006-05-26 13:54:04 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: added PY_LOCAL_AGGRESSIVE macro to enable "aggressive"
LOCAL inlining; also added some missing whitespace
........
r46298 | andrew.kuchling | 2006-05-26 14:01:44 +0200 (Fri, 26 May 2006) | 1 line
Typo fixes
........
r46299 | fredrik.lundh | 2006-05-26 14:01:49 +0200 (Fri, 26 May 2006) | 4 lines
Py_LOCAL shouldn't be used for data; it works for some .NET 2003 compilers,
but Trent's copy thinks that it's an anachronism...
........
r46300 | martin.blais | 2006-05-26 14:03:27 +0200 (Fri, 26 May 2006) | 12 lines
Support for buffer protocol for socket and struct.
* Added socket.recv_buf() and socket.recvfrom_buf() methods, that use the buffer
protocol (send and sendto already did).
* Added struct.pack_to(), that is the corresponding buffer compatible method to
unpack_from().
* Fixed minor typos in arraymodule.
........
r46302 | ronald.oussoren | 2006-05-26 14:23:20 +0200 (Fri, 26 May 2006) | 6 lines
- Remove previous version of the binary distribution script for OSX
- Some small bugfixes for the IDLE.app wrapper
- Tweaks to build-installer to ensure that python gets build in the right way,
including sqlite3.
- Updated readme files
........
r46305 | tim.peters | 2006-05-26 14:26:21 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46307 | andrew.dalke | 2006-05-26 14:28:15 +0200 (Fri, 26 May 2006) | 7 lines
I like tests.
The new split functions use a preallocated list. Added tests which exceed
the preallocation size, to exercise list appends/resizes.
Also added more edge case tests.
........
r46308 | andrew.dalke | 2006-05-26 14:31:00 +0200 (Fri, 26 May 2006) | 2 lines
Test cases for off-by-one errors in string split with multicharacter pattern.
........
r46309 | tim.peters | 2006-05-26 14:31:20 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46313 | andrew.kuchling | 2006-05-26 14:39:48 +0200 (Fri, 26 May 2006) | 1 line
Add str.partition()
........
r46314 | bob.ippolito | 2006-05-26 14:52:53 +0200 (Fri, 26 May 2006) | 1 line
quick hack to fix busted binhex test
........
r46316 | andrew.dalke | 2006-05-26 15:05:55 +0200 (Fri, 26 May 2006) | 2 lines
Added more rstrip tests, including for prealloc'ed arrays
........
r46320 | bob.ippolito | 2006-05-26 15:15:44 +0200 (Fri, 26 May 2006) | 1 line
fix #1229380 No struct.pack exception for some out of range integers
........
r46325 | tim.peters | 2006-05-26 15:39:17 +0200 (Fri, 26 May 2006) | 2 lines
Use open() to open files (was using file()).
........
r46327 | andrew.dalke | 2006-05-26 16:00:45 +0200 (Fri, 26 May 2006) | 37 lines
Changes to string.split/rsplit on whitespace to preallocate space in the
results list.
Originally it allocated 0 items and used the list growth during append. Now
it preallocates 12 items so the first few appends don't need list reallocs.
("Here are some words ."*2).split(None, 1) is 7% faster
("Here are some words ."*2).split() is is 15% faster
(Your milage may vary, see dealership for details.)
File parsing like this
for line in f:
count += len(line.split())
is also about 15% faster. There is a slowdown of about 3% for large
strings because of the additional overhead of checking if the append is
to a preallocated region of the list or not. This will be the rare case.
It could be improved with special case code but we decided it was not
useful enough.
There is a cost of 12*sizeof(PyObject *) bytes per list. For the normal
case of file parsing this is not a problem because of the lists have
a short lifetime. We have not come up with cases where this is a problem
in real life.
I chose 12 because human text averages about 11 words per line in books,
one of my data sets averages 6.2 words with a final peak at 11 words per
line, and I work with a tab delimited data set with 8 tabs per line (or
9 words per line). 12 encompasses all of these.
Also changed the last rstrip code to append then reverse, rather than
doing insert(0). The strip() and rstrip() times are now comparable.
........
r46328 | tim.peters | 2006-05-26 16:02:05 +0200 (Fri, 26 May 2006) | 5 lines
Explicitly close files. I'm trying to stop the frequent spurious test_tarfile
failures on Windows buildbots, but it's hard to know how since the regrtest
failure output is useless here, and it never fails when a buildbot slave runs
test_tarfile the second time in verbose mode.
........
r46329 | andrew.kuchling | 2006-05-26 16:03:41 +0200 (Fri, 26 May 2006) | 1 line
Add buffer support for struct, socket
........
r46330 | andrew.kuchling | 2006-05-26 16:04:19 +0200 (Fri, 26 May 2006) | 1 line
Typo fix
........
r46331 | bob.ippolito | 2006-05-26 16:07:23 +0200 (Fri, 26 May 2006) | 1 line
Fix distutils so that libffi will cross-compile between darwin/x86 and darwin/ppc
........
r46333 | bob.ippolito | 2006-05-26 16:23:21 +0200 (Fri, 26 May 2006) | 1 line
Fix _struct typo that broke some 64-bit platforms
........
r46335 | bob.ippolito | 2006-05-26 16:29:35 +0200 (Fri, 26 May 2006) | 1 line
Enable PY_USE_INT_WHEN_POSSIBLE in struct
........
r46343 | andrew.dalke | 2006-05-26 17:21:01 +0200 (Fri, 26 May 2006) | 2 lines
Eeked out another 3% or so performance in split whitespace by cleaning up the algorithm.
........
r46352 | andrew.dalke | 2006-05-26 18:22:52 +0200 (Fri, 26 May 2006) | 3 lines
Test for more edge strip cases; leading and trailing separator gets removed
even with strip(..., 0)
........
r46354 | bob.ippolito | 2006-05-26 18:23:28 +0200 (Fri, 26 May 2006) | 1 line
fix signed/unsigned mismatch in struct
........
r46355 | steve.holden | 2006-05-26 18:27:59 +0200 (Fri, 26 May 2006) | 5 lines
Add -t option to allow easy test selection.
Action verbose option correctly.
Tweak operation counts. Add empty and new instances tests.
Enable comparisons across different warp factors. Change version.
........
r46356 | fredrik.lundh | 2006-05-26 18:32:42 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: use Py_LOCAL on a few more locals in stringobject.c
........
r46357 | thomas.heller | 2006-05-26 18:42:44 +0200 (Fri, 26 May 2006) | 4 lines
For now, I gave up with automatic conversion of reST to Python-latex,
so I'm writing this in latex now.
Skeleton for the ctypes reference.
........
r46358 | tim.peters | 2006-05-26 18:49:28 +0200 (Fri, 26 May 2006) | 3 lines
Repair Windows compiler warnings about mixing
signed and unsigned integral types in comparisons.
........
r46359 | tim.peters | 2006-05-26 18:52:04 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46360 | tim.peters | 2006-05-26 18:53:04 +0200 (Fri, 26 May 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46362 | fredrik.lundh | 2006-05-26 19:04:58 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: stringlib refactoring (in progress)
........
r46363 | thomas.heller | 2006-05-26 19:18:33 +0200 (Fri, 26 May 2006) | 1 line
Write some docs.
........
r46364 | fredrik.lundh | 2006-05-26 19:22:38 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: stringlib refactoring (in progress)
........
r46366 | fredrik.lundh | 2006-05-26 19:26:39 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: cleanup
........
r46367 | fredrik.lundh | 2006-05-26 19:31:41 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: remove remaining USE_FAST macros; if fastsearch was
broken, someone would have noticed by now ;-)
........
r46368 | steve.holden | 2006-05-26 19:41:32 +0200 (Fri, 26 May 2006) | 5 lines
Use minimum calibration time rather than avergae to avoid
the illusion of negative run times. Halt with an error if
run times go below 10 ms, indicating that results will be
unreliable.
........
r46370 | thomas.heller | 2006-05-26 19:47:40 +0200 (Fri, 26 May 2006) | 2 lines
Reordered, and wrote more docs.
........
r46372 | georg.brandl | 2006-05-26 20:03:31 +0200 (Fri, 26 May 2006) | 9 lines
Need for speed: Patch #921466 : sys.path_importer_cache is now used to cache valid and
invalid file paths for the built-in import machinery which leads to
fewer open calls on startup.
Also fix issue with PEP 302 style import hooks which lead to more open()
calls than necessary.
........
r46373 | fredrik.lundh | 2006-05-26 20:05:34 +0200 (Fri, 26 May 2006) | 3 lines
removed unnecessary include
........
r46377 | fredrik.lundh | 2006-05-26 20:15:38 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: added rpartition implementation
........
r46380 | fredrik.lundh | 2006-05-26 20:24:15 +0200 (Fri, 26 May 2006) | 5 lines
needspeed: rpartition documentation, tests, and a bug fixes.
feel free to add more tests and improve the documentation.
........
r46381 | steve.holden | 2006-05-26 20:26:21 +0200 (Fri, 26 May 2006) | 4 lines
Revert tests to MAL's original round sizes to retiain comparability
from long ago and far away. Stop calling this pybench 1.4 because it
isn't. Remove the empty test, which was a bad idea.
........
r46387 | andrew.kuchling | 2006-05-26 20:41:18 +0200 (Fri, 26 May 2006) | 1 line
Add rpartition() and path caching
........
r46388 | andrew.dalke | 2006-05-26 21:02:09 +0200 (Fri, 26 May 2006) | 10 lines
substring split now uses /F's fast string matching algorithm.
(If compiled without FAST search support, changed the pre-memcmp test
to check the last character as well as the first. This gave a 25%
speedup for my test case.)
Rewrote the split algorithms so they stop when maxsplit gets to 0.
Previously they did a string match first then checked if the maxsplit
was reached. The new way prevents a needless string search.
........
r46391 | brett.cannon | 2006-05-26 21:04:47 +0200 (Fri, 26 May 2006) | 2 lines
Change C spacing to 4 spaces by default to match PEP 7 for new C files.
........
r46392 | georg.brandl | 2006-05-26 21:04:47 +0200 (Fri, 26 May 2006) | 3 lines
Exception isn't the root of all exception classes anymore.
........
r46397 | fredrik.lundh | 2006-05-26 21:23:21 +0200 (Fri, 26 May 2006) | 3 lines
added rpartition method to UserString class
........
r46398 | fredrik.lundh | 2006-05-26 21:24:53 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: stringlib refactoring, continued. added count and
find helpers; updated unicodeobject to use stringlib_count
........
r46400 | fredrik.lundh | 2006-05-26 21:29:05 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: stringlib refactoring: use stringlib/find for unicode
find
........
r46403 | fredrik.lundh | 2006-05-26 21:33:03 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: use a macro to fix slice indexes
........
r46404 | thomas.heller | 2006-05-26 21:43:45 +0200 (Fri, 26 May 2006) | 1 line
Write more docs.
........
r46406 | fredrik.lundh | 2006-05-26 21:48:07 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: stringlib refactoring: use stringlib/find for string find
........
r46407 | andrew.kuchling | 2006-05-26 21:51:10 +0200 (Fri, 26 May 2006) | 1 line
Comment typo
........
r46409 | georg.brandl | 2006-05-26 22:04:44 +0200 (Fri, 26 May 2006) | 3 lines
Replace Py_BuildValue("OO") by PyTuple_Pack.
........
r46411 | georg.brandl | 2006-05-26 22:14:47 +0200 (Fri, 26 May 2006) | 2 lines
Patch #1492218: document None being a constant.
........
r46415 | georg.brandl | 2006-05-26 22:22:50 +0200 (Fri, 26 May 2006) | 3 lines
Simplify calling.
........
r46416 | andrew.dalke | 2006-05-26 22:25:22 +0200 (Fri, 26 May 2006) | 4 lines
Added limits to the replace code so it does not count all of the matching
patterns in a string, only the number needed by the max limit.
........
r46417 | bob.ippolito | 2006-05-26 22:25:23 +0200 (Fri, 26 May 2006) | 1 line
enable all of the struct tests, use ssize_t, fix some whitespace
........
r46418 | tim.peters | 2006-05-26 22:56:56 +0200 (Fri, 26 May 2006) | 2 lines
Record Iceland sprint attendees.
........
r46421 | tim.peters | 2006-05-26 23:51:13 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46422 | steve.holden | 2006-05-27 00:17:54 +0200 (Sat, 27 May 2006) | 2 lines
Add Richard Tew to developers
........
r46423 | steve.holden | 2006-05-27 00:33:20 +0200 (Sat, 27 May 2006) | 2 lines
Update help text and documentaition.
........
r46424 | steve.holden | 2006-05-27 00:39:27 +0200 (Sat, 27 May 2006) | 2 lines
Blasted typos ...
........
r46425 | andrew.dalke | 2006-05-27 00:49:03 +0200 (Sat, 27 May 2006) | 2 lines
Added description of why splitlines doesn't use the prealloc strategy
........
r46426 | tim.peters | 2006-05-27 01:14:37 +0200 (Sat, 27 May 2006) | 19 lines
Patch 1145039.
set_exc_info(), reset_exc_info(): By exploiting the
likely (who knows?) invariant that when an exception's
`type` is NULL, its `value` and `traceback` are also NULL,
save some cycles in heavily-executed code.
This is a "a kronar saved is a kronar earned" patch: the
speedup isn't reliably measurable, but it obviously does
reduce the operation count in the normal (no exception
raised) path through PyEval_EvalFrameEx().
The tim-exc_sanity branch tries to push this harder, but
is still blowing up (at least in part due to pre-existing
subtle bugs that appear to have no other visible
consequences!).
Not a bugfix candidate.
........
r46429 | steve.holden | 2006-05-27 02:51:52 +0200 (Sat, 27 May 2006) | 2 lines
Reinstate new-style object tests.
........
r46430 | neal.norwitz | 2006-05-27 07:18:57 +0200 (Sat, 27 May 2006) | 1 line
Fix compiler warning (and whitespace) on Mac OS 10.4. (A lot of this code looked duplicated, I wonder if a utility function could help reduce the duplication here.)
........
r46431 | neal.norwitz | 2006-05-27 07:21:30 +0200 (Sat, 27 May 2006) | 4 lines
Fix Coverity warnings.
- Check the correct variable (str_obj, not str) for NULL
- sep_len was already verified it wasn't 0
........
r46432 | martin.v.loewis | 2006-05-27 10:36:52 +0200 (Sat, 27 May 2006) | 2 lines
Patch 1494554: Update numeric properties to Unicode 4.1.
........
r46433 | martin.v.loewis | 2006-05-27 10:54:29 +0200 (Sat, 27 May 2006) | 2 lines
Explain why 'consumed' is initialized.
........
r46436 | fredrik.lundh | 2006-05-27 12:05:10 +0200 (Sat, 27 May 2006) | 3 lines
needforspeed: more stringlib refactoring
........
r46438 | fredrik.lundh | 2006-05-27 12:39:48 +0200 (Sat, 27 May 2006) | 5 lines
needforspeed: backed out the Py_LOCAL-isation of ceval; the massive in-
lining killed performance on certain Intel boxes, and the "aggressive"
macro itself gives most of the benefits on others.
........
r46439 | andrew.dalke | 2006-05-27 13:04:36 +0200 (Sat, 27 May 2006) | 2 lines
fixed typo
........
r46440 | martin.v.loewis | 2006-05-27 13:07:49 +0200 (Sat, 27 May 2006) | 2 lines
Revert bogus change committed in 46432 to this file.
........
r46444 | andrew.kuchling | 2006-05-27 13:26:33 +0200 (Sat, 27 May 2006) | 1 line
Add Py_LOCAL macros
........
r46450 | bob.ippolito | 2006-05-27 13:47:12 +0200 (Sat, 27 May 2006) | 1 line
Remove the range checking and int usage #defines from _struct and strip out the now-dead code
........
r46454 | bob.ippolito | 2006-05-27 14:11:36 +0200 (Sat, 27 May 2006) | 1 line
Fix up struct docstrings, add struct.pack_to function for symmetry
........
r46456 | richard.jones | 2006-05-27 14:29:24 +0200 (Sat, 27 May 2006) | 2 lines
Conversion of exceptions over from faked-up classes to new-style C types.
........
r46457 | georg.brandl | 2006-05-27 14:30:25 +0200 (Sat, 27 May 2006) | 3 lines
Add news item for new-style exception class branch merge.
........
r46458 | tim.peters | 2006-05-27 14:36:53 +0200 (Sat, 27 May 2006) | 3 lines
More random thrashing trying to understand spurious
Windows failures. Who's keeping a bz2 file open?
........
r46460 | andrew.kuchling | 2006-05-27 15:44:37 +0200 (Sat, 27 May 2006) | 1 line
Mention new-style exceptions
........
r46461 | richard.jones | 2006-05-27 15:50:42 +0200 (Sat, 27 May 2006) | 1 line
credit where credit is due
........
r46462 | georg.brandl | 2006-05-27 16:02:03 +0200 (Sat, 27 May 2006) | 3 lines
Always close BZ2Proxy object. Remove unnecessary struct usage.
........
r46463 | tim.peters | 2006-05-27 16:13:13 +0200 (Sat, 27 May 2006) | 2 lines
The cheery optimism of old age.
........
r46464 | andrew.dalke | 2006-05-27 16:16:40 +0200 (Sat, 27 May 2006) | 2 lines
cleanup - removed trailing whitespace
........
r46465 | georg.brandl | 2006-05-27 16:41:55 +0200 (Sat, 27 May 2006) | 3 lines
Remove spurious semicolons after macro invocations.
........
r46468 | fredrik.lundh | 2006-05-27 16:58:20 +0200 (Sat, 27 May 2006) | 4 lines
needforspeed: replace improvements, changed to Py_LOCAL_INLINE
where appropriate
........
r46469 | fredrik.lundh | 2006-05-27 17:20:22 +0200 (Sat, 27 May 2006) | 4 lines
needforspeed: stringlib refactoring: changed find_obj to find_slice,
to enable use from stringobject
........
r46470 | fredrik.lundh | 2006-05-27 17:26:19 +0200 (Sat, 27 May 2006) | 3 lines
needforspeed: stringlib refactoring: use find_slice for stringobject
........
r46472 | kristjan.jonsson | 2006-05-27 17:41:31 +0200 (Sat, 27 May 2006) | 1 line
Add a PCBuild8 build directory for building with Visual Studio .NET 2005. Contains a special project to perform profile guided optimizations on the pythoncore.dll, by instrumenting and running pybench.py
........
r46473 | jack.diederich | 2006-05-27 17:44:34 +0200 (Sat, 27 May 2006) | 3 lines
needforspeed: use PyObject_MALLOC instead of system malloc for small
allocations. Use PyMem_MALLOC for larger (1k+) chunks. 1%-2% speedup.
........
r46474 | bob.ippolito | 2006-05-27 17:53:49 +0200 (Sat, 27 May 2006) | 1 line
fix struct regression on 64-bit platforms
........
r46475 | richard.jones | 2006-05-27 18:07:28 +0200 (Sat, 27 May 2006) | 1 line
doc string additions and tweaks
........
r46477 | richard.jones | 2006-05-27 18:15:11 +0200 (Sat, 27 May 2006) | 1 line
move semicolons
........
r46478 | george.yoshida | 2006-05-27 18:32:44 +0200 (Sat, 27 May 2006) | 2 lines
minor markup nits
........
r46488 | george.yoshida | 2006-05-27 18:51:43 +0200 (Sat, 27 May 2006) | 3 lines
End of Ch.3 is now about "with statement".
Avoid obsolescence by directly referring to the section.
........
r46489 | george.yoshida | 2006-05-27 19:09:17 +0200 (Sat, 27 May 2006) | 2 lines
fix typo
........
2006-05-27 19:21:47 +00:00
|
|
|
#else
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2012-06-22 16:30:09 -07:00
|
|
|
#if HAVE_MKDIRAT
|
2020-11-22 11:18:40 +01:00
|
|
|
if (dir_fd != DEFAULT_DIR_FD) {
|
|
|
|
|
if (HAVE_MKDIRAT_RUNTIME) {
|
2014-08-05 14:04:04 +10:00
|
|
|
result = mkdirat(dir_fd, path->narrow, mode);
|
2020-11-22 11:18:40 +01:00
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
mkdirat_unavailable = 1;
|
|
|
|
|
}
|
|
|
|
|
} else
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
2017-10-27 14:27:06 +02:00
|
|
|
#if defined(__WATCOMC__) && !defined(__QNX__)
|
2014-08-05 14:04:04 +10:00
|
|
|
result = mkdir(path->narrow);
|
1996-05-23 22:58:55 +00:00
|
|
|
#else
|
2014-08-05 14:04:04 +10:00
|
|
|
result = mkdir(path->narrow, mode);
|
1996-05-23 22:58:55 +00:00
|
|
|
#endif
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
2020-11-22 11:18:40 +01:00
|
|
|
|
|
|
|
|
#if HAVE_MKDIRAT
|
|
|
|
|
if (mkdirat_unavailable) {
|
|
|
|
|
argument_unavailable_error(NULL, "dir_fd");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
if (result < 0)
|
|
|
|
|
return path_error(path);
|
2016-09-08 10:35:16 -07:00
|
|
|
#endif /* MS_WINDOWS */
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
1990-10-14 12:07:46 +00:00
|
|
|
}
|
|
|
|
|
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2006-04-21 10:40:58 +00:00
|
|
|
/* sys/resource.h is needed for at least: wait3(), wait4(), broken nice. */
|
|
|
|
|
#if defined(HAVE_SYS_RESOURCE_H)
|
2001-07-11 22:35:31 +00:00
|
|
|
#include <sys/resource.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2006-04-21 10:40:58 +00:00
|
|
|
|
|
|
|
|
#ifdef HAVE_NICE
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.nice
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
increment: int
|
|
|
|
|
/
|
1993-01-09 17:18:52 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Add increment to the priority of process and return the new priority.
|
|
|
|
|
[clinic start generated code]*/
|
2001-07-11 14:45:34 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_nice_impl(PyObject *module, int increment)
|
|
|
|
|
/*[clinic end generated code: output=9dad8a9da8109943 input=864be2d402a21da2]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
int value;
|
|
|
|
|
|
|
|
|
|
/* There are two flavours of 'nice': one that returns the new
|
|
|
|
|
priority (as required by almost all standards out there) and the
|
2017-09-28 22:44:27 -07:00
|
|
|
Linux/FreeBSD one, which returns '0' on success and advices
|
2014-08-05 14:04:04 +10:00
|
|
|
the use of getpriority() to get the new priority.
|
|
|
|
|
|
|
|
|
|
If we are of the nice family that returns the new priority, we
|
|
|
|
|
need to clear errno before the call, and check if errno is filled
|
|
|
|
|
before calling posix_error() on a returnvalue of -1, because the
|
|
|
|
|
-1 may be the actual new priority! */
|
2001-07-11 14:45:34 +00:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
errno = 0;
|
|
|
|
|
value = nice(increment);
|
2001-07-11 22:35:31 +00:00
|
|
|
#if defined(HAVE_BROKEN_NICE) && defined(HAVE_GETPRIORITY)
|
2010-05-06 00:08:46 +00:00
|
|
|
if (value == 0)
|
|
|
|
|
value = getpriority(PRIO_PROCESS, 0);
|
2001-07-11 14:45:34 +00:00
|
|
|
#endif
|
2010-05-06 00:08:46 +00:00
|
|
|
if (value == -1 && errno != 0)
|
|
|
|
|
/* either nice() or getpriority() returned an error */
|
|
|
|
|
return posix_error();
|
|
|
|
|
return PyLong_FromLong((long) value);
|
1993-01-09 17:18:52 +00:00
|
|
|
}
|
1994-08-01 11:34:53 +00:00
|
|
|
#endif /* HAVE_NICE */
|
1991-04-08 20:59:13 +00:00
|
|
|
|
2011-02-25 20:57:54 +00:00
|
|
|
|
|
|
|
|
#ifdef HAVE_GETPRIORITY
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.getpriority
|
|
|
|
|
|
|
|
|
|
which: int
|
|
|
|
|
who: int
|
|
|
|
|
|
|
|
|
|
Return program scheduling priority.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_getpriority_impl(PyObject *module, int which, int who)
|
|
|
|
|
/*[clinic end generated code: output=c41b7b63c7420228 input=9be615d40e2544ef]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
int retval;
|
2011-02-25 20:57:54 +00:00
|
|
|
|
|
|
|
|
errno = 0;
|
|
|
|
|
retval = getpriority(which, who);
|
|
|
|
|
if (errno != 0)
|
|
|
|
|
return posix_error();
|
|
|
|
|
return PyLong_FromLong((long)retval);
|
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_GETPRIORITY */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SETPRIORITY
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.setpriority
|
|
|
|
|
|
|
|
|
|
which: int
|
|
|
|
|
who: int
|
|
|
|
|
priority: int
|
|
|
|
|
|
|
|
|
|
Set program scheduling priority.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_setpriority_impl(PyObject *module, int which, int who, int priority)
|
|
|
|
|
/*[clinic end generated code: output=3d910d95a7771eb2 input=710ccbf65b9dc513]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
int retval;
|
|
|
|
|
|
|
|
|
|
retval = setpriority(which, who, priority);
|
2011-02-25 20:57:54 +00:00
|
|
|
if (retval == -1)
|
|
|
|
|
return posix_error();
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_SETPRIORITY */
|
|
|
|
|
|
|
|
|
|
|
1996-12-10 23:23:01 +00:00
|
|
|
static PyObject *
|
2014-08-05 14:04:04 +10:00
|
|
|
internal_rename(path_t *src, path_t *dst, int src_dir_fd, int dst_dir_fd, int is_replace)
|
1990-10-14 12:07:46 +00:00
|
|
|
{
|
2016-05-07 16:45:18 +03:00
|
|
|
const char *function_name = is_replace ? "replace" : "rename";
|
2012-06-22 16:30:09 -07:00
|
|
|
int dir_fd_specified;
|
|
|
|
|
|
2020-11-22 11:18:40 +01:00
|
|
|
#ifdef HAVE_RENAMEAT
|
|
|
|
|
int renameat_unavailable = 0;
|
|
|
|
|
#endif
|
|
|
|
|
|
2002-10-03 05:10:39 +00:00
|
|
|
#ifdef MS_WINDOWS
|
2010-05-06 00:08:46 +00:00
|
|
|
BOOL result;
|
2012-01-30 22:08:52 +01:00
|
|
|
int flags = is_replace ? MOVEFILE_REPLACE_EXISTING : 0;
|
2012-06-22 16:30:09 -07:00
|
|
|
#else
|
|
|
|
|
int result;
|
|
|
|
|
#endif
|
2011-11-15 22:27:41 +01:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
dir_fd_specified = (src_dir_fd != DEFAULT_DIR_FD) ||
|
|
|
|
|
(dst_dir_fd != DEFAULT_DIR_FD);
|
|
|
|
|
#ifndef HAVE_RENAMEAT
|
|
|
|
|
if (dir_fd_specified) {
|
|
|
|
|
argument_unavailable_error(function_name, "src_dir_fd and dst_dir_fd");
|
2014-08-05 14:04:04 +10:00
|
|
|
return NULL;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
2011-11-15 22:27:41 +01:00
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.rename", "OOii", src->object, dst->object,
|
|
|
|
|
src_dir_fd == DEFAULT_DIR_FD ? -1 : src_dir_fd,
|
|
|
|
|
dst_dir_fd == DEFAULT_DIR_FD ? -1 : dst_dir_fd) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2016-09-08 10:35:16 -07:00
|
|
|
result = MoveFileExW(src->wide, dst->wide, flags);
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_END_ALLOW_THREADS
|
2011-11-15 22:27:41 +01:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
if (!result)
|
|
|
|
|
return path_error2(src, dst);
|
2011-11-15 22:27:41 +01:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
#else
|
2016-09-08 10:35:16 -07:00
|
|
|
if ((src->narrow && dst->wide) || (src->wide && dst->narrow)) {
|
|
|
|
|
PyErr_Format(PyExc_ValueError,
|
|
|
|
|
"%s: src and dst must be the same type", function_name);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
#ifdef HAVE_RENAMEAT
|
2020-11-22 11:18:40 +01:00
|
|
|
if (dir_fd_specified) {
|
|
|
|
|
if (HAVE_RENAMEAT_RUNTIME) {
|
|
|
|
|
result = renameat(src_dir_fd, src->narrow, dst_dir_fd, dst->narrow);
|
|
|
|
|
} else {
|
|
|
|
|
renameat_unavailable = 1;
|
|
|
|
|
}
|
|
|
|
|
} else
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
2016-09-08 10:35:16 -07:00
|
|
|
result = rename(src->narrow, dst->narrow);
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_END_ALLOW_THREADS
|
2011-11-15 22:27:41 +01:00
|
|
|
|
2020-11-22 11:18:40 +01:00
|
|
|
|
|
|
|
|
#ifdef HAVE_RENAMEAT
|
|
|
|
|
if (renameat_unavailable) {
|
|
|
|
|
argument_unavailable_error(function_name, "src_dir_fd and dst_dir_fd");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
if (result)
|
|
|
|
|
return path_error2(src, dst);
|
2002-10-03 05:10:39 +00:00
|
|
|
#endif
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.rename
|
|
|
|
|
|
|
|
|
|
src : path_t
|
|
|
|
|
dst : path_t
|
|
|
|
|
*
|
|
|
|
|
src_dir_fd : dir_fd = None
|
|
|
|
|
dst_dir_fd : dir_fd = None
|
|
|
|
|
|
|
|
|
|
Rename a file or directory.
|
|
|
|
|
|
|
|
|
|
If either src_dir_fd or dst_dir_fd is not None, it should be a file
|
|
|
|
|
descriptor open to a directory, and the respective path string (src or dst)
|
|
|
|
|
should be relative; the path will then be relative to that directory.
|
|
|
|
|
src_dir_fd and dst_dir_fd, may not be implemented on your platform.
|
|
|
|
|
If they are unavailable, using them will raise a NotImplementedError.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
2012-01-30 22:08:52 +01:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_rename_impl(PyObject *module, path_t *src, path_t *dst, int src_dir_fd,
|
2015-04-14 18:07:59 -04:00
|
|
|
int dst_dir_fd)
|
2016-07-07 17:35:15 +03:00
|
|
|
/*[clinic end generated code: output=59e803072cf41230 input=faa61c847912c850]*/
|
2012-01-30 22:08:52 +01:00
|
|
|
{
|
2014-08-05 14:04:04 +10:00
|
|
|
return internal_rename(src, dst, src_dir_fd, dst_dir_fd, 0);
|
2012-01-30 22:08:52 +01:00
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.replace = os.rename
|
|
|
|
|
|
|
|
|
|
Rename a file or directory, overwriting the destination.
|
|
|
|
|
|
|
|
|
|
If either src_dir_fd or dst_dir_fd is not None, it should be a file
|
|
|
|
|
descriptor open to a directory, and the respective path string (src or dst)
|
|
|
|
|
should be relative; the path will then be relative to that directory.
|
|
|
|
|
src_dir_fd and dst_dir_fd, may not be implemented on your platform.
|
2019-02-12 23:15:54 -05:00
|
|
|
If they are unavailable, using them will raise a NotImplementedError.
|
2014-08-05 14:04:04 +10:00
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_replace_impl(PyObject *module, path_t *src, path_t *dst, int src_dir_fd,
|
|
|
|
|
int dst_dir_fd)
|
2019-02-12 23:15:54 -05:00
|
|
|
/*[clinic end generated code: output=1968c02e7857422b input=c003f0def43378ef]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
return internal_rename(src, dst, src_dir_fd, dst_dir_fd, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.rmdir
|
|
|
|
|
|
|
|
|
|
path: path_t
|
|
|
|
|
*
|
|
|
|
|
dir_fd: dir_fd(requires='unlinkat') = None
|
|
|
|
|
|
|
|
|
|
Remove a directory.
|
|
|
|
|
|
|
|
|
|
If dir_fd is not None, it should be a file descriptor open to a directory,
|
|
|
|
|
and path should be relative; path will then be relative to that directory.
|
|
|
|
|
dir_fd may not be implemented on your platform.
|
|
|
|
|
If it is unavailable, using it will raise a NotImplementedError.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_rmdir_impl(PyObject *module, path_t *path, int dir_fd)
|
|
|
|
|
/*[clinic end generated code: output=080eb54f506e8301 input=38c8b375ca34a7e2]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
int result;
|
2020-11-22 11:18:40 +01:00
|
|
|
#ifdef HAVE_UNLINKAT
|
|
|
|
|
int unlinkat_unavailable = 0;
|
|
|
|
|
#endif
|
2012-06-23 16:55:07 -07:00
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.rmdir", "Oi", path->object,
|
|
|
|
|
dir_fd == DEFAULT_DIR_FD ? -1 : dir_fd) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-23 16:55:07 -07:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2002-10-03 05:10:39 +00:00
|
|
|
#ifdef MS_WINDOWS
|
2016-09-08 10:35:16 -07:00
|
|
|
/* Windows, success=1, UNIX, success=0 */
|
|
|
|
|
result = !RemoveDirectoryW(path->wide);
|
2002-10-03 05:10:39 +00:00
|
|
|
#else
|
2012-06-23 16:55:07 -07:00
|
|
|
#ifdef HAVE_UNLINKAT
|
2020-11-22 11:18:40 +01:00
|
|
|
if (dir_fd != DEFAULT_DIR_FD) {
|
|
|
|
|
if (HAVE_UNLINKAT_RUNTIME) {
|
2014-08-05 14:04:04 +10:00
|
|
|
result = unlinkat(dir_fd, path->narrow, AT_REMOVEDIR);
|
2020-11-22 11:18:40 +01:00
|
|
|
} else {
|
|
|
|
|
unlinkat_unavailable = 1;
|
|
|
|
|
result = -1;
|
|
|
|
|
}
|
|
|
|
|
} else
|
2002-10-03 05:10:39 +00:00
|
|
|
#endif
|
2014-08-05 14:04:04 +10:00
|
|
|
result = rmdir(path->narrow);
|
2012-06-23 16:55:07 -07:00
|
|
|
#endif
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
|
2020-11-22 11:18:40 +01:00
|
|
|
#ifdef HAVE_UNLINKAT
|
|
|
|
|
if (unlinkat_unavailable) {
|
|
|
|
|
argument_unavailable_error("rmdir", "dir_fd");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
if (result)
|
|
|
|
|
return path_error(path);
|
2012-06-23 16:55:07 -07:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
1990-10-14 12:07:46 +00:00
|
|
|
}
|
|
|
|
|
|
1997-06-02 22:20:51 +00:00
|
|
|
|
1996-05-23 22:58:55 +00:00
|
|
|
#ifdef HAVE_SYSTEM
|
2014-08-05 14:04:04 +10:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.system -> long
|
|
|
|
|
|
|
|
|
|
command: Py_UNICODE
|
|
|
|
|
|
|
|
|
|
Execute the command in a subshell.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static long
|
2018-12-14 11:19:51 +02:00
|
|
|
os_system_impl(PyObject *module, const Py_UNICODE *command)
|
|
|
|
|
/*[clinic end generated code: output=5b7c3599c068ca42 input=303f5ce97df606b0]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
long result;
|
2019-05-23 08:45:22 -07:00
|
|
|
|
2019-10-18 00:52:15 -07:00
|
|
|
if (PySys_Audit("os.system", "(u)", command) < 0) {
|
2019-05-23 08:45:22 -07:00
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2016-11-19 18:41:16 -08:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
2014-08-05 14:04:04 +10:00
|
|
|
result = _wsystem(command);
|
2016-11-19 18:41:16 -08:00
|
|
|
_Py_END_SUPPRESS_IPH
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
2014-08-05 14:04:04 +10:00
|
|
|
return result;
|
1990-10-14 12:07:46 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#else /* MS_WINDOWS */
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.system -> long
|
1990-10-14 12:07:46 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
command: FSConverter
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Execute the command in a subshell.
|
|
|
|
|
[clinic start generated code]*/
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
static long
|
2016-07-07 17:35:15 +03:00
|
|
|
os_system_impl(PyObject *module, PyObject *command)
|
|
|
|
|
/*[clinic end generated code: output=290fc437dd4f33a0 input=86a58554ba6094af]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
long result;
|
2016-05-07 16:45:18 +03:00
|
|
|
const char *bytes = PyBytes_AsString(command);
|
2019-05-23 08:45:22 -07:00
|
|
|
|
2019-10-18 00:52:15 -07:00
|
|
|
if (PySys_Audit("os.system", "(O)", command) < 0) {
|
2019-05-23 08:45:22 -07:00
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
result = system(bytes);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
#endif /* HAVE_SYSTEM */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.umask
|
|
|
|
|
|
|
|
|
|
mask: int
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Set the current numeric umask and return the previous umask.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_umask_impl(PyObject *module, int mask)
|
|
|
|
|
/*[clinic end generated code: output=a2e33ce3bc1a6e33 input=ab6bfd9b24d8a7e8]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
int i = (int)umask(mask);
|
|
|
|
|
if (i < 0)
|
|
|
|
|
return posix_error();
|
|
|
|
|
return PyLong_FromLong((long)i);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
|
|
|
|
|
/* override the default DeleteFileW behavior so that directory
|
|
|
|
|
symlinks can be removed with this function, the same as with
|
|
|
|
|
Unix symlinks */
|
|
|
|
|
BOOL WINAPI Py_DeleteFileW(LPCWSTR lpFileName)
|
|
|
|
|
{
|
|
|
|
|
WIN32_FILE_ATTRIBUTE_DATA info;
|
|
|
|
|
WIN32_FIND_DATAW find_data;
|
|
|
|
|
HANDLE find_data_handle;
|
|
|
|
|
int is_directory = 0;
|
|
|
|
|
int is_link = 0;
|
|
|
|
|
|
|
|
|
|
if (GetFileAttributesExW(lpFileName, GetFileExInfoStandard, &info)) {
|
2010-07-08 21:39:08 +00:00
|
|
|
is_directory = info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
|
2011-02-25 14:39:16 +00:00
|
|
|
|
2010-07-08 21:39:08 +00:00
|
|
|
/* Get WIN32_FIND_DATA structure for the path to determine if
|
|
|
|
|
it is a symlink */
|
|
|
|
|
if(is_directory &&
|
|
|
|
|
info.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
|
|
|
|
|
find_data_handle = FindFirstFileW(lpFileName, &find_data);
|
|
|
|
|
|
|
|
|
|
if(find_data_handle != INVALID_HANDLE_VALUE) {
|
2014-05-05 19:46:17 +01:00
|
|
|
/* IO_REPARSE_TAG_SYMLINK if it is a symlink and
|
|
|
|
|
IO_REPARSE_TAG_MOUNT_POINT if it is a junction point. */
|
|
|
|
|
is_link = find_data.dwReserved0 == IO_REPARSE_TAG_SYMLINK ||
|
|
|
|
|
find_data.dwReserved0 == IO_REPARSE_TAG_MOUNT_POINT;
|
2010-07-08 21:39:08 +00:00
|
|
|
FindClose(find_data_handle);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (is_directory && is_link)
|
|
|
|
|
return RemoveDirectoryW(lpFileName);
|
|
|
|
|
|
|
|
|
|
return DeleteFileW(lpFileName);
|
|
|
|
|
}
|
|
|
|
|
#endif /* MS_WINDOWS */
|
1997-06-02 22:20:51 +00:00
|
|
|
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.unlink
|
|
|
|
|
|
|
|
|
|
path: path_t
|
|
|
|
|
*
|
|
|
|
|
dir_fd: dir_fd(requires='unlinkat')=None
|
|
|
|
|
|
|
|
|
|
Remove a file (same as remove()).
|
|
|
|
|
|
|
|
|
|
If dir_fd is not None, it should be a file descriptor open to a directory,
|
|
|
|
|
and path should be relative; path will then be relative to that directory.
|
|
|
|
|
dir_fd may not be implemented on your platform.
|
|
|
|
|
If it is unavailable, using it will raise a NotImplementedError.
|
|
|
|
|
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_unlink_impl(PyObject *module, path_t *path, int dir_fd)
|
|
|
|
|
/*[clinic end generated code: output=621797807b9963b1 input=d7bcde2b1b2a2552]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
int result;
|
2020-11-22 11:18:40 +01:00
|
|
|
#ifdef HAVE_UNLINKAT
|
|
|
|
|
int unlinkat_unavailable = 0;
|
|
|
|
|
#endif
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.remove", "Oi", path->object,
|
|
|
|
|
dir_fd == DEFAULT_DIR_FD ? -1 : dir_fd) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
2002-10-03 05:10:39 +00:00
|
|
|
#ifdef MS_WINDOWS
|
2016-09-08 10:35:16 -07:00
|
|
|
/* Windows, success=1, UNIX, success=0 */
|
|
|
|
|
result = !Py_DeleteFileW(path->wide);
|
2002-10-03 05:10:39 +00:00
|
|
|
#else
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef HAVE_UNLINKAT
|
2020-11-22 11:18:40 +01:00
|
|
|
if (dir_fd != DEFAULT_DIR_FD) {
|
|
|
|
|
if (HAVE_UNLINKAT_RUNTIME) {
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
result = unlinkat(dir_fd, path->narrow, 0);
|
2020-11-22 11:18:40 +01:00
|
|
|
} else {
|
|
|
|
|
unlinkat_unavailable = 1;
|
|
|
|
|
}
|
|
|
|
|
} else
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif /* HAVE_UNLINKAT */
|
2014-08-05 14:04:04 +10:00
|
|
|
result = unlink(path->narrow);
|
2002-10-03 05:10:39 +00:00
|
|
|
#endif
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_END_SUPPRESS_IPH
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
|
2020-11-22 11:18:40 +01:00
|
|
|
#ifdef HAVE_UNLINKAT
|
|
|
|
|
if (unlinkat_unavailable) {
|
|
|
|
|
argument_unavailable_error(NULL, "dir_fd");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
if (result)
|
|
|
|
|
return path_error(path);
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.remove = os.unlink
|
|
|
|
|
|
|
|
|
|
Remove a file (same as unlink()).
|
|
|
|
|
|
|
|
|
|
If dir_fd is not None, it should be a file descriptor open to a directory,
|
|
|
|
|
and path should be relative; path will then be relative to that directory.
|
|
|
|
|
dir_fd may not be implemented on your platform.
|
|
|
|
|
If it is unavailable, using it will raise a NotImplementedError.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_remove_impl(PyObject *module, path_t *path, int dir_fd)
|
|
|
|
|
/*[clinic end generated code: output=a8535b28f0068883 input=e05c5ab55cd30983]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
return os_unlink_impl(module, path, dir_fd);
|
|
|
|
|
}
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2012-06-24 04:33:36 -07:00
|
|
|
|
|
|
|
|
static PyStructSequence_Field uname_result_fields[] = {
|
|
|
|
|
{"sysname", "operating system name"},
|
|
|
|
|
{"nodename", "name of machine on network (implementation-defined)"},
|
|
|
|
|
{"release", "operating system release"},
|
|
|
|
|
{"version", "operating system version"},
|
|
|
|
|
{"machine", "hardware identifier"},
|
|
|
|
|
{NULL}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
PyDoc_STRVAR(uname_result__doc__,
|
|
|
|
|
"uname_result: Result from os.uname().\n\n\
|
|
|
|
|
This object may be accessed either as a tuple of\n\
|
|
|
|
|
(sysname, nodename, release, version, machine),\n\
|
|
|
|
|
or via the attributes sysname, nodename, release, version, and machine.\n\
|
|
|
|
|
\n\
|
|
|
|
|
See os.uname for more information.");
|
|
|
|
|
|
|
|
|
|
static PyStructSequence_Desc uname_result_desc = {
|
2019-11-05 07:16:14 -08:00
|
|
|
MODNAME ".uname_result", /* name */
|
2012-06-24 04:33:36 -07:00
|
|
|
uname_result__doc__, /* doc */
|
|
|
|
|
uname_result_fields,
|
|
|
|
|
5
|
|
|
|
|
};
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2012-06-24 04:33:36 -07:00
|
|
|
#ifdef HAVE_UNAME
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.uname
|
|
|
|
|
|
|
|
|
|
Return an object identifying the current operating system.
|
|
|
|
|
|
|
|
|
|
The object behaves like a named tuple with the following fields:
|
|
|
|
|
(sysname, nodename, release, version, machine)
|
|
|
|
|
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
1996-12-10 23:23:01 +00:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_uname_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=e6a49cf1a1508a19 input=e68bd246db3043ed]*/
|
1992-02-05 11:15:54 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
struct utsname u;
|
|
|
|
|
int res;
|
2012-06-24 04:33:36 -07:00
|
|
|
PyObject *value;
|
2010-05-06 00:08:46 +00:00
|
|
|
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
res = uname(&u);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
if (res < 0)
|
|
|
|
|
return posix_error();
|
2012-06-24 04:33:36 -07:00
|
|
|
|
2020-03-16 21:15:01 +08:00
|
|
|
PyObject *UnameResultType = get_posix_state(module)->UnameResultType;
|
2019-11-05 07:16:14 -08:00
|
|
|
value = PyStructSequence_New((PyTypeObject *)UnameResultType);
|
2012-06-24 04:33:36 -07:00
|
|
|
if (value == NULL)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
#define SET(i, field) \
|
|
|
|
|
{ \
|
2013-06-03 22:07:27 +02:00
|
|
|
PyObject *o = PyUnicode_DecodeFSDefault(field); \
|
2012-06-24 04:33:36 -07:00
|
|
|
if (!o) { \
|
|
|
|
|
Py_DECREF(value); \
|
|
|
|
|
return NULL; \
|
|
|
|
|
} \
|
|
|
|
|
PyStructSequence_SET_ITEM(value, i, o); \
|
|
|
|
|
} \
|
|
|
|
|
|
|
|
|
|
SET(0, u.sysname);
|
|
|
|
|
SET(1, u.nodename);
|
|
|
|
|
SET(2, u.release);
|
|
|
|
|
SET(3, u.version);
|
|
|
|
|
SET(4, u.machine);
|
|
|
|
|
|
|
|
|
|
#undef SET
|
|
|
|
|
|
|
|
|
|
return value;
|
1992-02-05 11:15:54 +00:00
|
|
|
}
|
1994-08-01 11:34:53 +00:00
|
|
|
#endif /* HAVE_UNAME */
|
1991-04-08 20:59:13 +00:00
|
|
|
|
2011-09-08 19:29:07 -07:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
int now;
|
|
|
|
|
time_t atime_s;
|
|
|
|
|
long atime_ns;
|
|
|
|
|
time_t mtime_s;
|
|
|
|
|
long mtime_ns;
|
|
|
|
|
} utime_t;
|
|
|
|
|
|
|
|
|
|
/*
|
2014-10-09 13:52:31 +02:00
|
|
|
* these macros assume that "ut" is a pointer to a utime_t
|
2012-06-22 16:30:09 -07:00
|
|
|
* they also intentionally leak the declaration of a pointer named "time"
|
|
|
|
|
*/
|
|
|
|
|
#define UTIME_TO_TIMESPEC \
|
|
|
|
|
struct timespec ts[2]; \
|
|
|
|
|
struct timespec *time; \
|
2014-10-09 13:52:31 +02:00
|
|
|
if (ut->now) \
|
2012-06-22 16:30:09 -07:00
|
|
|
time = NULL; \
|
|
|
|
|
else { \
|
2014-10-09 13:52:31 +02:00
|
|
|
ts[0].tv_sec = ut->atime_s; \
|
|
|
|
|
ts[0].tv_nsec = ut->atime_ns; \
|
|
|
|
|
ts[1].tv_sec = ut->mtime_s; \
|
|
|
|
|
ts[1].tv_nsec = ut->mtime_ns; \
|
2012-06-22 16:30:09 -07:00
|
|
|
time = ts; \
|
|
|
|
|
} \
|
|
|
|
|
|
|
|
|
|
#define UTIME_TO_TIMEVAL \
|
|
|
|
|
struct timeval tv[2]; \
|
|
|
|
|
struct timeval *time; \
|
2014-10-09 13:52:31 +02:00
|
|
|
if (ut->now) \
|
2012-06-22 16:30:09 -07:00
|
|
|
time = NULL; \
|
|
|
|
|
else { \
|
2014-10-09 13:52:31 +02:00
|
|
|
tv[0].tv_sec = ut->atime_s; \
|
|
|
|
|
tv[0].tv_usec = ut->atime_ns / 1000; \
|
|
|
|
|
tv[1].tv_sec = ut->mtime_s; \
|
|
|
|
|
tv[1].tv_usec = ut->mtime_ns / 1000; \
|
2012-06-22 16:30:09 -07:00
|
|
|
time = tv; \
|
|
|
|
|
} \
|
|
|
|
|
|
|
|
|
|
#define UTIME_TO_UTIMBUF \
|
2014-10-12 08:45:15 +02:00
|
|
|
struct utimbuf u; \
|
2012-06-22 16:30:09 -07:00
|
|
|
struct utimbuf *time; \
|
2014-10-09 13:52:31 +02:00
|
|
|
if (ut->now) \
|
2012-06-22 16:30:09 -07:00
|
|
|
time = NULL; \
|
|
|
|
|
else { \
|
2014-10-12 08:45:15 +02:00
|
|
|
u.actime = ut->atime_s; \
|
|
|
|
|
u.modtime = ut->mtime_s; \
|
|
|
|
|
time = &u; \
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#define UTIME_TO_TIME_T \
|
|
|
|
|
time_t timet[2]; \
|
2014-10-12 08:45:15 +02:00
|
|
|
time_t *time; \
|
2014-10-09 13:52:31 +02:00
|
|
|
if (ut->now) \
|
2012-06-22 16:30:09 -07:00
|
|
|
time = NULL; \
|
|
|
|
|
else { \
|
2014-10-09 13:52:31 +02:00
|
|
|
timet[0] = ut->atime_s; \
|
|
|
|
|
timet[1] = ut->mtime_s; \
|
2014-10-12 08:45:15 +02:00
|
|
|
time = timet; \
|
2012-06-22 16:30:09 -07:00
|
|
|
} \
|
|
|
|
|
|
|
|
|
|
|
2015-09-03 21:30:26 +02:00
|
|
|
#if defined(HAVE_FUTIMESAT) || defined(HAVE_UTIMENSAT)
|
2012-06-22 16:30:09 -07:00
|
|
|
|
|
|
|
|
static int
|
2015-12-25 20:01:53 +02:00
|
|
|
utime_dir_fd(utime_t *ut, int dir_fd, const char *path, int follow_symlinks)
|
2012-06-22 16:30:09 -07:00
|
|
|
{
|
2020-11-22 11:18:40 +01:00
|
|
|
#if defined(__APPLE__) && defined(HAVE_UTIMENSAT)
|
|
|
|
|
if (HAVE_UTIMENSAT_RUNTIME) {
|
|
|
|
|
int flags = follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW;
|
|
|
|
|
UTIME_TO_TIMESPEC;
|
|
|
|
|
return utimensat(dir_fd, path, time, flags);
|
|
|
|
|
} else {
|
|
|
|
|
errno = ENOSYS;
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
#elif defined(HAVE_UTIMENSAT)
|
2012-06-22 16:30:09 -07:00
|
|
|
int flags = follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW;
|
|
|
|
|
UTIME_TO_TIMESPEC;
|
|
|
|
|
return utimensat(dir_fd, path, time, flags);
|
|
|
|
|
#elif defined(HAVE_FUTIMESAT)
|
|
|
|
|
UTIME_TO_TIMEVAL;
|
|
|
|
|
/*
|
|
|
|
|
* follow_symlinks will never be false here;
|
|
|
|
|
* we only allow !follow_symlinks and dir_fd together
|
|
|
|
|
* if we have utimensat()
|
|
|
|
|
*/
|
|
|
|
|
assert(follow_symlinks);
|
|
|
|
|
return futimesat(dir_fd, path, time);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
#define FUTIMENSAT_DIR_FD_CONVERTER dir_fd_converter
|
|
|
|
|
#else
|
|
|
|
|
#define FUTIMENSAT_DIR_FD_CONVERTER dir_fd_unavailable
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
2015-09-03 21:30:26 +02:00
|
|
|
#if defined(HAVE_FUTIMES) || defined(HAVE_FUTIMENS)
|
2012-06-22 16:30:09 -07:00
|
|
|
|
|
|
|
|
static int
|
2014-10-09 13:52:31 +02:00
|
|
|
utime_fd(utime_t *ut, int fd)
|
2012-06-22 16:30:09 -07:00
|
|
|
{
|
|
|
|
|
#ifdef HAVE_FUTIMENS
|
2020-11-22 11:18:40 +01:00
|
|
|
|
|
|
|
|
if (HAVE_FUTIMENS_RUNTIME) {
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
UTIME_TO_TIMESPEC;
|
|
|
|
|
return futimens(fd, time);
|
2020-11-22 11:18:40 +01:00
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
#ifndef HAVE_FUTIMES
|
|
|
|
|
{
|
|
|
|
|
/* Not sure if this can happen */
|
|
|
|
|
PyErr_SetString(
|
|
|
|
|
PyExc_RuntimeError,
|
|
|
|
|
"neither futimens nor futimes are supported"
|
|
|
|
|
" on this system");
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_FUTIMES
|
|
|
|
|
{
|
2012-06-22 16:30:09 -07:00
|
|
|
UTIME_TO_TIMEVAL;
|
|
|
|
|
return futimes(fd, time);
|
2020-11-22 11:18:40 +01:00
|
|
|
}
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
#define PATH_UTIME_HAVE_FD 1
|
|
|
|
|
#else
|
|
|
|
|
#define PATH_UTIME_HAVE_FD 0
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
2015-09-22 01:29:33 +02:00
|
|
|
#if defined(HAVE_UTIMENSAT) || defined(HAVE_LUTIMES)
|
|
|
|
|
# define UTIME_HAVE_NOFOLLOW_SYMLINKS
|
|
|
|
|
#endif
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2015-09-21 22:37:15 +02:00
|
|
|
#ifdef UTIME_HAVE_NOFOLLOW_SYMLINKS
|
2012-06-22 16:30:09 -07:00
|
|
|
|
|
|
|
|
static int
|
2015-12-25 20:01:53 +02:00
|
|
|
utime_nofollow_symlinks(utime_t *ut, const char *path)
|
2012-06-22 16:30:09 -07:00
|
|
|
{
|
|
|
|
|
#ifdef HAVE_UTIMENSAT
|
2020-11-22 11:18:40 +01:00
|
|
|
if (HAVE_UTIMENSAT_RUNTIME) {
|
|
|
|
|
UTIME_TO_TIMESPEC;
|
|
|
|
|
return utimensat(DEFAULT_DIR_FD, path, time, AT_SYMLINK_NOFOLLOW);
|
|
|
|
|
} else
|
|
|
|
|
#ifndef HAVE_LUTIMES
|
|
|
|
|
{
|
|
|
|
|
/* Not sure if this can happen */
|
|
|
|
|
PyErr_SetString(
|
|
|
|
|
PyExc_RuntimeError,
|
|
|
|
|
"neither utimensat nor lutimes are supported"
|
|
|
|
|
" on this system");
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_LUTIMES
|
|
|
|
|
{
|
2012-06-22 16:30:09 -07:00
|
|
|
UTIME_TO_TIMEVAL;
|
|
|
|
|
return lutimes(path, time);
|
2020-11-22 11:18:40 +01:00
|
|
|
}
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef MS_WINDOWS
|
|
|
|
|
|
|
|
|
|
static int
|
2015-12-25 20:01:53 +02:00
|
|
|
utime_default(utime_t *ut, const char *path)
|
2012-06-22 16:30:09 -07:00
|
|
|
{
|
2020-11-22 11:18:40 +01:00
|
|
|
#if defined(__APPLE__) && defined(HAVE_UTIMENSAT)
|
|
|
|
|
if (HAVE_UTIMENSAT_RUNTIME) {
|
|
|
|
|
UTIME_TO_TIMESPEC;
|
|
|
|
|
return utimensat(DEFAULT_DIR_FD, path, time, 0);
|
|
|
|
|
} else {
|
|
|
|
|
UTIME_TO_TIMEVAL;
|
|
|
|
|
return utimes(path, time);
|
|
|
|
|
}
|
|
|
|
|
#elif defined(HAVE_UTIMENSAT)
|
2012-06-22 16:30:09 -07:00
|
|
|
UTIME_TO_TIMESPEC;
|
|
|
|
|
return utimensat(DEFAULT_DIR_FD, path, time, 0);
|
|
|
|
|
#elif defined(HAVE_UTIMES)
|
|
|
|
|
UTIME_TO_TIMEVAL;
|
|
|
|
|
return utimes(path, time);
|
|
|
|
|
#elif defined(HAVE_UTIME_H)
|
|
|
|
|
UTIME_TO_UTIMBUF;
|
|
|
|
|
return utime(path, time);
|
|
|
|
|
#else
|
|
|
|
|
UTIME_TO_TIME_T;
|
|
|
|
|
return utime(path, time);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
2012-05-03 00:30:07 -07:00
|
|
|
static int
|
2020-05-10 11:05:29 +02:00
|
|
|
split_py_long_to_s_and_ns(PyObject *module, PyObject *py_long, time_t *s, long *ns)
|
2012-05-03 00:30:07 -07:00
|
|
|
{
|
|
|
|
|
int result = 0;
|
2012-05-04 11:06:09 -04:00
|
|
|
PyObject *divmod;
|
2020-05-10 11:05:29 +02:00
|
|
|
divmod = PyNumber_Divmod(py_long, get_posix_state(module)->billion);
|
2012-05-03 00:30:07 -07:00
|
|
|
if (!divmod)
|
|
|
|
|
goto exit;
|
2018-09-12 22:14:35 +03:00
|
|
|
if (!PyTuple_Check(divmod) || PyTuple_GET_SIZE(divmod) != 2) {
|
|
|
|
|
PyErr_Format(PyExc_TypeError,
|
|
|
|
|
"%.200s.__divmod__() must return a 2-tuple, not %.200s",
|
2019-11-05 07:16:14 -08:00
|
|
|
_PyType_Name(Py_TYPE(py_long)), _PyType_Name(Py_TYPE(divmod)));
|
2018-09-12 22:14:35 +03:00
|
|
|
goto exit;
|
|
|
|
|
}
|
2012-05-03 00:30:07 -07:00
|
|
|
*s = _PyLong_AsTime_t(PyTuple_GET_ITEM(divmod, 0));
|
|
|
|
|
if ((*s == -1) && PyErr_Occurred())
|
|
|
|
|
goto exit;
|
|
|
|
|
*ns = PyLong_AsLong(PyTuple_GET_ITEM(divmod, 1));
|
2012-05-04 01:10:59 -04:00
|
|
|
if ((*ns == -1) && PyErr_Occurred())
|
2012-05-03 00:30:07 -07:00
|
|
|
goto exit;
|
|
|
|
|
|
|
|
|
|
result = 1;
|
|
|
|
|
exit:
|
|
|
|
|
Py_XDECREF(divmod);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.utime
|
|
|
|
|
|
|
|
|
|
path: path_t(allow_fd='PATH_UTIME_HAVE_FD')
|
2019-09-14 12:24:05 +03:00
|
|
|
times: object = None
|
2014-08-05 14:04:04 +10:00
|
|
|
*
|
|
|
|
|
ns: object = NULL
|
|
|
|
|
dir_fd: dir_fd(requires='futimensat') = None
|
|
|
|
|
follow_symlinks: bool=True
|
|
|
|
|
|
2015-09-09 01:56:53 +00:00
|
|
|
# "utime(path, times=None, *[, ns], dir_fd=None, follow_symlinks=True)\n\
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
Set the access and modified time of path.
|
|
|
|
|
|
|
|
|
|
path may always be specified as a string.
|
|
|
|
|
On some platforms, path may also be specified as an open file descriptor.
|
|
|
|
|
If this functionality is unavailable, using it raises an exception.
|
|
|
|
|
|
|
|
|
|
If times is not None, it must be a tuple (atime, mtime);
|
|
|
|
|
atime and mtime should be expressed as float seconds since the epoch.
|
2015-09-09 01:56:53 +00:00
|
|
|
If ns is specified, it must be a tuple (atime_ns, mtime_ns);
|
2014-08-05 14:04:04 +10:00
|
|
|
atime_ns and mtime_ns should be expressed as integer nanoseconds
|
|
|
|
|
since the epoch.
|
2015-09-09 01:56:53 +00:00
|
|
|
If times is None and ns is unspecified, utime uses the current time.
|
2014-08-05 14:04:04 +10:00
|
|
|
Specifying tuples for both times and ns is an error.
|
|
|
|
|
|
|
|
|
|
If dir_fd is not None, it should be a file descriptor open to a directory,
|
|
|
|
|
and path should be relative; path will then be relative to that directory.
|
|
|
|
|
If follow_symlinks is False, and the last element of the path is a symbolic
|
|
|
|
|
link, utime will modify the symbolic link itself instead of the file the
|
|
|
|
|
link points to.
|
|
|
|
|
It is an error to use dir_fd or follow_symlinks when specifying path
|
|
|
|
|
as an open file descriptor.
|
|
|
|
|
dir_fd and follow_symlinks may not be available on your platform.
|
|
|
|
|
If they are unavailable, using them will raise a NotImplementedError.
|
|
|
|
|
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_utime_impl(PyObject *module, path_t *path, PyObject *times, PyObject *ns,
|
|
|
|
|
int dir_fd, int follow_symlinks)
|
2019-09-14 12:24:05 +03:00
|
|
|
/*[clinic end generated code: output=cfcac69d027b82cf input=2fbd62a2f228f8f4]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
HANDLE hFile;
|
|
|
|
|
FILETIME atime, mtime;
|
|
|
|
|
#else
|
|
|
|
|
int result;
|
|
|
|
|
#endif
|
2012-05-03 00:30:07 -07:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
utime_t utime;
|
2012-05-04 02:31:57 -07:00
|
|
|
|
2013-08-01 00:08:16 +02:00
|
|
|
memset(&utime, 0, sizeof(utime_t));
|
2012-05-04 02:31:57 -07:00
|
|
|
|
2019-09-14 12:24:05 +03:00
|
|
|
if (times != Py_None && ns) {
|
2012-06-22 16:30:09 -07:00
|
|
|
PyErr_SetString(PyExc_ValueError,
|
|
|
|
|
"utime: you may specify either 'times'"
|
|
|
|
|
" or 'ns' but not both");
|
2018-12-01 14:30:20 +02:00
|
|
|
return NULL;
|
2012-05-03 00:30:07 -07:00
|
|
|
}
|
|
|
|
|
|
2019-09-14 12:24:05 +03:00
|
|
|
if (times != Py_None) {
|
2013-04-17 22:06:44 +02:00
|
|
|
time_t a_sec, m_sec;
|
|
|
|
|
long a_nsec, m_nsec;
|
2012-05-03 00:30:07 -07:00
|
|
|
if (!PyTuple_CheckExact(times) || (PyTuple_Size(times) != 2)) {
|
2012-06-22 16:30:09 -07:00
|
|
|
PyErr_SetString(PyExc_TypeError,
|
|
|
|
|
"utime: 'times' must be either"
|
|
|
|
|
" a tuple of two ints or None");
|
2018-12-01 14:30:20 +02:00
|
|
|
return NULL;
|
2012-05-03 00:30:07 -07:00
|
|
|
}
|
2012-06-22 16:30:09 -07:00
|
|
|
utime.now = 0;
|
2012-05-04 01:31:13 -04:00
|
|
|
if (_PyTime_ObjectToTimespec(PyTuple_GET_ITEM(times, 0),
|
2015-03-30 01:02:57 +02:00
|
|
|
&a_sec, &a_nsec, _PyTime_ROUND_FLOOR) == -1 ||
|
2012-05-04 01:31:13 -04:00
|
|
|
_PyTime_ObjectToTimespec(PyTuple_GET_ITEM(times, 1),
|
2015-03-30 01:02:57 +02:00
|
|
|
&m_sec, &m_nsec, _PyTime_ROUND_FLOOR) == -1) {
|
2018-12-01 14:30:20 +02:00
|
|
|
return NULL;
|
2012-05-04 02:31:57 -07:00
|
|
|
}
|
2013-04-17 22:06:44 +02:00
|
|
|
utime.atime_s = a_sec;
|
|
|
|
|
utime.atime_ns = a_nsec;
|
|
|
|
|
utime.mtime_s = m_sec;
|
|
|
|
|
utime.mtime_ns = m_nsec;
|
2012-05-03 00:30:07 -07:00
|
|
|
}
|
2012-06-22 16:30:09 -07:00
|
|
|
else if (ns) {
|
2012-05-03 00:30:07 -07:00
|
|
|
if (!PyTuple_CheckExact(ns) || (PyTuple_Size(ns) != 2)) {
|
2012-06-22 16:30:09 -07:00
|
|
|
PyErr_SetString(PyExc_TypeError,
|
|
|
|
|
"utime: 'ns' must be a tuple of two ints");
|
2018-12-01 14:30:20 +02:00
|
|
|
return NULL;
|
2012-05-03 00:30:07 -07:00
|
|
|
}
|
2012-06-22 16:30:09 -07:00
|
|
|
utime.now = 0;
|
2020-05-10 11:05:29 +02:00
|
|
|
if (!split_py_long_to_s_and_ns(module, PyTuple_GET_ITEM(ns, 0),
|
2012-06-22 16:30:09 -07:00
|
|
|
&utime.atime_s, &utime.atime_ns) ||
|
2020-05-10 11:05:29 +02:00
|
|
|
!split_py_long_to_s_and_ns(module, PyTuple_GET_ITEM(ns, 1),
|
2012-06-22 16:30:09 -07:00
|
|
|
&utime.mtime_s, &utime.mtime_ns)) {
|
2018-12-01 14:30:20 +02:00
|
|
|
return NULL;
|
2012-05-04 02:31:57 -07:00
|
|
|
}
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
/* times and ns are both None/unspecified. use "now". */
|
|
|
|
|
utime.now = 1;
|
2012-05-03 00:30:07 -07:00
|
|
|
}
|
|
|
|
|
|
2015-09-21 22:37:15 +02:00
|
|
|
#if !defined(UTIME_HAVE_NOFOLLOW_SYMLINKS)
|
2012-06-22 16:30:09 -07:00
|
|
|
if (follow_symlinks_specified("utime", follow_symlinks))
|
2018-12-01 14:30:20 +02:00
|
|
|
return NULL;
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
2012-05-03 00:30:07 -07:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
if (path_and_dir_fd_invalid("utime", path, dir_fd) ||
|
|
|
|
|
dir_fd_and_fd_invalid("utime", dir_fd, path->fd) ||
|
|
|
|
|
fd_and_follow_symlinks_invalid("utime", path->fd, follow_symlinks))
|
2018-12-01 14:30:20 +02:00
|
|
|
return NULL;
|
2012-05-03 00:30:07 -07:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
#if !defined(HAVE_UTIMENSAT)
|
|
|
|
|
if ((dir_fd != DEFAULT_DIR_FD) && (!follow_symlinks)) {
|
2012-06-26 09:25:44 +02:00
|
|
|
PyErr_SetString(PyExc_ValueError,
|
2012-06-22 16:30:09 -07:00
|
|
|
"utime: cannot use dir_fd and follow_symlinks "
|
|
|
|
|
"together on this platform");
|
2018-12-01 14:30:20 +02:00
|
|
|
return NULL;
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
#endif
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.utime", "OOOi", path->object, times, ns ? ns : Py_None,
|
|
|
|
|
dir_fd == DEFAULT_DIR_FD ? -1 : dir_fd) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2009-05-17 04:21:53 +00:00
|
|
|
#ifdef MS_WINDOWS
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2016-09-08 10:35:16 -07:00
|
|
|
hFile = CreateFileW(path->wide, FILE_WRITE_ATTRIBUTES, 0,
|
|
|
|
|
NULL, OPEN_EXISTING,
|
|
|
|
|
FILE_FLAG_BACKUP_SEMANTICS, NULL);
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
if (hFile == INVALID_HANDLE_VALUE) {
|
2014-08-05 14:04:04 +10:00
|
|
|
path_error(path);
|
2018-12-01 14:30:20 +02:00
|
|
|
return NULL;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
if (utime.now) {
|
2013-11-23 15:23:26 +01:00
|
|
|
GetSystemTimeAsFileTime(&mtime);
|
|
|
|
|
atime = mtime;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
|
|
|
|
else {
|
2015-02-21 15:26:02 -08:00
|
|
|
_Py_time_t_to_FILE_TIME(utime.atime_s, utime.atime_ns, &atime);
|
|
|
|
|
_Py_time_t_to_FILE_TIME(utime.mtime_s, utime.mtime_ns, &mtime);
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
|
|
|
|
if (!SetFileTime(hFile, NULL, &atime, &mtime)) {
|
|
|
|
|
/* Avoid putting the file name into the error here,
|
|
|
|
|
as that may confuse the user into believing that
|
|
|
|
|
something is wrong with the file, when it also
|
|
|
|
|
could be the time stamp that gives a problem. */
|
2012-10-31 22:24:06 +01:00
|
|
|
PyErr_SetFromWindowsErr(0);
|
2018-12-01 14:30:20 +02:00
|
|
|
CloseHandle(hFile);
|
|
|
|
|
return NULL;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2018-12-01 14:30:20 +02:00
|
|
|
CloseHandle(hFile);
|
2009-05-17 04:21:53 +00:00
|
|
|
#else /* MS_WINDOWS */
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2012-05-03 00:30:07 -07:00
|
|
|
|
2015-09-21 22:37:15 +02:00
|
|
|
#ifdef UTIME_HAVE_NOFOLLOW_SYMLINKS
|
2012-06-22 16:30:09 -07:00
|
|
|
if ((!follow_symlinks) && (dir_fd == DEFAULT_DIR_FD))
|
2014-08-05 14:04:04 +10:00
|
|
|
result = utime_nofollow_symlinks(&utime, path->narrow);
|
2012-06-22 16:30:09 -07:00
|
|
|
else
|
2011-09-08 19:29:07 -07:00
|
|
|
#endif
|
2011-03-17 20:20:30 +02:00
|
|
|
|
2015-09-03 21:30:26 +02:00
|
|
|
#if defined(HAVE_FUTIMESAT) || defined(HAVE_UTIMENSAT)
|
2020-11-22 11:18:40 +01:00
|
|
|
if ((dir_fd != DEFAULT_DIR_FD) || (!follow_symlinks)) {
|
2014-08-05 14:04:04 +10:00
|
|
|
result = utime_dir_fd(&utime, dir_fd, path->narrow, follow_symlinks);
|
2020-11-22 11:18:40 +01:00
|
|
|
|
|
|
|
|
} else
|
2011-09-08 19:29:07 -07:00
|
|
|
#endif
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2015-09-03 21:30:26 +02:00
|
|
|
#if defined(HAVE_FUTIMES) || defined(HAVE_FUTIMENS)
|
2014-08-05 14:04:04 +10:00
|
|
|
if (path->fd != -1)
|
|
|
|
|
result = utime_fd(&utime, path->fd);
|
2012-06-22 16:30:09 -07:00
|
|
|
else
|
2011-03-17 20:20:30 +02:00
|
|
|
#endif
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
result = utime_default(&utime, path->narrow);
|
2011-03-17 20:20:30 +02:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_END_ALLOW_THREADS
|
2011-03-17 20:20:30 +02:00
|
|
|
|
2020-11-22 11:18:40 +01:00
|
|
|
#if defined(__APPLE__) && defined(HAVE_UTIMENSAT)
|
|
|
|
|
/* See utime_dir_fd implementation */
|
|
|
|
|
if (result == -1 && errno == ENOSYS) {
|
|
|
|
|
argument_unavailable_error(NULL, "dir_fd");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
if (result < 0) {
|
|
|
|
|
/* see previous comment about not putting filename in error here */
|
2018-12-01 14:30:20 +02:00
|
|
|
posix_error();
|
|
|
|
|
return NULL;
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
2012-05-03 00:30:07 -07:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif /* MS_WINDOWS */
|
2012-05-03 00:30:07 -07:00
|
|
|
|
2018-12-01 14:30:20 +02:00
|
|
|
Py_RETURN_NONE;
|
2011-03-17 20:20:30 +02:00
|
|
|
}
|
|
|
|
|
|
1991-06-04 19:40:25 +00:00
|
|
|
/* Process operations */
|
1991-06-03 12:42:10 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os._exit
|
|
|
|
|
|
|
|
|
|
status: int
|
|
|
|
|
|
|
|
|
|
Exit to the system with specified status, without normal exit processing.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os__exit_impl(PyObject *module, int status)
|
|
|
|
|
/*[clinic end generated code: output=116e52d9c2260d54 input=5e6d57556b0c4a62]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
_exit(status);
|
2010-05-06 00:08:46 +00:00
|
|
|
return NULL; /* Make gcc -Wall happy */
|
1991-06-03 12:42:10 +00:00
|
|
|
}
|
|
|
|
|
|
2016-09-08 10:35:16 -07:00
|
|
|
#if defined(HAVE_WEXECV) || defined(HAVE_WSPAWNV)
|
|
|
|
|
#define EXECV_CHAR wchar_t
|
|
|
|
|
#else
|
|
|
|
|
#define EXECV_CHAR char
|
|
|
|
|
#endif
|
|
|
|
|
|
2019-05-21 18:46:37 +08:00
|
|
|
#if defined(HAVE_EXECV) || defined(HAVE_SPAWNV) || defined(HAVE_RTPSPAWN)
|
2002-10-07 06:44:21 +00:00
|
|
|
static void
|
2016-09-08 10:35:16 -07:00
|
|
|
free_string_array(EXECV_CHAR **array, Py_ssize_t count)
|
2002-10-07 06:44:21 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_ssize_t i;
|
|
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
|
PyMem_Free(array[i]);
|
|
|
|
|
PyMem_DEL(array);
|
2002-10-07 06:44:21 +00:00
|
|
|
}
|
2009-05-05 04:43:17 +00:00
|
|
|
|
2016-09-15 20:19:47 +03:00
|
|
|
static int
|
|
|
|
|
fsconvert_strdup(PyObject *o, EXECV_CHAR **out)
|
2009-05-05 04:43:17 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_ssize_t size;
|
2016-09-15 20:19:47 +03:00
|
|
|
PyObject *ub;
|
|
|
|
|
int result = 0;
|
2016-09-08 10:35:16 -07:00
|
|
|
#if defined(HAVE_WEXECV) || defined(HAVE_WSPAWNV)
|
2016-09-15 20:19:47 +03:00
|
|
|
if (!PyUnicode_FSDecoder(o, &ub))
|
2016-09-08 10:35:16 -07:00
|
|
|
return 0;
|
2016-09-15 20:19:47 +03:00
|
|
|
*out = PyUnicode_AsWideCharString(ub, &size);
|
|
|
|
|
if (*out)
|
|
|
|
|
result = 1;
|
2016-09-08 10:35:16 -07:00
|
|
|
#else
|
2016-09-15 20:19:47 +03:00
|
|
|
if (!PyUnicode_FSConverter(o, &ub))
|
2010-05-06 00:08:46 +00:00
|
|
|
return 0;
|
2016-09-15 20:19:47 +03:00
|
|
|
size = PyBytes_GET_SIZE(ub);
|
|
|
|
|
*out = PyMem_Malloc(size + 1);
|
|
|
|
|
if (*out) {
|
|
|
|
|
memcpy(*out, PyBytes_AS_STRING(ub), size + 1);
|
|
|
|
|
result = 1;
|
|
|
|
|
} else
|
2013-11-07 23:56:10 +01:00
|
|
|
PyErr_NoMemory();
|
2016-09-08 10:35:16 -07:00
|
|
|
#endif
|
2016-09-15 20:19:47 +03:00
|
|
|
Py_DECREF(ub);
|
|
|
|
|
return result;
|
2009-05-05 04:43:17 +00:00
|
|
|
}
|
2002-10-07 06:44:21 +00:00
|
|
|
#endif
|
|
|
|
|
|
2019-05-21 18:46:37 +08:00
|
|
|
#if defined(HAVE_EXECV) || defined (HAVE_FEXECVE) || defined(HAVE_RTPSPAWN)
|
2016-09-08 10:35:16 -07:00
|
|
|
static EXECV_CHAR**
|
2010-04-23 21:41:56 +00:00
|
|
|
parse_envlist(PyObject* env, Py_ssize_t *envc_ptr)
|
|
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_ssize_t i, pos, envc;
|
|
|
|
|
PyObject *keys=NULL, *vals=NULL;
|
2016-09-15 20:19:47 +03:00
|
|
|
PyObject *key, *val, *key2, *val2, *keyval;
|
2016-09-08 10:35:16 -07:00
|
|
|
EXECV_CHAR **envlist;
|
2010-05-06 00:08:46 +00:00
|
|
|
|
|
|
|
|
i = PyMapping_Size(env);
|
|
|
|
|
if (i < 0)
|
|
|
|
|
return NULL;
|
2016-09-08 10:35:16 -07:00
|
|
|
envlist = PyMem_NEW(EXECV_CHAR *, i + 1);
|
2010-05-06 00:08:46 +00:00
|
|
|
if (envlist == NULL) {
|
|
|
|
|
PyErr_NoMemory();
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
envc = 0;
|
|
|
|
|
keys = PyMapping_Keys(env);
|
2013-11-14 21:37:05 +01:00
|
|
|
if (!keys)
|
|
|
|
|
goto error;
|
2010-05-06 00:08:46 +00:00
|
|
|
vals = PyMapping_Values(env);
|
2013-11-14 21:37:05 +01:00
|
|
|
if (!vals)
|
2010-05-06 00:08:46 +00:00
|
|
|
goto error;
|
|
|
|
|
if (!PyList_Check(keys) || !PyList_Check(vals)) {
|
|
|
|
|
PyErr_Format(PyExc_TypeError,
|
|
|
|
|
"env.keys() or env.values() is not a list");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (pos = 0; pos < i; pos++) {
|
|
|
|
|
key = PyList_GetItem(keys, pos);
|
|
|
|
|
val = PyList_GetItem(vals, pos);
|
|
|
|
|
if (!key || !val)
|
|
|
|
|
goto error;
|
|
|
|
|
|
2016-09-15 20:19:47 +03:00
|
|
|
#if defined(HAVE_WEXECV) || defined(HAVE_WSPAWNV)
|
|
|
|
|
if (!PyUnicode_FSDecoder(key, &key2))
|
|
|
|
|
goto error;
|
|
|
|
|
if (!PyUnicode_FSDecoder(val, &val2)) {
|
|
|
|
|
Py_DECREF(key2);
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
2017-06-25 07:33:01 +03:00
|
|
|
/* Search from index 1 because on Windows starting '=' is allowed for
|
|
|
|
|
defining hidden environment variables. */
|
|
|
|
|
if (PyUnicode_GET_LENGTH(key2) == 0 ||
|
|
|
|
|
PyUnicode_FindChar(key2, '=', 1, PyUnicode_GET_LENGTH(key2), 1) != -1)
|
|
|
|
|
{
|
|
|
|
|
PyErr_SetString(PyExc_ValueError, "illegal environment variable name");
|
2017-06-26 21:35:20 -04:00
|
|
|
Py_DECREF(key2);
|
|
|
|
|
Py_DECREF(val2);
|
2017-06-25 07:33:01 +03:00
|
|
|
goto error;
|
|
|
|
|
}
|
2016-09-15 20:19:47 +03:00
|
|
|
keyval = PyUnicode_FromFormat("%U=%U", key2, val2);
|
|
|
|
|
#else
|
|
|
|
|
if (!PyUnicode_FSConverter(key, &key2))
|
|
|
|
|
goto error;
|
|
|
|
|
if (!PyUnicode_FSConverter(val, &val2)) {
|
|
|
|
|
Py_DECREF(key2);
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
2017-06-25 07:33:01 +03:00
|
|
|
if (PyBytes_GET_SIZE(key2) == 0 ||
|
|
|
|
|
strchr(PyBytes_AS_STRING(key2) + 1, '=') != NULL)
|
|
|
|
|
{
|
|
|
|
|
PyErr_SetString(PyExc_ValueError, "illegal environment variable name");
|
2017-06-26 21:35:20 -04:00
|
|
|
Py_DECREF(key2);
|
|
|
|
|
Py_DECREF(val2);
|
2017-06-25 07:33:01 +03:00
|
|
|
goto error;
|
|
|
|
|
}
|
2016-09-15 20:19:47 +03:00
|
|
|
keyval = PyBytes_FromFormat("%s=%s", PyBytes_AS_STRING(key2),
|
|
|
|
|
PyBytes_AS_STRING(val2));
|
|
|
|
|
#endif
|
|
|
|
|
Py_DECREF(key2);
|
|
|
|
|
Py_DECREF(val2);
|
2016-09-08 10:35:16 -07:00
|
|
|
if (!keyval)
|
2010-05-06 00:08:46 +00:00
|
|
|
goto error;
|
|
|
|
|
|
2016-09-08 10:35:16 -07:00
|
|
|
if (!fsconvert_strdup(keyval, &envlist[envc++])) {
|
|
|
|
|
Py_DECREF(keyval);
|
2010-05-06 00:08:46 +00:00
|
|
|
goto error;
|
|
|
|
|
}
|
2016-09-15 20:19:47 +03:00
|
|
|
|
2016-09-08 10:35:16 -07:00
|
|
|
Py_DECREF(keyval);
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
|
|
|
|
Py_DECREF(vals);
|
|
|
|
|
Py_DECREF(keys);
|
2010-04-23 21:41:56 +00:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
envlist[envc] = 0;
|
|
|
|
|
*envc_ptr = envc;
|
|
|
|
|
return envlist;
|
2010-04-23 21:41:56 +00:00
|
|
|
|
|
|
|
|
error:
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_XDECREF(keys);
|
|
|
|
|
Py_XDECREF(vals);
|
2016-09-08 10:35:16 -07:00
|
|
|
free_string_array(envlist, envc);
|
2010-05-06 00:08:46 +00:00
|
|
|
return NULL;
|
2010-04-23 21:41:56 +00:00
|
|
|
}
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2016-09-08 10:35:16 -07:00
|
|
|
static EXECV_CHAR**
|
2011-03-17 20:20:30 +02:00
|
|
|
parse_arglist(PyObject* argv, Py_ssize_t *argc)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
2016-09-08 10:35:16 -07:00
|
|
|
EXECV_CHAR **argvlist = PyMem_NEW(EXECV_CHAR *, *argc+1);
|
2011-03-17 20:20:30 +02:00
|
|
|
if (argvlist == NULL) {
|
|
|
|
|
PyErr_NoMemory();
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
for (i = 0; i < *argc; i++) {
|
2011-03-19 09:11:14 +02:00
|
|
|
PyObject* item = PySequence_ITEM(argv, i);
|
|
|
|
|
if (item == NULL)
|
|
|
|
|
goto fail;
|
|
|
|
|
if (!fsconvert_strdup(item, &argvlist[i])) {
|
|
|
|
|
Py_DECREF(item);
|
2011-03-17 20:20:30 +02:00
|
|
|
goto fail;
|
|
|
|
|
}
|
2011-03-19 09:11:14 +02:00
|
|
|
Py_DECREF(item);
|
2011-03-17 20:20:30 +02:00
|
|
|
}
|
|
|
|
|
argvlist[*argc] = NULL;
|
|
|
|
|
return argvlist;
|
|
|
|
|
fail:
|
2011-03-19 09:11:14 +02:00
|
|
|
*argc = i;
|
2011-03-17 20:20:30 +02:00
|
|
|
free_string_array(argvlist, *argc);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2016-09-08 10:35:16 -07:00
|
|
|
|
2011-03-17 20:20:30 +02:00
|
|
|
#endif
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2011-03-17 20:20:30 +02:00
|
|
|
#ifdef HAVE_EXECV
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.execv
|
|
|
|
|
|
2016-09-08 10:35:16 -07:00
|
|
|
path: path_t
|
2014-08-05 14:04:04 +10:00
|
|
|
Path of executable file.
|
|
|
|
|
argv: object
|
|
|
|
|
Tuple or list of strings.
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Execute an executable path with arguments, replacing current process.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-09-08 10:35:16 -07:00
|
|
|
os_execv_impl(PyObject *module, path_t *path, PyObject *argv)
|
|
|
|
|
/*[clinic end generated code: output=3b52fec34cd0dafd input=9bac31efae07dac7]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2016-09-08 10:35:16 -07:00
|
|
|
EXECV_CHAR **argvlist;
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_ssize_t argc;
|
|
|
|
|
|
|
|
|
|
/* execv has two arguments: (path, argv), where
|
|
|
|
|
argv is a list or tuple of strings. */
|
|
|
|
|
|
|
|
|
|
if (!PyList_Check(argv) && !PyTuple_Check(argv)) {
|
|
|
|
|
PyErr_SetString(PyExc_TypeError,
|
2011-03-17 20:20:30 +02:00
|
|
|
"execv() arg 2 must be a tuple or list");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
argc = PySequence_Size(argv);
|
|
|
|
|
if (argc < 1) {
|
|
|
|
|
PyErr_SetString(PyExc_ValueError, "execv() arg 2 must not be empty");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
argvlist = parse_arglist(argv, &argc);
|
|
|
|
|
if (argvlist == NULL) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2016-11-19 19:17:26 -08:00
|
|
|
if (!argvlist[0][0]) {
|
|
|
|
|
PyErr_SetString(PyExc_ValueError,
|
|
|
|
|
"execv() arg 2 first element cannot be empty");
|
|
|
|
|
free_string_array(argvlist, argc);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2011-03-17 20:20:30 +02:00
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.exec", "OOO", path->object, argv, Py_None) < 0) {
|
2020-02-04 16:15:00 -08:00
|
|
|
free_string_array(argvlist, argc);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-19 19:17:26 -08:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
2016-09-08 10:35:16 -07:00
|
|
|
#ifdef HAVE_WEXECV
|
|
|
|
|
_wexecv(path->wide, argvlist);
|
|
|
|
|
#else
|
|
|
|
|
execv(path->narrow, argvlist);
|
|
|
|
|
#endif
|
2016-11-19 19:17:26 -08:00
|
|
|
_Py_END_SUPPRESS_IPH
|
2011-03-17 20:20:30 +02:00
|
|
|
|
|
|
|
|
/* If we get here it's definitely an error */
|
|
|
|
|
|
|
|
|
|
free_string_array(argvlist, argc);
|
|
|
|
|
return posix_error();
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.execve
|
|
|
|
|
|
|
|
|
|
path: path_t(allow_fd='PATH_HAVE_FEXECVE')
|
|
|
|
|
Path of executable file.
|
|
|
|
|
argv: object
|
|
|
|
|
Tuple or list of strings.
|
|
|
|
|
env: object
|
|
|
|
|
Dictionary of strings mapping to strings.
|
|
|
|
|
|
|
|
|
|
Execute an executable path with arguments, replacing current process.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_execve_impl(PyObject *module, path_t *path, PyObject *argv, PyObject *env)
|
|
|
|
|
/*[clinic end generated code: output=ff9fa8e4da8bde58 input=626804fa092606d9]*/
|
1993-11-05 10:15:19 +00:00
|
|
|
{
|
2016-09-08 10:35:16 -07:00
|
|
|
EXECV_CHAR **argvlist = NULL;
|
|
|
|
|
EXECV_CHAR **envlist;
|
2011-03-17 20:20:30 +02:00
|
|
|
Py_ssize_t argc, envc;
|
2010-05-06 00:08:46 +00:00
|
|
|
|
|
|
|
|
/* execve has three arguments: (path, argv, env), where
|
|
|
|
|
argv is a list or tuple of strings and env is a dictionary
|
|
|
|
|
like posix.environ. */
|
|
|
|
|
|
2011-03-17 20:20:30 +02:00
|
|
|
if (!PyList_Check(argv) && !PyTuple_Check(argv)) {
|
2010-05-06 00:08:46 +00:00
|
|
|
PyErr_SetString(PyExc_TypeError,
|
2012-06-22 16:30:09 -07:00
|
|
|
"execve: argv must be a tuple or list");
|
2020-02-04 16:15:00 -08:00
|
|
|
goto fail_0;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2011-03-17 20:20:30 +02:00
|
|
|
argc = PySequence_Size(argv);
|
2016-11-19 19:17:26 -08:00
|
|
|
if (argc < 1) {
|
|
|
|
|
PyErr_SetString(PyExc_ValueError, "execve: argv must not be empty");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
if (!PyMapping_Check(env)) {
|
|
|
|
|
PyErr_SetString(PyExc_TypeError,
|
2012-06-22 16:30:09 -07:00
|
|
|
"execve: environment must be a mapping object");
|
2020-02-04 16:15:00 -08:00
|
|
|
goto fail_0;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
|
|
|
|
|
2011-03-17 20:20:30 +02:00
|
|
|
argvlist = parse_arglist(argv, &argc);
|
2010-05-06 00:08:46 +00:00
|
|
|
if (argvlist == NULL) {
|
2020-02-04 16:15:00 -08:00
|
|
|
goto fail_0;
|
2011-03-17 20:20:30 +02:00
|
|
|
}
|
2016-11-19 19:17:26 -08:00
|
|
|
if (!argvlist[0][0]) {
|
|
|
|
|
PyErr_SetString(PyExc_ValueError,
|
|
|
|
|
"execve: argv first element cannot be empty");
|
2020-02-04 16:15:00 -08:00
|
|
|
goto fail_0;
|
2016-11-19 19:17:26 -08:00
|
|
|
}
|
2011-03-17 20:20:30 +02:00
|
|
|
|
|
|
|
|
envlist = parse_envlist(env, &envc);
|
|
|
|
|
if (envlist == NULL)
|
2020-02-04 16:15:00 -08:00
|
|
|
goto fail_0;
|
|
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.exec", "OOO", path->object, argv, env) < 0) {
|
2020-02-04 16:15:00 -08:00
|
|
|
goto fail_1;
|
|
|
|
|
}
|
2011-03-17 20:20:30 +02:00
|
|
|
|
2016-11-19 19:17:26 -08:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef HAVE_FEXECVE
|
2014-08-05 14:04:04 +10:00
|
|
|
if (path->fd > -1)
|
|
|
|
|
fexecve(path->fd, argvlist, envlist);
|
2012-06-22 16:30:09 -07:00
|
|
|
else
|
|
|
|
|
#endif
|
2016-09-08 10:35:16 -07:00
|
|
|
#ifdef HAVE_WEXECV
|
|
|
|
|
_wexecve(path->wide, argvlist, envlist);
|
|
|
|
|
#else
|
2014-08-05 14:04:04 +10:00
|
|
|
execve(path->narrow, argvlist, envlist);
|
2016-09-08 10:35:16 -07:00
|
|
|
#endif
|
2016-11-19 19:17:26 -08:00
|
|
|
_Py_END_SUPPRESS_IPH
|
2011-03-17 20:20:30 +02:00
|
|
|
|
|
|
|
|
/* If we get here it's definitely an error */
|
|
|
|
|
|
2018-10-20 03:28:22 +03:00
|
|
|
posix_path_error(path);
|
2020-02-04 16:15:00 -08:00
|
|
|
fail_1:
|
2016-09-08 10:35:16 -07:00
|
|
|
free_string_array(envlist, envc);
|
2020-02-04 16:15:00 -08:00
|
|
|
fail_0:
|
2012-06-22 16:30:09 -07:00
|
|
|
if (argvlist)
|
|
|
|
|
free_string_array(argvlist, argc);
|
2011-03-17 20:20:30 +02:00
|
|
|
return NULL;
|
|
|
|
|
}
|
2016-09-08 10:35:16 -07:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif /* HAVE_EXECV */
|
|
|
|
|
|
2018-01-29 01:56:10 +00:00
|
|
|
#ifdef HAVE_POSIX_SPAWN
|
|
|
|
|
|
|
|
|
|
enum posix_spawn_file_actions_identifier {
|
|
|
|
|
POSIX_SPAWN_OPEN,
|
|
|
|
|
POSIX_SPAWN_CLOSE,
|
|
|
|
|
POSIX_SPAWN_DUP2
|
|
|
|
|
};
|
|
|
|
|
|
2018-10-01 22:19:56 -07:00
|
|
|
#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM)
|
2018-09-07 16:44:24 +01:00
|
|
|
static int
|
2020-05-10 11:05:29 +02:00
|
|
|
convert_sched_param(PyObject *module, PyObject *param, struct sched_param *res);
|
2018-10-01 22:19:56 -07:00
|
|
|
#endif
|
2018-09-07 16:44:24 +01:00
|
|
|
|
|
|
|
|
static int
|
2020-05-10 11:05:29 +02:00
|
|
|
parse_posix_spawn_flags(PyObject *module, const char *func_name, PyObject *setpgroup,
|
2019-02-01 15:47:24 +01:00
|
|
|
int resetids, int setsid, PyObject *setsigmask,
|
2018-09-07 16:44:24 +01:00
|
|
|
PyObject *setsigdef, PyObject *scheduler,
|
|
|
|
|
posix_spawnattr_t *attrp)
|
|
|
|
|
{
|
|
|
|
|
long all_flags = 0;
|
|
|
|
|
|
|
|
|
|
errno = posix_spawnattr_init(attrp);
|
|
|
|
|
if (errno) {
|
|
|
|
|
posix_error();
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (setpgroup) {
|
|
|
|
|
pid_t pgid = PyLong_AsPid(setpgroup);
|
|
|
|
|
if (pgid == (pid_t)-1 && PyErr_Occurred()) {
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
errno = posix_spawnattr_setpgroup(attrp, pgid);
|
|
|
|
|
if (errno) {
|
|
|
|
|
posix_error();
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
all_flags |= POSIX_SPAWN_SETPGROUP;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (resetids) {
|
|
|
|
|
all_flags |= POSIX_SPAWN_RESETIDS;
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-01 13:05:22 +03:00
|
|
|
if (setsid) {
|
2020-11-22 11:18:40 +01:00
|
|
|
#ifdef HAVE_POSIX_SPAWN_SETSID_RUNTIME
|
|
|
|
|
if (HAVE_POSIX_SPAWN_SETSID_RUNTIME) {
|
|
|
|
|
#endif
|
2019-02-01 13:05:22 +03:00
|
|
|
#ifdef POSIX_SPAWN_SETSID
|
|
|
|
|
all_flags |= POSIX_SPAWN_SETSID;
|
|
|
|
|
#elif defined(POSIX_SPAWN_SETSID_NP)
|
|
|
|
|
all_flags |= POSIX_SPAWN_SETSID_NP;
|
|
|
|
|
#else
|
|
|
|
|
argument_unavailable_error(func_name, "setsid");
|
|
|
|
|
return -1;
|
|
|
|
|
#endif
|
2020-11-22 11:18:40 +01:00
|
|
|
|
|
|
|
|
#ifdef HAVE_POSIX_SPAWN_SETSID_RUNTIME
|
|
|
|
|
} else {
|
|
|
|
|
argument_unavailable_error(func_name, "setsid");
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_POSIX_SPAWN_SETSID_RUNTIME */
|
|
|
|
|
|
2019-02-01 13:05:22 +03:00
|
|
|
}
|
|
|
|
|
|
2018-09-07 16:44:24 +01:00
|
|
|
if (setsigmask) {
|
|
|
|
|
sigset_t set;
|
|
|
|
|
if (!_Py_Sigset_Converter(setsigmask, &set)) {
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
errno = posix_spawnattr_setsigmask(attrp, &set);
|
|
|
|
|
if (errno) {
|
|
|
|
|
posix_error();
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
all_flags |= POSIX_SPAWN_SETSIGMASK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (setsigdef) {
|
|
|
|
|
sigset_t set;
|
|
|
|
|
if (!_Py_Sigset_Converter(setsigdef, &set)) {
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
errno = posix_spawnattr_setsigdefault(attrp, &set);
|
|
|
|
|
if (errno) {
|
|
|
|
|
posix_error();
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
all_flags |= POSIX_SPAWN_SETSIGDEF;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (scheduler) {
|
|
|
|
|
#ifdef POSIX_SPAWN_SETSCHEDULER
|
|
|
|
|
PyObject *py_schedpolicy;
|
2020-05-10 11:05:29 +02:00
|
|
|
PyObject *schedparam_obj;
|
2018-09-07 16:44:24 +01:00
|
|
|
struct sched_param schedparam;
|
|
|
|
|
|
2020-05-10 11:05:29 +02:00
|
|
|
if (!PyArg_ParseTuple(scheduler, "OO"
|
2018-09-07 16:44:24 +01:00
|
|
|
";A scheduler tuple must have two elements",
|
2020-05-10 11:05:29 +02:00
|
|
|
&py_schedpolicy, &schedparam_obj)) {
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
if (!convert_sched_param(module, schedparam_obj, &schedparam)) {
|
2018-09-07 16:44:24 +01:00
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
if (py_schedpolicy != Py_None) {
|
|
|
|
|
int schedpolicy = _PyLong_AsInt(py_schedpolicy);
|
|
|
|
|
|
|
|
|
|
if (schedpolicy == -1 && PyErr_Occurred()) {
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
errno = posix_spawnattr_setschedpolicy(attrp, schedpolicy);
|
|
|
|
|
if (errno) {
|
|
|
|
|
posix_error();
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
all_flags |= POSIX_SPAWN_SETSCHEDULER;
|
|
|
|
|
}
|
|
|
|
|
errno = posix_spawnattr_setschedparam(attrp, &schedparam);
|
|
|
|
|
if (errno) {
|
|
|
|
|
posix_error();
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
all_flags |= POSIX_SPAWN_SETSCHEDPARAM;
|
|
|
|
|
#else
|
|
|
|
|
PyErr_SetString(PyExc_NotImplementedError,
|
|
|
|
|
"The scheduler option is not supported in this system.");
|
|
|
|
|
goto fail;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
errno = posix_spawnattr_setflags(attrp, all_flags);
|
|
|
|
|
if (errno) {
|
|
|
|
|
posix_error();
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
fail:
|
|
|
|
|
(void)posix_spawnattr_destroy(attrp);
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-01 16:45:04 +03:00
|
|
|
static int
|
|
|
|
|
parse_file_actions(PyObject *file_actions,
|
2018-06-19 09:19:50 +01:00
|
|
|
posix_spawn_file_actions_t *file_actionsp,
|
|
|
|
|
PyObject *temp_buffer)
|
2018-05-01 16:45:04 +03:00
|
|
|
{
|
|
|
|
|
PyObject *seq;
|
|
|
|
|
PyObject *file_action = NULL;
|
|
|
|
|
PyObject *tag_obj;
|
|
|
|
|
|
|
|
|
|
seq = PySequence_Fast(file_actions,
|
|
|
|
|
"file_actions must be a sequence or None");
|
|
|
|
|
if (seq == NULL) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
errno = posix_spawn_file_actions_init(file_actionsp);
|
|
|
|
|
if (errno) {
|
|
|
|
|
posix_error();
|
|
|
|
|
Py_DECREF(seq);
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-26 14:54:20 -06:00
|
|
|
for (Py_ssize_t i = 0; i < PySequence_Fast_GET_SIZE(seq); ++i) {
|
2018-05-01 16:45:04 +03:00
|
|
|
file_action = PySequence_Fast_GET_ITEM(seq, i);
|
|
|
|
|
Py_INCREF(file_action);
|
|
|
|
|
if (!PyTuple_Check(file_action) || !PyTuple_GET_SIZE(file_action)) {
|
|
|
|
|
PyErr_SetString(PyExc_TypeError,
|
|
|
|
|
"Each file_actions element must be a non-empty tuple");
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
long tag = PyLong_AsLong(PyTuple_GET_ITEM(file_action, 0));
|
|
|
|
|
if (tag == -1 && PyErr_Occurred()) {
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Populate the file_actions object */
|
|
|
|
|
switch (tag) {
|
|
|
|
|
case POSIX_SPAWN_OPEN: {
|
|
|
|
|
int fd, oflag;
|
|
|
|
|
PyObject *path;
|
|
|
|
|
unsigned long mode;
|
|
|
|
|
if (!PyArg_ParseTuple(file_action, "OiO&ik"
|
|
|
|
|
";A open file_action tuple must have 5 elements",
|
|
|
|
|
&tag_obj, &fd, PyUnicode_FSConverter, &path,
|
|
|
|
|
&oflag, &mode))
|
|
|
|
|
{
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
2018-06-19 09:19:50 +01:00
|
|
|
if (PyList_Append(temp_buffer, path)) {
|
|
|
|
|
Py_DECREF(path);
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
2018-05-01 16:45:04 +03:00
|
|
|
errno = posix_spawn_file_actions_addopen(file_actionsp,
|
|
|
|
|
fd, PyBytes_AS_STRING(path), oflag, (mode_t)mode);
|
2018-06-19 09:19:50 +01:00
|
|
|
Py_DECREF(path);
|
2018-05-01 16:45:04 +03:00
|
|
|
if (errno) {
|
|
|
|
|
posix_error();
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case POSIX_SPAWN_CLOSE: {
|
|
|
|
|
int fd;
|
|
|
|
|
if (!PyArg_ParseTuple(file_action, "Oi"
|
|
|
|
|
";A close file_action tuple must have 2 elements",
|
|
|
|
|
&tag_obj, &fd))
|
|
|
|
|
{
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
errno = posix_spawn_file_actions_addclose(file_actionsp, fd);
|
|
|
|
|
if (errno) {
|
|
|
|
|
posix_error();
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case POSIX_SPAWN_DUP2: {
|
|
|
|
|
int fd1, fd2;
|
|
|
|
|
if (!PyArg_ParseTuple(file_action, "Oii"
|
|
|
|
|
";A dup2 file_action tuple must have 3 elements",
|
|
|
|
|
&tag_obj, &fd1, &fd2))
|
|
|
|
|
{
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
errno = posix_spawn_file_actions_adddup2(file_actionsp,
|
|
|
|
|
fd1, fd2);
|
|
|
|
|
if (errno) {
|
|
|
|
|
posix_error();
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
default: {
|
|
|
|
|
PyErr_SetString(PyExc_TypeError,
|
|
|
|
|
"Unknown file_actions identifier");
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Py_DECREF(file_action);
|
|
|
|
|
}
|
2018-09-07 16:44:24 +01:00
|
|
|
|
2018-05-01 16:45:04 +03:00
|
|
|
Py_DECREF(seq);
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
fail:
|
|
|
|
|
Py_DECREF(seq);
|
|
|
|
|
Py_DECREF(file_action);
|
|
|
|
|
(void)posix_spawn_file_actions_destroy(file_actionsp);
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-29 01:56:10 +00:00
|
|
|
|
|
|
|
|
static PyObject *
|
2019-01-16 16:29:26 +03:00
|
|
|
py_posix_spawn(int use_posix_spawnp, PyObject *module, path_t *path, PyObject *argv,
|
|
|
|
|
PyObject *env, PyObject *file_actions,
|
2019-02-01 13:05:22 +03:00
|
|
|
PyObject *setpgroup, int resetids, int setsid, PyObject *setsigmask,
|
2019-01-16 16:29:26 +03:00
|
|
|
PyObject *setsigdef, PyObject *scheduler)
|
2018-01-29 01:56:10 +00:00
|
|
|
{
|
2019-02-01 15:47:24 +01:00
|
|
|
const char *func_name = use_posix_spawnp ? "posix_spawnp" : "posix_spawn";
|
2018-01-29 01:56:10 +00:00
|
|
|
EXECV_CHAR **argvlist = NULL;
|
2018-01-29 20:34:42 +00:00
|
|
|
EXECV_CHAR **envlist = NULL;
|
2018-05-01 16:45:04 +03:00
|
|
|
posix_spawn_file_actions_t file_actions_buf;
|
2018-01-29 20:34:42 +00:00
|
|
|
posix_spawn_file_actions_t *file_actionsp = NULL;
|
2018-09-07 16:44:24 +01:00
|
|
|
posix_spawnattr_t attr;
|
|
|
|
|
posix_spawnattr_t *attrp = NULL;
|
2018-01-29 01:56:10 +00:00
|
|
|
Py_ssize_t argc, envc;
|
2018-05-01 16:45:04 +03:00
|
|
|
PyObject *result = NULL;
|
2018-06-19 09:19:50 +01:00
|
|
|
PyObject *temp_buffer = NULL;
|
2018-05-01 16:45:04 +03:00
|
|
|
pid_t pid;
|
|
|
|
|
int err_code;
|
2018-01-29 01:56:10 +00:00
|
|
|
|
2019-02-01 13:05:22 +03:00
|
|
|
/* posix_spawn and posix_spawnp have three arguments: (path, argv, env), where
|
2018-05-01 16:45:04 +03:00
|
|
|
argv is a list or tuple of strings and env is a dictionary
|
2018-01-29 01:56:10 +00:00
|
|
|
like posix.environ. */
|
|
|
|
|
|
2018-05-01 16:45:04 +03:00
|
|
|
if (!PyList_Check(argv) && !PyTuple_Check(argv)) {
|
2019-02-01 15:47:24 +01:00
|
|
|
PyErr_Format(PyExc_TypeError,
|
|
|
|
|
"%s: argv must be a tuple or list", func_name);
|
2018-01-29 20:34:42 +00:00
|
|
|
goto exit;
|
2018-01-29 01:56:10 +00:00
|
|
|
}
|
|
|
|
|
argc = PySequence_Size(argv);
|
|
|
|
|
if (argc < 1) {
|
2019-02-01 15:47:24 +01:00
|
|
|
PyErr_Format(PyExc_ValueError,
|
|
|
|
|
"%s: argv must not be empty", func_name);
|
2018-01-29 01:56:10 +00:00
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!PyMapping_Check(env)) {
|
2019-02-01 15:47:24 +01:00
|
|
|
PyErr_Format(PyExc_TypeError,
|
|
|
|
|
"%s: environment must be a mapping object", func_name);
|
2018-01-29 20:34:42 +00:00
|
|
|
goto exit;
|
2018-01-29 01:56:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
argvlist = parse_arglist(argv, &argc);
|
|
|
|
|
if (argvlist == NULL) {
|
2018-01-29 20:34:42 +00:00
|
|
|
goto exit;
|
2018-01-29 01:56:10 +00:00
|
|
|
}
|
|
|
|
|
if (!argvlist[0][0]) {
|
2019-02-01 15:47:24 +01:00
|
|
|
PyErr_Format(PyExc_ValueError,
|
|
|
|
|
"%s: argv first element cannot be empty", func_name);
|
2018-01-29 20:34:42 +00:00
|
|
|
goto exit;
|
2018-01-29 01:56:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
envlist = parse_envlist(env, &envc);
|
2018-01-29 20:34:42 +00:00
|
|
|
if (envlist == NULL) {
|
|
|
|
|
goto exit;
|
|
|
|
|
}
|
2018-01-29 01:56:10 +00:00
|
|
|
|
2019-05-10 12:00:06 +10:00
|
|
|
if (file_actions != NULL && file_actions != Py_None) {
|
2018-06-19 09:19:50 +01:00
|
|
|
/* There is a bug in old versions of glibc that makes some of the
|
|
|
|
|
* helper functions for manipulating file actions not copy the provided
|
|
|
|
|
* buffers. The problem is that posix_spawn_file_actions_addopen does not
|
|
|
|
|
* copy the value of path for some old versions of glibc (<2.20).
|
|
|
|
|
* The use of temp_buffer here is a workaround that keeps the
|
|
|
|
|
* python objects that own the buffers alive until posix_spawn gets called.
|
|
|
|
|
* Check https://bugs.python.org/issue33630 and
|
|
|
|
|
* https://sourceware.org/bugzilla/show_bug.cgi?id=17048 for more info.*/
|
|
|
|
|
temp_buffer = PyList_New(0);
|
|
|
|
|
if (!temp_buffer) {
|
|
|
|
|
goto exit;
|
|
|
|
|
}
|
|
|
|
|
if (parse_file_actions(file_actions, &file_actions_buf, temp_buffer)) {
|
2018-01-29 20:34:42 +00:00
|
|
|
goto exit;
|
2018-01-29 01:56:10 +00:00
|
|
|
}
|
2018-05-01 16:45:04 +03:00
|
|
|
file_actionsp = &file_actions_buf;
|
2018-01-29 20:34:42 +00:00
|
|
|
}
|
2018-01-29 01:56:10 +00:00
|
|
|
|
2020-05-10 11:05:29 +02:00
|
|
|
if (parse_posix_spawn_flags(module, func_name, setpgroup, resetids, setsid,
|
2019-02-01 15:47:24 +01:00
|
|
|
setsigmask, setsigdef, scheduler, &attr)) {
|
2018-09-07 16:44:24 +01:00
|
|
|
goto exit;
|
|
|
|
|
}
|
|
|
|
|
attrp = &attr;
|
|
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.posix_spawn", "OOO", path->object, argv, env) < 0) {
|
2020-02-04 16:15:00 -08:00
|
|
|
goto exit;
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-29 01:56:10 +00:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
2019-01-16 16:29:26 +03:00
|
|
|
#ifdef HAVE_POSIX_SPAWNP
|
|
|
|
|
if (use_posix_spawnp) {
|
|
|
|
|
err_code = posix_spawnp(&pid, path->narrow,
|
|
|
|
|
file_actionsp, attrp, argvlist, envlist);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
#endif /* HAVE_POSIX_SPAWNP */
|
|
|
|
|
{
|
|
|
|
|
err_code = posix_spawn(&pid, path->narrow,
|
|
|
|
|
file_actionsp, attrp, argvlist, envlist);
|
|
|
|
|
}
|
2018-01-29 01:56:10 +00:00
|
|
|
_Py_END_SUPPRESS_IPH
|
2019-01-16 16:29:26 +03:00
|
|
|
|
2018-05-01 16:45:04 +03:00
|
|
|
if (err_code) {
|
|
|
|
|
errno = err_code;
|
|
|
|
|
PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path->object);
|
2018-01-29 20:34:42 +00:00
|
|
|
goto exit;
|
|
|
|
|
}
|
2018-12-30 21:13:02 -08:00
|
|
|
#ifdef _Py_MEMORY_SANITIZER
|
|
|
|
|
__msan_unpoison(&pid, sizeof(pid));
|
|
|
|
|
#endif
|
2018-01-29 20:34:42 +00:00
|
|
|
result = PyLong_FromPid(pid);
|
2018-01-29 01:56:10 +00:00
|
|
|
|
2018-01-29 20:34:42 +00:00
|
|
|
exit:
|
2018-05-01 16:45:04 +03:00
|
|
|
if (file_actionsp) {
|
|
|
|
|
(void)posix_spawn_file_actions_destroy(file_actionsp);
|
2018-01-29 20:34:42 +00:00
|
|
|
}
|
2018-09-07 16:44:24 +01:00
|
|
|
if (attrp) {
|
|
|
|
|
(void)posix_spawnattr_destroy(attrp);
|
|
|
|
|
}
|
2018-01-29 20:34:42 +00:00
|
|
|
if (envlist) {
|
|
|
|
|
free_string_array(envlist, envc);
|
|
|
|
|
}
|
2018-01-29 01:56:10 +00:00
|
|
|
if (argvlist) {
|
|
|
|
|
free_string_array(argvlist, argc);
|
|
|
|
|
}
|
2018-06-19 09:19:50 +01:00
|
|
|
Py_XDECREF(temp_buffer);
|
2018-01-29 20:34:42 +00:00
|
|
|
return result;
|
2018-01-29 01:56:10 +00:00
|
|
|
}
|
2019-01-16 16:29:26 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
|
|
|
|
|
os.posix_spawn
|
|
|
|
|
path: path_t
|
|
|
|
|
Path of executable file.
|
|
|
|
|
argv: object
|
|
|
|
|
Tuple or list of strings.
|
|
|
|
|
env: object
|
|
|
|
|
Dictionary of strings mapping to strings.
|
|
|
|
|
/
|
|
|
|
|
*
|
|
|
|
|
file_actions: object(c_default='NULL') = ()
|
|
|
|
|
A sequence of file action tuples.
|
|
|
|
|
setpgroup: object = NULL
|
|
|
|
|
The pgroup to use with the POSIX_SPAWN_SETPGROUP flag.
|
|
|
|
|
resetids: bool(accept={int}) = False
|
2019-02-01 13:05:22 +03:00
|
|
|
If the value is `true` the POSIX_SPAWN_RESETIDS will be activated.
|
|
|
|
|
setsid: bool(accept={int}) = False
|
|
|
|
|
If the value is `true` the POSIX_SPAWN_SETSID or POSIX_SPAWN_SETSID_NP will be activated.
|
2019-01-16 16:29:26 +03:00
|
|
|
setsigmask: object(c_default='NULL') = ()
|
|
|
|
|
The sigmask to use with the POSIX_SPAWN_SETSIGMASK flag.
|
|
|
|
|
setsigdef: object(c_default='NULL') = ()
|
|
|
|
|
The sigmask to use with the POSIX_SPAWN_SETSIGDEF flag.
|
|
|
|
|
scheduler: object = NULL
|
|
|
|
|
A tuple with the scheduler policy (optional) and parameters.
|
|
|
|
|
|
|
|
|
|
Execute the program specified by path in a new process.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
os_posix_spawn_impl(PyObject *module, path_t *path, PyObject *argv,
|
|
|
|
|
PyObject *env, PyObject *file_actions,
|
2019-02-01 13:05:22 +03:00
|
|
|
PyObject *setpgroup, int resetids, int setsid,
|
|
|
|
|
PyObject *setsigmask, PyObject *setsigdef,
|
|
|
|
|
PyObject *scheduler)
|
|
|
|
|
/*[clinic end generated code: output=14a1098c566bc675 input=8c6305619a00ad04]*/
|
2019-01-16 16:29:26 +03:00
|
|
|
{
|
|
|
|
|
return py_posix_spawn(0, module, path, argv, env, file_actions,
|
2019-02-01 13:05:22 +03:00
|
|
|
setpgroup, resetids, setsid, setsigmask, setsigdef,
|
2019-01-16 16:29:26 +03:00
|
|
|
scheduler);
|
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_POSIX_SPAWN */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_POSIX_SPAWNP
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
|
|
|
|
|
os.posix_spawnp
|
|
|
|
|
path: path_t
|
|
|
|
|
Path of executable file.
|
|
|
|
|
argv: object
|
|
|
|
|
Tuple or list of strings.
|
|
|
|
|
env: object
|
|
|
|
|
Dictionary of strings mapping to strings.
|
|
|
|
|
/
|
|
|
|
|
*
|
|
|
|
|
file_actions: object(c_default='NULL') = ()
|
|
|
|
|
A sequence of file action tuples.
|
|
|
|
|
setpgroup: object = NULL
|
|
|
|
|
The pgroup to use with the POSIX_SPAWN_SETPGROUP flag.
|
|
|
|
|
resetids: bool(accept={int}) = False
|
|
|
|
|
If the value is `True` the POSIX_SPAWN_RESETIDS will be activated.
|
2019-02-01 13:05:22 +03:00
|
|
|
setsid: bool(accept={int}) = False
|
|
|
|
|
If the value is `True` the POSIX_SPAWN_SETSID or POSIX_SPAWN_SETSID_NP will be activated.
|
2019-01-16 16:29:26 +03:00
|
|
|
setsigmask: object(c_default='NULL') = ()
|
|
|
|
|
The sigmask to use with the POSIX_SPAWN_SETSIGMASK flag.
|
|
|
|
|
setsigdef: object(c_default='NULL') = ()
|
|
|
|
|
The sigmask to use with the POSIX_SPAWN_SETSIGDEF flag.
|
|
|
|
|
scheduler: object = NULL
|
|
|
|
|
A tuple with the scheduler policy (optional) and parameters.
|
|
|
|
|
|
|
|
|
|
Execute the program specified by path in a new process.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
os_posix_spawnp_impl(PyObject *module, path_t *path, PyObject *argv,
|
|
|
|
|
PyObject *env, PyObject *file_actions,
|
2019-02-01 13:05:22 +03:00
|
|
|
PyObject *setpgroup, int resetids, int setsid,
|
|
|
|
|
PyObject *setsigmask, PyObject *setsigdef,
|
|
|
|
|
PyObject *scheduler)
|
|
|
|
|
/*[clinic end generated code: output=7b9aaefe3031238d input=c1911043a22028da]*/
|
2019-01-16 16:29:26 +03:00
|
|
|
{
|
|
|
|
|
return py_posix_spawn(1, module, path, argv, env, file_actions,
|
2019-02-01 13:05:22 +03:00
|
|
|
setpgroup, resetids, setsid, setsigmask, setsigdef,
|
2019-01-16 16:29:26 +03:00
|
|
|
scheduler);
|
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_POSIX_SPAWNP */
|
2018-01-29 01:56:10 +00:00
|
|
|
|
2019-05-21 18:46:37 +08:00
|
|
|
#ifdef HAVE_RTPSPAWN
|
|
|
|
|
static intptr_t
|
|
|
|
|
_rtp_spawn(int mode, const char *rtpFileName, const char *argv[],
|
|
|
|
|
const char *envp[])
|
|
|
|
|
{
|
|
|
|
|
RTP_ID rtpid;
|
|
|
|
|
int status;
|
|
|
|
|
pid_t res;
|
|
|
|
|
int async_err = 0;
|
|
|
|
|
|
|
|
|
|
/* Set priority=100 and uStackSize=16 MiB (0x1000000) for new processes.
|
|
|
|
|
uStackSize=0 cannot be used, the default stack size is too small for
|
|
|
|
|
Python. */
|
|
|
|
|
if (envp) {
|
|
|
|
|
rtpid = rtpSpawn(rtpFileName, argv, envp,
|
|
|
|
|
100, 0x1000000, 0, VX_FP_TASK);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
rtpid = rtpSpawn(rtpFileName, argv, (const char **)environ,
|
|
|
|
|
100, 0x1000000, 0, VX_FP_TASK);
|
|
|
|
|
}
|
|
|
|
|
if ((rtpid != RTP_ID_ERROR) && (mode == _P_WAIT)) {
|
|
|
|
|
do {
|
|
|
|
|
res = waitpid((pid_t)rtpid, &status, 0);
|
|
|
|
|
} while (res < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
|
|
|
|
|
|
|
|
|
if (res < 0)
|
|
|
|
|
return RTP_ID_ERROR;
|
|
|
|
|
return ((intptr_t)status);
|
|
|
|
|
}
|
|
|
|
|
return ((intptr_t)rtpid);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if defined(HAVE_SPAWNV) || defined(HAVE_WSPAWNV) || defined(HAVE_RTPSPAWN)
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.spawnv
|
|
|
|
|
|
|
|
|
|
mode: int
|
|
|
|
|
Mode of process creation.
|
2016-09-08 10:35:16 -07:00
|
|
|
path: path_t
|
2014-08-05 14:04:04 +10:00
|
|
|
Path of executable file.
|
|
|
|
|
argv: object
|
|
|
|
|
Tuple or list of strings.
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Execute the program specified by path in a new process.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-09-08 10:35:16 -07:00
|
|
|
os_spawnv_impl(PyObject *module, int mode, path_t *path, PyObject *argv)
|
|
|
|
|
/*[clinic end generated code: output=71cd037a9d96b816 input=43224242303291be]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2016-09-08 10:35:16 -07:00
|
|
|
EXECV_CHAR **argvlist;
|
2014-08-05 14:04:04 +10:00
|
|
|
int i;
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_ssize_t argc;
|
2016-09-06 13:47:26 -07:00
|
|
|
intptr_t spawnval;
|
2010-05-06 00:08:46 +00:00
|
|
|
PyObject *(*getitem)(PyObject *, Py_ssize_t);
|
|
|
|
|
|
|
|
|
|
/* spawnv has three arguments: (mode, path, argv), where
|
|
|
|
|
argv is a list or tuple of strings. */
|
|
|
|
|
|
|
|
|
|
if (PyList_Check(argv)) {
|
|
|
|
|
argc = PyList_Size(argv);
|
|
|
|
|
getitem = PyList_GetItem;
|
|
|
|
|
}
|
|
|
|
|
else if (PyTuple_Check(argv)) {
|
|
|
|
|
argc = PyTuple_Size(argv);
|
|
|
|
|
getitem = PyTuple_GetItem;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
PyErr_SetString(PyExc_TypeError,
|
|
|
|
|
"spawnv() arg 2 must be a tuple or list");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2016-11-19 18:53:19 -08:00
|
|
|
if (argc == 0) {
|
|
|
|
|
PyErr_SetString(PyExc_ValueError,
|
|
|
|
|
"spawnv() arg 2 cannot be empty");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2010-05-06 00:08:46 +00:00
|
|
|
|
2016-09-08 10:35:16 -07:00
|
|
|
argvlist = PyMem_NEW(EXECV_CHAR *, argc+1);
|
2010-05-06 00:08:46 +00:00
|
|
|
if (argvlist == NULL) {
|
|
|
|
|
return PyErr_NoMemory();
|
|
|
|
|
}
|
|
|
|
|
for (i = 0; i < argc; i++) {
|
|
|
|
|
if (!fsconvert_strdup((*getitem)(argv, i),
|
|
|
|
|
&argvlist[i])) {
|
|
|
|
|
free_string_array(argvlist, i);
|
|
|
|
|
PyErr_SetString(
|
|
|
|
|
PyExc_TypeError,
|
|
|
|
|
"spawnv() arg 2 must contain only strings");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2016-11-19 19:03:54 -08:00
|
|
|
if (i == 0 && !argvlist[0][0]) {
|
2017-06-15 15:30:40 +02:00
|
|
|
free_string_array(argvlist, i + 1);
|
2016-11-19 19:03:54 -08:00
|
|
|
PyErr_SetString(
|
|
|
|
|
PyExc_ValueError,
|
|
|
|
|
"spawnv() arg 2 first element cannot be empty");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
|
|
|
|
argvlist[argc] = NULL;
|
1999-01-25 23:20:23 +00:00
|
|
|
|
2019-05-21 18:46:37 +08:00
|
|
|
#if !defined(HAVE_RTPSPAWN)
|
2010-05-06 00:08:46 +00:00
|
|
|
if (mode == _OLD_P_OVERLAY)
|
|
|
|
|
mode = _P_OVERLAY;
|
2019-05-21 18:46:37 +08:00
|
|
|
#endif
|
2002-01-30 05:46:57 +00:00
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.spawn", "iOOO", mode, path->object, argv,
|
2020-02-04 16:15:00 -08:00
|
|
|
Py_None) < 0) {
|
|
|
|
|
free_string_array(argvlist, argc);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2016-09-11 20:19:32 -07:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
2016-09-08 10:35:16 -07:00
|
|
|
#ifdef HAVE_WSPAWNV
|
|
|
|
|
spawnval = _wspawnv(mode, path->wide, argvlist);
|
2019-05-21 18:46:37 +08:00
|
|
|
#elif defined(HAVE_RTPSPAWN)
|
|
|
|
|
spawnval = _rtp_spawn(mode, path->narrow, (const char **)argvlist, NULL);
|
2016-09-08 10:35:16 -07:00
|
|
|
#else
|
|
|
|
|
spawnval = _spawnv(mode, path->narrow, argvlist);
|
|
|
|
|
#endif
|
2016-09-11 20:19:32 -07:00
|
|
|
_Py_END_SUPPRESS_IPH
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
2002-01-30 05:46:57 +00:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
free_string_array(argvlist, argc);
|
1999-01-25 23:20:23 +00:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
if (spawnval == -1)
|
|
|
|
|
return posix_error();
|
|
|
|
|
else
|
2013-06-05 23:29:30 +01:00
|
|
|
return Py_BuildValue(_Py_PARSE_INTPTR, spawnval);
|
1999-01-25 23:20:23 +00:00
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.spawnve
|
|
|
|
|
|
|
|
|
|
mode: int
|
|
|
|
|
Mode of process creation.
|
2016-09-08 10:35:16 -07:00
|
|
|
path: path_t
|
2014-08-05 14:04:04 +10:00
|
|
|
Path of executable file.
|
|
|
|
|
argv: object
|
|
|
|
|
Tuple or list of strings.
|
|
|
|
|
env: object
|
|
|
|
|
Dictionary of strings mapping to strings.
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Execute the program specified by path in a new process.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
1999-01-25 23:20:23 +00:00
|
|
|
static PyObject *
|
2016-09-08 10:35:16 -07:00
|
|
|
os_spawnve_impl(PyObject *module, int mode, path_t *path, PyObject *argv,
|
2016-07-07 17:35:15 +03:00
|
|
|
PyObject *env)
|
2016-09-08 10:35:16 -07:00
|
|
|
/*[clinic end generated code: output=30fe85be56fe37ad input=3e40803ee7c4c586]*/
|
1999-01-25 23:20:23 +00:00
|
|
|
{
|
2016-09-08 10:35:16 -07:00
|
|
|
EXECV_CHAR **argvlist;
|
|
|
|
|
EXECV_CHAR **envlist;
|
2010-05-06 00:08:46 +00:00
|
|
|
PyObject *res = NULL;
|
2010-08-15 18:07:50 +00:00
|
|
|
Py_ssize_t argc, i, envc;
|
2016-09-06 13:47:26 -07:00
|
|
|
intptr_t spawnval;
|
2010-05-06 00:08:46 +00:00
|
|
|
PyObject *(*getitem)(PyObject *, Py_ssize_t);
|
2017-06-23 15:04:46 +02:00
|
|
|
Py_ssize_t lastarg = 0;
|
2010-05-06 00:08:46 +00:00
|
|
|
|
|
|
|
|
/* spawnve has four arguments: (mode, path, argv, env), where
|
|
|
|
|
argv is a list or tuple of strings and env is a dictionary
|
|
|
|
|
like posix.environ. */
|
|
|
|
|
|
|
|
|
|
if (PyList_Check(argv)) {
|
|
|
|
|
argc = PyList_Size(argv);
|
|
|
|
|
getitem = PyList_GetItem;
|
|
|
|
|
}
|
|
|
|
|
else if (PyTuple_Check(argv)) {
|
|
|
|
|
argc = PyTuple_Size(argv);
|
|
|
|
|
getitem = PyTuple_GetItem;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
PyErr_SetString(PyExc_TypeError,
|
|
|
|
|
"spawnve() arg 2 must be a tuple or list");
|
|
|
|
|
goto fail_0;
|
|
|
|
|
}
|
2016-11-19 18:53:19 -08:00
|
|
|
if (argc == 0) {
|
|
|
|
|
PyErr_SetString(PyExc_ValueError,
|
|
|
|
|
"spawnve() arg 2 cannot be empty");
|
|
|
|
|
goto fail_0;
|
|
|
|
|
}
|
2010-05-06 00:08:46 +00:00
|
|
|
if (!PyMapping_Check(env)) {
|
|
|
|
|
PyErr_SetString(PyExc_TypeError,
|
|
|
|
|
"spawnve() arg 3 must be a mapping object");
|
|
|
|
|
goto fail_0;
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-08 10:35:16 -07:00
|
|
|
argvlist = PyMem_NEW(EXECV_CHAR *, argc+1);
|
2010-05-06 00:08:46 +00:00
|
|
|
if (argvlist == NULL) {
|
|
|
|
|
PyErr_NoMemory();
|
|
|
|
|
goto fail_0;
|
|
|
|
|
}
|
|
|
|
|
for (i = 0; i < argc; i++) {
|
|
|
|
|
if (!fsconvert_strdup((*getitem)(argv, i),
|
|
|
|
|
&argvlist[i]))
|
|
|
|
|
{
|
|
|
|
|
lastarg = i;
|
|
|
|
|
goto fail_1;
|
|
|
|
|
}
|
2016-11-19 19:17:26 -08:00
|
|
|
if (i == 0 && !argvlist[0][0]) {
|
2017-06-23 15:04:46 +02:00
|
|
|
lastarg = i + 1;
|
2016-11-19 19:17:26 -08:00
|
|
|
PyErr_SetString(
|
|
|
|
|
PyExc_ValueError,
|
|
|
|
|
"spawnv() arg 2 first element cannot be empty");
|
|
|
|
|
goto fail_1;
|
|
|
|
|
}
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
|
|
|
|
lastarg = argc;
|
|
|
|
|
argvlist[argc] = NULL;
|
|
|
|
|
|
|
|
|
|
envlist = parse_envlist(env, &envc);
|
|
|
|
|
if (envlist == NULL)
|
|
|
|
|
goto fail_1;
|
1999-01-25 23:20:23 +00:00
|
|
|
|
2019-05-21 18:46:37 +08:00
|
|
|
#if !defined(HAVE_RTPSPAWN)
|
2010-05-06 00:08:46 +00:00
|
|
|
if (mode == _OLD_P_OVERLAY)
|
|
|
|
|
mode = _P_OVERLAY;
|
2019-05-21 18:46:37 +08:00
|
|
|
#endif
|
2001-12-07 20:35:43 +00:00
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.spawn", "iOOO", mode, path->object, argv, env) < 0) {
|
2020-02-04 16:15:00 -08:00
|
|
|
goto fail_2;
|
|
|
|
|
}
|
|
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2016-09-11 20:19:32 -07:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
2016-09-08 10:35:16 -07:00
|
|
|
#ifdef HAVE_WSPAWNV
|
|
|
|
|
spawnval = _wspawnve(mode, path->wide, argvlist, envlist);
|
2019-05-21 18:46:37 +08:00
|
|
|
#elif defined(HAVE_RTPSPAWN)
|
|
|
|
|
spawnval = _rtp_spawn(mode, path->narrow, (const char **)argvlist,
|
|
|
|
|
(const char **)envlist);
|
2016-09-08 10:35:16 -07:00
|
|
|
#else
|
|
|
|
|
spawnval = _spawnve(mode, path->narrow, argvlist, envlist);
|
|
|
|
|
#endif
|
2016-09-11 20:19:32 -07:00
|
|
|
_Py_END_SUPPRESS_IPH
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
2001-12-07 20:35:43 +00:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
if (spawnval == -1)
|
|
|
|
|
(void) posix_error();
|
|
|
|
|
else
|
2013-06-05 23:29:30 +01:00
|
|
|
res = Py_BuildValue(_Py_PARSE_INTPTR, spawnval);
|
1999-01-25 23:20:23 +00:00
|
|
|
|
2020-02-04 16:15:00 -08:00
|
|
|
fail_2:
|
2010-05-06 00:08:46 +00:00
|
|
|
while (--envc >= 0)
|
|
|
|
|
PyMem_DEL(envlist[envc]);
|
|
|
|
|
PyMem_DEL(envlist);
|
2002-12-13 18:36:22 +00:00
|
|
|
fail_1:
|
2017-06-23 15:04:46 +02:00
|
|
|
free_string_array(argvlist, lastarg);
|
2002-10-07 06:44:21 +00:00
|
|
|
fail_0:
|
2010-05-06 00:08:46 +00:00
|
|
|
return res;
|
1999-01-25 23:20:23 +00:00
|
|
|
}
|
2004-04-04 07:11:43 +00:00
|
|
|
|
1999-01-25 23:20:23 +00:00
|
|
|
#endif /* HAVE_SPAWNV */
|
|
|
|
|
|
|
|
|
|
|
2017-05-27 17:50:54 +02:00
|
|
|
#ifdef HAVE_FORK
|
2017-05-29 10:03:41 -07:00
|
|
|
|
|
|
|
|
/* Helper function to validate arguments.
|
|
|
|
|
Returns 0 on success. non-zero on failure with a TypeError raised.
|
|
|
|
|
If obj is non-NULL it must be callable. */
|
|
|
|
|
static int
|
|
|
|
|
check_null_or_callable(PyObject *obj, const char* obj_name)
|
|
|
|
|
{
|
|
|
|
|
if (obj && !PyCallable_Check(obj)) {
|
|
|
|
|
PyErr_Format(PyExc_TypeError, "'%s' must be callable, not %s",
|
2019-11-05 07:16:14 -08:00
|
|
|
obj_name, _PyType_Name(Py_TYPE(obj)));
|
2017-05-29 10:03:41 -07:00
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-27 17:50:54 +02:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.register_at_fork
|
|
|
|
|
|
2017-05-29 10:03:41 -07:00
|
|
|
*
|
|
|
|
|
before: object=NULL
|
|
|
|
|
A callable to be called in the parent before the fork() syscall.
|
|
|
|
|
after_in_child: object=NULL
|
|
|
|
|
A callable to be called in the child after fork().
|
|
|
|
|
after_in_parent: object=NULL
|
|
|
|
|
A callable to be called in the parent after fork().
|
2017-05-27 17:50:54 +02:00
|
|
|
|
2017-05-29 10:03:41 -07:00
|
|
|
Register callables to be called when forking a new process.
|
2017-05-27 17:50:54 +02:00
|
|
|
|
2017-05-29 10:03:41 -07:00
|
|
|
'before' callbacks are called in reverse order.
|
|
|
|
|
'after_in_child' and 'after_in_parent' callbacks are called in order.
|
2017-05-27 17:50:54 +02:00
|
|
|
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2017-05-29 10:03:41 -07:00
|
|
|
os_register_at_fork_impl(PyObject *module, PyObject *before,
|
|
|
|
|
PyObject *after_in_child, PyObject *after_in_parent)
|
|
|
|
|
/*[clinic end generated code: output=5398ac75e8e97625 input=cd1187aa85d2312e]*/
|
2017-05-27 17:50:54 +02:00
|
|
|
{
|
|
|
|
|
PyInterpreterState *interp;
|
|
|
|
|
|
2017-05-29 10:03:41 -07:00
|
|
|
if (!before && !after_in_child && !after_in_parent) {
|
|
|
|
|
PyErr_SetString(PyExc_TypeError, "At least one argument is required.");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
if (check_null_or_callable(before, "before") ||
|
|
|
|
|
check_null_or_callable(after_in_child, "after_in_child") ||
|
|
|
|
|
check_null_or_callable(after_in_parent, "after_in_parent")) {
|
2017-05-27 17:50:54 +02:00
|
|
|
return NULL;
|
|
|
|
|
}
|
2020-04-14 15:14:01 +02:00
|
|
|
interp = _PyInterpreterState_GET();
|
2017-05-27 17:50:54 +02:00
|
|
|
|
2017-05-29 10:03:41 -07:00
|
|
|
if (register_at_forker(&interp->before_forkers, before)) {
|
2017-05-27 17:50:54 +02:00
|
|
|
return NULL;
|
|
|
|
|
}
|
2017-05-29 10:03:41 -07:00
|
|
|
if (register_at_forker(&interp->after_forkers_child, after_in_child)) {
|
2017-05-27 17:50:54 +02:00
|
|
|
return NULL;
|
2017-05-29 10:03:41 -07:00
|
|
|
}
|
|
|
|
|
if (register_at_forker(&interp->after_forkers_parent, after_in_parent)) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
Py_RETURN_NONE;
|
2017-05-27 17:50:54 +02:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_FORK */
|
|
|
|
|
|
|
|
|
|
|
2001-04-11 20:58:20 +00:00
|
|
|
#ifdef HAVE_FORK1
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.fork1
|
|
|
|
|
|
|
|
|
|
Fork a child process with a single multiplexed (i.e., not bound) thread.
|
|
|
|
|
|
|
|
|
|
Return 0 to child process and PID of child to parent process.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
2001-04-11 20:58:20 +00:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_fork1_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=0de8e67ce2a310bc input=12db02167893926e]*/
|
2001-04-11 20:58:20 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
pid_t pid;
|
2017-05-27 17:50:54 +02:00
|
|
|
|
2020-04-14 15:14:01 +02:00
|
|
|
if (_PyInterpreterState_GET() != PyInterpreterState_Main()) {
|
2018-09-14 14:17:20 -07:00
|
|
|
PyErr_SetString(PyExc_RuntimeError, "fork not supported for subinterpreters");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2017-05-27 17:50:54 +02:00
|
|
|
PyOS_BeforeFork();
|
2010-05-06 00:08:46 +00:00
|
|
|
pid = fork1();
|
|
|
|
|
if (pid == 0) {
|
|
|
|
|
/* child: this clobbers and resets the import lock. */
|
2017-05-27 17:50:54 +02:00
|
|
|
PyOS_AfterFork_Child();
|
2010-05-06 00:08:46 +00:00
|
|
|
} else {
|
|
|
|
|
/* parent: release the import lock. */
|
2017-05-27 17:50:54 +02:00
|
|
|
PyOS_AfterFork_Parent();
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
|
|
|
|
if (pid == -1)
|
|
|
|
|
return posix_error();
|
|
|
|
|
return PyLong_FromPid(pid);
|
2001-04-11 20:58:20 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_FORK1 */
|
2001-04-11 20:58:20 +00:00
|
|
|
|
|
|
|
|
|
1995-03-01 10:34:45 +00:00
|
|
|
#ifdef HAVE_FORK
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.fork
|
|
|
|
|
|
|
|
|
|
Fork a child process.
|
|
|
|
|
|
|
|
|
|
Return 0 to child process and PID of child to parent process.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
1996-12-10 23:23:01 +00:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_fork_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=3626c81f98985d49 input=13c956413110eeaa]*/
|
1991-06-03 12:42:10 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
pid_t pid;
|
2020-05-01 11:33:44 +02:00
|
|
|
PyInterpreterState *interp = _PyInterpreterState_GET();
|
|
|
|
|
if (interp->config._isolated_interpreter) {
|
|
|
|
|
PyErr_SetString(PyExc_RuntimeError,
|
|
|
|
|
"fork not supported for isolated subinterpreters");
|
2018-09-14 14:17:20 -07:00
|
|
|
return NULL;
|
|
|
|
|
}
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.fork", NULL) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2017-05-27 17:50:54 +02:00
|
|
|
PyOS_BeforeFork();
|
2010-05-06 00:08:46 +00:00
|
|
|
pid = fork();
|
|
|
|
|
if (pid == 0) {
|
|
|
|
|
/* child: this clobbers and resets the import lock. */
|
2017-05-27 17:50:54 +02:00
|
|
|
PyOS_AfterFork_Child();
|
2010-05-06 00:08:46 +00:00
|
|
|
} else {
|
|
|
|
|
/* parent: release the import lock. */
|
2017-05-27 17:50:54 +02:00
|
|
|
PyOS_AfterFork_Parent();
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
|
|
|
|
if (pid == -1)
|
|
|
|
|
return posix_error();
|
|
|
|
|
return PyLong_FromPid(pid);
|
1991-06-03 12:42:10 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_FORK */
|
1991-06-03 12:42:10 +00:00
|
|
|
|
2011-08-02 17:30:04 -05:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
#ifdef HAVE_SCHED_H
|
2011-09-06 19:03:35 +02:00
|
|
|
#ifdef HAVE_SCHED_GET_PRIORITY_MAX
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.sched_get_priority_max
|
|
|
|
|
|
|
|
|
|
policy: int
|
|
|
|
|
|
|
|
|
|
Get the maximum scheduling priority for policy.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_sched_get_priority_max_impl(PyObject *module, int policy)
|
|
|
|
|
/*[clinic end generated code: output=9e465c6e43130521 input=2097b7998eca6874]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
int max;
|
2011-08-02 17:30:04 -05:00
|
|
|
|
|
|
|
|
max = sched_get_priority_max(policy);
|
|
|
|
|
if (max < 0)
|
|
|
|
|
return posix_error();
|
|
|
|
|
return PyLong_FromLong(max);
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.sched_get_priority_min
|
|
|
|
|
|
|
|
|
|
policy: int
|
|
|
|
|
|
|
|
|
|
Get the minimum scheduling priority for policy.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_sched_get_priority_min_impl(PyObject *module, int policy)
|
|
|
|
|
/*[clinic end generated code: output=7595c1138cc47a6d input=21bc8fa0d70983bf]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
int min = sched_get_priority_min(policy);
|
2011-08-02 17:30:04 -05:00
|
|
|
if (min < 0)
|
|
|
|
|
return posix_error();
|
|
|
|
|
return PyLong_FromLong(min);
|
|
|
|
|
}
|
2011-09-06 19:03:35 +02:00
|
|
|
#endif /* HAVE_SCHED_GET_PRIORITY_MAX */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2011-08-02 18:07:32 -05:00
|
|
|
#ifdef HAVE_SCHED_SETSCHEDULER
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.sched_getscheduler
|
|
|
|
|
pid: pid_t
|
|
|
|
|
/
|
|
|
|
|
|
2019-07-31 08:16:13 +10:00
|
|
|
Get the scheduling policy for the process identified by pid.
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
Passing 0 for pid returns the scheduling policy for the calling process.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_sched_getscheduler_impl(PyObject *module, pid_t pid)
|
2019-07-31 08:16:13 +10:00
|
|
|
/*[clinic end generated code: output=dce4c0bd3f1b34c8 input=8d99dac505485ac8]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2011-08-02 17:30:04 -05:00
|
|
|
int policy;
|
|
|
|
|
|
|
|
|
|
policy = sched_getscheduler(pid);
|
|
|
|
|
if (policy < 0)
|
|
|
|
|
return posix_error();
|
|
|
|
|
return PyLong_FromLong(policy);
|
|
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_SCHED_SETSCHEDULER */
|
2011-08-02 17:30:04 -05:00
|
|
|
|
2011-08-02 18:07:32 -05:00
|
|
|
|
2018-10-01 22:19:56 -07:00
|
|
|
#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM)
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
2018-11-13 04:09:31 -08:00
|
|
|
class os.sched_param "PyObject *" "SchedParamType"
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
os.sched_param.__new__
|
|
|
|
|
|
|
|
|
|
sched_priority: object
|
|
|
|
|
A scheduling parameter.
|
|
|
|
|
|
2019-11-05 07:16:14 -08:00
|
|
|
Currently has only one field: sched_priority
|
2014-08-05 14:04:04 +10:00
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
os_sched_param_impl(PyTypeObject *type, PyObject *sched_priority)
|
2019-11-05 07:16:14 -08:00
|
|
|
/*[clinic end generated code: output=48f4067d60f48c13 input=eb42909a2c0e3e6c]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
PyObject *res;
|
2011-08-02 17:30:04 -05:00
|
|
|
|
|
|
|
|
res = PyStructSequence_New(type);
|
|
|
|
|
if (!res)
|
|
|
|
|
return NULL;
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_INCREF(sched_priority);
|
|
|
|
|
PyStructSequence_SET_ITEM(res, 0, sched_priority);
|
2011-08-02 17:30:04 -05:00
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
2015-04-03 23:53:51 +03:00
|
|
|
PyDoc_VAR(os_sched_param__doc__);
|
|
|
|
|
|
2011-08-02 17:30:04 -05:00
|
|
|
static PyStructSequence_Field sched_param_fields[] = {
|
|
|
|
|
{"sched_priority", "the scheduling priority"},
|
|
|
|
|
{0}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static PyStructSequence_Desc sched_param_desc = {
|
|
|
|
|
"sched_param", /* name */
|
2014-08-05 14:04:04 +10:00
|
|
|
os_sched_param__doc__, /* doc */
|
2011-08-02 17:30:04 -05:00
|
|
|
sched_param_fields,
|
|
|
|
|
1
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static int
|
2020-05-10 11:05:29 +02:00
|
|
|
convert_sched_param(PyObject *module, PyObject *param, struct sched_param *res)
|
2011-08-02 17:30:04 -05:00
|
|
|
{
|
|
|
|
|
long priority;
|
|
|
|
|
|
2020-05-10 11:05:29 +02:00
|
|
|
if (!Py_IS_TYPE(param, (PyTypeObject *)get_posix_state(module)->SchedParamType)) {
|
2011-08-02 17:30:04 -05:00
|
|
|
PyErr_SetString(PyExc_TypeError, "must have a sched_param object");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
priority = PyLong_AsLong(PyStructSequence_GET_ITEM(param, 0));
|
|
|
|
|
if (priority == -1 && PyErr_Occurred())
|
|
|
|
|
return 0;
|
|
|
|
|
if (priority > INT_MAX || priority < INT_MIN) {
|
|
|
|
|
PyErr_SetString(PyExc_OverflowError, "sched_priority out of range");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
res->sched_priority = Py_SAFE_DOWNCAST(priority, long, int);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2018-10-01 22:19:56 -07:00
|
|
|
#endif /* defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM) */
|
2011-08-02 17:30:04 -05:00
|
|
|
|
2011-08-02 18:07:32 -05:00
|
|
|
|
|
|
|
|
#ifdef HAVE_SCHED_SETSCHEDULER
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.sched_setscheduler
|
2011-08-02 18:07:32 -05:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
pid: pid_t
|
|
|
|
|
policy: int
|
2020-05-10 11:05:29 +02:00
|
|
|
param as param_obj: object
|
2014-08-05 14:04:04 +10:00
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Set the scheduling policy for the process identified by pid.
|
|
|
|
|
|
|
|
|
|
If pid is 0, the calling process is changed.
|
|
|
|
|
param is an instance of sched_param.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_sched_setscheduler_impl(PyObject *module, pid_t pid, int policy,
|
2020-05-10 11:05:29 +02:00
|
|
|
PyObject *param_obj)
|
|
|
|
|
/*[clinic end generated code: output=cde27faa55dc993e input=73013d731bd8fbe9]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2020-05-10 11:05:29 +02:00
|
|
|
struct sched_param param;
|
|
|
|
|
if (!convert_sched_param(module, param_obj, ¶m)) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2011-09-10 01:40:52 +02:00
|
|
|
/*
|
2011-09-10 01:53:19 +02:00
|
|
|
** sched_setscheduler() returns 0 in Linux, but the previous
|
|
|
|
|
** scheduling policy under Solaris/Illumos, and others.
|
|
|
|
|
** On error, -1 is returned in all Operating Systems.
|
2011-09-10 01:40:52 +02:00
|
|
|
*/
|
2020-05-10 11:05:29 +02:00
|
|
|
if (sched_setscheduler(pid, policy, ¶m) == -1)
|
2011-08-02 17:30:04 -05:00
|
|
|
return posix_error();
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_SCHED_SETSCHEDULER*/
|
2011-08-02 17:30:04 -05:00
|
|
|
|
2011-08-02 18:07:32 -05:00
|
|
|
|
|
|
|
|
#ifdef HAVE_SCHED_SETPARAM
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.sched_getparam
|
|
|
|
|
pid: pid_t
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Returns scheduling parameters for the process identified by pid.
|
2011-08-02 18:07:32 -05:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
If pid is 0, returns parameters for the calling process.
|
|
|
|
|
Return value is an instance of sched_param.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_sched_getparam_impl(PyObject *module, pid_t pid)
|
|
|
|
|
/*[clinic end generated code: output=b194e8708dcf2db8 input=18a1ef9c2efae296]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2011-08-02 17:30:04 -05:00
|
|
|
struct sched_param param;
|
2014-08-05 14:04:04 +10:00
|
|
|
PyObject *result;
|
|
|
|
|
PyObject *priority;
|
2011-08-02 17:30:04 -05:00
|
|
|
|
|
|
|
|
if (sched_getparam(pid, ¶m))
|
|
|
|
|
return posix_error();
|
2020-05-10 11:05:29 +02:00
|
|
|
PyObject *SchedParamType = get_posix_state(module)->SchedParamType;
|
2019-11-05 07:16:14 -08:00
|
|
|
result = PyStructSequence_New((PyTypeObject *)SchedParamType);
|
2014-08-05 14:04:04 +10:00
|
|
|
if (!result)
|
2011-08-02 17:30:04 -05:00
|
|
|
return NULL;
|
|
|
|
|
priority = PyLong_FromLong(param.sched_priority);
|
|
|
|
|
if (!priority) {
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_DECREF(result);
|
2011-08-02 17:30:04 -05:00
|
|
|
return NULL;
|
|
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
PyStructSequence_SET_ITEM(result, 0, priority);
|
|
|
|
|
return result;
|
2011-08-02 17:30:04 -05:00
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.sched_setparam
|
|
|
|
|
pid: pid_t
|
2020-05-10 11:05:29 +02:00
|
|
|
param as param_obj: object
|
2014-08-05 14:04:04 +10:00
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Set scheduling parameters for the process identified by pid.
|
|
|
|
|
|
|
|
|
|
If pid is 0, sets parameters for the calling process.
|
|
|
|
|
param should be an instance of sched_param.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
2011-08-02 17:30:04 -05:00
|
|
|
static PyObject *
|
2020-05-10 11:05:29 +02:00
|
|
|
os_sched_setparam_impl(PyObject *module, pid_t pid, PyObject *param_obj)
|
|
|
|
|
/*[clinic end generated code: output=f19fe020a53741c1 input=27b98337c8b2dcc7]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2020-05-10 11:05:29 +02:00
|
|
|
struct sched_param param;
|
|
|
|
|
if (!convert_sched_param(module, param_obj, ¶m)) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sched_setparam(pid, ¶m))
|
2011-08-02 17:30:04 -05:00
|
|
|
return posix_error();
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_SCHED_SETPARAM */
|
2011-08-02 17:30:04 -05:00
|
|
|
|
2011-08-02 18:07:32 -05:00
|
|
|
|
|
|
|
|
#ifdef HAVE_SCHED_RR_GET_INTERVAL
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.sched_rr_get_interval -> double
|
|
|
|
|
pid: pid_t
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Return the round-robin quantum for the process identified by pid, in seconds.
|
|
|
|
|
|
|
|
|
|
Value returned is a float.
|
|
|
|
|
[clinic start generated code]*/
|
2011-08-02 18:07:32 -05:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
static double
|
2016-07-07 17:35:15 +03:00
|
|
|
os_sched_rr_get_interval_impl(PyObject *module, pid_t pid)
|
|
|
|
|
/*[clinic end generated code: output=7e2d935833ab47dc input=2a973da15cca6fae]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
struct timespec interval;
|
|
|
|
|
if (sched_rr_get_interval(pid, &interval)) {
|
|
|
|
|
posix_error();
|
|
|
|
|
return -1.0;
|
|
|
|
|
}
|
2018-12-30 21:13:02 -08:00
|
|
|
#ifdef _Py_MEMORY_SANITIZER
|
|
|
|
|
__msan_unpoison(&interval, sizeof(interval));
|
|
|
|
|
#endif
|
2014-08-05 14:04:04 +10:00
|
|
|
return (double)interval.tv_sec + 1e-9*interval.tv_nsec;
|
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_SCHED_RR_GET_INTERVAL */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.sched_yield
|
|
|
|
|
|
|
|
|
|
Voluntarily relinquish the CPU.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
2011-08-02 17:30:04 -05:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_sched_yield_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=902323500f222cac input=e54d6f98189391d4]*/
|
2011-08-02 17:30:04 -05:00
|
|
|
{
|
|
|
|
|
if (sched_yield())
|
|
|
|
|
return posix_error();
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
|
|
|
|
|
2011-08-02 17:41:34 -05:00
|
|
|
#ifdef HAVE_SCHED_SETAFFINITY
|
2012-08-04 16:16:35 +02:00
|
|
|
/* The minimum number of CPUs allocated in a cpu_set_t */
|
|
|
|
|
static const int NCPUS_START = sizeof(unsigned long) * CHAR_BIT;
|
2011-08-02 17:30:04 -05:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.sched_setaffinity
|
|
|
|
|
pid: pid_t
|
|
|
|
|
mask : object
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Set the CPU affinity of the process identified by pid to mask.
|
|
|
|
|
|
|
|
|
|
mask should be an iterable of integers identifying CPUs.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_sched_setaffinity_impl(PyObject *module, pid_t pid, PyObject *mask)
|
|
|
|
|
/*[clinic end generated code: output=882d7dd9a229335b input=a0791a597c7085ba]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2012-08-04 16:16:35 +02:00
|
|
|
int ncpus;
|
|
|
|
|
size_t setsize;
|
2014-08-05 14:04:04 +10:00
|
|
|
cpu_set_t *cpu_set = NULL;
|
|
|
|
|
PyObject *iterator = NULL, *item;
|
2011-08-02 17:30:04 -05:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
iterator = PyObject_GetIter(mask);
|
2012-08-04 16:16:35 +02:00
|
|
|
if (iterator == NULL)
|
2011-08-02 17:30:04 -05:00
|
|
|
return NULL;
|
|
|
|
|
|
2012-08-04 16:16:35 +02:00
|
|
|
ncpus = NCPUS_START;
|
|
|
|
|
setsize = CPU_ALLOC_SIZE(ncpus);
|
2014-08-05 14:04:04 +10:00
|
|
|
cpu_set = CPU_ALLOC(ncpus);
|
|
|
|
|
if (cpu_set == NULL) {
|
2012-08-04 16:16:35 +02:00
|
|
|
PyErr_NoMemory();
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
CPU_ZERO_S(setsize, cpu_set);
|
2011-08-02 17:30:04 -05:00
|
|
|
|
2012-08-04 16:16:35 +02:00
|
|
|
while ((item = PyIter_Next(iterator))) {
|
|
|
|
|
long cpu;
|
|
|
|
|
if (!PyLong_Check(item)) {
|
|
|
|
|
PyErr_Format(PyExc_TypeError,
|
|
|
|
|
"expected an iterator of ints, "
|
|
|
|
|
"but iterator yielded %R",
|
|
|
|
|
Py_TYPE(item));
|
|
|
|
|
Py_DECREF(item);
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
cpu = PyLong_AsLong(item);
|
|
|
|
|
Py_DECREF(item);
|
|
|
|
|
if (cpu < 0) {
|
|
|
|
|
if (!PyErr_Occurred())
|
|
|
|
|
PyErr_SetString(PyExc_ValueError, "negative CPU number");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
if (cpu > INT_MAX - 1) {
|
|
|
|
|
PyErr_SetString(PyExc_OverflowError, "CPU number too large");
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
if (cpu >= ncpus) {
|
|
|
|
|
/* Grow CPU mask to fit the CPU number */
|
|
|
|
|
int newncpus = ncpus;
|
|
|
|
|
cpu_set_t *newmask;
|
|
|
|
|
size_t newsetsize;
|
|
|
|
|
while (newncpus <= cpu) {
|
|
|
|
|
if (newncpus > INT_MAX / 2)
|
|
|
|
|
newncpus = cpu + 1;
|
|
|
|
|
else
|
|
|
|
|
newncpus = newncpus * 2;
|
|
|
|
|
}
|
|
|
|
|
newmask = CPU_ALLOC(newncpus);
|
|
|
|
|
if (newmask == NULL) {
|
|
|
|
|
PyErr_NoMemory();
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
newsetsize = CPU_ALLOC_SIZE(newncpus);
|
|
|
|
|
CPU_ZERO_S(newsetsize, newmask);
|
2014-08-05 14:04:04 +10:00
|
|
|
memcpy(newmask, cpu_set, setsize);
|
|
|
|
|
CPU_FREE(cpu_set);
|
2012-08-04 16:16:35 +02:00
|
|
|
setsize = newsetsize;
|
2014-08-05 14:04:04 +10:00
|
|
|
cpu_set = newmask;
|
2012-08-04 16:16:35 +02:00
|
|
|
ncpus = newncpus;
|
|
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
CPU_SET_S(cpu, setsize, cpu_set);
|
2012-08-04 16:16:35 +02:00
|
|
|
}
|
2019-06-27 09:10:57 -07:00
|
|
|
if (PyErr_Occurred()) {
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
2012-08-04 16:16:35 +02:00
|
|
|
Py_CLEAR(iterator);
|
2011-08-02 17:30:04 -05:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
if (sched_setaffinity(pid, setsize, cpu_set)) {
|
2012-08-04 16:16:35 +02:00
|
|
|
posix_error();
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
CPU_FREE(cpu_set);
|
2011-08-02 17:30:04 -05:00
|
|
|
Py_RETURN_NONE;
|
2011-08-10 20:28:54 -05:00
|
|
|
|
2012-08-04 16:16:35 +02:00
|
|
|
error:
|
2014-08-05 14:04:04 +10:00
|
|
|
if (cpu_set)
|
|
|
|
|
CPU_FREE(cpu_set);
|
2012-08-04 16:16:35 +02:00
|
|
|
Py_XDECREF(iterator);
|
|
|
|
|
return NULL;
|
2011-08-02 17:30:04 -05:00
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.sched_getaffinity
|
|
|
|
|
pid: pid_t
|
|
|
|
|
/
|
|
|
|
|
|
2015-07-13 21:01:39 +01:00
|
|
|
Return the affinity of the process identified by pid (or the current process if zero).
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
The affinity is returned as a set of CPU identifiers.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_sched_getaffinity_impl(PyObject *module, pid_t pid)
|
2016-07-07 18:20:03 +03:00
|
|
|
/*[clinic end generated code: output=f726f2c193c17a4f input=983ce7cb4a565980]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2012-08-04 16:16:35 +02:00
|
|
|
int cpu, ncpus, count;
|
|
|
|
|
size_t setsize;
|
|
|
|
|
cpu_set_t *mask = NULL;
|
|
|
|
|
PyObject *res = NULL;
|
2011-08-02 17:30:04 -05:00
|
|
|
|
2012-08-04 16:16:35 +02:00
|
|
|
ncpus = NCPUS_START;
|
|
|
|
|
while (1) {
|
|
|
|
|
setsize = CPU_ALLOC_SIZE(ncpus);
|
|
|
|
|
mask = CPU_ALLOC(ncpus);
|
|
|
|
|
if (mask == NULL)
|
|
|
|
|
return PyErr_NoMemory();
|
|
|
|
|
if (sched_getaffinity(pid, setsize, mask) == 0)
|
|
|
|
|
break;
|
|
|
|
|
CPU_FREE(mask);
|
|
|
|
|
if (errno != EINVAL)
|
|
|
|
|
return posix_error();
|
|
|
|
|
if (ncpus > INT_MAX / 2) {
|
|
|
|
|
PyErr_SetString(PyExc_OverflowError, "could not allocate "
|
|
|
|
|
"a large enough CPU set");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
ncpus = ncpus * 2;
|
2011-08-02 17:30:04 -05:00
|
|
|
}
|
2012-08-04 16:16:35 +02:00
|
|
|
|
|
|
|
|
res = PySet_New(NULL);
|
|
|
|
|
if (res == NULL)
|
|
|
|
|
goto error;
|
|
|
|
|
for (cpu = 0, count = CPU_COUNT_S(setsize, mask); count; cpu++) {
|
|
|
|
|
if (CPU_ISSET_S(cpu, setsize, mask)) {
|
|
|
|
|
PyObject *cpu_num = PyLong_FromLong(cpu);
|
|
|
|
|
--count;
|
|
|
|
|
if (cpu_num == NULL)
|
|
|
|
|
goto error;
|
|
|
|
|
if (PySet_Add(res, cpu_num)) {
|
|
|
|
|
Py_DECREF(cpu_num);
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
Py_DECREF(cpu_num);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
CPU_FREE(mask);
|
|
|
|
|
return res;
|
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
if (mask)
|
|
|
|
|
CPU_FREE(mask);
|
|
|
|
|
Py_XDECREF(res);
|
|
|
|
|
return NULL;
|
2011-08-02 17:30:04 -05:00
|
|
|
}
|
|
|
|
|
|
2011-08-02 17:41:34 -05:00
|
|
|
#endif /* HAVE_SCHED_SETAFFINITY */
|
|
|
|
|
|
2011-08-02 17:30:04 -05:00
|
|
|
#endif /* HAVE_SCHED_H */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2003-03-21 01:43:31 +00:00
|
|
|
/* AIX uses /dev/ptc but is otherwise the same as /dev/ptmx */
|
2003-03-21 03:08:31 +00:00
|
|
|
/* IRIX has both /dev/ptc and /dev/ptmx, use ptmx */
|
|
|
|
|
#if defined(HAVE_DEV_PTC) && !defined(HAVE_DEV_PTMX)
|
2003-03-21 01:43:31 +00:00
|
|
|
#define DEV_PTY_FILE "/dev/ptc"
|
|
|
|
|
#define HAVE_DEV_PTMX
|
|
|
|
|
#else
|
|
|
|
|
#define DEV_PTY_FILE "/dev/ptmx"
|
|
|
|
|
#endif
|
|
|
|
|
|
2002-12-31 12:55:15 +00:00
|
|
|
#if defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) || defined(HAVE_DEV_PTMX)
|
2000-06-28 16:40:38 +00:00
|
|
|
#ifdef HAVE_PTY_H
|
|
|
|
|
#include <pty.h>
|
|
|
|
|
#else
|
|
|
|
|
#ifdef HAVE_LIBUTIL_H
|
|
|
|
|
#include <libutil.h>
|
2010-02-07 19:56:39 +00:00
|
|
|
#else
|
|
|
|
|
#ifdef HAVE_UTIL_H
|
|
|
|
|
#include <util.h>
|
|
|
|
|
#endif /* HAVE_UTIL_H */
|
2000-06-28 16:40:38 +00:00
|
|
|
#endif /* HAVE_LIBUTIL_H */
|
|
|
|
|
#endif /* HAVE_PTY_H */
|
2003-01-01 09:51:12 +00:00
|
|
|
#ifdef HAVE_STROPTS_H
|
|
|
|
|
#include <stropts.h>
|
2002-12-31 12:55:15 +00:00
|
|
|
#endif
|
2018-02-14 11:54:28 -08:00
|
|
|
#endif /* defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) || defined(HAVE_DEV_PTMX) */
|
2000-06-28 16:40:38 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2002-12-31 12:55:15 +00:00
|
|
|
#if defined(HAVE_OPENPTY) || defined(HAVE__GETPTY) || defined(HAVE_DEV_PTMX)
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.openpty
|
|
|
|
|
|
|
|
|
|
Open a pseudo-terminal.
|
|
|
|
|
|
|
|
|
|
Return a tuple of (master_fd, slave_fd) containing open file descriptors
|
|
|
|
|
for both the master and slave ends.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_openpty_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=98841ce5ec9cef3c input=f3d99fd99e762907]*/
|
2000-06-28 16:40:38 +00:00
|
|
|
{
|
2013-08-28 00:53:59 +02:00
|
|
|
int master_fd = -1, slave_fd = -1;
|
2000-07-14 14:28:33 +00:00
|
|
|
#ifndef HAVE_OPENPTY
|
2010-05-06 00:08:46 +00:00
|
|
|
char * slave_name;
|
2002-12-31 12:55:15 +00:00
|
|
|
#endif
|
|
|
|
|
#if defined(HAVE_DEV_PTMX) && !defined(HAVE_OPENPTY) && !defined(HAVE__GETPTY)
|
2010-05-06 00:08:46 +00:00
|
|
|
PyOS_sighandler_t sig_saved;
|
2018-12-31 03:16:40 +01:00
|
|
|
#if defined(__sun) && defined(__SVR4)
|
2010-05-06 00:08:46 +00:00
|
|
|
extern char *ptsname(int fildes);
|
2002-12-31 12:55:15 +00:00
|
|
|
#endif
|
2000-07-14 14:28:33 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_OPENPTY
|
2010-05-06 00:08:46 +00:00
|
|
|
if (openpty(&master_fd, &slave_fd, NULL, NULL, NULL) != 0)
|
2013-08-28 00:53:59 +02:00
|
|
|
goto posix_error;
|
|
|
|
|
|
|
|
|
|
if (_Py_set_inheritable(master_fd, 0, NULL) < 0)
|
|
|
|
|
goto error;
|
|
|
|
|
if (_Py_set_inheritable(slave_fd, 0, NULL) < 0)
|
|
|
|
|
goto error;
|
|
|
|
|
|
2003-03-21 01:43:31 +00:00
|
|
|
#elif defined(HAVE__GETPTY)
|
2010-05-06 00:08:46 +00:00
|
|
|
slave_name = _getpty(&master_fd, O_RDWR, 0666, 0);
|
|
|
|
|
if (slave_name == NULL)
|
2013-08-28 00:53:59 +02:00
|
|
|
goto posix_error;
|
|
|
|
|
if (_Py_set_inheritable(master_fd, 0, NULL) < 0)
|
|
|
|
|
goto error;
|
2000-07-14 14:28:33 +00:00
|
|
|
|
2013-08-28 00:53:59 +02:00
|
|
|
slave_fd = _Py_open(slave_name, O_RDWR);
|
2010-05-06 00:08:46 +00:00
|
|
|
if (slave_fd < 0)
|
2015-03-18 00:22:14 +01:00
|
|
|
goto error;
|
2013-08-28 00:53:59 +02:00
|
|
|
|
2002-12-31 12:55:15 +00:00
|
|
|
#else
|
2013-11-25 23:19:58 +01:00
|
|
|
master_fd = open(DEV_PTY_FILE, O_RDWR | O_NOCTTY); /* open master */
|
2010-05-06 00:08:46 +00:00
|
|
|
if (master_fd < 0)
|
2013-08-28 00:53:59 +02:00
|
|
|
goto posix_error;
|
|
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
sig_saved = PyOS_setsig(SIGCHLD, SIG_DFL);
|
2013-08-28 00:53:59 +02:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
/* change permission of slave */
|
|
|
|
|
if (grantpt(master_fd) < 0) {
|
|
|
|
|
PyOS_setsig(SIGCHLD, sig_saved);
|
2013-08-28 00:53:59 +02:00
|
|
|
goto posix_error;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2013-08-28 00:53:59 +02:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
/* unlock slave */
|
|
|
|
|
if (unlockpt(master_fd) < 0) {
|
|
|
|
|
PyOS_setsig(SIGCHLD, sig_saved);
|
2013-08-28 00:53:59 +02:00
|
|
|
goto posix_error;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2013-08-28 00:53:59 +02:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
PyOS_setsig(SIGCHLD, sig_saved);
|
2013-08-28 00:53:59 +02:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
slave_name = ptsname(master_fd); /* get name of slave */
|
|
|
|
|
if (slave_name == NULL)
|
2013-08-28 00:53:59 +02:00
|
|
|
goto posix_error;
|
|
|
|
|
|
|
|
|
|
slave_fd = _Py_open(slave_name, O_RDWR | O_NOCTTY); /* open slave */
|
2015-03-18 00:22:14 +01:00
|
|
|
if (slave_fd == -1)
|
|
|
|
|
goto error;
|
2013-11-25 23:19:58 +01:00
|
|
|
|
|
|
|
|
if (_Py_set_inheritable(master_fd, 0, NULL) < 0)
|
|
|
|
|
goto posix_error;
|
|
|
|
|
|
2016-04-26 17:04:18 +02:00
|
|
|
#if !defined(__CYGWIN__) && !defined(__ANDROID__) && !defined(HAVE_DEV_PTC)
|
2010-05-06 00:08:46 +00:00
|
|
|
ioctl(slave_fd, I_PUSH, "ptem"); /* push ptem */
|
|
|
|
|
ioctl(slave_fd, I_PUSH, "ldterm"); /* push ldterm */
|
2002-12-31 16:16:07 +00:00
|
|
|
#ifndef __hpux
|
2010-05-06 00:08:46 +00:00
|
|
|
ioctl(slave_fd, I_PUSH, "ttcompat"); /* push ttcompat */
|
2002-12-31 16:16:07 +00:00
|
|
|
#endif /* __hpux */
|
2002-12-31 12:55:15 +00:00
|
|
|
#endif /* HAVE_CYGWIN */
|
2000-07-24 16:06:23 +00:00
|
|
|
#endif /* HAVE_OPENPTY */
|
2000-07-14 14:28:33 +00:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
return Py_BuildValue("(ii)", master_fd, slave_fd);
|
2000-07-14 14:28:33 +00:00
|
|
|
|
2013-08-28 00:53:59 +02:00
|
|
|
posix_error:
|
|
|
|
|
posix_error();
|
|
|
|
|
error:
|
|
|
|
|
if (master_fd != -1)
|
|
|
|
|
close(master_fd);
|
|
|
|
|
if (slave_fd != -1)
|
|
|
|
|
close(slave_fd);
|
|
|
|
|
return NULL;
|
2000-06-28 16:40:38 +00:00
|
|
|
}
|
2002-12-31 12:55:15 +00:00
|
|
|
#endif /* defined(HAVE_OPENPTY) || defined(HAVE__GETPTY) || defined(HAVE_DEV_PTMX) */
|
2000-06-28 16:40:38 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2000-06-28 16:40:38 +00:00
|
|
|
#ifdef HAVE_FORKPTY
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.forkpty
|
|
|
|
|
|
|
|
|
|
Fork a new process with a new pseudo-terminal as controlling tty.
|
|
|
|
|
|
|
|
|
|
Returns a tuple of (pid, master_fd).
|
|
|
|
|
Like fork(), return pid of 0 to the child process,
|
|
|
|
|
and pid of child to the parent process.
|
|
|
|
|
To both, return fd of newly opened pseudo-terminal.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_forkpty_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=60d0a5c7512e4087 input=f1f7f4bae3966010]*/
|
2000-06-28 16:40:38 +00:00
|
|
|
{
|
2017-05-27 17:50:54 +02:00
|
|
|
int master_fd = -1;
|
2010-05-06 00:08:46 +00:00
|
|
|
pid_t pid;
|
|
|
|
|
|
2020-04-14 15:14:01 +02:00
|
|
|
if (_PyInterpreterState_GET() != PyInterpreterState_Main()) {
|
2018-09-14 14:17:20 -07:00
|
|
|
PyErr_SetString(PyExc_RuntimeError, "fork not supported for subinterpreters");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.forkpty", NULL) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2017-05-27 17:50:54 +02:00
|
|
|
PyOS_BeforeFork();
|
2010-05-06 00:08:46 +00:00
|
|
|
pid = forkpty(&master_fd, NULL, NULL, NULL);
|
|
|
|
|
if (pid == 0) {
|
|
|
|
|
/* child: this clobbers and resets the import lock. */
|
2017-05-27 17:50:54 +02:00
|
|
|
PyOS_AfterFork_Child();
|
2010-05-06 00:08:46 +00:00
|
|
|
} else {
|
|
|
|
|
/* parent: release the import lock. */
|
2017-05-27 17:50:54 +02:00
|
|
|
PyOS_AfterFork_Parent();
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
|
|
|
|
if (pid == -1)
|
|
|
|
|
return posix_error();
|
|
|
|
|
return Py_BuildValue("(Ni)", PyLong_FromPid(pid), master_fd);
|
2000-06-28 16:40:38 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_FORKPTY */
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2011-03-17 20:20:30 +02:00
|
|
|
|
1995-03-01 10:34:45 +00:00
|
|
|
#ifdef HAVE_GETEGID
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.getegid
|
|
|
|
|
|
|
|
|
|
Return the current process's effective group id.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
1996-12-10 23:23:01 +00:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_getegid_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=67d9be7ac68898a2 input=1596f79ad1107d5d]*/
|
1992-05-15 11:05:24 +00:00
|
|
|
{
|
2013-02-10 21:56:49 +02:00
|
|
|
return _PyLong_FromGid(getegid());
|
1992-05-15 11:05:24 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_GETEGID */
|
1992-05-15 11:05:24 +00:00
|
|
|
|
1997-06-02 22:20:51 +00:00
|
|
|
|
1995-03-01 10:34:45 +00:00
|
|
|
#ifdef HAVE_GETEUID
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.geteuid
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Return the current process's effective user id.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
1996-12-10 23:23:01 +00:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_geteuid_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=ea1b60f0d6abb66e input=4644c662d3bd9f19]*/
|
1991-06-03 12:42:10 +00:00
|
|
|
{
|
2014-08-05 14:04:04 +10:00
|
|
|
return _PyLong_FromUid(geteuid());
|
1991-06-03 12:42:10 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_GETEUID */
|
1991-06-03 12:42:10 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
#ifdef HAVE_GETGID
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.getgid
|
|
|
|
|
|
|
|
|
|
Return the current process's group id.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_getgid_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=4f28ebc9d3e5dfcf input=58796344cd87c0f6]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
return _PyLong_FromGid(getgid());
|
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_GETGID */
|
|
|
|
|
|
|
|
|
|
|
2016-09-15 20:45:16 +03:00
|
|
|
#ifdef HAVE_GETPID
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.getpid
|
|
|
|
|
|
|
|
|
|
Return the current process id.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_getpid_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=9ea6fdac01ed2b3c input=5a9a00f0ab68aa00]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
return PyLong_FromPid(getpid());
|
|
|
|
|
}
|
2016-09-15 20:45:16 +03:00
|
|
|
#endif /* HAVE_GETPID */
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2019-06-13 00:01:29 -07:00
|
|
|
#ifdef NGROUPS_MAX
|
|
|
|
|
#define MAX_GROUPS NGROUPS_MAX
|
|
|
|
|
#else
|
|
|
|
|
/* defined to be 16 on Solaris7, so this should be a small number */
|
|
|
|
|
#define MAX_GROUPS 64
|
|
|
|
|
#endif
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
#ifdef HAVE_GETGROUPLIST
|
|
|
|
|
|
2020-04-18 19:14:10 +03:00
|
|
|
#ifdef __APPLE__
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.getgrouplist
|
|
|
|
|
|
|
|
|
|
user: str
|
|
|
|
|
username to lookup
|
|
|
|
|
group as basegid: int
|
|
|
|
|
base group id of the user
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Returns a list of groups to which a user belongs.
|
|
|
|
|
[clinic start generated code]*/
|
2011-06-10 07:30:30 +02:00
|
|
|
|
|
|
|
|
static PyObject *
|
2020-04-18 19:14:10 +03:00
|
|
|
os_getgrouplist_impl(PyObject *module, const char *user, int basegid)
|
|
|
|
|
/*[clinic end generated code: output=6e734697b8c26de0 input=f8d870374b09a490]*/
|
|
|
|
|
#else
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.getgrouplist
|
|
|
|
|
|
|
|
|
|
user: str
|
|
|
|
|
username to lookup
|
|
|
|
|
group as basegid: gid_t
|
|
|
|
|
base group id of the user
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Returns a list of groups to which a user belongs.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
os_getgrouplist_impl(PyObject *module, const char *user, gid_t basegid)
|
|
|
|
|
/*[clinic end generated code: output=0ebd7fb70115575b input=cc61d5c20b08958d]*/
|
|
|
|
|
#endif
|
2011-06-10 07:30:30 +02:00
|
|
|
{
|
|
|
|
|
int i, ngroups;
|
|
|
|
|
PyObject *list;
|
|
|
|
|
#ifdef __APPLE__
|
2020-04-18 19:14:10 +03:00
|
|
|
int *groups;
|
2011-06-10 07:30:30 +02:00
|
|
|
#else
|
2020-04-18 19:14:10 +03:00
|
|
|
gid_t *groups;
|
2011-06-10 07:30:30 +02:00
|
|
|
#endif
|
2019-06-13 00:01:29 -07:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* NGROUPS_MAX is defined by POSIX.1 as the maximum
|
|
|
|
|
* number of supplimental groups a users can belong to.
|
|
|
|
|
* We have to increment it by one because
|
|
|
|
|
* getgrouplist() returns both the supplemental groups
|
|
|
|
|
* and the primary group, i.e. all of the groups the
|
|
|
|
|
* user belongs to.
|
|
|
|
|
*/
|
|
|
|
|
ngroups = 1 + MAX_GROUPS;
|
2011-06-10 07:30:30 +02:00
|
|
|
|
2020-03-24 18:22:10 +01:00
|
|
|
while (1) {
|
2011-06-10 07:30:30 +02:00
|
|
|
#ifdef __APPLE__
|
2020-03-24 18:22:10 +01:00
|
|
|
groups = PyMem_New(int, ngroups);
|
2011-06-10 07:30:30 +02:00
|
|
|
#else
|
2020-03-24 18:22:10 +01:00
|
|
|
groups = PyMem_New(gid_t, ngroups);
|
2011-06-10 07:30:30 +02:00
|
|
|
#endif
|
2020-03-24 18:22:10 +01:00
|
|
|
if (groups == NULL) {
|
|
|
|
|
return PyErr_NoMemory();
|
|
|
|
|
}
|
2011-06-10 07:30:30 +02:00
|
|
|
|
2020-03-24 18:22:10 +01:00
|
|
|
int old_ngroups = ngroups;
|
|
|
|
|
if (getgrouplist(user, basegid, groups, &ngroups) != -1) {
|
|
|
|
|
/* Success */
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* getgrouplist() fails if the group list is too small */
|
2020-03-23 20:00:57 +01:00
|
|
|
PyMem_Free(groups);
|
|
|
|
|
|
2020-03-24 18:22:10 +01:00
|
|
|
if (ngroups > old_ngroups) {
|
|
|
|
|
/* If the group list is too small, the glibc implementation of
|
|
|
|
|
getgrouplist() sets ngroups to the total number of groups and
|
|
|
|
|
returns -1. */
|
2020-03-23 20:00:57 +01:00
|
|
|
}
|
2020-03-24 18:22:10 +01:00
|
|
|
else {
|
|
|
|
|
/* Double the group list size */
|
|
|
|
|
if (ngroups > INT_MAX / 2) {
|
|
|
|
|
return PyErr_NoMemory();
|
|
|
|
|
}
|
|
|
|
|
ngroups *= 2;
|
2020-03-23 20:00:57 +01:00
|
|
|
}
|
2020-03-24 18:22:10 +01:00
|
|
|
|
|
|
|
|
/* Retry getgrouplist() with a larger group list */
|
2020-03-23 20:00:57 +01:00
|
|
|
}
|
2011-06-10 07:30:30 +02:00
|
|
|
|
2018-12-30 21:13:02 -08:00
|
|
|
#ifdef _Py_MEMORY_SANITIZER
|
|
|
|
|
/* Clang memory sanitizer libc intercepts don't know getgrouplist. */
|
|
|
|
|
__msan_unpoison(&ngroups, sizeof(ngroups));
|
|
|
|
|
__msan_unpoison(groups, ngroups*sizeof(*groups));
|
|
|
|
|
#endif
|
|
|
|
|
|
2011-06-10 07:30:30 +02:00
|
|
|
list = PyList_New(ngroups);
|
|
|
|
|
if (list == NULL) {
|
|
|
|
|
PyMem_Del(groups);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < ngroups; i++) {
|
2013-02-10 21:56:49 +02:00
|
|
|
#ifdef __APPLE__
|
2011-06-10 07:30:30 +02:00
|
|
|
PyObject *o = PyLong_FromUnsignedLong((unsigned long)groups[i]);
|
2013-02-10 21:56:49 +02:00
|
|
|
#else
|
|
|
|
|
PyObject *o = _PyLong_FromGid(groups[i]);
|
|
|
|
|
#endif
|
2011-06-10 07:30:30 +02:00
|
|
|
if (o == NULL) {
|
|
|
|
|
Py_DECREF(list);
|
|
|
|
|
PyMem_Del(groups);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
PyList_SET_ITEM(list, i, o);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PyMem_Del(groups);
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_GETGROUPLIST */
|
|
|
|
|
|
1997-06-02 22:20:51 +00:00
|
|
|
|
1999-12-13 16:37:25 +00:00
|
|
|
#ifdef HAVE_GETGROUPS
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.getgroups
|
|
|
|
|
|
|
|
|
|
Return list of supplemental group IDs for the process.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
1999-12-13 16:37:25 +00:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_getgroups_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=42b0c17758561b56 input=d3f109412e6a155c]*/
|
1999-12-13 16:37:25 +00:00
|
|
|
{
|
|
|
|
|
PyObject *result = NULL;
|
2010-05-06 00:08:46 +00:00
|
|
|
gid_t grouplist[MAX_GROUPS];
|
2010-07-23 13:53:51 +00:00
|
|
|
|
2011-02-25 14:39:16 +00:00
|
|
|
/* On MacOSX getgroups(2) can return more than MAX_GROUPS results
|
2010-07-23 13:53:51 +00:00
|
|
|
* This is a helper variable to store the intermediate result when
|
|
|
|
|
* that happens.
|
|
|
|
|
*
|
|
|
|
|
* To keep the code readable the OSX behaviour is unconditional,
|
|
|
|
|
* according to the POSIX spec this should be safe on all unix-y
|
|
|
|
|
* systems.
|
|
|
|
|
*/
|
|
|
|
|
gid_t* alt_grouplist = grouplist;
|
2010-05-06 00:08:46 +00:00
|
|
|
int n;
|
1999-12-13 16:37:25 +00:00
|
|
|
|
2013-08-01 21:21:15 -07:00
|
|
|
#ifdef __APPLE__
|
|
|
|
|
/* Issue #17557: As of OS X 10.8, getgroups(2) no longer raises EINVAL if
|
|
|
|
|
* there are more groups than can fit in grouplist. Therefore, on OS X
|
|
|
|
|
* always first call getgroups with length 0 to get the actual number
|
|
|
|
|
* of groups.
|
|
|
|
|
*/
|
|
|
|
|
n = getgroups(0, NULL);
|
|
|
|
|
if (n < 0) {
|
|
|
|
|
return posix_error();
|
|
|
|
|
} else if (n <= MAX_GROUPS) {
|
|
|
|
|
/* groups will fit in existing array */
|
|
|
|
|
alt_grouplist = grouplist;
|
|
|
|
|
} else {
|
2015-02-16 13:33:32 +02:00
|
|
|
alt_grouplist = PyMem_New(gid_t, n);
|
2013-08-01 21:21:15 -07:00
|
|
|
if (alt_grouplist == NULL) {
|
2018-12-07 03:11:30 -07:00
|
|
|
return PyErr_NoMemory();
|
2013-08-01 21:21:15 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
n = getgroups(n, alt_grouplist);
|
|
|
|
|
if (n == -1) {
|
|
|
|
|
if (alt_grouplist != grouplist) {
|
|
|
|
|
PyMem_Free(alt_grouplist);
|
|
|
|
|
}
|
|
|
|
|
return posix_error();
|
|
|
|
|
}
|
|
|
|
|
#else
|
2010-05-06 00:08:46 +00:00
|
|
|
n = getgroups(MAX_GROUPS, grouplist);
|
2010-07-23 13:53:51 +00:00
|
|
|
if (n < 0) {
|
|
|
|
|
if (errno == EINVAL) {
|
|
|
|
|
n = getgroups(0, NULL);
|
|
|
|
|
if (n == -1) {
|
|
|
|
|
return posix_error();
|
|
|
|
|
}
|
|
|
|
|
if (n == 0) {
|
|
|
|
|
/* Avoid malloc(0) */
|
|
|
|
|
alt_grouplist = grouplist;
|
|
|
|
|
} else {
|
2015-02-16 13:33:32 +02:00
|
|
|
alt_grouplist = PyMem_New(gid_t, n);
|
2010-07-23 13:53:51 +00:00
|
|
|
if (alt_grouplist == NULL) {
|
2018-12-07 03:11:30 -07:00
|
|
|
return PyErr_NoMemory();
|
2010-07-23 13:53:51 +00:00
|
|
|
}
|
|
|
|
|
n = getgroups(n, alt_grouplist);
|
|
|
|
|
if (n == -1) {
|
|
|
|
|
PyMem_Free(alt_grouplist);
|
|
|
|
|
return posix_error();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return posix_error();
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-08-01 21:21:15 -07:00
|
|
|
#endif
|
|
|
|
|
|
2010-07-23 13:53:51 +00:00
|
|
|
result = PyList_New(n);
|
|
|
|
|
if (result != NULL) {
|
2010-05-06 00:08:46 +00:00
|
|
|
int i;
|
|
|
|
|
for (i = 0; i < n; ++i) {
|
2013-02-10 21:56:49 +02:00
|
|
|
PyObject *o = _PyLong_FromGid(alt_grouplist[i]);
|
2010-05-06 00:08:46 +00:00
|
|
|
if (o == NULL) {
|
2010-11-26 16:16:47 +00:00
|
|
|
Py_DECREF(result);
|
|
|
|
|
result = NULL;
|
|
|
|
|
break;
|
1999-12-13 16:37:25 +00:00
|
|
|
}
|
2010-05-06 00:08:46 +00:00
|
|
|
PyList_SET_ITEM(result, i, o);
|
1999-12-13 16:37:25 +00:00
|
|
|
}
|
2010-07-23 13:53:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (alt_grouplist != grouplist) {
|
|
|
|
|
PyMem_Free(alt_grouplist);
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2003-02-17 18:17:05 +00:00
|
|
|
|
1999-12-13 16:37:25 +00:00
|
|
|
return result;
|
|
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_GETGROUPS */
|
1999-12-13 16:37:25 +00:00
|
|
|
|
2009-12-02 20:46:48 +00:00
|
|
|
#ifdef HAVE_INITGROUPS
|
2020-04-18 19:14:10 +03:00
|
|
|
#ifdef __APPLE__
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.initgroups
|
|
|
|
|
|
|
|
|
|
username as oname: FSConverter
|
|
|
|
|
gid: int
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Initialize the group access list.
|
|
|
|
|
|
|
|
|
|
Call the system initgroups() to initialize the group access list with all of
|
|
|
|
|
the groups of which the specified username is a member, plus the specified
|
|
|
|
|
group id.
|
|
|
|
|
[clinic start generated code]*/
|
2009-12-02 20:46:48 +00:00
|
|
|
|
|
|
|
|
static PyObject *
|
2020-04-18 19:14:10 +03:00
|
|
|
os_initgroups_impl(PyObject *module, PyObject *oname, int gid)
|
|
|
|
|
/*[clinic end generated code: output=7f074d30a425fd3a input=df3d54331b0af204]*/
|
2013-02-10 21:56:49 +02:00
|
|
|
#else
|
2020-04-18 19:14:10 +03:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.initgroups
|
2009-12-02 20:46:48 +00:00
|
|
|
|
2020-04-18 19:14:10 +03:00
|
|
|
username as oname: FSConverter
|
|
|
|
|
gid: gid_t
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Initialize the group access list.
|
|
|
|
|
|
|
|
|
|
Call the system initgroups() to initialize the group access list with all of
|
|
|
|
|
the groups of which the specified username is a member, plus the specified
|
|
|
|
|
group id.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
os_initgroups_impl(PyObject *module, PyObject *oname, gid_t gid)
|
|
|
|
|
/*[clinic end generated code: output=59341244521a9e3f input=0cb91bdc59a4c564]*/
|
2013-02-10 21:56:49 +02:00
|
|
|
#endif
|
2020-04-18 19:14:10 +03:00
|
|
|
{
|
|
|
|
|
const char *username = PyBytes_AS_STRING(oname);
|
2009-12-02 20:46:48 +00:00
|
|
|
|
2020-04-18 19:14:10 +03:00
|
|
|
if (initgroups(username, gid) == -1)
|
2010-05-06 00:08:46 +00:00
|
|
|
return PyErr_SetFromErrno(PyExc_OSError);
|
2009-12-02 20:46:48 +00:00
|
|
|
|
2017-01-23 09:47:21 +02:00
|
|
|
Py_RETURN_NONE;
|
2009-12-02 20:46:48 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_INITGROUPS */
|
|
|
|
|
|
2009-12-02 20:46:48 +00:00
|
|
|
|
2002-06-13 21:09:11 +00:00
|
|
|
#ifdef HAVE_GETPGID
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.getpgid
|
|
|
|
|
|
|
|
|
|
pid: pid_t
|
|
|
|
|
|
|
|
|
|
Call the system call getpgid(), and return the result.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_getpgid_impl(PyObject *module, pid_t pid)
|
|
|
|
|
/*[clinic end generated code: output=1db95a97be205d18 input=39d710ae3baaf1c7]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
pid_t pgid = getpgid(pid);
|
2010-05-06 00:08:46 +00:00
|
|
|
if (pgid < 0)
|
|
|
|
|
return posix_error();
|
|
|
|
|
return PyLong_FromPid(pgid);
|
2002-06-13 21:09:11 +00:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_GETPGID */
|
|
|
|
|
|
|
|
|
|
|
1994-08-01 11:34:53 +00:00
|
|
|
#ifdef HAVE_GETPGRP
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.getpgrp
|
|
|
|
|
|
|
|
|
|
Return the current process group id.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
1996-12-10 23:23:01 +00:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_getpgrp_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=c4fc381e51103cf3 input=6846fb2bb9a3705e]*/
|
1991-06-04 20:23:49 +00:00
|
|
|
{
|
1994-08-01 11:34:53 +00:00
|
|
|
#ifdef GETPGRP_HAVE_ARG
|
2010-05-06 00:08:46 +00:00
|
|
|
return PyLong_FromPid(getpgrp(0));
|
1994-08-18 15:42:46 +00:00
|
|
|
#else /* GETPGRP_HAVE_ARG */
|
2010-05-06 00:08:46 +00:00
|
|
|
return PyLong_FromPid(getpgrp());
|
1994-08-18 15:42:46 +00:00
|
|
|
#endif /* GETPGRP_HAVE_ARG */
|
1991-06-04 20:23:49 +00:00
|
|
|
}
|
1994-08-01 11:34:53 +00:00
|
|
|
#endif /* HAVE_GETPGRP */
|
1991-06-04 20:23:49 +00:00
|
|
|
|
1997-06-02 22:20:51 +00:00
|
|
|
|
1994-08-01 11:34:53 +00:00
|
|
|
#ifdef HAVE_SETPGRP
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.setpgrp
|
|
|
|
|
|
|
|
|
|
Make the current process the leader of its process group.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
1996-12-10 23:23:01 +00:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_setpgrp_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=2554735b0a60f0a0 input=1f0619fcb5731e7e]*/
|
1992-09-13 20:07:29 +00:00
|
|
|
{
|
1994-10-20 21:56:42 +00:00
|
|
|
#ifdef SETPGRP_HAVE_ARG
|
2010-05-06 00:08:46 +00:00
|
|
|
if (setpgrp(0, 0) < 0)
|
1994-10-20 21:56:42 +00:00
|
|
|
#else /* SETPGRP_HAVE_ARG */
|
2010-05-06 00:08:46 +00:00
|
|
|
if (setpgrp() < 0)
|
1994-10-20 21:56:42 +00:00
|
|
|
#endif /* SETPGRP_HAVE_ARG */
|
2010-05-06 00:08:46 +00:00
|
|
|
return posix_error();
|
2017-01-23 09:47:21 +02:00
|
|
|
Py_RETURN_NONE;
|
1992-09-13 20:07:29 +00:00
|
|
|
}
|
1994-08-01 11:34:53 +00:00
|
|
|
#endif /* HAVE_SETPGRP */
|
|
|
|
|
|
1995-03-01 10:34:45 +00:00
|
|
|
#ifdef HAVE_GETPPID
|
2010-09-07 21:31:17 +00:00
|
|
|
|
|
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
#include <tlhelp32.h>
|
|
|
|
|
|
|
|
|
|
static PyObject*
|
|
|
|
|
win32_getppid()
|
|
|
|
|
{
|
|
|
|
|
HANDLE snapshot;
|
|
|
|
|
pid_t mypid;
|
|
|
|
|
PyObject* result = NULL;
|
|
|
|
|
BOOL have_record;
|
|
|
|
|
PROCESSENTRY32 pe;
|
|
|
|
|
|
|
|
|
|
mypid = getpid(); /* This function never fails */
|
|
|
|
|
|
|
|
|
|
snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
|
|
|
|
|
if (snapshot == INVALID_HANDLE_VALUE)
|
|
|
|
|
return PyErr_SetFromWindowsErr(GetLastError());
|
|
|
|
|
|
|
|
|
|
pe.dwSize = sizeof(pe);
|
|
|
|
|
have_record = Process32First(snapshot, &pe);
|
|
|
|
|
while (have_record) {
|
|
|
|
|
if (mypid == (pid_t)pe.th32ProcessID) {
|
|
|
|
|
/* We could cache the ulong value in a static variable. */
|
|
|
|
|
result = PyLong_FromPid((pid_t)pe.th32ParentProcessID);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
have_record = Process32Next(snapshot, &pe);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If our loop exits and our pid was not found (result will be NULL)
|
|
|
|
|
* then GetLastError will return ERROR_NO_MORE_FILES. This is an
|
|
|
|
|
* error anyway, so let's raise it. */
|
|
|
|
|
if (!result)
|
|
|
|
|
result = PyErr_SetFromWindowsErr(GetLastError());
|
|
|
|
|
|
|
|
|
|
CloseHandle(snapshot);
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
#endif /*MS_WINDOWS*/
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.getppid
|
|
|
|
|
|
|
|
|
|
Return the parent's process id.
|
|
|
|
|
|
|
|
|
|
If the parent process has already exited, Windows machines will still
|
|
|
|
|
return its id; others systems will return the id of the 'init' process (1).
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_getppid_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=43b2a946a8c603b4 input=e637cb87539c030e]*/
|
1991-06-03 12:42:10 +00:00
|
|
|
{
|
2010-09-07 21:31:17 +00:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
return win32_getppid();
|
|
|
|
|
#else
|
2010-05-06 00:08:46 +00:00
|
|
|
return PyLong_FromPid(getppid());
|
1995-03-01 10:34:45 +00:00
|
|
|
#endif
|
2010-09-07 21:31:17 +00:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_GETPPID */
|
1991-06-03 12:42:10 +00:00
|
|
|
|
1997-06-02 22:20:51 +00:00
|
|
|
|
1999-12-14 21:25:03 +00:00
|
|
|
#ifdef HAVE_GETLOGIN
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.getlogin
|
|
|
|
|
|
|
|
|
|
Return the actual login name.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
1999-12-14 21:25:03 +00:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_getlogin_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=a32e66a7e5715dac input=2a21ab1e917163df]*/
|
1999-12-14 21:25:03 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
PyObject *result = NULL;
|
2011-02-25 14:39:16 +00:00
|
|
|
#ifdef MS_WINDOWS
|
2010-09-23 20:04:14 +00:00
|
|
|
wchar_t user_name[UNLEN + 1];
|
2011-09-29 00:42:28 +02:00
|
|
|
DWORD num_chars = Py_ARRAY_LENGTH(user_name);
|
2010-09-23 20:04:14 +00:00
|
|
|
|
|
|
|
|
if (GetUserNameW(user_name, &num_chars)) {
|
|
|
|
|
/* num_chars is the number of unicode chars plus null terminator */
|
|
|
|
|
result = PyUnicode_FromWideChar(user_name, num_chars - 1);
|
2011-02-25 14:39:16 +00:00
|
|
|
}
|
|
|
|
|
else
|
2010-09-23 20:04:14 +00:00
|
|
|
result = PyErr_SetFromWindowsErr(GetLastError());
|
|
|
|
|
#else
|
2010-05-06 00:08:46 +00:00
|
|
|
char *name;
|
|
|
|
|
int old_errno = errno;
|
2000-12-06 21:24:28 +00:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
errno = 0;
|
|
|
|
|
name = getlogin();
|
|
|
|
|
if (name == NULL) {
|
|
|
|
|
if (errno)
|
2010-08-15 09:33:08 +00:00
|
|
|
posix_error();
|
1999-12-14 21:25:03 +00:00
|
|
|
else
|
2010-08-15 09:33:08 +00:00
|
|
|
PyErr_SetString(PyExc_OSError, "unable to determine login name");
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
|
|
|
|
else
|
2010-08-15 09:33:08 +00:00
|
|
|
result = PyUnicode_DecodeFSDefault(name);
|
2010-05-06 00:08:46 +00:00
|
|
|
errno = old_errno;
|
2010-09-23 20:04:14 +00:00
|
|
|
#endif
|
1999-12-14 21:25:03 +00:00
|
|
|
return result;
|
|
|
|
|
}
|
2010-09-23 20:04:14 +00:00
|
|
|
#endif /* HAVE_GETLOGIN */
|
1999-12-14 21:25:03 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
1995-03-01 10:34:45 +00:00
|
|
|
#ifdef HAVE_GETUID
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.getuid
|
|
|
|
|
|
|
|
|
|
Return the current process's user id.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
1996-12-10 23:23:01 +00:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_getuid_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=415c0b401ebed11a input=b53c8b35f110a516]*/
|
1992-05-15 11:05:24 +00:00
|
|
|
{
|
2013-02-10 21:56:49 +02:00
|
|
|
return _PyLong_FromUid(getuid());
|
1992-05-15 11:05:24 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_GETUID */
|
|
|
|
|
|
1992-05-15 11:05:24 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
#define HAVE_KILL
|
|
|
|
|
#endif /* MS_WINDOWS */
|
1997-06-02 22:20:51 +00:00
|
|
|
|
1995-03-01 10:34:45 +00:00
|
|
|
#ifdef HAVE_KILL
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.kill
|
|
|
|
|
|
|
|
|
|
pid: pid_t
|
|
|
|
|
signal: Py_ssize_t
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Kill a process with a signal.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
2002-02-16 23:35:41 +00:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_kill_impl(PyObject *module, pid_t pid, Py_ssize_t signal)
|
|
|
|
|
/*[clinic end generated code: output=8e346a6701c88568 input=61a36b86ca275ab9]*/
|
2002-02-16 23:35:41 +00:00
|
|
|
{
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.kill", "in", pid, signal) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
#ifndef MS_WINDOWS
|
2014-08-05 14:04:04 +10:00
|
|
|
if (kill(pid, (int)signal) == -1)
|
2010-05-06 00:08:46 +00:00
|
|
|
return posix_error();
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
#else /* !MS_WINDOWS */
|
2010-05-15 20:35:12 +00:00
|
|
|
PyObject *result;
|
2014-08-05 14:04:04 +10:00
|
|
|
DWORD sig = (DWORD)signal;
|
|
|
|
|
DWORD err;
|
2010-05-06 00:08:46 +00:00
|
|
|
HANDLE handle;
|
|
|
|
|
|
|
|
|
|
/* Console processes which share a common console can be sent CTRL+C or
|
|
|
|
|
CTRL+BREAK events, provided they handle said events. */
|
|
|
|
|
if (sig == CTRL_C_EVENT || sig == CTRL_BREAK_EVENT) {
|
2013-06-05 23:29:30 +01:00
|
|
|
if (GenerateConsoleCtrlEvent(sig, (DWORD)pid) == 0) {
|
2010-05-06 00:08:46 +00:00
|
|
|
err = GetLastError();
|
|
|
|
|
PyErr_SetFromWindowsErr(err);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If the signal is outside of what GenerateConsoleCtrlEvent can use,
|
|
|
|
|
attempt to open and terminate the process. */
|
2013-06-05 23:29:30 +01:00
|
|
|
handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, (DWORD)pid);
|
2010-05-06 00:08:46 +00:00
|
|
|
if (handle == NULL) {
|
|
|
|
|
err = GetLastError();
|
|
|
|
|
return PyErr_SetFromWindowsErr(err);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (TerminateProcess(handle, sig) == 0) {
|
|
|
|
|
err = GetLastError();
|
|
|
|
|
result = PyErr_SetFromWindowsErr(err);
|
|
|
|
|
} else {
|
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
|
result = Py_None;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CloseHandle(handle);
|
|
|
|
|
return result;
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* !MS_WINDOWS */
|
2020-02-12 23:47:42 -08:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_KILL */
|
2010-04-12 17:16:38 +00:00
|
|
|
|
1996-06-28 18:55:32 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
#ifdef HAVE_KILLPG
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.killpg
|
1996-06-28 18:55:32 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
pgid: pid_t
|
|
|
|
|
signal: int
|
|
|
|
|
/
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Kill a process group with a signal.
|
|
|
|
|
[clinic start generated code]*/
|
1996-06-28 18:55:32 +00:00
|
|
|
|
2000-07-13 01:26:58 +00:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_killpg_impl(PyObject *module, pid_t pgid, int signal)
|
|
|
|
|
/*[clinic end generated code: output=6dbcd2f1fdf5fdba input=38b5449eb8faec19]*/
|
2000-07-13 01:26:58 +00:00
|
|
|
{
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.killpg", "ii", pgid, signal) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
/* XXX some man pages make the `pgid` parameter an int, others
|
|
|
|
|
a pid_t. Since getpgrp() returns a pid_t, we assume killpg should
|
|
|
|
|
take the same type. Moreover, pid_t is always at least as wide as
|
|
|
|
|
int (else compilation of this module fails), which is safe. */
|
|
|
|
|
if (killpg(pgid, signal) == -1)
|
|
|
|
|
return posix_error();
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_KILLPG */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_PLOCK
|
|
|
|
|
#ifdef HAVE_SYS_LOCK_H
|
|
|
|
|
#include <sys/lock.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.plock
|
|
|
|
|
op: int
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Lock program segments into memory.");
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_plock_impl(PyObject *module, int op)
|
|
|
|
|
/*[clinic end generated code: output=81424167033b168e input=e6e5e348e1525f60]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
if (plock(op) == -1)
|
|
|
|
|
return posix_error();
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_PLOCK */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SETUID
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.setuid
|
|
|
|
|
|
|
|
|
|
uid: uid_t
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Set the current process's user id.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_setuid_impl(PyObject *module, uid_t uid)
|
|
|
|
|
/*[clinic end generated code: output=a0a41fd0d1ec555f input=c921a3285aa22256]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
if (setuid(uid) < 0)
|
|
|
|
|
return posix_error();
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_SETUID */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SETEUID
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.seteuid
|
|
|
|
|
|
|
|
|
|
euid: uid_t
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Set the current process's effective user id.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_seteuid_impl(PyObject *module, uid_t euid)
|
|
|
|
|
/*[clinic end generated code: output=102e3ad98361519a input=ba93d927e4781aa9]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
if (seteuid(euid) < 0)
|
|
|
|
|
return posix_error();
|
|
|
|
|
Py_RETURN_NONE;
|
2000-07-13 01:26:58 +00:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_SETEUID */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2000-07-13 01:26:58 +00:00
|
|
|
#ifdef HAVE_SETEGID
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.setegid
|
|
|
|
|
|
|
|
|
|
egid: gid_t
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Set the current process's effective group id.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_setegid_impl(PyObject *module, gid_t egid)
|
|
|
|
|
/*[clinic end generated code: output=4e4b825a6a10258d input=4080526d0ccd6ce3]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
if (setegid(egid) < 0)
|
2010-05-06 00:08:46 +00:00
|
|
|
return posix_error();
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
2000-07-13 01:26:58 +00:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_SETEGID */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2000-07-13 01:26:58 +00:00
|
|
|
#ifdef HAVE_SETREUID
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.setreuid
|
|
|
|
|
|
|
|
|
|
ruid: uid_t
|
|
|
|
|
euid: uid_t
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Set the current process's real and effective user ids.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_setreuid_impl(PyObject *module, uid_t ruid, uid_t euid)
|
|
|
|
|
/*[clinic end generated code: output=62d991210006530a input=0ca8978de663880c]*/
|
2000-07-13 01:26:58 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
if (setreuid(ruid, euid) < 0) {
|
|
|
|
|
return posix_error();
|
|
|
|
|
} else {
|
2017-01-23 09:47:21 +02:00
|
|
|
Py_RETURN_NONE;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2000-07-13 01:26:58 +00:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_SETREUID */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2000-07-13 01:26:58 +00:00
|
|
|
#ifdef HAVE_SETREGID
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.setregid
|
|
|
|
|
|
|
|
|
|
rgid: gid_t
|
|
|
|
|
egid: gid_t
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Set the current process's real and effective group ids.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_setregid_impl(PyObject *module, gid_t rgid, gid_t egid)
|
|
|
|
|
/*[clinic end generated code: output=aa803835cf5342f3 input=c59499f72846db78]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
if (setregid(rgid, egid) < 0)
|
2010-05-06 00:08:46 +00:00
|
|
|
return posix_error();
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
2000-07-13 01:26:58 +00:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_SETREGID */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
1994-08-01 11:34:53 +00:00
|
|
|
#ifdef HAVE_SETGID
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.setgid
|
|
|
|
|
gid: gid_t
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Set the current process's group id.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_setgid_impl(PyObject *module, gid_t gid)
|
|
|
|
|
/*[clinic end generated code: output=bdccd7403f6ad8c3 input=27d30c4059045dc6]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
if (setgid(gid) < 0)
|
|
|
|
|
return posix_error();
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
1993-11-10 09:23:53 +00:00
|
|
|
}
|
1994-08-18 15:42:46 +00:00
|
|
|
#endif /* HAVE_SETGID */
|
1993-11-10 09:23:53 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2001-10-18 04:06:00 +00:00
|
|
|
#ifdef HAVE_SETGROUPS
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.setgroups
|
|
|
|
|
|
|
|
|
|
groups: object
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Set the groups of the current process to list.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
2001-10-18 04:06:00 +00:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_setgroups(PyObject *module, PyObject *groups)
|
|
|
|
|
/*[clinic end generated code: output=3fcb32aad58c5ecd input=fa742ca3daf85a7e]*/
|
2001-10-18 04:06:00 +00:00
|
|
|
{
|
2017-04-19 20:03:52 +03:00
|
|
|
Py_ssize_t i, len;
|
2010-05-06 00:08:46 +00:00
|
|
|
gid_t grouplist[MAX_GROUPS];
|
|
|
|
|
|
|
|
|
|
if (!PySequence_Check(groups)) {
|
|
|
|
|
PyErr_SetString(PyExc_TypeError, "setgroups argument must be a sequence");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
len = PySequence_Size(groups);
|
2017-04-19 20:03:52 +03:00
|
|
|
if (len < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2010-05-06 00:08:46 +00:00
|
|
|
if (len > MAX_GROUPS) {
|
|
|
|
|
PyErr_SetString(PyExc_ValueError, "too many groups");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
for(i = 0; i < len; i++) {
|
|
|
|
|
PyObject *elem;
|
|
|
|
|
elem = PySequence_GetItem(groups, i);
|
|
|
|
|
if (!elem)
|
|
|
|
|
return NULL;
|
|
|
|
|
if (!PyLong_Check(elem)) {
|
|
|
|
|
PyErr_SetString(PyExc_TypeError,
|
|
|
|
|
"groups must be integers");
|
|
|
|
|
Py_DECREF(elem);
|
|
|
|
|
return NULL;
|
|
|
|
|
} else {
|
2013-02-10 21:56:49 +02:00
|
|
|
if (!_Py_Gid_Converter(elem, &grouplist[i])) {
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_DECREF(elem);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Py_DECREF(elem);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (setgroups(len, grouplist) < 0)
|
|
|
|
|
return posix_error();
|
2017-01-23 09:47:21 +02:00
|
|
|
Py_RETURN_NONE;
|
2001-10-18 04:06:00 +00:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_SETGROUPS */
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2006-04-21 10:40:58 +00:00
|
|
|
#if defined(HAVE_WAIT3) || defined(HAVE_WAIT4)
|
|
|
|
|
static PyObject *
|
2020-05-10 11:05:29 +02:00
|
|
|
wait_helper(PyObject *module, pid_t pid, int status, struct rusage *ru)
|
2006-04-21 10:40:58 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
PyObject *result;
|
2019-11-05 07:16:14 -08:00
|
|
|
PyObject *struct_rusage;
|
2006-04-21 10:40:58 +00:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
if (pid == -1)
|
|
|
|
|
return posix_error();
|
2006-04-21 10:40:58 +00:00
|
|
|
|
2019-09-09 09:48:32 -06:00
|
|
|
// If wait succeeded but no child was ready to report status, ru will not
|
|
|
|
|
// have been populated.
|
|
|
|
|
if (pid == 0) {
|
|
|
|
|
memset(ru, 0, sizeof(*ru));
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-05 07:16:14 -08:00
|
|
|
PyObject *m = PyImport_ImportModuleNoBlock("resource");
|
|
|
|
|
if (m == NULL)
|
|
|
|
|
return NULL;
|
2020-05-10 11:05:29 +02:00
|
|
|
struct_rusage = PyObject_GetAttr(m, get_posix_state(module)->struct_rusage);
|
2019-11-05 07:16:14 -08:00
|
|
|
Py_DECREF(m);
|
|
|
|
|
if (struct_rusage == NULL)
|
|
|
|
|
return NULL;
|
2006-04-21 10:40:58 +00:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
/* XXX(nnorwitz): Copied (w/mods) from resource.c, there should be only one. */
|
|
|
|
|
result = PyStructSequence_New((PyTypeObject*) struct_rusage);
|
2019-11-25 19:07:37 -08:00
|
|
|
Py_DECREF(struct_rusage);
|
2010-05-06 00:08:46 +00:00
|
|
|
if (!result)
|
|
|
|
|
return NULL;
|
2006-04-21 10:40:58 +00:00
|
|
|
|
|
|
|
|
#ifndef doubletime
|
|
|
|
|
#define doubletime(TV) ((double)(TV).tv_sec + (TV).tv_usec * 0.000001)
|
|
|
|
|
#endif
|
|
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
PyStructSequence_SET_ITEM(result, 0,
|
2012-02-08 23:03:19 +01:00
|
|
|
PyFloat_FromDouble(doubletime(ru->ru_utime)));
|
2010-05-06 00:08:46 +00:00
|
|
|
PyStructSequence_SET_ITEM(result, 1,
|
2012-02-08 23:03:19 +01:00
|
|
|
PyFloat_FromDouble(doubletime(ru->ru_stime)));
|
2006-04-21 10:40:58 +00:00
|
|
|
#define SET_INT(result, index, value)\
|
2010-05-06 00:08:46 +00:00
|
|
|
PyStructSequence_SET_ITEM(result, index, PyLong_FromLong(value))
|
|
|
|
|
SET_INT(result, 2, ru->ru_maxrss);
|
|
|
|
|
SET_INT(result, 3, ru->ru_ixrss);
|
|
|
|
|
SET_INT(result, 4, ru->ru_idrss);
|
|
|
|
|
SET_INT(result, 5, ru->ru_isrss);
|
|
|
|
|
SET_INT(result, 6, ru->ru_minflt);
|
|
|
|
|
SET_INT(result, 7, ru->ru_majflt);
|
|
|
|
|
SET_INT(result, 8, ru->ru_nswap);
|
|
|
|
|
SET_INT(result, 9, ru->ru_inblock);
|
|
|
|
|
SET_INT(result, 10, ru->ru_oublock);
|
|
|
|
|
SET_INT(result, 11, ru->ru_msgsnd);
|
|
|
|
|
SET_INT(result, 12, ru->ru_msgrcv);
|
|
|
|
|
SET_INT(result, 13, ru->ru_nsignals);
|
|
|
|
|
SET_INT(result, 14, ru->ru_nvcsw);
|
|
|
|
|
SET_INT(result, 15, ru->ru_nivcsw);
|
2006-04-21 10:40:58 +00:00
|
|
|
#undef SET_INT
|
|
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
if (PyErr_Occurred()) {
|
|
|
|
|
Py_DECREF(result);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2006-04-21 10:40:58 +00:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
return Py_BuildValue("NiN", PyLong_FromPid(pid), status, result);
|
2006-04-21 10:40:58 +00:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_WAIT3 || HAVE_WAIT4 */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2006-04-21 10:40:58 +00:00
|
|
|
#ifdef HAVE_WAIT3
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.wait3
|
|
|
|
|
|
|
|
|
|
options: int
|
|
|
|
|
Wait for completion of a child process.
|
|
|
|
|
|
|
|
|
|
Returns a tuple of information about the child process:
|
|
|
|
|
(pid, status, rusage)
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_wait3_impl(PyObject *module, int options)
|
|
|
|
|
/*[clinic end generated code: output=92c3224e6f28217a input=8ac4c56956b61710]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
pid_t pid;
|
|
|
|
|
struct rusage ru;
|
2015-02-07 13:27:50 +00:00
|
|
|
int async_err = 0;
|
2014-08-05 14:04:04 +10:00
|
|
|
WAIT_TYPE status;
|
|
|
|
|
WAIT_STATUS_INT(status) = 0;
|
|
|
|
|
|
2015-02-07 13:27:50 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
pid = wait3(&status, options, &ru);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (pid < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
|
|
|
|
if (pid < 0)
|
|
|
|
|
return (!async_err) ? posix_error() : NULL;
|
2006-04-21 10:40:58 +00:00
|
|
|
|
2020-05-10 11:05:29 +02:00
|
|
|
return wait_helper(module, pid, WAIT_STATUS_INT(status), &ru);
|
2006-04-21 10:40:58 +00:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_WAIT3 */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2006-04-21 10:40:58 +00:00
|
|
|
#ifdef HAVE_WAIT4
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
|
|
|
|
|
os.wait4
|
|
|
|
|
|
|
|
|
|
pid: pid_t
|
|
|
|
|
options: int
|
|
|
|
|
|
|
|
|
|
Wait for completion of a specific child process.
|
|
|
|
|
|
|
|
|
|
Returns a tuple of information about the child process:
|
|
|
|
|
(pid, status, rusage)
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_wait4_impl(PyObject *module, pid_t pid, int options)
|
|
|
|
|
/*[clinic end generated code: output=66195aa507b35f70 input=d11deed0750600ba]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2015-02-07 13:27:50 +00:00
|
|
|
pid_t res;
|
2010-05-06 00:08:46 +00:00
|
|
|
struct rusage ru;
|
2015-02-07 13:27:50 +00:00
|
|
|
int async_err = 0;
|
2010-05-06 00:08:46 +00:00
|
|
|
WAIT_TYPE status;
|
|
|
|
|
WAIT_STATUS_INT(status) = 0;
|
2006-04-21 10:40:58 +00:00
|
|
|
|
2015-02-07 13:27:50 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
res = wait4(pid, &status, options, &ru);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (res < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
|
|
|
|
if (res < 0)
|
|
|
|
|
return (!async_err) ? posix_error() : NULL;
|
2006-04-21 10:40:58 +00:00
|
|
|
|
2020-05-10 11:05:29 +02:00
|
|
|
return wait_helper(module, res, WAIT_STATUS_INT(status), &ru);
|
2006-04-21 10:40:58 +00:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_WAIT4 */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2011-03-17 20:20:30 +02:00
|
|
|
#if defined(HAVE_WAITID) && !defined(__APPLE__)
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.waitid
|
|
|
|
|
|
|
|
|
|
idtype: idtype_t
|
|
|
|
|
Must be one of be P_PID, P_PGID or P_ALL.
|
|
|
|
|
id: id_t
|
|
|
|
|
The id to wait on.
|
|
|
|
|
options: int
|
|
|
|
|
Constructed from the ORing of one or more of WEXITED, WSTOPPED
|
|
|
|
|
or WCONTINUED and additionally may be ORed with WNOHANG or WNOWAIT.
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Returns the result of waiting for a process or processes.
|
|
|
|
|
|
|
|
|
|
Returns either waitid_result or None if WNOHANG is specified and there are
|
|
|
|
|
no children in a waitable state.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_waitid_impl(PyObject *module, idtype_t idtype, id_t id, int options)
|
|
|
|
|
/*[clinic end generated code: output=5d2e1c0bde61f4d8 input=d8e7f76e052b7920]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
PyObject *result;
|
|
|
|
|
int res;
|
2015-02-07 13:27:50 +00:00
|
|
|
int async_err = 0;
|
2011-03-17 20:20:30 +02:00
|
|
|
siginfo_t si;
|
|
|
|
|
si.si_pid = 0;
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2015-02-07 13:27:50 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
res = waitid(idtype, id, &si, options);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (res < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
|
|
|
|
if (res < 0)
|
|
|
|
|
return (!async_err) ? posix_error() : NULL;
|
2011-03-17 20:20:30 +02:00
|
|
|
|
|
|
|
|
if (si.si_pid == 0)
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
|
2020-03-16 21:15:01 +08:00
|
|
|
PyObject *WaitidResultType = get_posix_state(module)->WaitidResultType;
|
2019-11-05 07:16:14 -08:00
|
|
|
result = PyStructSequence_New((PyTypeObject *)WaitidResultType);
|
2011-03-17 20:20:30 +02:00
|
|
|
if (!result)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
PyStructSequence_SET_ITEM(result, 0, PyLong_FromPid(si.si_pid));
|
2013-02-10 21:56:49 +02:00
|
|
|
PyStructSequence_SET_ITEM(result, 1, _PyLong_FromUid(si.si_uid));
|
2011-03-17 20:20:30 +02:00
|
|
|
PyStructSequence_SET_ITEM(result, 2, PyLong_FromLong((long)(si.si_signo)));
|
|
|
|
|
PyStructSequence_SET_ITEM(result, 3, PyLong_FromLong((long)(si.si_status)));
|
|
|
|
|
PyStructSequence_SET_ITEM(result, 4, PyLong_FromLong((long)(si.si_code)));
|
|
|
|
|
if (PyErr_Occurred()) {
|
|
|
|
|
Py_DECREF(result);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* defined(HAVE_WAITID) && !defined(__APPLE__) */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(HAVE_WAITPID)
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.waitpid
|
|
|
|
|
pid: pid_t
|
|
|
|
|
options: int
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Wait for completion of a given child process.
|
|
|
|
|
|
|
|
|
|
Returns a tuple of information regarding the child process:
|
|
|
|
|
(pid, status)
|
|
|
|
|
|
|
|
|
|
The options argument is ignored on Windows.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_waitpid_impl(PyObject *module, pid_t pid, int options)
|
|
|
|
|
/*[clinic end generated code: output=5c37c06887a20270 input=0bf1666b8758fda3]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2015-02-07 13:27:50 +00:00
|
|
|
pid_t res;
|
|
|
|
|
int async_err = 0;
|
2010-05-06 00:08:46 +00:00
|
|
|
WAIT_TYPE status;
|
|
|
|
|
WAIT_STATUS_INT(status) = 0;
|
1999-01-27 17:53:11 +00:00
|
|
|
|
2015-02-07 13:27:50 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
res = waitpid(pid, &status, options);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (res < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
|
|
|
|
if (res < 0)
|
|
|
|
|
return (!async_err) ? posix_error() : NULL;
|
2006-04-21 10:40:58 +00:00
|
|
|
|
2015-02-07 13:27:50 +00:00
|
|
|
return Py_BuildValue("Ni", PyLong_FromPid(res), WAIT_STATUS_INT(status));
|
1992-08-09 12:55:27 +00:00
|
|
|
}
|
2002-02-01 11:27:43 +00:00
|
|
|
#elif defined(HAVE_CWAIT)
|
|
|
|
|
/* MS C has a variant of waitpid() that's usable for most purposes. */
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.waitpid
|
2016-09-06 13:47:26 -07:00
|
|
|
pid: intptr_t
|
2014-08-05 14:04:04 +10:00
|
|
|
options: int
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Wait for completion of a given process.
|
|
|
|
|
|
|
|
|
|
Returns a tuple of information regarding the process:
|
|
|
|
|
(pid, status << 8)
|
|
|
|
|
|
|
|
|
|
The options argument is ignored on Windows.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-09-06 13:47:26 -07:00
|
|
|
os_waitpid_impl(PyObject *module, intptr_t pid, int options)
|
2016-09-06 15:54:20 -07:00
|
|
|
/*[clinic end generated code: output=be836b221271d538 input=40f2440c515410f8]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
int status;
|
2016-09-06 13:47:26 -07:00
|
|
|
intptr_t res;
|
2015-02-07 13:27:50 +00:00
|
|
|
int async_err = 0;
|
2002-02-01 11:27:43 +00:00
|
|
|
|
2015-02-07 13:27:50 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2016-11-19 18:33:39 -08:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
2015-02-07 13:27:50 +00:00
|
|
|
res = _cwait(&status, pid, options);
|
2016-11-19 18:33:39 -08:00
|
|
|
_Py_END_SUPPRESS_IPH
|
2015-02-07 13:27:50 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (res < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
2015-09-15 10:11:03 +02:00
|
|
|
if (res < 0)
|
2015-02-07 13:27:50 +00:00
|
|
|
return (!async_err) ? posix_error() : NULL;
|
2006-04-21 10:40:58 +00:00
|
|
|
|
2020-04-22 16:30:35 +02:00
|
|
|
unsigned long long ustatus = (unsigned int)status;
|
|
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
/* shift the status left a byte so this is more like the POSIX waitpid */
|
2020-04-22 16:30:35 +02:00
|
|
|
return Py_BuildValue(_Py_PARSE_INTPTR "K", res, ustatus << 8);
|
2002-02-01 11:27:43 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif
|
|
|
|
|
|
1997-06-02 22:20:51 +00:00
|
|
|
|
1995-03-01 10:34:45 +00:00
|
|
|
#ifdef HAVE_WAIT
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.wait
|
|
|
|
|
|
|
|
|
|
Wait for completion of a child process.
|
|
|
|
|
|
|
|
|
|
Returns a tuple of information about the child process:
|
|
|
|
|
(pid, status)
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
1996-12-10 23:23:01 +00:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_wait_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=6bc419ac32fb364b input=03b0182d4a4700ce]*/
|
1992-08-09 12:55:27 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
pid_t pid;
|
2015-02-07 13:27:50 +00:00
|
|
|
int async_err = 0;
|
2010-05-06 00:08:46 +00:00
|
|
|
WAIT_TYPE status;
|
|
|
|
|
WAIT_STATUS_INT(status) = 0;
|
2003-02-17 18:17:05 +00:00
|
|
|
|
2015-02-07 13:27:50 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
pid = wait(&status);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (pid < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
|
|
|
|
if (pid < 0)
|
|
|
|
|
return (!async_err) ? posix_error() : NULL;
|
2006-04-21 10:40:58 +00:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
return Py_BuildValue("Ni", PyLong_FromPid(pid), WAIT_STATUS_INT(status));
|
1991-06-03 12:42:10 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_WAIT */
|
1991-06-03 12:42:10 +00:00
|
|
|
|
2019-11-05 19:21:29 -08:00
|
|
|
#if defined(__linux__) && defined(__NR_pidfd_open)
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.pidfd_open
|
|
|
|
|
pid: pid_t
|
|
|
|
|
flags: unsigned_int = 0
|
|
|
|
|
|
|
|
|
|
Return a file descriptor referring to the process *pid*.
|
|
|
|
|
|
|
|
|
|
The descriptor can be used to perform process management without races and
|
|
|
|
|
signals.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
os_pidfd_open_impl(PyObject *module, pid_t pid, unsigned int flags)
|
|
|
|
|
/*[clinic end generated code: output=5c7252698947dc41 input=c3fd99ce947ccfef]*/
|
|
|
|
|
{
|
|
|
|
|
int fd = syscall(__NR_pidfd_open, pid, flags);
|
|
|
|
|
if (fd < 0) {
|
|
|
|
|
return posix_error();
|
|
|
|
|
}
|
|
|
|
|
return PyLong_FromLong(fd);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
#if defined(HAVE_READLINK) || defined(MS_WINDOWS)
|
2018-09-17 15:38:27 +03:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.readlink
|
|
|
|
|
|
|
|
|
|
path: path_t
|
|
|
|
|
*
|
|
|
|
|
dir_fd: dir_fd(requires='readlinkat') = None
|
|
|
|
|
|
|
|
|
|
Return a string representing the path to which the symbolic link points.
|
|
|
|
|
|
|
|
|
|
If dir_fd is not None, it should be a file descriptor open to a directory,
|
|
|
|
|
and path should be relative; path will then be relative to that directory.
|
|
|
|
|
|
|
|
|
|
dir_fd may not be implemented on your platform. If it is unavailable,
|
|
|
|
|
using it will raise a NotImplementedError.
|
|
|
|
|
[clinic start generated code]*/
|
1997-06-02 22:20:51 +00:00
|
|
|
|
1996-12-10 23:23:01 +00:00
|
|
|
static PyObject *
|
2018-09-17 15:38:27 +03:00
|
|
|
os_readlink_impl(PyObject *module, path_t *path, int dir_fd)
|
|
|
|
|
/*[clinic end generated code: output=d21b732a2e814030 input=113c87e0db1ecaf2]*/
|
1990-10-14 12:07:46 +00:00
|
|
|
{
|
2018-08-15 13:03:41 +03:00
|
|
|
#if defined(HAVE_READLINK)
|
2016-09-23 20:24:28 +02:00
|
|
|
char buffer[MAXPATHLEN+1];
|
2012-06-22 16:30:09 -07:00
|
|
|
ssize_t length;
|
2020-11-22 11:18:40 +01:00
|
|
|
#ifdef HAVE_READLINKAT
|
|
|
|
|
int readlinkat_unavailable = 0;
|
|
|
|
|
#endif
|
2010-05-06 00:08:46 +00:00
|
|
|
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef HAVE_READLINKAT
|
2020-11-22 11:18:40 +01:00
|
|
|
if (dir_fd != DEFAULT_DIR_FD) {
|
|
|
|
|
if (HAVE_READLINKAT_RUNTIME) {
|
|
|
|
|
length = readlinkat(dir_fd, path->narrow, buffer, MAXPATHLEN);
|
|
|
|
|
} else {
|
|
|
|
|
readlinkat_unavailable = 1;
|
|
|
|
|
}
|
|
|
|
|
} else
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
2018-09-17 15:38:27 +03:00
|
|
|
length = readlink(path->narrow, buffer, MAXPATHLEN);
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
|
2020-11-22 11:18:40 +01:00
|
|
|
#ifdef HAVE_READLINKAT
|
|
|
|
|
if (readlinkat_unavailable) {
|
|
|
|
|
argument_unavailable_error(NULL, "dir_fd");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
if (length < 0) {
|
2018-09-17 15:38:27 +03:00
|
|
|
return path_error(path);
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
2016-09-23 20:24:28 +02:00
|
|
|
buffer[length] = '\0';
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2018-09-17 15:38:27 +03:00
|
|
|
if (PyUnicode_Check(path->object))
|
|
|
|
|
return PyUnicode_DecodeFSDefaultAndSize(buffer, length);
|
2010-05-14 16:35:39 +00:00
|
|
|
else
|
2018-09-17 15:38:27 +03:00
|
|
|
return PyBytes_FromStringAndSize(buffer, length);
|
2018-08-15 13:03:41 +03:00
|
|
|
#elif defined(MS_WINDOWS)
|
2018-09-17 15:38:27 +03:00
|
|
|
DWORD n_bytes_returned;
|
2019-08-21 15:27:33 -07:00
|
|
|
DWORD io_result = 0;
|
2018-09-17 15:38:27 +03:00
|
|
|
HANDLE reparse_point_handle;
|
|
|
|
|
char target_buffer[_Py_MAXIMUM_REPARSE_DATA_BUFFER_SIZE];
|
|
|
|
|
_Py_REPARSE_DATA_BUFFER *rdb = (_Py_REPARSE_DATA_BUFFER *)target_buffer;
|
2019-09-03 12:50:51 -07:00
|
|
|
PyObject *result = NULL;
|
2018-09-17 15:38:27 +03:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
/* First get a handle to the reparse point */
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
reparse_point_handle = CreateFileW(
|
2018-09-17 15:38:27 +03:00
|
|
|
path->wide,
|
2014-08-05 14:04:04 +10:00
|
|
|
0,
|
|
|
|
|
0,
|
|
|
|
|
0,
|
|
|
|
|
OPEN_EXISTING,
|
|
|
|
|
FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS,
|
|
|
|
|
0);
|
2019-08-21 15:27:33 -07:00
|
|
|
if (reparse_point_handle != INVALID_HANDLE_VALUE) {
|
|
|
|
|
/* New call DeviceIoControl to read the reparse point */
|
|
|
|
|
io_result = DeviceIoControl(
|
|
|
|
|
reparse_point_handle,
|
|
|
|
|
FSCTL_GET_REPARSE_POINT,
|
|
|
|
|
0, 0, /* in buffer */
|
|
|
|
|
target_buffer, sizeof(target_buffer),
|
|
|
|
|
&n_bytes_returned,
|
|
|
|
|
0 /* we're not using OVERLAPPED_IO */
|
|
|
|
|
);
|
|
|
|
|
CloseHandle(reparse_point_handle);
|
2018-08-15 13:03:41 +03:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
|
2018-08-15 13:03:41 +03:00
|
|
|
if (io_result == 0) {
|
2018-09-17 15:38:27 +03:00
|
|
|
return path_error(path);
|
2018-08-15 13:03:41 +03:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2019-08-21 15:27:33 -07:00
|
|
|
wchar_t *name = NULL;
|
|
|
|
|
Py_ssize_t nameLen = 0;
|
|
|
|
|
if (rdb->ReparseTag == IO_REPARSE_TAG_SYMLINK)
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2019-08-21 15:27:33 -07:00
|
|
|
name = (wchar_t *)((char*)rdb->SymbolicLinkReparseBuffer.PathBuffer +
|
|
|
|
|
rdb->SymbolicLinkReparseBuffer.SubstituteNameOffset);
|
|
|
|
|
nameLen = rdb->SymbolicLinkReparseBuffer.SubstituteNameLength / sizeof(wchar_t);
|
2014-08-05 14:04:04 +10:00
|
|
|
}
|
2019-08-21 15:27:33 -07:00
|
|
|
else if (rdb->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT)
|
|
|
|
|
{
|
|
|
|
|
name = (wchar_t *)((char*)rdb->MountPointReparseBuffer.PathBuffer +
|
|
|
|
|
rdb->MountPointReparseBuffer.SubstituteNameOffset);
|
|
|
|
|
nameLen = rdb->MountPointReparseBuffer.SubstituteNameLength / sizeof(wchar_t);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
PyErr_SetString(PyExc_ValueError, "not a symbolic link");
|
|
|
|
|
}
|
|
|
|
|
if (name) {
|
|
|
|
|
if (nameLen > 4 && wcsncmp(name, L"\\??\\", 4) == 0) {
|
|
|
|
|
/* Our buffer is mutable, so this is okay */
|
|
|
|
|
name[1] = L'\\';
|
|
|
|
|
}
|
|
|
|
|
result = PyUnicode_FromWideChar(name, nameLen);
|
2019-09-03 12:50:51 -07:00
|
|
|
if (result && path->narrow) {
|
2019-08-21 15:27:33 -07:00
|
|
|
Py_SETREF(result, PyUnicode_EncodeFSDefault(result));
|
|
|
|
|
}
|
2018-08-15 13:03:41 +03:00
|
|
|
}
|
2018-09-17 15:38:27 +03:00
|
|
|
return result;
|
2018-08-15 13:03:41 +03:00
|
|
|
#endif
|
2014-08-05 14:04:04 +10:00
|
|
|
}
|
2018-08-15 13:03:41 +03:00
|
|
|
#endif /* defined(HAVE_READLINK) || defined(MS_WINDOWS) */
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
#if defined(MS_WINDOWS)
|
|
|
|
|
|
2018-03-05 14:26:08 -08:00
|
|
|
/* Remove the last portion of the path - return 0 on success */
|
|
|
|
|
static int
|
2013-06-05 01:49:17 +02:00
|
|
|
_dirnameW(WCHAR *path)
|
|
|
|
|
{
|
2013-05-27 23:21:28 -04:00
|
|
|
WCHAR *ptr;
|
2018-03-05 14:26:08 -08:00
|
|
|
size_t length = wcsnlen_s(path, MAX_PATH);
|
|
|
|
|
if (length == MAX_PATH) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
2013-05-27 23:21:28 -04:00
|
|
|
|
|
|
|
|
/* walk the path from the end until a backslash is encountered */
|
2018-03-05 14:26:08 -08:00
|
|
|
for(ptr = path + length; ptr != path; ptr--) {
|
|
|
|
|
if (*ptr == L'\\' || *ptr == L'/') {
|
2013-05-27 23:21:28 -04:00
|
|
|
break;
|
2018-03-05 14:26:08 -08:00
|
|
|
}
|
2013-05-27 23:21:28 -04:00
|
|
|
}
|
|
|
|
|
*ptr = 0;
|
2018-03-05 14:26:08 -08:00
|
|
|
return 0;
|
2013-05-27 23:21:28 -04:00
|
|
|
}
|
|
|
|
|
|
2020-05-18 09:17:19 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SYMLINK
|
|
|
|
|
|
|
|
|
|
#if defined(MS_WINDOWS)
|
|
|
|
|
|
2013-06-05 01:49:17 +02:00
|
|
|
/* Is this path absolute? */
|
|
|
|
|
static int
|
|
|
|
|
_is_absW(const WCHAR *path)
|
|
|
|
|
{
|
2018-03-05 14:26:08 -08:00
|
|
|
return path[0] == L'\\' || path[0] == L'/' ||
|
|
|
|
|
(path[0] && path[1] == L':');
|
2013-05-27 23:21:28 -04:00
|
|
|
}
|
|
|
|
|
|
2018-03-05 14:26:08 -08:00
|
|
|
/* join root and rest with a backslash - return 0 on success */
|
|
|
|
|
static int
|
2013-06-05 01:49:17 +02:00
|
|
|
_joinW(WCHAR *dest_path, const WCHAR *root, const WCHAR *rest)
|
|
|
|
|
{
|
|
|
|
|
if (_is_absW(rest)) {
|
2018-03-05 14:26:08 -08:00
|
|
|
return wcscpy_s(dest_path, MAX_PATH, rest);
|
2013-05-27 23:21:28 -04:00
|
|
|
}
|
|
|
|
|
|
2018-03-05 14:26:08 -08:00
|
|
|
if (wcscpy_s(dest_path, MAX_PATH, root)) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
2013-05-27 23:21:28 -04:00
|
|
|
|
2018-03-05 14:26:08 -08:00
|
|
|
if (dest_path[0] && wcscat_s(dest_path, MAX_PATH, L"\\")) {
|
|
|
|
|
return -1;
|
2013-05-27 23:21:28 -04:00
|
|
|
}
|
2018-03-05 14:26:08 -08:00
|
|
|
|
|
|
|
|
return wcscat_s(dest_path, MAX_PATH, rest);
|
2013-05-27 23:21:28 -04:00
|
|
|
}
|
|
|
|
|
|
2013-06-05 01:49:17 +02:00
|
|
|
/* Return True if the path at src relative to dest is a directory */
|
|
|
|
|
static int
|
2016-05-07 16:45:18 +03:00
|
|
|
_check_dirW(LPCWSTR src, LPCWSTR dest)
|
2013-05-27 23:21:28 -04:00
|
|
|
{
|
|
|
|
|
WIN32_FILE_ATTRIBUTE_DATA src_info;
|
|
|
|
|
WCHAR dest_parent[MAX_PATH];
|
|
|
|
|
WCHAR src_resolved[MAX_PATH] = L"";
|
|
|
|
|
|
|
|
|
|
/* dest_parent = os.path.dirname(dest) */
|
2018-03-05 14:26:08 -08:00
|
|
|
if (wcscpy_s(dest_parent, MAX_PATH, dest) ||
|
|
|
|
|
_dirnameW(dest_parent)) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2013-05-27 23:21:28 -04:00
|
|
|
/* src_resolved = os.path.join(dest_parent, src) */
|
2018-03-05 14:26:08 -08:00
|
|
|
if (_joinW(src_resolved, dest_parent, src)) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2013-05-27 23:21:28 -04:00
|
|
|
return (
|
|
|
|
|
GetFileAttributesExW(src_resolved, GetFileExInfoStandard, &src_info)
|
|
|
|
|
&& src_info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY
|
|
|
|
|
);
|
|
|
|
|
}
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
2010-07-08 21:39:08 +00:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.symlink
|
|
|
|
|
src: path_t
|
|
|
|
|
dst: path_t
|
|
|
|
|
target_is_directory: bool = False
|
|
|
|
|
*
|
|
|
|
|
dir_fd: dir_fd(requires='symlinkat')=None
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
# "symlink(src, dst, target_is_directory=False, *, dir_fd=None)\n\n\
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Create a symbolic link pointing to src named dst.
|
|
|
|
|
|
|
|
|
|
target_is_directory is required on Windows if the target is to be
|
|
|
|
|
interpreted as a directory. (On Windows, symlink requires
|
|
|
|
|
Windows 6.0 or greater, and raises a NotImplementedError otherwise.)
|
|
|
|
|
target_is_directory is ignored on non-Windows platforms.
|
|
|
|
|
|
|
|
|
|
If dir_fd is not None, it should be a file descriptor open to a directory,
|
|
|
|
|
and path should be relative; path will then be relative to that directory.
|
|
|
|
|
dir_fd may not be implemented on your platform.
|
|
|
|
|
If it is unavailable, using it will raise a NotImplementedError.
|
|
|
|
|
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_symlink_impl(PyObject *module, path_t *src, path_t *dst,
|
2015-04-14 18:07:59 -04:00
|
|
|
int target_is_directory, int dir_fd)
|
2016-07-07 17:35:15 +03:00
|
|
|
/*[clinic end generated code: output=08ca9f3f3cf960f6 input=e820ec4472547bc3]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
DWORD result;
|
2019-04-09 20:19:46 +02:00
|
|
|
DWORD flags = 0;
|
|
|
|
|
|
|
|
|
|
/* Assumed true, set to false if detected to not be available. */
|
|
|
|
|
static int windows_has_symlink_unprivileged_flag = TRUE;
|
2012-06-22 16:30:09 -07:00
|
|
|
#else
|
2014-08-05 14:04:04 +10:00
|
|
|
int result;
|
2020-11-22 11:18:40 +01:00
|
|
|
#ifdef HAVE_SYMLINKAT
|
|
|
|
|
int symlinkat_unavailable = 0;
|
|
|
|
|
#endif
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.symlink", "OOi", src->object, dst->object,
|
|
|
|
|
dir_fd == DEFAULT_DIR_FD ? -1 : dir_fd) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
#ifdef MS_WINDOWS
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2019-04-09 20:19:46 +02:00
|
|
|
if (windows_has_symlink_unprivileged_flag) {
|
|
|
|
|
/* Allow non-admin symlinks if system allows it. */
|
|
|
|
|
flags |= SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE;
|
|
|
|
|
}
|
2013-05-27 23:21:28 -04:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2018-03-05 14:26:08 -08:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
2019-04-09 20:19:46 +02:00
|
|
|
/* if src is a directory, ensure flags==1 (target_is_directory bit) */
|
|
|
|
|
if (target_is_directory || _check_dirW(src->wide, dst->wide)) {
|
|
|
|
|
flags |= SYMBOLIC_LINK_FLAG_DIRECTORY;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result = CreateSymbolicLinkW(dst->wide, src->wide, flags);
|
2018-03-05 14:26:08 -08:00
|
|
|
_Py_END_SUPPRESS_IPH
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
|
2019-04-09 20:19:46 +02:00
|
|
|
if (windows_has_symlink_unprivileged_flag && !result &&
|
|
|
|
|
ERROR_INVALID_PARAMETER == GetLastError()) {
|
|
|
|
|
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
|
|
|
|
/* This error might be caused by
|
|
|
|
|
SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE not being supported.
|
|
|
|
|
Try again, and update windows_has_symlink_unprivileged_flag if we
|
|
|
|
|
are successful this time.
|
|
|
|
|
|
|
|
|
|
NOTE: There is a risk of a race condition here if there are other
|
|
|
|
|
conditions than the flag causing ERROR_INVALID_PARAMETER, and
|
|
|
|
|
another process (or thread) changes that condition in between our
|
|
|
|
|
calls to CreateSymbolicLink.
|
|
|
|
|
*/
|
|
|
|
|
flags &= ~(SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE);
|
|
|
|
|
result = CreateSymbolicLinkW(dst->wide, src->wide, flags);
|
|
|
|
|
_Py_END_SUPPRESS_IPH
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
|
|
|
|
|
if (result || ERROR_INVALID_PARAMETER != GetLastError()) {
|
|
|
|
|
windows_has_symlink_unprivileged_flag = FALSE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
if (!result)
|
|
|
|
|
return path_error2(src, dst);
|
2012-06-22 16:30:09 -07:00
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
2018-03-05 14:26:08 -08:00
|
|
|
if ((src->narrow && dst->wide) || (src->wide && dst->narrow)) {
|
|
|
|
|
PyErr_SetString(PyExc_ValueError,
|
|
|
|
|
"symlink: src and dst must be the same type");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2020-11-22 11:18:40 +01:00
|
|
|
#ifdef HAVE_SYMLINKAT
|
|
|
|
|
if (dir_fd != DEFAULT_DIR_FD) {
|
|
|
|
|
if (HAVE_SYMLINKAT_RUNTIME) {
|
|
|
|
|
result = symlinkat(src->narrow, dir_fd, dst->narrow);
|
|
|
|
|
} else {
|
|
|
|
|
symlinkat_unavailable = 1;
|
|
|
|
|
}
|
|
|
|
|
} else
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
2014-08-05 14:04:04 +10:00
|
|
|
result = symlink(src->narrow, dst->narrow);
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
|
2020-11-22 11:18:40 +01:00
|
|
|
#ifdef HAVE_SYMLINKAT
|
|
|
|
|
if (symlinkat_unavailable) {
|
|
|
|
|
argument_unavailable_error(NULL, "dir_fd");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
if (result)
|
|
|
|
|
return path_error2(src, dst);
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_SYMLINK */
|
|
|
|
|
|
|
|
|
|
|
2010-07-08 21:39:08 +00:00
|
|
|
|
1997-12-29 20:02:27 +00:00
|
|
|
|
2012-06-24 04:33:36 -07:00
|
|
|
static PyStructSequence_Field times_result_fields[] = {
|
|
|
|
|
{"user", "user time"},
|
|
|
|
|
{"system", "system time"},
|
|
|
|
|
{"children_user", "user time of children"},
|
|
|
|
|
{"children_system", "system time of children"},
|
|
|
|
|
{"elapsed", "elapsed time since an arbitrary point in the past"},
|
|
|
|
|
{NULL}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
PyDoc_STRVAR(times_result__doc__,
|
|
|
|
|
"times_result: Result from os.times().\n\n\
|
|
|
|
|
This object may be accessed either as a tuple of\n\
|
|
|
|
|
(user, system, children_user, children_system, elapsed),\n\
|
|
|
|
|
or via the attributes user, system, children_user, children_system,\n\
|
|
|
|
|
and elapsed.\n\
|
|
|
|
|
\n\
|
|
|
|
|
See os.times for more information.");
|
|
|
|
|
|
|
|
|
|
static PyStructSequence_Desc times_result_desc = {
|
|
|
|
|
"times_result", /* name */
|
|
|
|
|
times_result__doc__, /* doc */
|
|
|
|
|
times_result_fields,
|
|
|
|
|
5
|
|
|
|
|
};
|
|
|
|
|
|
2012-07-24 21:23:53 +02:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
#define HAVE_TIMES /* mandatory, for the method table */
|
|
|
|
|
#endif
|
2012-06-24 04:33:36 -07:00
|
|
|
|
2012-07-24 21:23:53 +02:00
|
|
|
#ifdef HAVE_TIMES
|
2012-06-24 04:33:36 -07:00
|
|
|
|
|
|
|
|
static PyObject *
|
2020-05-10 11:05:29 +02:00
|
|
|
build_times_result(PyObject *module, double user, double system,
|
2012-06-24 04:33:36 -07:00
|
|
|
double children_user, double children_system,
|
|
|
|
|
double elapsed)
|
|
|
|
|
{
|
2020-05-10 11:05:29 +02:00
|
|
|
PyObject *TimesResultType = get_posix_state(module)->TimesResultType;
|
2019-11-05 07:16:14 -08:00
|
|
|
PyObject *value = PyStructSequence_New((PyTypeObject *)TimesResultType);
|
2012-06-24 04:33:36 -07:00
|
|
|
if (value == NULL)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
#define SET(i, field) \
|
|
|
|
|
{ \
|
|
|
|
|
PyObject *o = PyFloat_FromDouble(field); \
|
|
|
|
|
if (!o) { \
|
|
|
|
|
Py_DECREF(value); \
|
|
|
|
|
return NULL; \
|
|
|
|
|
} \
|
|
|
|
|
PyStructSequence_SET_ITEM(value, i, o); \
|
|
|
|
|
} \
|
|
|
|
|
|
|
|
|
|
SET(0, user);
|
|
|
|
|
SET(1, system);
|
|
|
|
|
SET(2, children_user);
|
|
|
|
|
SET(3, children_system);
|
|
|
|
|
SET(4, elapsed);
|
|
|
|
|
|
|
|
|
|
#undef SET
|
|
|
|
|
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
#ifndef MS_WINDOWS
|
|
|
|
|
#define NEED_TICKS_PER_SECOND
|
|
|
|
|
static long ticks_per_second = -1;
|
|
|
|
|
#endif /* MS_WINDOWS */
|
|
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.times
|
|
|
|
|
|
|
|
|
|
Return a collection containing process timing information.
|
|
|
|
|
|
|
|
|
|
The object returned behaves like a named tuple with these fields:
|
|
|
|
|
(utime, stime, cutime, cstime, elapsed_time)
|
|
|
|
|
All fields are floating point numbers.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
1996-12-10 23:23:01 +00:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_times_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=35f640503557d32a input=2bf9df3d6ab2e48b]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
#ifdef MS_WINDOWS
|
1994-09-29 09:50:09 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
FILETIME create, exit, kernel, user;
|
|
|
|
|
HANDLE hProc;
|
|
|
|
|
hProc = GetCurrentProcess();
|
|
|
|
|
GetProcessTimes(hProc, &create, &exit, &kernel, &user);
|
|
|
|
|
/* The fields of a FILETIME structure are the hi and lo part
|
|
|
|
|
of a 64-bit value expressed in 100 nanosecond units.
|
|
|
|
|
1e7 is one second in such units; 1e-7 the inverse.
|
|
|
|
|
429.4967296 is 2**32 / 1e7 or 2**32 * 1e-7.
|
|
|
|
|
*/
|
2020-05-10 11:05:29 +02:00
|
|
|
return build_times_result(module,
|
2010-05-06 00:08:46 +00:00
|
|
|
(double)(user.dwHighDateTime*429.4967296 +
|
|
|
|
|
user.dwLowDateTime*1e-7),
|
|
|
|
|
(double)(kernel.dwHighDateTime*429.4967296 +
|
|
|
|
|
kernel.dwLowDateTime*1e-7),
|
|
|
|
|
(double)0,
|
|
|
|
|
(double)0,
|
|
|
|
|
(double)0);
|
1994-09-29 09:50:09 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#else /* MS_WINDOWS */
|
2012-07-24 21:23:53 +02:00
|
|
|
{
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
|
2012-07-24 21:23:53 +02:00
|
|
|
struct tms t;
|
|
|
|
|
clock_t c;
|
|
|
|
|
errno = 0;
|
|
|
|
|
c = times(&t);
|
|
|
|
|
if (c == (clock_t) -1)
|
|
|
|
|
return posix_error();
|
2020-05-10 11:05:29 +02:00
|
|
|
return build_times_result(module,
|
2012-07-24 21:23:53 +02:00
|
|
|
(double)t.tms_utime / ticks_per_second,
|
|
|
|
|
(double)t.tms_stime / ticks_per_second,
|
|
|
|
|
(double)t.tms_cutime / ticks_per_second,
|
|
|
|
|
(double)t.tms_cstime / ticks_per_second,
|
|
|
|
|
(double)c / ticks_per_second);
|
|
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* MS_WINDOWS */
|
2012-07-24 21:23:53 +02:00
|
|
|
#endif /* HAVE_TIMES */
|
|
|
|
|
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2003-11-10 06:35:36 +00:00
|
|
|
#ifdef HAVE_GETSID
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.getsid
|
|
|
|
|
|
|
|
|
|
pid: pid_t
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Call the system call getsid(pid) and return the result.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_getsid_impl(PyObject *module, pid_t pid)
|
|
|
|
|
/*[clinic end generated code: output=112deae56b306460 input=eeb2b923a30ce04e]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
int sid;
|
|
|
|
|
sid = getsid(pid);
|
|
|
|
|
if (sid < 0)
|
|
|
|
|
return posix_error();
|
|
|
|
|
return PyLong_FromLong((long)sid);
|
2003-11-10 06:35:36 +00:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_GETSID */
|
|
|
|
|
|
|
|
|
|
|
1994-08-01 11:34:53 +00:00
|
|
|
#ifdef HAVE_SETSID
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.setsid
|
|
|
|
|
|
|
|
|
|
Call the system call setsid().
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
1996-12-10 23:23:01 +00:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_setsid_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=e2ddedd517086d77 input=5fff45858e2f0776]*/
|
1992-09-13 20:07:29 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
if (setsid() < 0)
|
|
|
|
|
return posix_error();
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
1992-09-13 20:07:29 +00:00
|
|
|
}
|
1994-08-01 11:34:53 +00:00
|
|
|
#endif /* HAVE_SETSID */
|
1992-09-13 20:07:29 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
1994-08-01 11:34:53 +00:00
|
|
|
#ifdef HAVE_SETPGID
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.setpgid
|
|
|
|
|
|
|
|
|
|
pid: pid_t
|
|
|
|
|
pgrp: pid_t
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Call the system call setpgid(pid, pgrp).
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_setpgid_impl(PyObject *module, pid_t pid, pid_t pgrp)
|
|
|
|
|
/*[clinic end generated code: output=6461160319a43d6a input=fceb395eca572e1a]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
if (setpgid(pid, pgrp) < 0)
|
|
|
|
|
return posix_error();
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
1992-09-13 20:07:29 +00:00
|
|
|
}
|
1994-08-01 11:34:53 +00:00
|
|
|
#endif /* HAVE_SETPGID */
|
1992-09-13 20:07:29 +00:00
|
|
|
|
1997-06-02 22:20:51 +00:00
|
|
|
|
1994-08-01 11:34:53 +00:00
|
|
|
#ifdef HAVE_TCGETPGRP
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.tcgetpgrp
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
fd: int
|
|
|
|
|
/
|
1992-09-17 17:54:56 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Return the process group associated with the terminal specified by fd.
|
|
|
|
|
[clinic start generated code]*/
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_tcgetpgrp_impl(PyObject *module, int fd)
|
|
|
|
|
/*[clinic end generated code: output=f865e88be86c272b input=7f6c18eac10ada86]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
pid_t pgid = tcgetpgrp(fd);
|
|
|
|
|
if (pgid < 0)
|
|
|
|
|
return posix_error();
|
|
|
|
|
return PyLong_FromPid(pgid);
|
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_TCGETPGRP */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_TCSETPGRP
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.tcsetpgrp
|
|
|
|
|
|
|
|
|
|
fd: int
|
|
|
|
|
pgid: pid_t
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Set the process group associated with the terminal specified by fd.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_tcsetpgrp_impl(PyObject *module, int fd, pid_t pgid)
|
|
|
|
|
/*[clinic end generated code: output=f1821a381b9daa39 input=5bdc997c6a619020]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
if (tcsetpgrp(fd, pgid) < 0)
|
|
|
|
|
return posix_error();
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
1992-09-17 17:54:56 +00:00
|
|
|
}
|
1994-08-01 11:34:53 +00:00
|
|
|
#endif /* HAVE_TCSETPGRP */
|
1992-04-05 14:25:30 +00:00
|
|
|
|
1993-05-17 08:34:16 +00:00
|
|
|
/* Functions acting on file descriptors */
|
|
|
|
|
|
2013-08-28 00:53:59 +02:00
|
|
|
#ifdef O_CLOEXEC
|
|
|
|
|
extern int _Py_open_cloexec_works;
|
|
|
|
|
#endif
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.open -> int
|
|
|
|
|
path: path_t
|
|
|
|
|
flags: int
|
|
|
|
|
mode: int = 0o777
|
|
|
|
|
*
|
|
|
|
|
dir_fd: dir_fd(requires='openat') = None
|
|
|
|
|
|
|
|
|
|
# "open(path, flags, mode=0o777, *, dir_fd=None)\n\n\
|
|
|
|
|
|
|
|
|
|
Open a file for low level IO. Returns a file descriptor (integer).
|
|
|
|
|
|
|
|
|
|
If dir_fd is not None, it should be a file descriptor open to a directory,
|
|
|
|
|
and path should be relative; path will then be relative to that directory.
|
|
|
|
|
dir_fd may not be implemented on your platform.
|
|
|
|
|
If it is unavailable, using it will raise a NotImplementedError.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static int
|
2016-07-07 17:35:15 +03:00
|
|
|
os_open_impl(PyObject *module, path_t *path, int flags, int mode, int dir_fd)
|
|
|
|
|
/*[clinic end generated code: output=abc7227888c8bc73 input=ad8623b29acd2934]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
int fd;
|
2015-02-07 13:27:50 +00:00
|
|
|
int async_err = 0;
|
2020-11-22 11:18:40 +01:00
|
|
|
#ifdef HAVE_OPENAT
|
|
|
|
|
int openat_unavailable = 0;
|
|
|
|
|
#endif
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2013-08-28 00:53:59 +02:00
|
|
|
#ifdef O_CLOEXEC
|
|
|
|
|
int *atomic_flag_works = &_Py_open_cloexec_works;
|
|
|
|
|
#elif !defined(MS_WINDOWS)
|
|
|
|
|
int *atomic_flag_works = NULL;
|
|
|
|
|
#endif
|
2002-10-03 05:10:39 +00:00
|
|
|
|
2013-08-28 00:53:59 +02:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
flags |= O_NOINHERIT;
|
|
|
|
|
#elif defined(O_CLOEXEC)
|
|
|
|
|
flags |= O_CLOEXEC;
|
|
|
|
|
#endif
|
|
|
|
|
|
2019-05-23 08:45:22 -07:00
|
|
|
if (PySys_Audit("open", "OOi", path->object, Py_None, flags) < 0) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
2015-02-07 13:27:50 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2011-11-15 22:27:41 +01:00
|
|
|
#ifdef MS_WINDOWS
|
2016-09-08 10:35:16 -07:00
|
|
|
fd = _wopen(path->wide, flags, mode);
|
2016-09-09 09:03:15 -07:00
|
|
|
#else
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef HAVE_OPENAT
|
2020-11-22 11:18:40 +01:00
|
|
|
if (dir_fd != DEFAULT_DIR_FD) {
|
|
|
|
|
if (HAVE_OPENAT_RUNTIME) {
|
|
|
|
|
fd = openat(dir_fd, path->narrow, flags, mode);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
openat_unavailable = 1;
|
|
|
|
|
fd = -1;
|
|
|
|
|
}
|
|
|
|
|
} else
|
2016-09-09 09:03:15 -07:00
|
|
|
#endif /* HAVE_OPENAT */
|
2015-02-07 13:27:50 +00:00
|
|
|
fd = open(path->narrow, flags, mode);
|
2016-09-09 09:03:15 -07:00
|
|
|
#endif /* !MS_WINDOWS */
|
2015-02-07 13:27:50 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (fd < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_END_SUPPRESS_IPH
|
1993-05-17 08:34:16 +00:00
|
|
|
|
2020-11-22 11:18:40 +01:00
|
|
|
#ifdef HAVE_OPENAT
|
|
|
|
|
if (openat_unavailable) {
|
|
|
|
|
argument_unavailable_error(NULL, "dir_fd");
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2015-09-15 10:11:03 +02:00
|
|
|
if (fd < 0) {
|
2015-02-07 13:27:50 +00:00
|
|
|
if (!async_err)
|
|
|
|
|
PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path->object);
|
2014-08-05 14:04:04 +10:00
|
|
|
return -1;
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
|
2013-08-28 00:53:59 +02:00
|
|
|
#ifndef MS_WINDOWS
|
|
|
|
|
if (_Py_set_inheritable(fd, 0, atomic_flag_works) < 0) {
|
|
|
|
|
close(fd);
|
2014-08-05 14:04:04 +10:00
|
|
|
return -1;
|
2013-08-28 00:53:59 +02:00
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
return fd;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.close
|
|
|
|
|
|
|
|
|
|
fd: int
|
|
|
|
|
|
|
|
|
|
Close a file descriptor.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_close_impl(PyObject *module, int fd)
|
|
|
|
|
/*[clinic end generated code: output=2fe4e93602822c14 input=2bc42451ca5c3223]*/
|
1993-05-17 08:34:16 +00:00
|
|
|
{
|
2014-08-05 14:04:04 +10:00
|
|
|
int res;
|
2015-02-07 13:27:50 +00:00
|
|
|
/* We do not want to retry upon EINTR: see http://lwn.net/Articles/576478/
|
|
|
|
|
* and http://linux.derkeiler.com/Mailing-Lists/Kernel/2005-09/3000.html
|
|
|
|
|
* for more details.
|
|
|
|
|
*/
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
2010-05-06 00:08:46 +00:00
|
|
|
res = close(fd);
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_END_SUPPRESS_IPH
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
if (res < 0)
|
|
|
|
|
return posix_error();
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
1993-05-17 08:34:16 +00:00
|
|
|
}
|
|
|
|
|
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2019-09-11 17:11:57 +02:00
|
|
|
#ifdef HAVE_FDWALK
|
|
|
|
|
static int
|
|
|
|
|
_fdwalk_close_func(void *lohi, int fd)
|
|
|
|
|
{
|
|
|
|
|
int lo = ((int *)lohi)[0];
|
|
|
|
|
int hi = ((int *)lohi)[1];
|
|
|
|
|
|
2020-04-24 12:00:51 +02:00
|
|
|
if (fd >= hi) {
|
2019-09-11 17:11:57 +02:00
|
|
|
return 1;
|
2020-04-24 12:00:51 +02:00
|
|
|
}
|
|
|
|
|
else if (fd >= lo) {
|
|
|
|
|
/* Ignore errors */
|
|
|
|
|
(void)close(fd);
|
|
|
|
|
}
|
2019-09-11 17:11:57 +02:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_FDWALK */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.closerange
|
|
|
|
|
|
|
|
|
|
fd_low: int
|
|
|
|
|
fd_high: int
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Closes all file descriptors in [fd_low, fd_high), ignoring errors.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_closerange_impl(PyObject *module, int fd_low, int fd_high)
|
|
|
|
|
/*[clinic end generated code: output=0ce5c20fcda681c2 input=5855a3d053ebd4ec]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2019-09-11 17:11:57 +02:00
|
|
|
#ifdef HAVE_FDWALK
|
|
|
|
|
int lohi[2];
|
|
|
|
|
#endif
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
2019-09-11 17:11:57 +02:00
|
|
|
#ifdef HAVE_FDWALK
|
|
|
|
|
lohi[0] = Py_MAX(fd_low, 0);
|
|
|
|
|
lohi[1] = fd_high;
|
|
|
|
|
fdwalk(_fdwalk_close_func, lohi);
|
|
|
|
|
#else
|
2020-04-24 12:00:51 +02:00
|
|
|
fd_low = Py_MAX(fd_low, 0);
|
|
|
|
|
#ifdef __FreeBSD__
|
|
|
|
|
if (fd_high >= sysconf(_SC_OPEN_MAX)) {
|
|
|
|
|
/* Any errors encountered while closing file descriptors are ignored */
|
|
|
|
|
closefrom(fd_low);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
#endif
|
|
|
|
|
{
|
|
|
|
|
for (int i = fd_low; i < fd_high; i++) {
|
|
|
|
|
/* Ignore errors */
|
|
|
|
|
(void)close(i);
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-09-11 17:11:57 +02:00
|
|
|
#endif
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_END_SUPPRESS_IPH
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
Py_RETURN_NONE;
|
Merged revisions 60094-60123 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
*** NOTE ***
I haven't merged the files in Doc/c-api/. I got too many conflicts. Georg,
please split them manually.
........
r60095 | andrew.kuchling | 2008-01-19 21:12:04 +0100 (Sat, 19 Jan 2008) | 2 lines
Bug 1277: make Maildir use the user-provided factory instead of hard-wiring MaildirMessage.
2.5.2 bugfix candidate.
........
r60097 | georg.brandl | 2008-01-19 21:22:13 +0100 (Sat, 19 Jan 2008) | 4 lines
#1663329: add os.closerange() to close a range of fds,
ignoring errors, and use this in subprocess to speed up
subprocess creation in close_fds mode. Patch by Mike Klaas.
........
r60099 | georg.brandl | 2008-01-19 21:40:24 +0100 (Sat, 19 Jan 2008) | 2 lines
#1411695: clarify behavior of xml.sax.utils.[un]escape.
........
r60101 | andrew.kuchling | 2008-01-19 21:47:59 +0100 (Sat, 19 Jan 2008) | 7 lines
Patch #1019808 from Federico Schwindt: Return correct socket error when
a default timeout has been set, by using getsockopt() to get the error
condition (instead of trying another connect() call, which seems to be
a Linuxism).
2.5 bugfix candidate, assuming no one reports any problems with this change.
........
r60102 | gregory.p.smith | 2008-01-19 21:49:02 +0100 (Sat, 19 Jan 2008) | 3 lines
fix comment typos, use not arg instead of arg == "", add test coverage
for inside of the final if needquotes: within subprocess.list2cmdline().
........
r60103 | georg.brandl | 2008-01-19 21:53:07 +0100 (Sat, 19 Jan 2008) | 2 lines
#1509: fix sqlite3 docstrings and docs w.r.t. cursor.fetchXXX methods.
........
r60104 | gregory.p.smith | 2008-01-19 21:57:59 +0100 (Sat, 19 Jan 2008) | 6 lines
Fixes issue1336 - a race condition could occur when forking if the gc
kicked in during the critical section. solution: disable gc during
that section. Patch contributed by jpa and updated by me to cover the
race condition still existing what therve from twistedmatrix pointed
out (already seen and fixed in twisted's own subprocess code).
........
r60105 | gregory.p.smith | 2008-01-19 22:00:37 +0100 (Sat, 19 Jan 2008) | 2 lines
note about r60104
........
r60106 | andrew.kuchling | 2008-01-19 22:00:38 +0100 (Sat, 19 Jan 2008) | 1 line
Bug 1296: restore text describing OptionGroup
........
r60109 | georg.brandl | 2008-01-19 23:08:21 +0100 (Sat, 19 Jan 2008) | 2 lines
Split the monstrous C API manual files in smaller parts.
........
r60110 | georg.brandl | 2008-01-19 23:14:27 +0100 (Sat, 19 Jan 2008) | 2 lines
Missed one big file to split up.
........
r60111 | gregory.p.smith | 2008-01-19 23:23:56 +0100 (Sat, 19 Jan 2008) | 12 lines
Undo an unnecessary else: and indentation that r60104 added.
try:
...
except:
...
raise
else:
...
the else: is unecessary due to the blind except: with a raise.
........
r60115 | gregory.p.smith | 2008-01-19 23:49:37 +0100 (Sat, 19 Jan 2008) | 3 lines
Fix issue 1300: Quote command line arguments that contain a '|' character in
subprocess.list2cmdline (windows).
........
r60116 | gregory.p.smith | 2008-01-20 00:10:52 +0100 (Sun, 20 Jan 2008) | 3 lines
Fixes/Accepts Patch for issue1189216 - Work properly with archives
that have file headers past the 2**31 byte boundary.
........
r60119 | andrew.kuchling | 2008-01-20 01:00:38 +0100 (Sun, 20 Jan 2008) | 3 lines
Patch #1048820 from Stefan Wehr: add insert-mode editing to Textbox.
Fix an off-by-one error I noticed.
........
r60120 | andrew.kuchling | 2008-01-20 01:12:19 +0100 (Sun, 20 Jan 2008) | 1 line
Add an interactive test script for exercising curses
........
r60121 | gregory.p.smith | 2008-01-20 02:21:03 +0100 (Sun, 20 Jan 2008) | 7 lines
Fix zipfile decryption. The check for validity only worked on one
type of encrypted zip files. Files using extended local headers
needed to compare the check byte against different values. (according
to reading the infozip unzip crypt.c source code)
Fixes issue1003.
........
r60122 | gregory.p.smith | 2008-01-20 02:26:04 +0100 (Sun, 20 Jan 2008) | 2 lines
note for r60121
........
r60123 | gregory.p.smith | 2008-01-20 02:32:00 +0100 (Sun, 20 Jan 2008) | 4 lines
Document that zipfile decryption is insanely slow and fix a typo and
blatant lie in a docstring (it is not useful for security regardless of
how you spell it).
........
2008-01-20 09:06:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.dup -> int
|
|
|
|
|
|
|
|
|
|
fd: int
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Return a duplicate of a file descriptor.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static int
|
2016-07-07 17:35:15 +03:00
|
|
|
os_dup_impl(PyObject *module, int fd)
|
|
|
|
|
/*[clinic end generated code: output=486f4860636b2a9f input=6f10f7ea97f7852a]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
return _Py_dup(fd);
|
1993-05-17 08:34:16 +00:00
|
|
|
}
|
|
|
|
|
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
2017-12-29 13:13:06 -08:00
|
|
|
os.dup2 -> int
|
2014-08-05 14:04:04 +10:00
|
|
|
fd: int
|
|
|
|
|
fd2: int
|
|
|
|
|
inheritable: bool=True
|
|
|
|
|
|
|
|
|
|
Duplicate file descriptor.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
2017-12-29 13:13:06 -08:00
|
|
|
static int
|
2016-07-07 17:35:15 +03:00
|
|
|
os_dup2_impl(PyObject *module, int fd, int fd2, int inheritable)
|
2017-12-29 13:13:06 -08:00
|
|
|
/*[clinic end generated code: output=bc059d34a73404d1 input=c3cddda8922b038d]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2018-01-30 07:04:36 +01:00
|
|
|
int res = 0;
|
2013-08-28 00:53:59 +02:00
|
|
|
#if defined(HAVE_DUP3) && \
|
|
|
|
|
!(defined(HAVE_FCNTL_H) && defined(F_DUP2FD_CLOEXEC))
|
|
|
|
|
/* dup3() is available on Linux 2.6.27+ and glibc 2.9 */
|
2018-02-20 10:25:46 +03:00
|
|
|
static int dup3_works = -1;
|
2013-08-28 00:53:59 +02:00
|
|
|
#endif
|
|
|
|
|
|
2017-12-29 13:13:06 -08:00
|
|
|
if (fd < 0 || fd2 < 0) {
|
|
|
|
|
posix_error();
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
2013-08-28 00:53:59 +02:00
|
|
|
|
2015-02-07 13:27:50 +00:00
|
|
|
/* dup2() can fail with EINTR if the target FD is already open, because it
|
|
|
|
|
* then has to be closed. See os_close_impl() for why we don't handle EINTR
|
|
|
|
|
* upon close(), and therefore below.
|
|
|
|
|
*/
|
2013-08-28 00:53:59 +02:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
2010-05-06 00:08:46 +00:00
|
|
|
res = dup2(fd, fd2);
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_END_SUPPRESS_IPH
|
2013-08-28 00:53:59 +02:00
|
|
|
Py_END_ALLOW_THREADS
|
2017-12-29 13:13:06 -08:00
|
|
|
if (res < 0) {
|
|
|
|
|
posix_error();
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
res = fd2; // msvcrt dup2 returns 0 on success.
|
2013-08-28 00:53:59 +02:00
|
|
|
|
|
|
|
|
/* Character files like console cannot be make non-inheritable */
|
|
|
|
|
if (!inheritable && _Py_set_inheritable(fd2, 0, NULL) < 0) {
|
|
|
|
|
close(fd2);
|
2017-12-29 13:13:06 -08:00
|
|
|
return -1;
|
2013-08-28 00:53:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#elif defined(HAVE_FCNTL_H) && defined(F_DUP2FD_CLOEXEC)
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
if (!inheritable)
|
|
|
|
|
res = fcntl(fd, F_DUP2FD_CLOEXEC, fd2);
|
|
|
|
|
else
|
|
|
|
|
res = dup2(fd, fd2);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
2017-12-29 13:13:06 -08:00
|
|
|
if (res < 0) {
|
|
|
|
|
posix_error();
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
2013-08-28 00:53:59 +02:00
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_DUP3
|
|
|
|
|
if (!inheritable && dup3_works != 0) {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
res = dup3(fd, fd2, O_CLOEXEC);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
if (res < 0) {
|
|
|
|
|
if (dup3_works == -1)
|
|
|
|
|
dup3_works = (errno != ENOSYS);
|
2017-12-29 13:13:06 -08:00
|
|
|
if (dup3_works) {
|
|
|
|
|
posix_error();
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
2013-08-28 00:53:59 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (inheritable || dup3_works == 0)
|
|
|
|
|
{
|
|
|
|
|
#endif
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
res = dup2(fd, fd2);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
2017-12-29 13:13:06 -08:00
|
|
|
if (res < 0) {
|
|
|
|
|
posix_error();
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
2013-08-28 00:53:59 +02:00
|
|
|
|
|
|
|
|
if (!inheritable && _Py_set_inheritable(fd2, 0, NULL) < 0) {
|
|
|
|
|
close(fd2);
|
2017-12-29 13:13:06 -08:00
|
|
|
return -1;
|
2013-08-28 00:53:59 +02:00
|
|
|
}
|
|
|
|
|
#ifdef HAVE_DUP3
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
2017-12-29 13:13:06 -08:00
|
|
|
return res;
|
1993-05-17 08:34:16 +00:00
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2011-03-17 20:20:30 +02:00
|
|
|
#ifdef HAVE_LOCKF
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.lockf
|
|
|
|
|
|
|
|
|
|
fd: int
|
|
|
|
|
An open file descriptor.
|
|
|
|
|
command: int
|
|
|
|
|
One of F_LOCK, F_TLOCK, F_ULOCK or F_TEST.
|
|
|
|
|
length: Py_off_t
|
|
|
|
|
The number of bytes to lock, starting at the current position.
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Apply, test or remove a POSIX lock on an open file descriptor.
|
|
|
|
|
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_lockf_impl(PyObject *module, int fd, int command, Py_off_t length)
|
|
|
|
|
/*[clinic end generated code: output=af7051f3e7c29651 input=65da41d2106e9b79]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
int res;
|
2011-03-17 20:20:30 +02:00
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.lockf", "iiL", fd, command, length) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-17 20:20:30 +02:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2014-08-05 14:04:04 +10:00
|
|
|
res = lockf(fd, command, length);
|
2011-03-17 20:20:30 +02:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
|
|
|
|
|
if (res < 0)
|
|
|
|
|
return posix_error();
|
|
|
|
|
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_LOCKF */
|
2011-03-17 20:20:30 +02:00
|
|
|
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.lseek -> Py_off_t
|
2011-03-17 20:20:30 +02:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
fd: int
|
|
|
|
|
position: Py_off_t
|
|
|
|
|
how: int
|
|
|
|
|
/
|
2011-03-17 20:20:30 +02:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Set the position of a file descriptor. Return the new position.
|
2011-03-17 20:20:30 +02:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Return the new cursor position in number of bytes
|
|
|
|
|
relative to the beginning of the file.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static Py_off_t
|
2016-07-07 17:35:15 +03:00
|
|
|
os_lseek_impl(PyObject *module, int fd, Py_off_t position, int how)
|
|
|
|
|
/*[clinic end generated code: output=971e1efb6b30bd2f input=902654ad3f96a6d3]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
Py_off_t result;
|
|
|
|
|
|
|
|
|
|
#ifdef SEEK_SET
|
|
|
|
|
/* Turn 0, 1, 2 into SEEK_{SET,CUR,END} */
|
|
|
|
|
switch (how) {
|
|
|
|
|
case 0: how = SEEK_SET; break;
|
|
|
|
|
case 1: how = SEEK_CUR; break;
|
|
|
|
|
case 2: how = SEEK_END; break;
|
|
|
|
|
}
|
|
|
|
|
#endif /* SEEK_END */
|
|
|
|
|
|
2011-03-17 20:20:30 +02:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
2013-06-25 00:37:25 +02:00
|
|
|
#ifdef MS_WINDOWS
|
2014-08-05 14:04:04 +10:00
|
|
|
result = _lseeki64(fd, position, how);
|
2011-03-17 20:20:30 +02:00
|
|
|
#else
|
2014-08-05 14:04:04 +10:00
|
|
|
result = lseek(fd, position, how);
|
2011-03-17 20:20:30 +02:00
|
|
|
#endif
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_END_SUPPRESS_IPH
|
2011-03-17 20:20:30 +02:00
|
|
|
Py_END_ALLOW_THREADS
|
2014-08-05 14:04:04 +10:00
|
|
|
if (result < 0)
|
|
|
|
|
posix_error();
|
2011-03-17 20:20:30 +02:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
return result;
|
2011-03-17 20:20:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.read
|
|
|
|
|
fd: int
|
|
|
|
|
length: Py_ssize_t
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Read from a file descriptor. Returns a bytes object.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_read_impl(PyObject *module, int fd, Py_ssize_t length)
|
|
|
|
|
/*[clinic end generated code: output=dafbe9a5cddb987b input=1df2eaa27c0bf1d3]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2011-03-17 20:20:30 +02:00
|
|
|
Py_ssize_t n;
|
|
|
|
|
PyObject *buffer;
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
if (length < 0) {
|
|
|
|
|
errno = EINVAL;
|
|
|
|
|
return posix_error();
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-22 15:03:40 +01:00
|
|
|
length = Py_MIN(length, _PY_READ_MAX);
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
buffer = PyBytes_FromStringAndSize((char *)NULL, length);
|
2011-03-17 20:20:30 +02:00
|
|
|
if (buffer == NULL)
|
|
|
|
|
return NULL;
|
2015-02-07 13:27:50 +00:00
|
|
|
|
2015-03-19 22:53:20 +01:00
|
|
|
n = _Py_read(fd, PyBytes_AS_STRING(buffer), length);
|
|
|
|
|
if (n == -1) {
|
2011-03-17 20:20:30 +02:00
|
|
|
Py_DECREF(buffer);
|
2015-03-19 22:53:20 +01:00
|
|
|
return NULL;
|
2011-03-17 20:20:30 +02:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
if (n != length)
|
2011-03-17 20:20:30 +02:00
|
|
|
_PyBytes_Resize(&buffer, n);
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2011-03-17 20:20:30 +02:00
|
|
|
return buffer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if (defined(HAVE_SENDFILE) && (defined(__FreeBSD__) || defined(__DragonFly__) \
|
2018-07-31 10:24:54 +03:00
|
|
|
|| defined(__APPLE__))) \
|
|
|
|
|
|| defined(HAVE_READV) || defined(HAVE_PREADV) || defined (HAVE_PREADV2) \
|
|
|
|
|
|| defined(HAVE_WRITEV) || defined(HAVE_PWRITEV) || defined (HAVE_PWRITEV2)
|
|
|
|
|
static int
|
2017-04-19 20:03:52 +03:00
|
|
|
iov_setup(struct iovec **iov, Py_buffer **buf, PyObject *seq, Py_ssize_t cnt, int type)
|
2011-03-17 20:20:30 +02:00
|
|
|
{
|
2017-04-19 20:03:52 +03:00
|
|
|
Py_ssize_t i, j;
|
2011-03-17 20:20:30 +02:00
|
|
|
|
|
|
|
|
*iov = PyMem_New(struct iovec, cnt);
|
|
|
|
|
if (*iov == NULL) {
|
|
|
|
|
PyErr_NoMemory();
|
2014-01-08 15:21:28 +01:00
|
|
|
return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*buf = PyMem_New(Py_buffer, cnt);
|
|
|
|
|
if (*buf == NULL) {
|
|
|
|
|
PyMem_Del(*iov);
|
|
|
|
|
PyErr_NoMemory();
|
2014-01-08 15:21:28 +01:00
|
|
|
return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < cnt; i++) {
|
2011-03-19 09:11:14 +02:00
|
|
|
PyObject *item = PySequence_GetItem(seq, i);
|
|
|
|
|
if (item == NULL)
|
|
|
|
|
goto fail;
|
|
|
|
|
if (PyObject_GetBuffer(item, &(*buf)[i], type) == -1) {
|
|
|
|
|
Py_DECREF(item);
|
|
|
|
|
goto fail;
|
2011-03-17 20:20:30 +02:00
|
|
|
}
|
2011-03-19 09:11:14 +02:00
|
|
|
Py_DECREF(item);
|
2011-03-17 20:20:30 +02:00
|
|
|
(*iov)[i].iov_base = (*buf)[i].buf;
|
2018-07-31 10:24:54 +03:00
|
|
|
(*iov)[i].iov_len = (*buf)[i].len;
|
2011-03-17 20:20:30 +02:00
|
|
|
}
|
2018-07-31 10:24:54 +03:00
|
|
|
return 0;
|
2011-03-19 09:11:14 +02:00
|
|
|
|
|
|
|
|
fail:
|
|
|
|
|
PyMem_Del(*iov);
|
|
|
|
|
for (j = 0; j < i; j++) {
|
|
|
|
|
PyBuffer_Release(&(*buf)[j]);
|
|
|
|
|
}
|
|
|
|
|
PyMem_Del(*buf);
|
2014-01-08 15:21:28 +01:00
|
|
|
return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
iov_cleanup(struct iovec *iov, Py_buffer *buf, int cnt)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
PyMem_Del(iov);
|
|
|
|
|
for (i = 0; i < cnt; i++) {
|
|
|
|
|
PyBuffer_Release(&buf[i]);
|
|
|
|
|
}
|
|
|
|
|
PyMem_Del(buf);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2011-03-17 20:20:30 +02:00
|
|
|
#ifdef HAVE_READV
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.readv -> Py_ssize_t
|
|
|
|
|
|
|
|
|
|
fd: int
|
|
|
|
|
buffers: object
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Read from a file descriptor fd into an iterable of buffers.
|
|
|
|
|
|
|
|
|
|
The buffers should be mutable buffers accepting bytes.
|
|
|
|
|
readv will transfer data into each buffer until it is full
|
|
|
|
|
and then move on to the next buffer in the sequence to hold
|
|
|
|
|
the rest of the data.
|
|
|
|
|
|
|
|
|
|
readv returns the total number of bytes read,
|
|
|
|
|
which may be less than the total capacity of all the buffers.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static Py_ssize_t
|
2016-07-07 17:35:15 +03:00
|
|
|
os_readv_impl(PyObject *module, int fd, PyObject *buffers)
|
|
|
|
|
/*[clinic end generated code: output=792da062d3fcebdb input=e679eb5dbfa0357d]*/
|
1993-05-17 08:34:16 +00:00
|
|
|
{
|
2017-04-19 20:03:52 +03:00
|
|
|
Py_ssize_t cnt, n;
|
2015-02-07 13:27:50 +00:00
|
|
|
int async_err = 0;
|
2011-03-17 20:20:30 +02:00
|
|
|
struct iovec *iov;
|
|
|
|
|
Py_buffer *buf;
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
if (!PySequence_Check(buffers)) {
|
2011-03-17 20:20:30 +02:00
|
|
|
PyErr_SetString(PyExc_TypeError,
|
|
|
|
|
"readv() arg 2 must be a sequence");
|
2014-08-05 14:04:04 +10:00
|
|
|
return -1;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
1999-01-06 18:42:14 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
cnt = PySequence_Size(buffers);
|
2017-04-19 20:03:52 +03:00
|
|
|
if (cnt < 0)
|
|
|
|
|
return -1;
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
if (iov_setup(&iov, &buf, buffers, cnt, PyBUF_WRITABLE) < 0)
|
|
|
|
|
return -1;
|
1999-01-06 18:42:14 +00:00
|
|
|
|
2015-02-07 13:27:50 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
n = readv(fd, iov, cnt);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (n < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
1999-01-06 18:42:14 +00:00
|
|
|
|
2011-03-17 20:20:30 +02:00
|
|
|
iov_cleanup(iov, buf, cnt);
|
2014-08-05 14:04:04 +10:00
|
|
|
if (n < 0) {
|
2015-02-07 13:27:50 +00:00
|
|
|
if (!async_err)
|
|
|
|
|
posix_error();
|
2014-08-05 14:04:04 +10:00
|
|
|
return -1;
|
|
|
|
|
}
|
2014-01-08 15:21:28 +01:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
return n;
|
1993-05-17 08:34:16 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_READV */
|
|
|
|
|
|
1993-05-17 08:34:16 +00:00
|
|
|
|
2011-03-17 20:20:30 +02:00
|
|
|
#ifdef HAVE_PREAD
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.pread
|
|
|
|
|
|
|
|
|
|
fd: int
|
2019-09-25 14:47:04 +09:00
|
|
|
length: Py_ssize_t
|
2014-08-05 14:04:04 +10:00
|
|
|
offset: Py_off_t
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Read a number of bytes from a file descriptor starting at a particular offset.
|
|
|
|
|
|
|
|
|
|
Read length bytes from file descriptor fd, starting at offset bytes from
|
|
|
|
|
the beginning of the file. The file offset remains unchanged.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2019-09-25 14:47:04 +09:00
|
|
|
os_pread_impl(PyObject *module, int fd, Py_ssize_t length, Py_off_t offset)
|
|
|
|
|
/*[clinic end generated code: output=3f875c1eef82e32f input=85cb4a5589627144]*/
|
1993-05-17 08:34:16 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_ssize_t n;
|
2015-02-07 13:27:50 +00:00
|
|
|
int async_err = 0;
|
2010-05-06 00:08:46 +00:00
|
|
|
PyObject *buffer;
|
2011-03-17 20:20:30 +02:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
if (length < 0) {
|
2010-05-06 00:08:46 +00:00
|
|
|
errno = EINVAL;
|
|
|
|
|
return posix_error();
|
|
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
buffer = PyBytes_FromStringAndSize((char *)NULL, length);
|
2010-05-06 00:08:46 +00:00
|
|
|
if (buffer == NULL)
|
|
|
|
|
return NULL;
|
2015-02-07 13:27:50 +00:00
|
|
|
|
|
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
2015-02-07 13:27:50 +00:00
|
|
|
n = pread(fd, PyBytes_AS_STRING(buffer), length, offset);
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_END_SUPPRESS_IPH
|
2015-02-07 13:27:50 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (n < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
|
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
if (n < 0) {
|
|
|
|
|
Py_DECREF(buffer);
|
2015-02-07 13:27:50 +00:00
|
|
|
return (!async_err) ? posix_error() : NULL;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
if (n != length)
|
2010-05-06 00:08:46 +00:00
|
|
|
_PyBytes_Resize(&buffer, n);
|
|
|
|
|
return buffer;
|
1993-05-17 08:34:16 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_PREAD */
|
|
|
|
|
|
2018-01-27 16:16:37 +00:00
|
|
|
#if defined(HAVE_PREADV) || defined (HAVE_PREADV2)
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.preadv -> Py_ssize_t
|
|
|
|
|
|
|
|
|
|
fd: int
|
|
|
|
|
buffers: object
|
|
|
|
|
offset: Py_off_t
|
|
|
|
|
flags: int = 0
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Reads from a file descriptor into a number of mutable bytes-like objects.
|
|
|
|
|
|
|
|
|
|
Combines the functionality of readv() and pread(). As readv(), it will
|
|
|
|
|
transfer data into each buffer until it is full and then move on to the next
|
|
|
|
|
buffer in the sequence to hold the rest of the data. Its fourth argument,
|
|
|
|
|
specifies the file offset at which the input operation is to be performed. It
|
|
|
|
|
will return the total number of bytes read (which can be less than the total
|
|
|
|
|
capacity of all the objects).
|
|
|
|
|
|
|
|
|
|
The flags argument contains a bitwise OR of zero or more of the following flags:
|
|
|
|
|
|
|
|
|
|
- RWF_HIPRI
|
|
|
|
|
- RWF_NOWAIT
|
|
|
|
|
|
|
|
|
|
Using non-zero flags requires Linux 4.6 or newer.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static Py_ssize_t
|
|
|
|
|
os_preadv_impl(PyObject *module, int fd, PyObject *buffers, Py_off_t offset,
|
|
|
|
|
int flags)
|
|
|
|
|
/*[clinic end generated code: output=26fc9c6e58e7ada5 input=4173919dc1f7ed99]*/
|
|
|
|
|
{
|
|
|
|
|
Py_ssize_t cnt, n;
|
|
|
|
|
int async_err = 0;
|
|
|
|
|
struct iovec *iov;
|
|
|
|
|
Py_buffer *buf;
|
|
|
|
|
|
|
|
|
|
if (!PySequence_Check(buffers)) {
|
|
|
|
|
PyErr_SetString(PyExc_TypeError,
|
|
|
|
|
"preadv2() arg 2 must be a sequence");
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cnt = PySequence_Size(buffers);
|
|
|
|
|
if (cnt < 0) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifndef HAVE_PREADV2
|
|
|
|
|
if(flags != 0) {
|
|
|
|
|
argument_unavailable_error("preadv2", "flags");
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if (iov_setup(&iov, &buf, buffers, cnt, PyBUF_WRITABLE) < 0) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
#ifdef HAVE_PREADV2
|
|
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
|
|
|
|
n = preadv2(fd, iov, cnt, offset, flags);
|
|
|
|
|
_Py_END_SUPPRESS_IPH
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (n < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
|
|
|
|
#else
|
|
|
|
|
do {
|
2020-11-22 11:18:40 +01:00
|
|
|
#ifdef __APPLE__
|
|
|
|
|
/* This entire function will be removed from the module dict when the API
|
|
|
|
|
* is not available.
|
|
|
|
|
*/
|
|
|
|
|
#pragma clang diagnostic push
|
|
|
|
|
#pragma clang diagnostic ignored "-Wunguarded-availability"
|
|
|
|
|
#pragma clang diagnostic ignored "-Wunguarded-availability-new"
|
|
|
|
|
#endif
|
2018-01-27 16:16:37 +00:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
|
|
|
|
n = preadv(fd, iov, cnt, offset);
|
|
|
|
|
_Py_END_SUPPRESS_IPH
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (n < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
2020-11-22 11:18:40 +01:00
|
|
|
|
|
|
|
|
#ifdef __APPLE__
|
|
|
|
|
#pragma clang diagnostic pop
|
|
|
|
|
#endif
|
|
|
|
|
|
2018-01-27 16:16:37 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
iov_cleanup(iov, buf, cnt);
|
|
|
|
|
if (n < 0) {
|
|
|
|
|
if (!async_err) {
|
|
|
|
|
posix_error();
|
|
|
|
|
}
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return n;
|
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_PREADV */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.write -> Py_ssize_t
|
|
|
|
|
|
|
|
|
|
fd: int
|
|
|
|
|
data: Py_buffer
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Write a bytes object to a file descriptor.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static Py_ssize_t
|
2016-07-07 17:35:15 +03:00
|
|
|
os_write_impl(PyObject *module, int fd, Py_buffer *data)
|
|
|
|
|
/*[clinic end generated code: output=e4ef5bc904b58ef9 input=3207e28963234f3c]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2015-03-19 22:53:20 +01:00
|
|
|
return _Py_write(fd, data->buf, data->len);
|
1993-05-17 08:34:16 +00:00
|
|
|
}
|
|
|
|
|
|
2011-02-25 14:39:16 +00:00
|
|
|
#ifdef HAVE_SENDFILE
|
2020-04-18 19:14:10 +03:00
|
|
|
#ifdef __APPLE__
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.sendfile
|
|
|
|
|
|
|
|
|
|
out_fd: int
|
|
|
|
|
in_fd: int
|
|
|
|
|
offset: Py_off_t
|
|
|
|
|
count as sbytes: Py_off_t
|
|
|
|
|
headers: object(c_default="NULL") = ()
|
|
|
|
|
trailers: object(c_default="NULL") = ()
|
|
|
|
|
flags: int = 0
|
|
|
|
|
|
|
|
|
|
Copy count bytes from file descriptor in_fd to file descriptor out_fd.
|
|
|
|
|
[clinic start generated code]*/
|
2011-02-25 14:39:16 +00:00
|
|
|
|
|
|
|
|
static PyObject *
|
2020-04-18 19:14:10 +03:00
|
|
|
os_sendfile_impl(PyObject *module, int out_fd, int in_fd, Py_off_t offset,
|
|
|
|
|
Py_off_t sbytes, PyObject *headers, PyObject *trailers,
|
|
|
|
|
int flags)
|
|
|
|
|
/*[clinic end generated code: output=81c4bcd143f5c82b input=b0d72579d4c69afa]*/
|
|
|
|
|
#elif defined(__FreeBSD__) || defined(__DragonFly__)
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.sendfile
|
|
|
|
|
|
|
|
|
|
out_fd: int
|
|
|
|
|
in_fd: int
|
|
|
|
|
offset: Py_off_t
|
|
|
|
|
count: Py_ssize_t
|
|
|
|
|
headers: object(c_default="NULL") = ()
|
|
|
|
|
trailers: object(c_default="NULL") = ()
|
|
|
|
|
flags: int = 0
|
|
|
|
|
|
|
|
|
|
Copy count bytes from file descriptor in_fd to file descriptor out_fd.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
os_sendfile_impl(PyObject *module, int out_fd, int in_fd, Py_off_t offset,
|
|
|
|
|
Py_ssize_t count, PyObject *headers, PyObject *trailers,
|
|
|
|
|
int flags)
|
|
|
|
|
/*[clinic end generated code: output=329ea009bdd55afc input=338adb8ff84ae8cd]*/
|
|
|
|
|
#else
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.sendfile
|
|
|
|
|
|
|
|
|
|
out_fd: int
|
|
|
|
|
in_fd: int
|
|
|
|
|
offset as offobj: object
|
|
|
|
|
count: Py_ssize_t
|
|
|
|
|
|
|
|
|
|
Copy count bytes from file descriptor in_fd to file descriptor out_fd.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
os_sendfile_impl(PyObject *module, int out_fd, int in_fd, PyObject *offobj,
|
|
|
|
|
Py_ssize_t count)
|
|
|
|
|
/*[clinic end generated code: output=ae81216e40f167d8 input=76d64058c74477ba]*/
|
|
|
|
|
#endif
|
2011-02-25 14:39:16 +00:00
|
|
|
{
|
|
|
|
|
Py_ssize_t ret;
|
2015-02-07 13:27:50 +00:00
|
|
|
int async_err = 0;
|
2011-02-25 14:39:16 +00:00
|
|
|
|
|
|
|
|
#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__APPLE__)
|
|
|
|
|
#ifndef __APPLE__
|
2020-04-18 19:14:10 +03:00
|
|
|
off_t sbytes;
|
2011-02-25 14:39:16 +00:00
|
|
|
#endif
|
|
|
|
|
Py_buffer *hbuf, *tbuf;
|
|
|
|
|
struct sf_hdtr sf;
|
|
|
|
|
|
2013-07-07 16:32:36 +02:00
|
|
|
sf.headers = NULL;
|
|
|
|
|
sf.trailers = NULL;
|
|
|
|
|
|
2011-02-25 14:39:16 +00:00
|
|
|
if (headers != NULL) {
|
|
|
|
|
if (!PySequence_Check(headers)) {
|
|
|
|
|
PyErr_SetString(PyExc_TypeError,
|
2015-09-09 05:29:24 +00:00
|
|
|
"sendfile() headers must be a sequence");
|
2011-02-25 14:39:16 +00:00
|
|
|
return NULL;
|
|
|
|
|
} else {
|
2017-04-19 20:03:52 +03:00
|
|
|
Py_ssize_t i = PySequence_Size(headers);
|
|
|
|
|
if (i < 0)
|
|
|
|
|
return NULL;
|
|
|
|
|
if (i > INT_MAX) {
|
|
|
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
|
|
|
"sendfile() header is too large");
|
2011-02-25 14:39:16 +00:00
|
|
|
return NULL;
|
2017-04-19 20:03:52 +03:00
|
|
|
}
|
|
|
|
|
if (i > 0) {
|
|
|
|
|
sf.hdr_cnt = (int)i;
|
2018-07-31 10:24:54 +03:00
|
|
|
if (iov_setup(&(sf.headers), &hbuf,
|
|
|
|
|
headers, sf.hdr_cnt, PyBUF_SIMPLE) < 0)
|
2017-04-19 20:03:52 +03:00
|
|
|
return NULL;
|
2011-03-03 16:10:51 +00:00
|
|
|
#ifdef __APPLE__
|
2018-07-31 10:24:54 +03:00
|
|
|
for (i = 0; i < sf.hdr_cnt; i++) {
|
|
|
|
|
Py_ssize_t blen = sf.headers[i].iov_len;
|
|
|
|
|
# define OFF_T_MAX 0x7fffffffffffffff
|
|
|
|
|
if (sbytes >= OFF_T_MAX - blen) {
|
|
|
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
|
|
|
"sendfile() header is too large");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
sbytes += blen;
|
|
|
|
|
}
|
2011-03-03 16:10:51 +00:00
|
|
|
#endif
|
2017-04-19 20:03:52 +03:00
|
|
|
}
|
2011-02-25 14:39:16 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (trailers != NULL) {
|
|
|
|
|
if (!PySequence_Check(trailers)) {
|
|
|
|
|
PyErr_SetString(PyExc_TypeError,
|
2015-09-09 05:29:24 +00:00
|
|
|
"sendfile() trailers must be a sequence");
|
2011-02-25 14:39:16 +00:00
|
|
|
return NULL;
|
|
|
|
|
} else {
|
2017-04-19 20:03:52 +03:00
|
|
|
Py_ssize_t i = PySequence_Size(trailers);
|
|
|
|
|
if (i < 0)
|
|
|
|
|
return NULL;
|
|
|
|
|
if (i > INT_MAX) {
|
|
|
|
|
PyErr_SetString(PyExc_OverflowError,
|
|
|
|
|
"sendfile() trailer is too large");
|
2011-02-25 14:39:16 +00:00
|
|
|
return NULL;
|
2017-04-19 20:03:52 +03:00
|
|
|
}
|
|
|
|
|
if (i > 0) {
|
|
|
|
|
sf.trl_cnt = (int)i;
|
2018-07-31 10:24:54 +03:00
|
|
|
if (iov_setup(&(sf.trailers), &tbuf,
|
|
|
|
|
trailers, sf.trl_cnt, PyBUF_SIMPLE) < 0)
|
2017-04-19 20:03:52 +03:00
|
|
|
return NULL;
|
|
|
|
|
}
|
2011-02-25 14:39:16 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
2015-02-07 13:27:50 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2011-02-25 14:39:16 +00:00
|
|
|
#ifdef __APPLE__
|
2020-04-18 19:14:10 +03:00
|
|
|
ret = sendfile(in_fd, out_fd, offset, &sbytes, &sf, flags);
|
2011-02-25 14:39:16 +00:00
|
|
|
#else
|
2020-04-18 19:14:10 +03:00
|
|
|
ret = sendfile(in_fd, out_fd, offset, count, &sf, &sbytes, flags);
|
2011-02-25 14:39:16 +00:00
|
|
|
#endif
|
2015-02-07 13:27:50 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (ret < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_END_SUPPRESS_IPH
|
2011-02-25 14:39:16 +00:00
|
|
|
|
|
|
|
|
if (sf.headers != NULL)
|
|
|
|
|
iov_cleanup(sf.headers, hbuf, sf.hdr_cnt);
|
|
|
|
|
if (sf.trailers != NULL)
|
|
|
|
|
iov_cleanup(sf.trailers, tbuf, sf.trl_cnt);
|
|
|
|
|
|
|
|
|
|
if (ret < 0) {
|
|
|
|
|
if ((errno == EAGAIN) || (errno == EBUSY)) {
|
|
|
|
|
if (sbytes != 0) {
|
|
|
|
|
// some data has been sent
|
|
|
|
|
goto done;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
// no data has been sent; upper application is supposed
|
|
|
|
|
// to retry on EAGAIN or EBUSY
|
|
|
|
|
return posix_error();
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-02-07 13:27:50 +00:00
|
|
|
return (!async_err) ? posix_error() : NULL;
|
2011-02-25 14:39:16 +00:00
|
|
|
}
|
|
|
|
|
goto done;
|
|
|
|
|
|
|
|
|
|
done:
|
|
|
|
|
#if !defined(HAVE_LARGEFILE_SUPPORT)
|
|
|
|
|
return Py_BuildValue("l", sbytes);
|
|
|
|
|
#else
|
|
|
|
|
return Py_BuildValue("L", sbytes);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#else
|
2016-09-07 14:45:10 -07:00
|
|
|
#ifdef __linux__
|
2011-02-25 14:39:16 +00:00
|
|
|
if (offobj == Py_None) {
|
2015-02-07 13:27:50 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2020-04-18 19:14:10 +03:00
|
|
|
ret = sendfile(out_fd, in_fd, NULL, count);
|
2015-02-07 13:27:50 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (ret < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
2011-02-25 14:39:16 +00:00
|
|
|
if (ret < 0)
|
2015-02-07 13:27:50 +00:00
|
|
|
return (!async_err) ? posix_error() : NULL;
|
2011-04-19 09:47:16 +02:00
|
|
|
return Py_BuildValue("n", ret);
|
2011-02-25 14:39:16 +00:00
|
|
|
}
|
|
|
|
|
#endif
|
2020-04-18 19:14:10 +03:00
|
|
|
off_t offset;
|
2014-08-05 14:04:04 +10:00
|
|
|
if (!Py_off_t_converter(offobj, &offset))
|
2011-02-26 13:38:35 +00:00
|
|
|
return NULL;
|
2015-02-07 13:27:50 +00:00
|
|
|
|
2020-09-16 13:52:26 +02:00
|
|
|
#if defined(__sun) && defined(__SVR4)
|
|
|
|
|
// On Solaris, sendfile raises EINVAL rather than returning 0
|
|
|
|
|
// when the offset is equal or bigger than the in_fd size.
|
|
|
|
|
struct stat st;
|
|
|
|
|
|
|
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2020-09-16 05:25:09 -07:00
|
|
|
ret = fstat(in_fd, &st);
|
2020-09-16 13:52:26 +02:00
|
|
|
Py_END_ALLOW_THREADS
|
2020-09-16 05:25:09 -07:00
|
|
|
} while (ret != 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
2020-09-16 13:52:26 +02:00
|
|
|
if (ret < 0)
|
|
|
|
|
return (!async_err) ? posix_error() : NULL;
|
|
|
|
|
|
|
|
|
|
if (offset >= st.st_size) {
|
|
|
|
|
return Py_BuildValue("i", 0);
|
|
|
|
|
}
|
2020-11-12 02:14:03 -08:00
|
|
|
|
|
|
|
|
// On illumos specifically sendfile() may perform a partial write but
|
|
|
|
|
// return -1/an error (in one confirmed case the destination socket
|
|
|
|
|
// had a 5 second timeout set and errno was EAGAIN) and it's on the client
|
|
|
|
|
// code to check if the offset parameter was modified by sendfile().
|
|
|
|
|
//
|
|
|
|
|
// We need this variable to track said change.
|
|
|
|
|
off_t original_offset = offset;
|
2020-09-16 13:52:26 +02:00
|
|
|
#endif
|
|
|
|
|
|
2015-02-07 13:27:50 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2020-04-18 19:14:10 +03:00
|
|
|
ret = sendfile(out_fd, in_fd, &offset, count);
|
2020-11-12 02:14:03 -08:00
|
|
|
#if defined(__sun) && defined(__SVR4)
|
|
|
|
|
// This handles illumos-specific sendfile() partial write behavior,
|
|
|
|
|
// see a comment above for more details.
|
|
|
|
|
if (ret < 0 && offset != original_offset) {
|
|
|
|
|
ret = offset - original_offset;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2015-02-07 13:27:50 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (ret < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
2011-02-25 14:39:16 +00:00
|
|
|
if (ret < 0)
|
2015-02-07 13:27:50 +00:00
|
|
|
return (!async_err) ? posix_error() : NULL;
|
2011-02-25 14:39:16 +00:00
|
|
|
return Py_BuildValue("n", ret);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_SENDFILE */
|
|
|
|
|
|
|
|
|
|
|
2018-06-12 23:04:50 +02:00
|
|
|
#if defined(__APPLE__)
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os._fcopyfile
|
|
|
|
|
|
2019-10-13 11:59:31 +03:00
|
|
|
in_fd: int
|
|
|
|
|
out_fd: int
|
2018-06-12 23:04:50 +02:00
|
|
|
flags: int
|
|
|
|
|
/
|
|
|
|
|
|
2018-06-19 08:27:29 -07:00
|
|
|
Efficiently copy content or metadata of 2 regular file descriptors (macOS).
|
2018-06-12 23:04:50 +02:00
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2019-10-13 11:59:31 +03:00
|
|
|
os__fcopyfile_impl(PyObject *module, int in_fd, int out_fd, int flags)
|
|
|
|
|
/*[clinic end generated code: output=c9d1a35a992e401b input=1e34638a86948795]*/
|
2018-06-12 23:04:50 +02:00
|
|
|
{
|
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2019-10-13 11:59:31 +03:00
|
|
|
ret = fcopyfile(in_fd, out_fd, NULL, flags);
|
2018-06-12 23:04:50 +02:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
if (ret < 0)
|
|
|
|
|
return posix_error();
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.fstat
|
|
|
|
|
|
|
|
|
|
fd : int
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Perform a stat system call on the given file descriptor.
|
|
|
|
|
|
|
|
|
|
Like stat(), but for an open file descriptor.
|
|
|
|
|
Equivalent to os.stat(fd).
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_fstat_impl(PyObject *module, int fd)
|
|
|
|
|
/*[clinic end generated code: output=efc038cb5f654492 input=27e0e0ebbe5600c9]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
STRUCT_STAT st;
|
|
|
|
|
int res;
|
2015-02-07 13:27:50 +00:00
|
|
|
int async_err = 0;
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2015-02-07 13:27:50 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
res = FSTAT(fd, &st);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (res != 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
2010-05-06 00:08:46 +00:00
|
|
|
if (res != 0) {
|
2006-02-03 12:54:16 +00:00
|
|
|
#ifdef MS_WINDOWS
|
2012-10-31 22:24:06 +01:00
|
|
|
return PyErr_SetFromWindowsErr(0);
|
2006-02-03 12:54:16 +00:00
|
|
|
#else
|
2015-02-07 13:27:50 +00:00
|
|
|
return (!async_err) ? posix_error() : NULL;
|
2006-02-03 12:54:16 +00:00
|
|
|
#endif
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2002-01-30 05:46:57 +00:00
|
|
|
|
2020-05-10 11:05:29 +02:00
|
|
|
return _pystat_fromstructstat(module, &st);
|
1993-05-17 08:34:16 +00:00
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.isatty -> bool
|
|
|
|
|
fd: int
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Return True if the fd is connected to a terminal.
|
|
|
|
|
|
|
|
|
|
Return True if the file descriptor is an open file descriptor
|
|
|
|
|
connected to the slave end of a terminal.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static int
|
2016-07-07 17:35:15 +03:00
|
|
|
os_isatty_impl(PyObject *module, int fd)
|
|
|
|
|
/*[clinic end generated code: output=6a48c8b4e644ca00 input=08ce94aa1eaf7b5e]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2015-04-12 00:26:27 -04:00
|
|
|
int return_value;
|
2021-09-09 06:40:42 -07:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
|
|
|
|
return_value = isatty(fd);
|
|
|
|
|
_Py_END_SUPPRESS_IPH
|
2021-09-09 06:40:42 -07:00
|
|
|
Py_END_ALLOW_THREADS
|
2015-04-12 00:26:27 -04:00
|
|
|
return return_value;
|
2014-08-05 14:04:04 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_PIPE
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.pipe
|
|
|
|
|
|
|
|
|
|
Create a pipe.
|
|
|
|
|
|
|
|
|
|
Returns a tuple of two file descriptors:
|
|
|
|
|
(read_fd, write_fd)
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_pipe_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=ff9b76255793b440 input=02535e8c8fa6c4d4]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
int fds[2];
|
2013-08-28 00:53:59 +02:00
|
|
|
#ifdef MS_WINDOWS
|
2010-05-06 00:08:46 +00:00
|
|
|
HANDLE read, write;
|
2013-08-28 00:53:59 +02:00
|
|
|
SECURITY_ATTRIBUTES attr;
|
2010-05-06 00:08:46 +00:00
|
|
|
BOOL ok;
|
2013-08-28 00:53:59 +02:00
|
|
|
#else
|
|
|
|
|
int res;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
attr.nLength = sizeof(attr);
|
|
|
|
|
attr.lpSecurityDescriptor = NULL;
|
|
|
|
|
attr.bInheritHandle = FALSE;
|
|
|
|
|
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2016-11-19 18:41:16 -08:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
2013-08-28 00:53:59 +02:00
|
|
|
ok = CreatePipe(&read, &write, &attr, 0);
|
|
|
|
|
if (ok) {
|
2016-09-06 13:47:26 -07:00
|
|
|
fds[0] = _open_osfhandle((intptr_t)read, _O_RDONLY);
|
|
|
|
|
fds[1] = _open_osfhandle((intptr_t)write, _O_WRONLY);
|
2013-08-28 00:53:59 +02:00
|
|
|
if (fds[0] == -1 || fds[1] == -1) {
|
|
|
|
|
CloseHandle(read);
|
|
|
|
|
CloseHandle(write);
|
|
|
|
|
ok = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-11-19 18:41:16 -08:00
|
|
|
_Py_END_SUPPRESS_IPH
|
2013-08-28 00:53:59 +02:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
if (!ok)
|
2012-10-31 22:24:06 +01:00
|
|
|
return PyErr_SetFromWindowsErr(0);
|
2013-08-28 00:53:59 +02:00
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_PIPE2
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
res = pipe2(fds, O_CLOEXEC);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
|
|
|
|
|
if (res != 0 && errno == ENOSYS)
|
|
|
|
|
{
|
|
|
|
|
#endif
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
res = pipe(fds);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
|
|
|
|
|
if (res == 0) {
|
|
|
|
|
if (_Py_set_inheritable(fds[0], 0, NULL) < 0) {
|
|
|
|
|
close(fds[0]);
|
|
|
|
|
close(fds[1]);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
if (_Py_set_inheritable(fds[1], 0, NULL) < 0) {
|
|
|
|
|
close(fds[0]);
|
|
|
|
|
close(fds[1]);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#ifdef HAVE_PIPE2
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if (res != 0)
|
|
|
|
|
return PyErr_SetFromErrno(PyExc_OSError);
|
|
|
|
|
#endif /* !MS_WINDOWS */
|
|
|
|
|
return Py_BuildValue("(ii)", fds[0], fds[1]);
|
1993-05-17 08:34:16 +00:00
|
|
|
}
|
1996-05-23 22:58:55 +00:00
|
|
|
#endif /* HAVE_PIPE */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2011-05-29 20:07:40 +02:00
|
|
|
#ifdef HAVE_PIPE2
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.pipe2
|
|
|
|
|
|
|
|
|
|
flags: int
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Create a pipe with flags set atomically.
|
|
|
|
|
|
|
|
|
|
Returns a tuple of two file descriptors:
|
|
|
|
|
(read_fd, write_fd)
|
|
|
|
|
|
|
|
|
|
flags can be constructed by ORing together one or more of these values:
|
|
|
|
|
O_NONBLOCK, O_CLOEXEC.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_pipe2_impl(PyObject *module, int flags)
|
|
|
|
|
/*[clinic end generated code: output=25751fb43a45540f input=f261b6e7e63c6817]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2011-05-29 20:07:40 +02:00
|
|
|
int fds[2];
|
|
|
|
|
int res;
|
|
|
|
|
|
|
|
|
|
res = pipe2(fds, flags);
|
|
|
|
|
if (res != 0)
|
|
|
|
|
return posix_error();
|
|
|
|
|
return Py_BuildValue("(ii)", fds[0], fds[1]);
|
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_PIPE2 */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2011-03-17 20:20:30 +02:00
|
|
|
#ifdef HAVE_WRITEV
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.writev -> Py_ssize_t
|
|
|
|
|
fd: int
|
|
|
|
|
buffers: object
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Iterate over buffers, and write the contents of each to a file descriptor.
|
|
|
|
|
|
|
|
|
|
Returns the total number of bytes written.
|
|
|
|
|
buffers must be a sequence of bytes-like objects.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static Py_ssize_t
|
2016-07-07 17:35:15 +03:00
|
|
|
os_writev_impl(PyObject *module, int fd, PyObject *buffers)
|
|
|
|
|
/*[clinic end generated code: output=56565cfac3aac15b input=5b8d17fe4189d2fe]*/
|
2011-03-17 20:20:30 +02:00
|
|
|
{
|
2017-04-19 20:03:52 +03:00
|
|
|
Py_ssize_t cnt;
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_ssize_t result;
|
2015-02-07 13:27:50 +00:00
|
|
|
int async_err = 0;
|
2011-03-17 20:20:30 +02:00
|
|
|
struct iovec *iov;
|
|
|
|
|
Py_buffer *buf;
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
if (!PySequence_Check(buffers)) {
|
2011-03-17 20:20:30 +02:00
|
|
|
PyErr_SetString(PyExc_TypeError,
|
|
|
|
|
"writev() arg 2 must be a sequence");
|
2014-08-05 14:04:04 +10:00
|
|
|
return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
cnt = PySequence_Size(buffers);
|
2017-04-19 20:03:52 +03:00
|
|
|
if (cnt < 0)
|
|
|
|
|
return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
if (iov_setup(&iov, &buf, buffers, cnt, PyBUF_SIMPLE) < 0) {
|
|
|
|
|
return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
}
|
|
|
|
|
|
2015-02-07 13:27:50 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
result = writev(fd, iov, cnt);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (result < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
2011-03-17 20:20:30 +02:00
|
|
|
|
|
|
|
|
iov_cleanup(iov, buf, cnt);
|
2015-02-07 13:27:50 +00:00
|
|
|
if (result < 0 && !async_err)
|
2014-08-05 14:04:04 +10:00
|
|
|
posix_error();
|
2014-01-08 15:21:28 +01:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
return result;
|
2011-03-17 20:20:30 +02:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_WRITEV */
|
|
|
|
|
|
2011-03-17 20:20:30 +02:00
|
|
|
|
|
|
|
|
#ifdef HAVE_PWRITE
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.pwrite -> Py_ssize_t
|
|
|
|
|
|
|
|
|
|
fd: int
|
|
|
|
|
buffer: Py_buffer
|
|
|
|
|
offset: Py_off_t
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Write bytes to a file descriptor starting at a particular offset.
|
|
|
|
|
|
|
|
|
|
Write buffer to fd, starting at offset bytes from the beginning of
|
|
|
|
|
the file. Returns the number of bytes writte. Does not change the
|
|
|
|
|
current file offset.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static Py_ssize_t
|
2016-07-07 17:35:15 +03:00
|
|
|
os_pwrite_impl(PyObject *module, int fd, Py_buffer *buffer, Py_off_t offset)
|
|
|
|
|
/*[clinic end generated code: output=c74da630758ee925 input=19903f1b3dd26377]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
Py_ssize_t size;
|
2015-02-07 13:27:50 +00:00
|
|
|
int async_err = 0;
|
2011-03-17 20:20:30 +02:00
|
|
|
|
2015-02-07 13:27:50 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
2015-02-07 13:27:50 +00:00
|
|
|
size = pwrite(fd, buffer->buf, (size_t)buffer->len, offset);
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_END_SUPPRESS_IPH
|
2015-02-07 13:27:50 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (size < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2015-02-07 13:27:50 +00:00
|
|
|
if (size < 0 && !async_err)
|
2014-08-05 14:04:04 +10:00
|
|
|
posix_error();
|
|
|
|
|
return size;
|
2011-03-17 20:20:30 +02:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_PWRITE */
|
|
|
|
|
|
2018-01-27 16:16:37 +00:00
|
|
|
#if defined(HAVE_PWRITEV) || defined (HAVE_PWRITEV2)
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.pwritev -> Py_ssize_t
|
|
|
|
|
|
|
|
|
|
fd: int
|
|
|
|
|
buffers: object
|
|
|
|
|
offset: Py_off_t
|
|
|
|
|
flags: int = 0
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Writes the contents of bytes-like objects to a file descriptor at a given offset.
|
|
|
|
|
|
|
|
|
|
Combines the functionality of writev() and pwrite(). All buffers must be a sequence
|
|
|
|
|
of bytes-like objects. Buffers are processed in array order. Entire contents of first
|
|
|
|
|
buffer is written before proceeding to second, and so on. The operating system may
|
|
|
|
|
set a limit (sysconf() value SC_IOV_MAX) on the number of buffers that can be used.
|
|
|
|
|
This function writes the contents of each object to the file descriptor and returns
|
|
|
|
|
the total number of bytes written.
|
|
|
|
|
|
|
|
|
|
The flags argument contains a bitwise OR of zero or more of the following flags:
|
|
|
|
|
|
|
|
|
|
- RWF_DSYNC
|
|
|
|
|
- RWF_SYNC
|
|
|
|
|
|
|
|
|
|
Using non-zero flags requires Linux 4.7 or newer.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static Py_ssize_t
|
|
|
|
|
os_pwritev_impl(PyObject *module, int fd, PyObject *buffers, Py_off_t offset,
|
|
|
|
|
int flags)
|
|
|
|
|
/*[clinic end generated code: output=e3dd3e9d11a6a5c7 input=803dc5ddbf0cfd3b]*/
|
|
|
|
|
{
|
|
|
|
|
Py_ssize_t cnt;
|
|
|
|
|
Py_ssize_t result;
|
|
|
|
|
int async_err = 0;
|
|
|
|
|
struct iovec *iov;
|
|
|
|
|
Py_buffer *buf;
|
|
|
|
|
|
|
|
|
|
if (!PySequence_Check(buffers)) {
|
|
|
|
|
PyErr_SetString(PyExc_TypeError,
|
|
|
|
|
"pwritev() arg 2 must be a sequence");
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cnt = PySequence_Size(buffers);
|
|
|
|
|
if (cnt < 0) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifndef HAVE_PWRITEV2
|
|
|
|
|
if(flags != 0) {
|
|
|
|
|
argument_unavailable_error("pwritev2", "flags");
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if (iov_setup(&iov, &buf, buffers, cnt, PyBUF_SIMPLE) < 0) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
#ifdef HAVE_PWRITEV2
|
|
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
|
|
|
|
result = pwritev2(fd, iov, cnt, offset, flags);
|
|
|
|
|
_Py_END_SUPPRESS_IPH
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (result < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
|
|
|
|
#else
|
2020-11-22 11:18:40 +01:00
|
|
|
|
|
|
|
|
#ifdef __APPLE__
|
|
|
|
|
/* This entire function will be removed from the module dict when the API
|
|
|
|
|
* is not available.
|
|
|
|
|
*/
|
|
|
|
|
#pragma clang diagnostic push
|
|
|
|
|
#pragma clang diagnostic ignored "-Wunguarded-availability"
|
|
|
|
|
#pragma clang diagnostic ignored "-Wunguarded-availability-new"
|
|
|
|
|
#endif
|
2018-01-27 16:16:37 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
|
|
|
|
result = pwritev(fd, iov, cnt, offset);
|
|
|
|
|
_Py_END_SUPPRESS_IPH
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (result < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
2020-11-22 11:18:40 +01:00
|
|
|
|
|
|
|
|
#ifdef __APPLE__
|
|
|
|
|
#pragma clang diagnostic pop
|
|
|
|
|
#endif
|
|
|
|
|
|
2018-01-27 16:16:37 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
iov_cleanup(iov, buf, cnt);
|
|
|
|
|
if (result < 0) {
|
|
|
|
|
if (!async_err) {
|
|
|
|
|
posix_error();
|
|
|
|
|
}
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_PWRITEV */
|
|
|
|
|
|
2019-05-31 19:39:47 +01:00
|
|
|
#ifdef HAVE_COPY_FILE_RANGE
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
|
|
|
|
|
os.copy_file_range
|
|
|
|
|
src: int
|
|
|
|
|
Source file descriptor.
|
|
|
|
|
dst: int
|
|
|
|
|
Destination file descriptor.
|
|
|
|
|
count: Py_ssize_t
|
|
|
|
|
Number of bytes to copy.
|
|
|
|
|
offset_src: object = None
|
|
|
|
|
Starting offset in src.
|
|
|
|
|
offset_dst: object = None
|
|
|
|
|
Starting offset in dst.
|
|
|
|
|
|
|
|
|
|
Copy count bytes from one file descriptor to another.
|
|
|
|
|
|
|
|
|
|
If offset_src is None, then src is read from the current position;
|
|
|
|
|
respectively for offset_dst.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
os_copy_file_range_impl(PyObject *module, int src, int dst, Py_ssize_t count,
|
|
|
|
|
PyObject *offset_src, PyObject *offset_dst)
|
|
|
|
|
/*[clinic end generated code: output=1a91713a1d99fc7a input=42fdce72681b25a9]*/
|
|
|
|
|
{
|
|
|
|
|
off_t offset_src_val, offset_dst_val;
|
|
|
|
|
off_t *p_offset_src = NULL;
|
|
|
|
|
off_t *p_offset_dst = NULL;
|
|
|
|
|
Py_ssize_t ret;
|
|
|
|
|
int async_err = 0;
|
|
|
|
|
/* The flags argument is provided to allow
|
|
|
|
|
* for future extensions and currently must be to 0. */
|
|
|
|
|
int flags = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (count < 0) {
|
|
|
|
|
PyErr_SetString(PyExc_ValueError, "negative value for 'count' not allowed");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (offset_src != Py_None) {
|
|
|
|
|
if (!Py_off_t_converter(offset_src, &offset_src_val)) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
p_offset_src = &offset_src_val;
|
|
|
|
|
}
|
2018-01-27 16:16:37 +00:00
|
|
|
|
2019-05-31 19:39:47 +01:00
|
|
|
if (offset_dst != Py_None) {
|
|
|
|
|
if (!Py_off_t_converter(offset_dst, &offset_dst_val)) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
p_offset_dst = &offset_dst_val;
|
|
|
|
|
}
|
2018-01-27 16:16:37 +00:00
|
|
|
|
2019-05-31 19:39:47 +01:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
ret = copy_file_range(src, p_offset_src, dst, p_offset_dst, count, flags);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (ret < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
|
|
|
|
|
|
|
|
|
if (ret < 0) {
|
|
|
|
|
return (!async_err) ? posix_error() : NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return PyLong_FromSsize_t(ret);
|
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_COPY_FILE_RANGE*/
|
1997-06-02 22:20:51 +00:00
|
|
|
|
1996-05-23 22:58:55 +00:00
|
|
|
#ifdef HAVE_MKFIFO
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.mkfifo
|
|
|
|
|
|
|
|
|
|
path: path_t
|
|
|
|
|
mode: int=0o666
|
|
|
|
|
*
|
|
|
|
|
dir_fd: dir_fd(requires='mkfifoat')=None
|
|
|
|
|
|
|
|
|
|
Create a "fifo" (a POSIX named pipe).
|
|
|
|
|
|
|
|
|
|
If dir_fd is not None, it should be a file descriptor open to a directory,
|
|
|
|
|
and path should be relative; path will then be relative to that directory.
|
|
|
|
|
dir_fd may not be implemented on your platform.
|
|
|
|
|
If it is unavailable, using it will raise a NotImplementedError.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_mkfifo_impl(PyObject *module, path_t *path, int mode, int dir_fd)
|
|
|
|
|
/*[clinic end generated code: output=ce41cfad0e68c940 input=73032e98a36e0e19]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
int result;
|
2015-02-07 13:27:50 +00:00
|
|
|
int async_err = 0;
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2015-02-07 13:27:50 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef HAVE_MKFIFOAT
|
2015-02-07 13:27:50 +00:00
|
|
|
if (dir_fd != DEFAULT_DIR_FD)
|
|
|
|
|
result = mkfifoat(dir_fd, path->narrow, mode);
|
|
|
|
|
else
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
2015-02-07 13:27:50 +00:00
|
|
|
result = mkfifo(path->narrow, mode);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (result != 0 && errno == EINTR &&
|
|
|
|
|
!(async_err = PyErr_CheckSignals()));
|
|
|
|
|
if (result != 0)
|
|
|
|
|
return (!async_err) ? posix_error() : NULL;
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
2002-04-14 10:19:44 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_MKFIFO */
|
|
|
|
|
|
2002-04-14 10:19:44 +00:00
|
|
|
|
2002-07-30 01:08:28 +00:00
|
|
|
#if defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV)
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.mknod
|
|
|
|
|
|
|
|
|
|
path: path_t
|
|
|
|
|
mode: int=0o600
|
2015-01-18 11:17:39 +02:00
|
|
|
device: dev_t=0
|
2014-08-05 14:04:04 +10:00
|
|
|
*
|
|
|
|
|
dir_fd: dir_fd(requires='mknodat')=None
|
|
|
|
|
|
|
|
|
|
Create a node in the file system.
|
|
|
|
|
|
|
|
|
|
Create a node in the file system (file, device special file or named pipe)
|
|
|
|
|
at path. mode specifies both the permissions to use and the
|
|
|
|
|
type of node to be created, being combined (bitwise OR) with one of
|
|
|
|
|
S_IFREG, S_IFCHR, S_IFBLK, and S_IFIFO. If S_IFCHR or S_IFBLK is set on mode,
|
|
|
|
|
device defines the newly created device special file (probably using
|
|
|
|
|
os.makedev()). Otherwise device is ignored.
|
|
|
|
|
|
|
|
|
|
If dir_fd is not None, it should be a file descriptor open to a directory,
|
|
|
|
|
and path should be relative; path will then be relative to that directory.
|
|
|
|
|
dir_fd may not be implemented on your platform.
|
|
|
|
|
If it is unavailable, using it will raise a NotImplementedError.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_mknod_impl(PyObject *module, path_t *path, int mode, dev_t device,
|
2015-04-14 18:07:59 -04:00
|
|
|
int dir_fd)
|
2016-07-07 17:35:15 +03:00
|
|
|
/*[clinic end generated code: output=92e55d3ca8917461 input=ee44531551a4d83b]*/
|
2002-04-14 10:19:44 +00:00
|
|
|
{
|
2015-04-03 23:53:51 +03:00
|
|
|
int result;
|
|
|
|
|
int async_err = 0;
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2015-02-07 13:27:50 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef HAVE_MKNODAT
|
2015-02-07 13:27:50 +00:00
|
|
|
if (dir_fd != DEFAULT_DIR_FD)
|
|
|
|
|
result = mknodat(dir_fd, path->narrow, mode, device);
|
|
|
|
|
else
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
2015-02-07 13:27:50 +00:00
|
|
|
result = mknod(path->narrow, mode, device);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (result != 0 && errno == EINTR &&
|
|
|
|
|
!(async_err = PyErr_CheckSignals()));
|
|
|
|
|
if (result != 0)
|
|
|
|
|
return (!async_err) ? posix_error() : NULL;
|
2012-06-24 13:58:31 +02:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
1996-05-23 22:58:55 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV) */
|
|
|
|
|
|
1996-05-23 22:58:55 +00:00
|
|
|
|
2002-10-10 14:27:30 +00:00
|
|
|
#ifdef HAVE_DEVICE_MACROS
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.major -> unsigned_int
|
2002-10-10 14:27:30 +00:00
|
|
|
|
2015-01-18 11:17:39 +02:00
|
|
|
device: dev_t
|
2014-08-05 14:04:04 +10:00
|
|
|
/
|
2002-10-10 14:27:30 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Extracts a device major number from a raw device number.
|
|
|
|
|
[clinic start generated code]*/
|
2002-10-10 14:27:30 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
static unsigned int
|
2016-07-07 17:35:15 +03:00
|
|
|
os_major_impl(PyObject *module, dev_t device)
|
|
|
|
|
/*[clinic end generated code: output=5b3b2589bafb498e input=1e16a4d30c4d4462]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
return major(device);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.minor -> unsigned_int
|
|
|
|
|
|
2015-01-18 11:17:39 +02:00
|
|
|
device: dev_t
|
2014-08-05 14:04:04 +10:00
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Extracts a device minor number from a raw device number.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static unsigned int
|
2016-07-07 17:35:15 +03:00
|
|
|
os_minor_impl(PyObject *module, dev_t device)
|
|
|
|
|
/*[clinic end generated code: output=5e1a25e630b0157d input=0842c6d23f24c65e]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
return minor(device);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*[clinic input]
|
2015-01-18 11:17:39 +02:00
|
|
|
os.makedev -> dev_t
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
major: int
|
|
|
|
|
minor: int
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Composes a raw device number from the major and minor device numbers.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
2015-01-18 11:17:39 +02:00
|
|
|
static dev_t
|
2016-07-07 17:35:15 +03:00
|
|
|
os_makedev_impl(PyObject *module, int major, int minor)
|
|
|
|
|
/*[clinic end generated code: output=881aaa4aba6f6a52 input=4b9fd8fc73cbe48f]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
return makedev(major, minor);
|
2002-10-10 14:27:30 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_DEVICE_MACROS */
|
2002-10-10 14:27:30 +00:00
|
|
|
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2015-03-20 19:50:46 -07:00
|
|
|
#if defined HAVE_FTRUNCATE || defined MS_WINDOWS
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.ftruncate
|
|
|
|
|
|
|
|
|
|
fd: int
|
|
|
|
|
length: Py_off_t
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Truncate a file, specified by file descriptor, to a specific length.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_ftruncate_impl(PyObject *module, int fd, Py_off_t length)
|
|
|
|
|
/*[clinic end generated code: output=fba15523721be7e4 input=63b43641e52818f2]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
int result;
|
2015-02-07 13:27:50 +00:00
|
|
|
int async_err = 0;
|
1996-05-23 22:58:55 +00:00
|
|
|
|
2019-05-23 08:45:22 -07:00
|
|
|
if (PySys_Audit("os.truncate", "in", fd, length) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-07 13:27:50 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2015-04-12 00:26:43 -04:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
2015-03-20 19:50:46 -07:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
result = _chsize_s(fd, length);
|
|
|
|
|
#else
|
2015-02-07 13:27:50 +00:00
|
|
|
result = ftruncate(fd, length);
|
2015-03-20 19:50:46 -07:00
|
|
|
#endif
|
2015-04-12 00:26:43 -04:00
|
|
|
_Py_END_SUPPRESS_IPH
|
2015-02-07 13:27:50 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (result != 0 && errno == EINTR &&
|
|
|
|
|
!(async_err = PyErr_CheckSignals()));
|
|
|
|
|
if (result != 0)
|
|
|
|
|
return (!async_err) ? posix_error() : NULL;
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
1996-05-23 22:58:55 +00:00
|
|
|
}
|
2015-03-20 19:50:46 -07:00
|
|
|
#endif /* HAVE_FTRUNCATE || MS_WINDOWS */
|
2014-08-05 14:04:04 +10:00
|
|
|
|
1992-04-05 14:25:30 +00:00
|
|
|
|
2015-03-20 19:50:46 -07:00
|
|
|
#if defined HAVE_TRUNCATE || defined MS_WINDOWS
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.truncate
|
|
|
|
|
path: path_t(allow_fd='PATH_HAVE_FTRUNCATE')
|
|
|
|
|
length: Py_off_t
|
|
|
|
|
|
|
|
|
|
Truncate a file, specified by path, to a specific length.
|
|
|
|
|
|
|
|
|
|
On some platforms, path may also be specified as an open file descriptor.
|
|
|
|
|
If this functionality is unavailable, using it raises an exception.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_truncate_impl(PyObject *module, path_t *path, Py_off_t length)
|
|
|
|
|
/*[clinic end generated code: output=43009c8df5c0a12b input=77229cf0b50a9b77]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
int result;
|
2015-03-20 19:50:46 -07:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
int fd;
|
|
|
|
|
#endif
|
2011-03-17 20:20:30 +02:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
if (path->fd != -1)
|
2015-03-20 19:50:46 -07:00
|
|
|
return os_ftruncate_impl(module, path->fd, length);
|
|
|
|
|
|
2019-05-23 08:45:22 -07:00
|
|
|
if (PySys_Audit("os.truncate", "On", path->object, length) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-20 19:50:46 -07:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2015-04-12 00:26:43 -04:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
2015-03-20 19:50:46 -07:00
|
|
|
#ifdef MS_WINDOWS
|
2016-09-08 10:35:16 -07:00
|
|
|
fd = _wopen(path->wide, _O_WRONLY | _O_BINARY | _O_NOINHERIT);
|
2015-04-25 00:21:52 +02:00
|
|
|
if (fd < 0)
|
2015-03-20 19:50:46 -07:00
|
|
|
result = -1;
|
|
|
|
|
else {
|
|
|
|
|
result = _chsize_s(fd, length);
|
|
|
|
|
close(fd);
|
|
|
|
|
if (result < 0)
|
|
|
|
|
errno = result;
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
result = truncate(path->narrow, length);
|
2012-06-24 12:55:33 +02:00
|
|
|
#endif
|
2015-04-12 00:26:43 -04:00
|
|
|
_Py_END_SUPPRESS_IPH
|
2011-03-17 20:20:30 +02:00
|
|
|
Py_END_ALLOW_THREADS
|
2014-08-05 14:04:04 +10:00
|
|
|
if (result < 0)
|
2018-10-20 03:28:22 +03:00
|
|
|
return posix_path_error(path);
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
Py_RETURN_NONE;
|
2011-03-17 20:20:30 +02:00
|
|
|
}
|
2015-03-20 19:50:46 -07:00
|
|
|
#endif /* HAVE_TRUNCATE || MS_WINDOWS */
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2011-03-17 20:20:30 +02:00
|
|
|
|
2014-09-30 12:20:05 +02:00
|
|
|
/* Issue #22396: On 32-bit AIX platform, the prototypes of os.posix_fadvise()
|
|
|
|
|
and os.posix_fallocate() in system headers are wrong if _LARGE_FILES is
|
|
|
|
|
defined, which is the case in Python on AIX. AIX bug report:
|
|
|
|
|
http://www-01.ibm.com/support/docview.wss?uid=isg1IV56170 */
|
|
|
|
|
#if defined(_AIX) && defined(_LARGE_FILES) && !defined(__64BIT__)
|
|
|
|
|
# define POSIX_FADVISE_AIX_BUG
|
|
|
|
|
#endif
|
|
|
|
|
|
2014-09-30 12:35:58 +02:00
|
|
|
|
2014-09-30 12:20:05 +02:00
|
|
|
#if defined(HAVE_POSIX_FALLOCATE) && !defined(POSIX_FADVISE_AIX_BUG)
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.posix_fallocate
|
|
|
|
|
|
|
|
|
|
fd: int
|
|
|
|
|
offset: Py_off_t
|
|
|
|
|
length: Py_off_t
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Ensure a file has allocated at least a particular number of bytes on disk.
|
|
|
|
|
|
|
|
|
|
Ensure that the file specified by fd encompasses a range of bytes
|
|
|
|
|
starting at offset bytes from the beginning and continuing for length bytes.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_posix_fallocate_impl(PyObject *module, int fd, Py_off_t offset,
|
2015-04-14 18:07:59 -04:00
|
|
|
Py_off_t length)
|
2016-07-07 17:35:15 +03:00
|
|
|
/*[clinic end generated code: output=73f107139564aa9d input=d7a2ef0ab2ca52fb]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
int result;
|
2015-02-07 13:27:50 +00:00
|
|
|
int async_err = 0;
|
2011-03-17 20:20:30 +02:00
|
|
|
|
2015-02-07 13:27:50 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
result = posix_fallocate(fd, offset, length);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
2017-08-14 18:55:16 +05:00
|
|
|
} while (result == EINTR && !(async_err = PyErr_CheckSignals()));
|
|
|
|
|
|
|
|
|
|
if (result == 0)
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
|
|
|
|
|
if (async_err)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
errno = result;
|
|
|
|
|
return posix_error();
|
2011-03-17 20:20:30 +02:00
|
|
|
}
|
2014-09-30 12:35:58 +02:00
|
|
|
#endif /* HAVE_POSIX_FALLOCATE) && !POSIX_FADVISE_AIX_BUG */
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2011-03-17 20:20:30 +02:00
|
|
|
|
2014-09-30 12:20:05 +02:00
|
|
|
#if defined(HAVE_POSIX_FADVISE) && !defined(POSIX_FADVISE_AIX_BUG)
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.posix_fadvise
|
|
|
|
|
|
|
|
|
|
fd: int
|
|
|
|
|
offset: Py_off_t
|
|
|
|
|
length: Py_off_t
|
|
|
|
|
advice: int
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Announce an intention to access data in a specific pattern.
|
|
|
|
|
|
|
|
|
|
Announce an intention to access data in a specific pattern, thus allowing
|
|
|
|
|
the kernel to make optimizations.
|
|
|
|
|
The advice applies to the region of the file specified by fd starting at
|
|
|
|
|
offset and continuing for length bytes.
|
|
|
|
|
advice is one of POSIX_FADV_NORMAL, POSIX_FADV_SEQUENTIAL,
|
|
|
|
|
POSIX_FADV_RANDOM, POSIX_FADV_NOREUSE, POSIX_FADV_WILLNEED, or
|
|
|
|
|
POSIX_FADV_DONTNEED.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_posix_fadvise_impl(PyObject *module, int fd, Py_off_t offset,
|
2015-04-14 18:07:59 -04:00
|
|
|
Py_off_t length, int advice)
|
2016-07-07 17:35:15 +03:00
|
|
|
/*[clinic end generated code: output=412ef4aa70c98642 input=0fbe554edc2f04b5]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
int result;
|
2015-02-07 13:27:50 +00:00
|
|
|
int async_err = 0;
|
2011-03-17 20:20:30 +02:00
|
|
|
|
2015-02-07 13:27:50 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
result = posix_fadvise(fd, offset, length, advice);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
2017-08-14 18:55:16 +05:00
|
|
|
} while (result == EINTR && !(async_err = PyErr_CheckSignals()));
|
|
|
|
|
|
|
|
|
|
if (result == 0)
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
|
|
|
|
|
if (async_err)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
errno = result;
|
|
|
|
|
return posix_error();
|
2011-03-17 20:20:30 +02:00
|
|
|
}
|
2014-09-30 12:35:58 +02:00
|
|
|
#endif /* HAVE_POSIX_FADVISE && !POSIX_FADVISE_AIX_BUG */
|
2011-03-17 20:20:30 +02:00
|
|
|
|
1997-06-02 22:20:51 +00:00
|
|
|
|
2007-11-08 19:33:05 +00:00
|
|
|
#ifdef MS_WINDOWS
|
2020-01-24 11:53:44 +01:00
|
|
|
static PyObject*
|
|
|
|
|
win32_putenv(PyObject *name, PyObject *value)
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2017-06-25 07:33:01 +03:00
|
|
|
/* Search from index 1 because on Windows starting '=' is allowed for
|
|
|
|
|
defining hidden environment variables. */
|
|
|
|
|
if (PyUnicode_GET_LENGTH(name) == 0 ||
|
|
|
|
|
PyUnicode_FindChar(name, '=', 1, PyUnicode_GET_LENGTH(name), 1) != -1)
|
|
|
|
|
{
|
|
|
|
|
PyErr_SetString(PyExc_ValueError, "illegal environment variable name");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2020-01-24 11:53:44 +01:00
|
|
|
PyObject *unicode;
|
|
|
|
|
if (value != NULL) {
|
|
|
|
|
unicode = PyUnicode_FromFormat("%U=%U", name, value);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
unicode = PyUnicode_FromFormat("%U=", name);
|
|
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
if (unicode == NULL) {
|
|
|
|
|
return NULL;
|
2010-05-06 22:05:07 +00:00
|
|
|
}
|
2017-06-28 08:30:06 +03:00
|
|
|
|
2020-01-24 11:53:44 +01:00
|
|
|
Py_ssize_t size;
|
|
|
|
|
/* PyUnicode_AsWideCharString() rejects embedded null characters */
|
|
|
|
|
wchar_t *env = PyUnicode_AsWideCharString(unicode, &size);
|
|
|
|
|
Py_DECREF(unicode);
|
|
|
|
|
|
|
|
|
|
if (env == NULL) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2017-06-28 08:30:06 +03:00
|
|
|
if (size > _MAX_ENV) {
|
2011-11-22 22:16:17 +01:00
|
|
|
PyErr_Format(PyExc_ValueError,
|
|
|
|
|
"the environment variable is longer than %u characters",
|
|
|
|
|
_MAX_ENV);
|
2020-01-24 11:53:44 +01:00
|
|
|
PyMem_Free(env);
|
|
|
|
|
return NULL;
|
2017-06-28 08:30:06 +03:00
|
|
|
}
|
|
|
|
|
|
2020-01-24 11:53:44 +01:00
|
|
|
/* _wputenv() and SetEnvironmentVariableW() update the environment in the
|
|
|
|
|
Process Environment Block (PEB). _wputenv() also updates CRT 'environ'
|
|
|
|
|
and '_wenviron' variables, whereas SetEnvironmentVariableW() does not.
|
|
|
|
|
|
|
|
|
|
Prefer _wputenv() to be compatible with C libraries using CRT
|
|
|
|
|
variables and CRT functions using these variables (ex: getenv()). */
|
|
|
|
|
int err = _wputenv(env);
|
|
|
|
|
PyMem_Free(env);
|
|
|
|
|
|
|
|
|
|
if (err) {
|
2010-05-06 00:08:46 +00:00
|
|
|
posix_error();
|
2020-01-24 11:53:44 +01:00
|
|
|
return NULL;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2011-11-22 22:16:17 +01:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
2020-01-24 11:53:44 +01:00
|
|
|
}
|
|
|
|
|
#endif
|
2011-11-22 02:27:30 +01:00
|
|
|
|
2020-01-24 11:53:44 +01:00
|
|
|
|
|
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.putenv
|
|
|
|
|
|
|
|
|
|
name: unicode
|
|
|
|
|
value: unicode
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Change or add an environment variable.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
os_putenv_impl(PyObject *module, PyObject *name, PyObject *value)
|
|
|
|
|
/*[clinic end generated code: output=d29a567d6b2327d2 input=ba586581c2e6105f]*/
|
|
|
|
|
{
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.putenv", "OO", name, value) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2020-01-24 11:53:44 +01:00
|
|
|
return win32_putenv(name, value);
|
2014-08-05 14:04:04 +10:00
|
|
|
}
|
2020-01-24 14:05:48 +01:00
|
|
|
#else
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.putenv
|
2010-05-06 22:05:07 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
name: FSConverter
|
|
|
|
|
value: FSConverter
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Change or add an environment variable.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_putenv_impl(PyObject *module, PyObject *name, PyObject *value)
|
|
|
|
|
/*[clinic end generated code: output=d29a567d6b2327d2 input=a97bc6152f688d31]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2017-06-25 07:33:01 +03:00
|
|
|
const char *name_string = PyBytes_AS_STRING(name);
|
|
|
|
|
const char *value_string = PyBytes_AS_STRING(value);
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2017-06-25 07:33:01 +03:00
|
|
|
if (strchr(name_string, '=') != NULL) {
|
|
|
|
|
PyErr_SetString(PyExc_ValueError, "illegal environment variable name");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2020-01-22 22:48:16 +01:00
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.putenv", "OO", name, value) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-22 22:48:16 +01:00
|
|
|
if (setenv(name_string, value_string, 1)) {
|
|
|
|
|
return posix_error();
|
|
|
|
|
}
|
2010-05-06 22:05:07 +00:00
|
|
|
Py_RETURN_NONE;
|
1996-07-23 19:18:10 +00:00
|
|
|
}
|
2020-01-24 14:05:48 +01:00
|
|
|
#endif /* !defined(MS_WINDOWS) */
|
2014-08-05 14:04:04 +10:00
|
|
|
|
1997-09-15 22:54:34 +00:00
|
|
|
|
2020-01-24 11:53:44 +01:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.unsetenv
|
|
|
|
|
name: unicode
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Delete an environment variable.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
os_unsetenv_impl(PyObject *module, PyObject *name)
|
|
|
|
|
/*[clinic end generated code: output=54c4137ab1834f02 input=4d6a1747cc526d2f]*/
|
|
|
|
|
{
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.unsetenv", "(O)", name) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2020-01-24 11:53:44 +01:00
|
|
|
return win32_putenv(name, NULL);
|
|
|
|
|
}
|
2020-01-24 14:05:48 +01:00
|
|
|
#else
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.unsetenv
|
|
|
|
|
name: FSConverter
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Delete an environment variable.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_unsetenv_impl(PyObject *module, PyObject *name)
|
|
|
|
|
/*[clinic end generated code: output=54c4137ab1834f02 input=2bb5288a599c7107]*/
|
2001-10-19 01:31:59 +00:00
|
|
|
{
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.unsetenv", "(O)", name) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2011-11-24 13:53:38 +01:00
|
|
|
#ifdef HAVE_BROKEN_UNSETENV
|
|
|
|
|
unsetenv(PyBytes_AS_STRING(name));
|
|
|
|
|
#else
|
2020-01-24 11:53:44 +01:00
|
|
|
int err = unsetenv(PyBytes_AS_STRING(name));
|
|
|
|
|
if (err) {
|
2011-11-22 22:16:17 +01:00
|
|
|
return posix_error();
|
2020-01-24 11:53:44 +01:00
|
|
|
}
|
2011-11-24 13:53:38 +01:00
|
|
|
#endif
|
2010-05-06 00:08:46 +00:00
|
|
|
|
2010-05-06 22:05:07 +00:00
|
|
|
Py_RETURN_NONE;
|
2001-10-19 01:31:59 +00:00
|
|
|
}
|
2020-01-24 14:05:48 +01:00
|
|
|
#endif /* !MS_WINDOWS */
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.strerror
|
|
|
|
|
|
|
|
|
|
code: int
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Translate an error code to a message string.
|
|
|
|
|
[clinic start generated code]*/
|
2001-10-19 01:31:59 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_strerror_impl(PyObject *module, int code)
|
|
|
|
|
/*[clinic end generated code: output=baebf09fa02a78f2 input=75a8673d97915a91]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
char *message = strerror(code);
|
2010-05-06 00:08:46 +00:00
|
|
|
if (message == NULL) {
|
|
|
|
|
PyErr_SetString(PyExc_ValueError,
|
|
|
|
|
"strerror() argument out of range");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2011-12-17 05:47:23 +01:00
|
|
|
return PyUnicode_DecodeLocale(message, "surrogateescape");
|
1997-09-15 22:54:34 +00:00
|
|
|
}
|
|
|
|
|
|
1996-07-23 19:18:10 +00:00
|
|
|
|
1998-08-04 15:26:23 +00:00
|
|
|
#ifdef HAVE_SYS_WAIT_H
|
2002-04-23 15:58:02 +00:00
|
|
|
#ifdef WCOREDUMP
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.WCOREDUMP -> bool
|
|
|
|
|
|
|
|
|
|
status: int
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Return True if the process returning status was dumped to a core file.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static int
|
2016-07-07 17:35:15 +03:00
|
|
|
os_WCOREDUMP_impl(PyObject *module, int status)
|
|
|
|
|
/*[clinic end generated code: output=1a584b147b16bd18 input=8b05e7ab38528d04]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
WAIT_TYPE wait_status;
|
|
|
|
|
WAIT_STATUS_INT(wait_status) = status;
|
|
|
|
|
return WCOREDUMP(wait_status);
|
2002-04-23 15:58:02 +00:00
|
|
|
}
|
|
|
|
|
#endif /* WCOREDUMP */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2002-04-23 15:58:02 +00:00
|
|
|
#ifdef WIFCONTINUED
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.WIFCONTINUED -> bool
|
|
|
|
|
|
|
|
|
|
status: int
|
|
|
|
|
|
|
|
|
|
Return True if a particular process was continued from a job control stop.
|
|
|
|
|
|
|
|
|
|
Return True if the process returning status was continued from a
|
|
|
|
|
job control stop.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static int
|
2016-07-07 17:35:15 +03:00
|
|
|
os_WIFCONTINUED_impl(PyObject *module, int status)
|
|
|
|
|
/*[clinic end generated code: output=1e35295d844364bd input=e777e7d38eb25bd9]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
WAIT_TYPE wait_status;
|
|
|
|
|
WAIT_STATUS_INT(wait_status) = status;
|
|
|
|
|
return WIFCONTINUED(wait_status);
|
2002-04-23 15:58:02 +00:00
|
|
|
}
|
|
|
|
|
#endif /* WIFCONTINUED */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
1998-08-04 15:26:23 +00:00
|
|
|
#ifdef WIFSTOPPED
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.WIFSTOPPED -> bool
|
|
|
|
|
|
|
|
|
|
status: int
|
|
|
|
|
|
|
|
|
|
Return True if the process returning status was stopped.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static int
|
2016-07-07 17:35:15 +03:00
|
|
|
os_WIFSTOPPED_impl(PyObject *module, int status)
|
|
|
|
|
/*[clinic end generated code: output=fdb57122a5c9b4cb input=043cb7f1289ef904]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
WAIT_TYPE wait_status;
|
|
|
|
|
WAIT_STATUS_INT(wait_status) = status;
|
|
|
|
|
return WIFSTOPPED(wait_status);
|
1998-08-04 15:26:23 +00:00
|
|
|
}
|
|
|
|
|
#endif /* WIFSTOPPED */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
1998-08-04 15:26:23 +00:00
|
|
|
#ifdef WIFSIGNALED
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.WIFSIGNALED -> bool
|
1998-08-04 15:26:23 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
status: int
|
2002-01-30 05:46:57 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Return True if the process returning status was terminated by a signal.
|
|
|
|
|
[clinic start generated code]*/
|
2002-01-30 05:46:57 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
static int
|
2016-07-07 17:35:15 +03:00
|
|
|
os_WIFSIGNALED_impl(PyObject *module, int status)
|
|
|
|
|
/*[clinic end generated code: output=d1dde4dcc819a5f5 input=d55ba7cc9ce5dc43]*/
|
1998-08-04 15:26:23 +00:00
|
|
|
{
|
2014-08-05 14:04:04 +10:00
|
|
|
WAIT_TYPE wait_status;
|
|
|
|
|
WAIT_STATUS_INT(wait_status) = status;
|
|
|
|
|
return WIFSIGNALED(wait_status);
|
|
|
|
|
}
|
|
|
|
|
#endif /* WIFSIGNALED */
|
2002-01-30 05:46:57 +00:00
|
|
|
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
#ifdef WIFEXITED
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.WIFEXITED -> bool
|
1998-08-04 15:26:23 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
status: int
|
1998-08-04 15:26:23 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Return True if the process returning status exited via the exit() system call.
|
|
|
|
|
[clinic start generated code]*/
|
2002-01-30 05:46:57 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
static int
|
2016-07-07 17:35:15 +03:00
|
|
|
os_WIFEXITED_impl(PyObject *module, int status)
|
|
|
|
|
/*[clinic end generated code: output=01c09d6ebfeea397 input=d63775a6791586c0]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
WAIT_TYPE wait_status;
|
|
|
|
|
WAIT_STATUS_INT(wait_status) = status;
|
|
|
|
|
return WIFEXITED(wait_status);
|
|
|
|
|
}
|
|
|
|
|
#endif /* WIFEXITED */
|
1998-08-04 15:26:23 +00:00
|
|
|
|
|
|
|
|
|
2015-04-03 23:53:51 +03:00
|
|
|
#ifdef WEXITSTATUS
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.WEXITSTATUS -> int
|
|
|
|
|
|
|
|
|
|
status: int
|
|
|
|
|
|
|
|
|
|
Return the process return code from status.
|
|
|
|
|
[clinic start generated code]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
static int
|
2016-07-07 17:35:15 +03:00
|
|
|
os_WEXITSTATUS_impl(PyObject *module, int status)
|
|
|
|
|
/*[clinic end generated code: output=6e3efbba11f6488d input=e1fb4944e377585b]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
WAIT_TYPE wait_status;
|
|
|
|
|
WAIT_STATUS_INT(wait_status) = status;
|
|
|
|
|
return WEXITSTATUS(wait_status);
|
|
|
|
|
}
|
|
|
|
|
#endif /* WEXITSTATUS */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef WTERMSIG
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.WTERMSIG -> int
|
|
|
|
|
|
|
|
|
|
status: int
|
|
|
|
|
|
|
|
|
|
Return the signal that terminated the process that provided the status value.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static int
|
2016-07-07 17:35:15 +03:00
|
|
|
os_WTERMSIG_impl(PyObject *module, int status)
|
|
|
|
|
/*[clinic end generated code: output=172f7dfc8dcfc3ad input=727fd7f84ec3f243]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
WAIT_TYPE wait_status;
|
|
|
|
|
WAIT_STATUS_INT(wait_status) = status;
|
|
|
|
|
return WTERMSIG(wait_status);
|
|
|
|
|
}
|
|
|
|
|
#endif /* WTERMSIG */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef WSTOPSIG
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.WSTOPSIG -> int
|
|
|
|
|
|
|
|
|
|
status: int
|
|
|
|
|
|
|
|
|
|
Return the signal that stopped the process that provided the status value.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static int
|
2016-07-07 17:35:15 +03:00
|
|
|
os_WSTOPSIG_impl(PyObject *module, int status)
|
|
|
|
|
/*[clinic end generated code: output=0ab7586396f5d82b input=46ebf1d1b293c5c1]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
WAIT_TYPE wait_status;
|
|
|
|
|
WAIT_STATUS_INT(wait_status) = status;
|
|
|
|
|
return WSTOPSIG(wait_status);
|
|
|
|
|
}
|
|
|
|
|
#endif /* WSTOPSIG */
|
|
|
|
|
#endif /* HAVE_SYS_WAIT_H */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(HAVE_FSTATVFS) && defined(HAVE_SYS_STATVFS_H)
|
|
|
|
|
#ifdef _SCO_DS
|
|
|
|
|
/* SCO OpenServer 5.0 and later requires _SVID3 before it reveals the
|
|
|
|
|
needed definitions in sys/statvfs.h */
|
|
|
|
|
#define _SVID3
|
|
|
|
|
#endif
|
|
|
|
|
#include <sys/statvfs.h>
|
|
|
|
|
|
|
|
|
|
static PyObject*
|
2020-05-10 11:05:29 +02:00
|
|
|
_pystatvfs_fromstructstatvfs(PyObject *module, struct statvfs st) {
|
|
|
|
|
PyObject *StatVFSResultType = get_posix_state(module)->StatVFSResultType;
|
2019-11-05 07:16:14 -08:00
|
|
|
PyObject *v = PyStructSequence_New((PyTypeObject *)StatVFSResultType);
|
2010-05-06 00:08:46 +00:00
|
|
|
if (v == NULL)
|
|
|
|
|
return NULL;
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
|
|
|
|
|
#if !defined(HAVE_LARGEFILE_SUPPORT)
|
2010-05-06 00:08:46 +00:00
|
|
|
PyStructSequence_SET_ITEM(v, 0, PyLong_FromLong((long) st.f_bsize));
|
|
|
|
|
PyStructSequence_SET_ITEM(v, 1, PyLong_FromLong((long) st.f_frsize));
|
|
|
|
|
PyStructSequence_SET_ITEM(v, 2, PyLong_FromLong((long) st.f_blocks));
|
|
|
|
|
PyStructSequence_SET_ITEM(v, 3, PyLong_FromLong((long) st.f_bfree));
|
|
|
|
|
PyStructSequence_SET_ITEM(v, 4, PyLong_FromLong((long) st.f_bavail));
|
|
|
|
|
PyStructSequence_SET_ITEM(v, 5, PyLong_FromLong((long) st.f_files));
|
|
|
|
|
PyStructSequence_SET_ITEM(v, 6, PyLong_FromLong((long) st.f_ffree));
|
|
|
|
|
PyStructSequence_SET_ITEM(v, 7, PyLong_FromLong((long) st.f_favail));
|
|
|
|
|
PyStructSequence_SET_ITEM(v, 8, PyLong_FromLong((long) st.f_flag));
|
|
|
|
|
PyStructSequence_SET_ITEM(v, 9, PyLong_FromLong((long) st.f_namemax));
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
#else
|
2010-05-06 00:08:46 +00:00
|
|
|
PyStructSequence_SET_ITEM(v, 0, PyLong_FromLong((long) st.f_bsize));
|
|
|
|
|
PyStructSequence_SET_ITEM(v, 1, PyLong_FromLong((long) st.f_frsize));
|
|
|
|
|
PyStructSequence_SET_ITEM(v, 2,
|
2016-09-06 10:46:49 -07:00
|
|
|
PyLong_FromLongLong((long long) st.f_blocks));
|
2010-05-06 00:08:46 +00:00
|
|
|
PyStructSequence_SET_ITEM(v, 3,
|
2016-09-06 10:46:49 -07:00
|
|
|
PyLong_FromLongLong((long long) st.f_bfree));
|
2010-05-06 00:08:46 +00:00
|
|
|
PyStructSequence_SET_ITEM(v, 4,
|
2016-09-06 10:46:49 -07:00
|
|
|
PyLong_FromLongLong((long long) st.f_bavail));
|
2010-05-06 00:08:46 +00:00
|
|
|
PyStructSequence_SET_ITEM(v, 5,
|
2016-09-06 10:46:49 -07:00
|
|
|
PyLong_FromLongLong((long long) st.f_files));
|
2010-05-06 00:08:46 +00:00
|
|
|
PyStructSequence_SET_ITEM(v, 6,
|
2016-09-06 10:46:49 -07:00
|
|
|
PyLong_FromLongLong((long long) st.f_ffree));
|
2010-05-06 00:08:46 +00:00
|
|
|
PyStructSequence_SET_ITEM(v, 7,
|
2016-09-06 10:46:49 -07:00
|
|
|
PyLong_FromLongLong((long long) st.f_favail));
|
2010-05-06 00:08:46 +00:00
|
|
|
PyStructSequence_SET_ITEM(v, 8, PyLong_FromLong((long) st.f_flag));
|
|
|
|
|
PyStructSequence_SET_ITEM(v, 9, PyLong_FromLong((long) st.f_namemax));
|
|
|
|
|
#endif
|
2018-01-05 13:01:58 +01:00
|
|
|
/* The _ALL_SOURCE feature test macro defines f_fsid as a structure
|
|
|
|
|
* (issue #32390). */
|
|
|
|
|
#if defined(_AIX) && defined(_ALL_SOURCE)
|
|
|
|
|
PyStructSequence_SET_ITEM(v, 10, PyLong_FromUnsignedLong(st.f_fsid.val[0]));
|
|
|
|
|
#else
|
2017-12-14 23:46:46 +01:00
|
|
|
PyStructSequence_SET_ITEM(v, 10, PyLong_FromUnsignedLong(st.f_fsid));
|
2018-01-05 13:01:58 +01:00
|
|
|
#endif
|
2013-10-30 18:55:24 +01:00
|
|
|
if (PyErr_Occurred()) {
|
|
|
|
|
Py_DECREF(v);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2010-05-06 00:08:46 +00:00
|
|
|
|
|
|
|
|
return v;
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.fstatvfs
|
|
|
|
|
fd: int
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Perform an fstatvfs system call on the given fd.
|
|
|
|
|
|
|
|
|
|
Equivalent to statvfs(fd).
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
1999-01-06 18:42:14 +00:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_fstatvfs_impl(PyObject *module, int fd)
|
|
|
|
|
/*[clinic end generated code: output=53547cf0cc55e6c5 input=d8122243ac50975e]*/
|
1999-01-06 18:42:14 +00:00
|
|
|
{
|
2014-08-05 14:04:04 +10:00
|
|
|
int result;
|
2015-02-07 13:27:50 +00:00
|
|
|
int async_err = 0;
|
2010-05-06 00:08:46 +00:00
|
|
|
struct statvfs st;
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
|
2015-02-07 13:27:50 +00:00
|
|
|
do {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
result = fstatvfs(fd, &st);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
} while (result != 0 && errno == EINTR &&
|
|
|
|
|
!(async_err = PyErr_CheckSignals()));
|
2014-08-05 14:04:04 +10:00
|
|
|
if (result != 0)
|
2015-02-07 13:27:50 +00:00
|
|
|
return (!async_err) ? posix_error() : NULL;
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
|
2020-05-10 11:05:29 +02:00
|
|
|
return _pystatvfs_fromstructstatvfs(module, st);
|
1999-01-06 18:42:14 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* defined(HAVE_FSTATVFS) && defined(HAVE_SYS_STATVFS_H) */
|
1999-01-06 18:42:14 +00:00
|
|
|
|
|
|
|
|
|
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Inherits test_gzip/test_tarfile failures on 64-bit platforms from the trunk,
but I don't want the merge to hang around too long (even though the regular
p3yk-contributors are/have been busy with other things.)
Merged revisions 45621-46490 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r45621 | george.yoshida | 2006-04-21 18:34:17 +0200 (Fri, 21 Apr 2006) | 2 lines
Correct the grammar
........
r45622 | tim.peters | 2006-04-21 18:34:54 +0200 (Fri, 21 Apr 2006) | 2 lines
Whitespace normalization.
........
r45624 | thomas.heller | 2006-04-21 18:48:56 +0200 (Fri, 21 Apr 2006) | 1 line
Merge in changes from ctypes 0.9.9.6 upstream version.
........
r45625 | thomas.heller | 2006-04-21 18:51:04 +0200 (Fri, 21 Apr 2006) | 1 line
Merge in changes from ctypes 0.9.9.6 upstream version.
........
r45630 | thomas.heller | 2006-04-21 20:29:17 +0200 (Fri, 21 Apr 2006) | 8 lines
Documentation for ctypes.
I think that 'generic operating system services' is the best category.
Note that the Doc/lib/libctypes.latex file is generated from reST sources.
You are welcome to make typo fixes, and I'll try to keep the reST sources
in sync, but markup changes would be lost - they should be fixed in the tool
that creates the latex file.
The conversion script is external/ctypes/docs/manual/mkpydoc.py.
........
r45631 | tim.peters | 2006-04-21 23:18:10 +0200 (Fri, 21 Apr 2006) | 24 lines
SF bug #1473760 TempFile can hang on Windows.
Python 2.4 changed ntpath.abspath to do an import
inside the function. As a result, due to Python's
import lock, anything calling abspath on Windows
(directly, or indirectly like tempfile.TemporaryFile)
hung when it was called from a thread spawned as a
side effect of importing a module.
This is a depressingly frequent problem, and
deserves a more general fix. I'm settling for
a micro-fix here because this specific one accounts
for a report of Zope Corp's ZEO hanging on Windows,
and it was an odd way to change abspath to begin
with (ntpath needs a different implementation
depending on whether we're actually running on
Windows, and the _obvious_ way to arrange for that
is not to bury a possibly-failing import _inside_
the function).
Note that if/when other micro-fixes of this kind
get made, the new Lib/test/threaded_import_hangers.py
is a convenient place to add tests for them.
........
r45634 | phillip.eby | 2006-04-21 23:53:37 +0200 (Fri, 21 Apr 2006) | 2 lines
Guido wrote contextlib, not me, but thanks anyway. ;)
........
r45636 | andrew.kuchling | 2006-04-22 03:51:41 +0200 (Sat, 22 Apr 2006) | 1 line
Typo fixes
........
r45638 | andrew.kuchling | 2006-04-22 03:58:40 +0200 (Sat, 22 Apr 2006) | 1 line
Fix comment typo
........
r45639 | andrew.kuchling | 2006-04-22 04:06:03 +0200 (Sat, 22 Apr 2006) | 8 lines
Make copy of test_mailbox.py. We'll still want to check the backward
compatibility classes in the new mailbox.py that I'll be committing in
a few minutes.
One change has been made: the tests use len(mbox) instead of len(mbox.boxes).
The 'boxes' attribute was never documented and contains some internal state
that seems unlikely to have been useful.
........
r45640 | andrew.kuchling | 2006-04-22 04:32:43 +0200 (Sat, 22 Apr 2006) | 16 lines
Add Gregory K. Johnson's revised version of mailbox.py (funded by
the 2005 Summer of Code).
The revision adds a number of new mailbox classes that support adding
and removing messages; these classes also support mailbox locking and
default to using email.Message instead of rfc822.Message.
The old mailbox classes are largely left alone for backward compatibility.
The exception is the Maildir class, which was present in the old module
and now inherits from the new classes. The Maildir class's interface
is pretty simple, though, so I think it'll be compatible with existing
code.
(The change to the NEWS file also adds a missing word to a different
news item, which unfortunately required rewrapping the line.)
........
r45641 | tim.peters | 2006-04-22 07:52:59 +0200 (Sat, 22 Apr 2006) | 2 lines
Whitespace normalization.
........
r45642 | neal.norwitz | 2006-04-22 08:07:46 +0200 (Sat, 22 Apr 2006) | 1 line
Add libctypes as a dep
........
r45643 | martin.v.loewis | 2006-04-22 13:15:41 +0200 (Sat, 22 Apr 2006) | 1 line
Fix more ssize_t problems.
........
r45644 | martin.v.loewis | 2006-04-22 13:40:03 +0200 (Sat, 22 Apr 2006) | 1 line
Fix more ssize_t issues.
........
r45645 | george.yoshida | 2006-04-22 17:10:49 +0200 (Sat, 22 Apr 2006) | 2 lines
Typo fixes
........
r45647 | martin.v.loewis | 2006-04-22 17:19:54 +0200 (Sat, 22 Apr 2006) | 1 line
Port to Python 2.5. Drop .DEF file. Change output file names to .pyd.
........
r45648 | george.yoshida | 2006-04-22 17:27:14 +0200 (Sat, 22 Apr 2006) | 3 lines
- add versionadded tag
- make arbitrary arguments come last
........
r45649 | hyeshik.chang | 2006-04-22 17:48:15 +0200 (Sat, 22 Apr 2006) | 3 lines
Remove $CJKCodecs$ RCS tags. The CJKCodecs isn't maintained outside
anymore.
........
r45654 | greg.ward | 2006-04-23 05:47:58 +0200 (Sun, 23 Apr 2006) | 2 lines
Update optparse to Optik 1.5.1.
........
r45658 | george.yoshida | 2006-04-23 11:27:10 +0200 (Sun, 23 Apr 2006) | 2 lines
wrap SyntaxError with \exception{}
........
r45660 | ronald.oussoren | 2006-04-23 13:59:25 +0200 (Sun, 23 Apr 2006) | 6 lines
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.
........
r45661 | ronald.oussoren | 2006-04-23 14:36:23 +0200 (Sun, 23 Apr 2006) | 5 lines
Patch 1471761 - test for broken poll at runtime
This patch checks if poll is broken when the select module is loaded instead
of doing so at configure-time. This functionality is only active on Mac OS X.
........
r45662 | nick.coghlan | 2006-04-23 17:13:32 +0200 (Sun, 23 Apr 2006) | 1 line
Add a Context Types section to parallel the Iterator Types section (uses the same terminology as the 2.5a1 implementation)
........
r45663 | nick.coghlan | 2006-04-23 17:14:37 +0200 (Sun, 23 Apr 2006) | 1 line
Update contextlib documentation to use the same terminology as the module implementation
........
r45664 | gerhard.haering | 2006-04-23 17:24:26 +0200 (Sun, 23 Apr 2006) | 2 lines
Updated the sqlite3 module to the external pysqlite 2.2.2 version.
........
r45666 | nick.coghlan | 2006-04-23 17:39:16 +0200 (Sun, 23 Apr 2006) | 1 line
Update with statement documentation to use same terminology as 2.5a1 implementation
........
r45667 | nick.coghlan | 2006-04-23 18:05:04 +0200 (Sun, 23 Apr 2006) | 1 line
Add a (very) brief mention of the with statement to the end of chapter 8
........
r45668 | nick.coghlan | 2006-04-23 18:35:19 +0200 (Sun, 23 Apr 2006) | 1 line
Take 2 on mentioning the with statement, this time without inadvertently killing the Unicode examples
........
r45669 | nick.coghlan | 2006-04-23 19:04:07 +0200 (Sun, 23 Apr 2006) | 1 line
Backdated NEWS entry to record the implementation of PEP 338 for alpha 1
........
r45670 | tim.peters | 2006-04-23 20:13:45 +0200 (Sun, 23 Apr 2006) | 2 lines
Whitespace normalization.
........
r45671 | skip.montanaro | 2006-04-23 21:14:27 +0200 (Sun, 23 Apr 2006) | 1 line
first cut at trace module doc
........
r45672 | skip.montanaro | 2006-04-23 21:26:33 +0200 (Sun, 23 Apr 2006) | 1 line
minor tweak
........
r45673 | skip.montanaro | 2006-04-23 21:30:50 +0200 (Sun, 23 Apr 2006) | 1 line
it's always helpful if the example works...
........
r45674 | skip.montanaro | 2006-04-23 21:32:14 +0200 (Sun, 23 Apr 2006) | 1 line
correct example
........
r45675 | andrew.kuchling | 2006-04-23 23:01:04 +0200 (Sun, 23 Apr 2006) | 1 line
Edits to the PEP 343 section
........
r45676 | andrew.kuchling | 2006-04-23 23:51:10 +0200 (Sun, 23 Apr 2006) | 1 line
Add two items
........
r45677 | tim.peters | 2006-04-24 04:03:16 +0200 (Mon, 24 Apr 2006) | 5 lines
Bug #1337990: clarified that `doctest` does not support examples
requiring both expected output and an exception.
I'll backport to 2.4 next.
........
r45679 | nick.coghlan | 2006-04-24 05:04:43 +0200 (Mon, 24 Apr 2006) | 1 line
Note changes made to PEP 343 related documentation
........
r45681 | nick.coghlan | 2006-04-24 06:17:02 +0200 (Mon, 24 Apr 2006) | 1 line
Change PEP 343 related documentation to use the term context specifier instead of context object
........
r45682 | nick.coghlan | 2006-04-24 06:32:47 +0200 (Mon, 24 Apr 2006) | 1 line
Add unit tests for the -m and -c command line switches
........
r45683 | nick.coghlan | 2006-04-24 06:37:15 +0200 (Mon, 24 Apr 2006) | 1 line
Fix contextlib.nested to cope with exit methods raising and handling exceptions
........
r45685 | nick.coghlan | 2006-04-24 06:59:28 +0200 (Mon, 24 Apr 2006) | 1 line
Fix broken contextlib test from last checkin (I'd've sworn I tested that before checking it in. . .)
........
r45686 | nick.coghlan | 2006-04-24 07:24:26 +0200 (Mon, 24 Apr 2006) | 1 line
Back out new command line tests (broke buildbot)
........
r45687 | nick.coghlan | 2006-04-24 07:52:15 +0200 (Mon, 24 Apr 2006) | 1 line
More reliable version of new command line tests that just checks the exit codes
........
r45688 | thomas.wouters | 2006-04-24 13:37:13 +0200 (Mon, 24 Apr 2006) | 4 lines
Stop test_tcl's testLoadTk from leaking the Tk commands 'loadtk' registers.
........
r45690 | andrew.kuchling | 2006-04-24 16:30:47 +0200 (Mon, 24 Apr 2006) | 2 lines
Edits, using the new term
'context specifier' in a few places
........
r45697 | phillip.eby | 2006-04-24 22:53:13 +0200 (Mon, 24 Apr 2006) | 2 lines
Revert addition of setuptools
........
r45698 | tim.peters | 2006-04-25 00:45:13 +0200 (Tue, 25 Apr 2006) | 2 lines
Whitespace normalization.
........
r45700 | trent.mick | 2006-04-25 02:34:50 +0200 (Tue, 25 Apr 2006) | 4 lines
Put break at correct level so *all* root HKEYs acutally get checked for
an installed VC6. Otherwise only the first such tree gets checked and this
warning doesn't get displayed.
........
r45701 | tim.peters | 2006-04-25 05:31:36 +0200 (Tue, 25 Apr 2006) | 3 lines
Patch #1475231: add a new SKIP doctest option, thanks to
Edward Loper.
........
r45702 | neal.norwitz | 2006-04-25 07:04:35 +0200 (Tue, 25 Apr 2006) | 1 line
versionadded for SKIP
........
r45703 | neal.norwitz | 2006-04-25 07:05:03 +0200 (Tue, 25 Apr 2006) | 1 line
Restore Walters name
........
r45704 | neal.norwitz | 2006-04-25 07:49:42 +0200 (Tue, 25 Apr 2006) | 1 line
Revert previous change, SKIP had a versionadded elsewhere
........
r45706 | nick.coghlan | 2006-04-25 12:56:51 +0200 (Tue, 25 Apr 2006) | 31 lines
Move the PEP 343 documentation and implementation closer to the
terminology in the alpha 1 documentation.
- "context manager" reverts to its alpha 1 definition
- the term "context specifier" goes away entirely
- contextlib.GeneratorContextManager is renamed GeneratorContext
There are still a number of changes relative to alpha 1:
- the expression in the with statement is explicitly called the
"context expression" in the language reference
- the terms 'with statement context', 'context object' or 'with
statement context' are used in several places instead of a bare
'context'. The aim of this is to avoid ambiguity in relation to the
runtime context set up when the block is executed, and the context
objects that already exist in various application domains (such as
decimal.Context)
- contextlib.contextmanager is renamed to contextfactory
This best reflects the nature of the function resulting from the
use of that decorator
- decimal.ContextManager is renamed to WithStatementContext
Simple dropping the 'Manager' part wasn't possible due to the
fact that decimal.Context already exists and means something
different. WithStatementContext is ugly but workable.
A technically unrelated change snuck into this commit:
contextlib.closing now avoids the overhead of creating a
generator, since it's trivial to implement that particular
context manager directly.
........
r45707 | nick.coghlan | 2006-04-25 13:05:56 +0200 (Tue, 25 Apr 2006) | 1 line
Fix latex typo
........
r45708 | thomas.wouters | 2006-04-25 14:28:56 +0200 (Tue, 25 Apr 2006) | 4 lines
Fix markup glitch in unittest docs. Will backport.
........
r45710 | andrew.kuchling | 2006-04-25 14:31:38 +0200 (Tue, 25 Apr 2006) | 1 line
Add two items; easy_install is now off the table, though pkgutil still is
........
r45711 | andrew.kuchling | 2006-04-25 14:47:25 +0200 (Tue, 25 Apr 2006) | 1 line
Rework context terminology
........
r45712 | thomas.wouters | 2006-04-25 15:53:23 +0200 (Tue, 25 Apr 2006) | 9 lines
SF bug/patch #1433877: string parameter to ioctl not null terminated
The new char-array used in ioctl calls wasn't explicitly NUL-terminated;
quite probably the cause for the test_pty failures on Solaris that we
circumvented earlier. (I wasn't able to reproduce it with this patch, but it
has been somewhat elusive to start with.)
........
r45713 | george.yoshida | 2006-04-25 16:09:58 +0200 (Tue, 25 Apr 2006) | 2 lines
minor tweak
........
r45714 | thomas.wouters | 2006-04-25 17:08:10 +0200 (Tue, 25 Apr 2006) | 7 lines
Fix SF bug #1476111: SystemError in socket sendto. The AF_INET6 and
AF_PACKET cases in getsockaddrarg were missing their own checks for
tuple-ness of the address argument, which means a confusing SystemError was
raised by PyArg_ParseTuple instead.
........
r45715 | thomas.wouters | 2006-04-25 17:29:46 +0200 (Tue, 25 Apr 2006) | 10 lines
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.
........
r45717 | thomas.heller | 2006-04-25 20:26:08 +0200 (Tue, 25 Apr 2006) | 3 lines
Fix compiler warnings on Darwin.
Patch by Brett Canon, see
https://sourceforge.net/tracker/?func=detail&atid=532156&aid=1475959&group_id=71702
........
r45718 | guido.van.rossum | 2006-04-25 22:12:45 +0200 (Tue, 25 Apr 2006) | 4 lines
Implement MvL's improvement on __context__ in Condition;
this can just call __context__ on the underlying lock.
(The same change for Semaphore does *not* work!)
........
r45721 | tim.peters | 2006-04-26 03:15:53 +0200 (Wed, 26 Apr 2006) | 13 lines
Rev 45706 renamed stuff in contextlib.py, but didn't rename
uses of it in test_with.py. As a result, test_with has been skipped
(due to failing imports) on all buildbot boxes since. Alas, that's
not a test failure -- you have to pay attention to the
1 skip unexpected on PLATFORM:
test_with
kinds of output at the ends of test runs to notice that this got
broken.
It's likely that more renaming in test_with.py would be desirable.
........
r45722 | fred.drake | 2006-04-26 07:15:41 +0200 (Wed, 26 Apr 2006) | 1 line
markup fixes, cleanup
........
r45723 | fred.drake | 2006-04-26 07:19:39 +0200 (Wed, 26 Apr 2006) | 1 line
minor adjustment suggested by Peter Gephardt
........
r45724 | neal.norwitz | 2006-04-26 07:34:03 +0200 (Wed, 26 Apr 2006) | 10 lines
Patch from Aldo Cortesi (OpenBSD buildbot owner).
After the patch (45590) to add extra debug stats to the gc module, Python
was crashing on OpenBSD due to:
Fatal Python error: Interpreter not initialized (version mismatch?)
This seems to occur due to calling collect() when initialized (in pythonrun.c)
is set to 0. Now, the import will occur in the init function which
shouldn't suffer this problem.
........
r45725 | neal.norwitz | 2006-04-26 08:26:12 +0200 (Wed, 26 Apr 2006) | 3 lines
Fix this test on Solaris. There can be embedded \r, so don't just replace
the one at the end.
........
r45727 | nick.coghlan | 2006-04-26 13:50:04 +0200 (Wed, 26 Apr 2006) | 1 line
Fix an error in the last contextlib.closing example
........
r45728 | andrew.kuchling | 2006-04-26 14:21:06 +0200 (Wed, 26 Apr 2006) | 1 line
[Bug #1475080] Fix example
........
r45729 | andrew.kuchling | 2006-04-26 14:23:39 +0200 (Wed, 26 Apr 2006) | 1 line
Add labels to all sections
........
r45730 | thomas.wouters | 2006-04-26 17:53:30 +0200 (Wed, 26 Apr 2006) | 7 lines
The result of SF patch #1471578: big-memory tests for strings, lists and
tuples. Lots to be added, still, but this will give big-memory people
something to play with in 2.5 alpha 2, and hopefully get more people to
write these tests.
........
r45731 | tim.peters | 2006-04-26 19:11:16 +0200 (Wed, 26 Apr 2006) | 2 lines
Whitespace normalization.
........
r45732 | martin.v.loewis | 2006-04-26 19:19:44 +0200 (Wed, 26 Apr 2006) | 1 line
Use GS- and bufferoverlowU.lib where appropriate, for AMD64.
........
r45733 | thomas.wouters | 2006-04-26 20:46:01 +0200 (Wed, 26 Apr 2006) | 5 lines
Add tests for += and *= on strings, and fix the memory-use estimate for the
list.extend tests (they were estimating half the actual use.)
........
r45734 | thomas.wouters | 2006-04-26 21:14:46 +0200 (Wed, 26 Apr 2006) | 5 lines
Some more test-size-estimate fixes: test_append and test_insert trigger a
list resize, which overallocates.
........
r45735 | hyeshik.chang | 2006-04-26 21:20:26 +0200 (Wed, 26 Apr 2006) | 3 lines
Fix build on MIPS for libffi. I haven't tested this yet because I
don't have an access on MIPS machines. Will be tested by buildbot. :)
........
r45737 | fred.drake | 2006-04-27 01:40:32 +0200 (Thu, 27 Apr 2006) | 1 line
one more place to use the current Python version
........
r45738 | fred.drake | 2006-04-27 02:02:24 +0200 (Thu, 27 Apr 2006) | 3 lines
- update version numbers in file names again, until we have a better way
- elaborate instructions for Cygwin support (closes SF #839709)
........
r45739 | fred.drake | 2006-04-27 02:20:14 +0200 (Thu, 27 Apr 2006) | 1 line
add missing word
........
r45740 | anthony.baxter | 2006-04-27 04:11:24 +0200 (Thu, 27 Apr 2006) | 2 lines
2.5a2
........
r45741 | anthony.baxter | 2006-04-27 04:13:13 +0200 (Thu, 27 Apr 2006) | 1 line
2.5a2
........
r45749 | andrew.kuchling | 2006-04-27 14:22:37 +0200 (Thu, 27 Apr 2006) | 1 line
Now that 2.5a2 is out, revert to the current date
........
r45750 | andrew.kuchling | 2006-04-27 14:23:07 +0200 (Thu, 27 Apr 2006) | 1 line
Bump document version
........
r45751 | andrew.kuchling | 2006-04-27 14:34:39 +0200 (Thu, 27 Apr 2006) | 6 lines
[Bug #1477102] Add necessary import to example
This may be a useful style question for the docs -- should examples show
the necessary imports, or should it be assumed that the reader will
figure it out? In the What's New, I'm not consistent but usually opt
for omitting the imports.
........
r45753 | andrew.kuchling | 2006-04-27 14:38:35 +0200 (Thu, 27 Apr 2006) | 1 line
[Bug #1477140] Import Error base class
........
r45754 | andrew.kuchling | 2006-04-27 14:42:54 +0200 (Thu, 27 Apr 2006) | 1 line
Mention the xmlrpclib.Error base class, which is used in one of the examples
........
r45756 | george.yoshida | 2006-04-27 15:41:07 +0200 (Thu, 27 Apr 2006) | 2 lines
markup fix
........
r45757 | thomas.wouters | 2006-04-27 15:46:59 +0200 (Thu, 27 Apr 2006) | 4 lines
Some more size-estimate fixes, for large-list-tests.
........
r45758 | thomas.heller | 2006-04-27 17:50:42 +0200 (Thu, 27 Apr 2006) | 3 lines
Rerun the libffi configuration if any of the files used for that
are newer then fficonfig.py.
........
r45766 | thomas.wouters | 2006-04-28 00:37:50 +0200 (Fri, 28 Apr 2006) | 6 lines
Some style fixes and size-calculation fixes. Also do the small-memory run
using a prime number, rather than a convenient power-of-2-and-multiple-of-5,
so incorrect testing algorithms fail more easily.
........
r45767 | thomas.wouters | 2006-04-28 00:38:32 +0200 (Fri, 28 Apr 2006) | 6 lines
Do the small-memory run of big-meormy tests using a prime number, rather
than a convenient power-of-2-and-multiple-of-5, so incorrect testing
algorithms fail more easily.
........
r45768 | david.goodger | 2006-04-28 00:53:05 +0200 (Fri, 28 Apr 2006) | 1 line
Added SVN access for Steven Bethard and Talin, for PEP updating.
........
r45770 | thomas.wouters | 2006-04-28 01:13:20 +0200 (Fri, 28 Apr 2006) | 16 lines
- Add new Warning class, ImportWarning
- Warn-raise ImportWarning when importing would have picked up a directory
as package, if only it'd had an __init__.py. This swaps two tests (for
case-ness and __init__-ness), but case-test is not really more expensive,
and it's not in a speed-critical section.
- Test for the new warning by importing a common non-package directory on
sys.path: site-packages
- In regrtest.py, silence warnings generated by the build-environment
because Modules/ (which is added to sys.path for Setup-created modules)
has 'zlib' and '_ctypes' directories without __init__.py's.
........
r45771 | thomas.wouters | 2006-04-28 01:41:27 +0200 (Fri, 28 Apr 2006) | 6 lines
Add more ignores of ImportWarnings; these are all just potential triggers
(since they won't trigger if zlib is already sucessfully imported); they
were found by grepping .py files, instead of looking at warning output :)
........
r45773 | neal.norwitz | 2006-04-28 06:32:20 +0200 (Fri, 28 Apr 2006) | 1 line
Add some whitespace to be more consistent.
........
r45774 | neal.norwitz | 2006-04-28 06:34:43 +0200 (Fri, 28 Apr 2006) | 5 lines
Try to really fix the slow buildbots this time.
Printing to stdout, doesn't mean the data was actually written.
It depends on the buffering, so we need to flush. This will hopefully
really fix the buildbots getting killed due to no output on the slow bots.
........
r45775 | neal.norwitz | 2006-04-28 07:28:05 +0200 (Fri, 28 Apr 2006) | 1 line
Fix some warnings on Mac OS X 10.4
........
r45776 | neal.norwitz | 2006-04-28 07:28:30 +0200 (Fri, 28 Apr 2006) | 1 line
Fix a warning on alpha
........
r45777 | neal.norwitz | 2006-04-28 07:28:54 +0200 (Fri, 28 Apr 2006) | 1 line
Fix a warning on ppc (debian)
........
r45778 | george.yoshida | 2006-04-28 18:09:45 +0200 (Fri, 28 Apr 2006) | 2 lines
fix markup glitch
........
r45780 | georg.brandl | 2006-04-28 18:31:17 +0200 (Fri, 28 Apr 2006) | 3 lines
Add SeaMonkey to the list of Mozilla browsers.
........
r45781 | georg.brandl | 2006-04-28 18:36:55 +0200 (Fri, 28 Apr 2006) | 2 lines
Bug #1475009: clarify ntpath.join behavior with absolute components
........
r45783 | george.yoshida | 2006-04-28 18:40:14 +0200 (Fri, 28 Apr 2006) | 2 lines
correct a dead link
........
r45785 | georg.brandl | 2006-04-28 18:54:25 +0200 (Fri, 28 Apr 2006) | 4 lines
Bug #1472949: stringify IOErrors in shutil.copytree when appending
them to the Error errors list.
........
r45786 | georg.brandl | 2006-04-28 18:58:52 +0200 (Fri, 28 Apr 2006) | 3 lines
Bug #1478326: don't allow '/' in distutils.util.get_platform machine names
since this value is used to name the build directory.
........
r45788 | thomas.heller | 2006-04-28 19:02:18 +0200 (Fri, 28 Apr 2006) | 1 line
Remove a duplicated test (the same test is in test_incomplete.py).
........
r45792 | georg.brandl | 2006-04-28 21:09:24 +0200 (Fri, 28 Apr 2006) | 3 lines
Bug #1478429: make datetime.datetime.fromtimestamp accept every float,
possibly "rounding up" to the next whole second.
........
r45796 | george.yoshida | 2006-04-29 04:43:30 +0200 (Sat, 29 Apr 2006) | 2 lines
grammar fix
........
r45800 | ronald.oussoren | 2006-04-29 13:31:35 +0200 (Sat, 29 Apr 2006) | 2 lines
Patch 1471883: --enable-universalsdk on Mac OS X
........
r45801 | andrew.kuchling | 2006-04-29 13:53:15 +0200 (Sat, 29 Apr 2006) | 1 line
Add item
........
r45802 | andrew.kuchling | 2006-04-29 14:10:28 +0200 (Sat, 29 Apr 2006) | 1 line
Make case of 'ZIP' consistent
........
r45803 | andrew.kuchling | 2006-04-29 14:10:43 +0200 (Sat, 29 Apr 2006) | 1 line
Add item
........
r45808 | martin.v.loewis | 2006-04-29 14:37:25 +0200 (Sat, 29 Apr 2006) | 3 lines
Further changes for #1471883: Edit Misc/NEWS, and
add expat_config.h.
........
r45809 | brett.cannon | 2006-04-29 23:29:50 +0200 (Sat, 29 Apr 2006) | 2 lines
Fix docstring for contextfactory; mentioned old contextmanager name.
........
r45810 | gerhard.haering | 2006-04-30 01:12:41 +0200 (Sun, 30 Apr 2006) | 3 lines
This is the start of documentation for the sqlite3 module. Please feel free to
find a better place for the link to it than alongside bsddb & friends.
........
r45811 | andrew.kuchling | 2006-04-30 03:07:09 +0200 (Sun, 30 Apr 2006) | 1 line
Add two items
........
r45814 | george.yoshida | 2006-04-30 05:49:56 +0200 (Sun, 30 Apr 2006) | 2 lines
Use \versionchanged instead of \versionadded for new parameter support.
........
r45815 | georg.brandl | 2006-04-30 09:06:11 +0200 (Sun, 30 Apr 2006) | 2 lines
Patch #1470846: fix urllib2 ProxyBasicAuthHandler.
........
r45817 | georg.brandl | 2006-04-30 10:57:35 +0200 (Sun, 30 Apr 2006) | 3 lines
In stdlib, use hashlib instead of deprecated md5 and sha modules.
........
r45819 | georg.brandl | 2006-04-30 11:23:59 +0200 (Sun, 30 Apr 2006) | 3 lines
Patch #1470976: don't NLST files when retrieving over FTP.
........
r45821 | georg.brandl | 2006-04-30 13:13:56 +0200 (Sun, 30 Apr 2006) | 6 lines
Bug #1473625: stop cPickle making float dumps locale dependent in protocol 0.
On the way, add a decorator to test_support to facilitate running single
test functions in different locales with automatic cleanup.
........
r45822 | phillip.eby | 2006-04-30 17:59:26 +0200 (Sun, 30 Apr 2006) | 2 lines
Fix infinite regress when inspecting <string> or <stdin> frames.
........
r45824 | georg.brandl | 2006-04-30 19:42:26 +0200 (Sun, 30 Apr 2006) | 3 lines
Fix another problem in inspect: if the module for an object cannot be found, don't try to give its __dict__ to linecache.
........
r45825 | georg.brandl | 2006-04-30 20:14:54 +0200 (Sun, 30 Apr 2006) | 3 lines
Patch #1472854: make the rlcompleter.Completer class usable on non-
UNIX platforms.
........
r45826 | georg.brandl | 2006-04-30 21:34:19 +0200 (Sun, 30 Apr 2006) | 3 lines
Patch #1479438: add \keyword markup for "with".
........
r45827 | andrew.kuchling | 2006-04-30 23:19:31 +0200 (Sun, 30 Apr 2006) | 1 line
Add urllib2 HOWTO from Michael Foord
........
r45828 | andrew.kuchling | 2006-04-30 23:19:49 +0200 (Sun, 30 Apr 2006) | 1 line
Add item
........
r45830 | barry.warsaw | 2006-05-01 05:03:02 +0200 (Mon, 01 May 2006) | 11 lines
Port forward from 2.4 branch:
Patch #1464708 from William McVey: fixed handling of nested comments in mail
addresses. E.g.
"Foo ((Foo Bar)) <foo@example.com>"
Fixes for both rfc822.py and email package. This patch needs to be back
ported to Python 2.3 for email 2.5.
........
r45832 | fred.drake | 2006-05-01 08:25:58 +0200 (Mon, 01 May 2006) | 4 lines
- minor clarification in section title
- markup adjustments
(there is clearly much to be done in this section)
........
r45833 | martin.v.loewis | 2006-05-01 08:28:01 +0200 (Mon, 01 May 2006) | 2 lines
Work around deadlock risk. Will backport.
........
r45836 | andrew.kuchling | 2006-05-01 14:45:02 +0200 (Mon, 01 May 2006) | 1 line
Some ElementTree fixes: import from xml, not xmlcore; fix case of module name; mention list() instead of getchildren()
........
r45837 | gerhard.haering | 2006-05-01 17:14:48 +0200 (Mon, 01 May 2006) | 3 lines
Further integration of the documentation for the sqlite3 module. There's still
quite some content to move over from the pysqlite manual, but it's a start now.
........
r45838 | martin.v.loewis | 2006-05-01 17:56:03 +0200 (Mon, 01 May 2006) | 2 lines
Rename uisample to text, drop all non-text tables.
........
r45839 | martin.v.loewis | 2006-05-01 18:12:44 +0200 (Mon, 01 May 2006) | 2 lines
Add msilib documentation.
........
r45840 | martin.v.loewis | 2006-05-01 18:14:16 +0200 (Mon, 01 May 2006) | 4 lines
Rename parameters to match the documentation (which
in turn matches Microsoft's documentation).
Drop unused parameter in CAB.append.
........
r45841 | fred.drake | 2006-05-01 18:28:54 +0200 (Mon, 01 May 2006) | 1 line
add dependency
........
r45842 | andrew.kuchling | 2006-05-01 18:30:25 +0200 (Mon, 01 May 2006) | 1 line
Markup fixes; add some XXX comments noting problems
........
r45843 | andrew.kuchling | 2006-05-01 18:32:49 +0200 (Mon, 01 May 2006) | 1 line
Add item
........
r45844 | andrew.kuchling | 2006-05-01 19:06:54 +0200 (Mon, 01 May 2006) | 1 line
Markup fixes
........
r45850 | neal.norwitz | 2006-05-02 06:43:14 +0200 (Tue, 02 May 2006) | 3 lines
SF #1479181: split open() and file() from being aliases for each other.
........
r45852 | neal.norwitz | 2006-05-02 08:23:22 +0200 (Tue, 02 May 2006) | 1 line
Try to fix breakage caused by patch #1479181, r45850
........
r45853 | fred.drake | 2006-05-02 08:53:59 +0200 (Tue, 02 May 2006) | 3 lines
SF #1479988: add methods to allow access to weakrefs for the
weakref.WeakKeyDictionary and weakref.WeakValueDictionary
........
r45854 | neal.norwitz | 2006-05-02 09:27:47 +0200 (Tue, 02 May 2006) | 5 lines
Fix breakage from patch 1471883 (r45800 & r45808) on OSF/1.
The problem was that pyconfig.h was being included before some system headers
which caused redefinitions and other breakage. This moves system headers
after expat_config.h which includes pyconfig.h.
........
r45855 | vinay.sajip | 2006-05-02 10:35:36 +0200 (Tue, 02 May 2006) | 1 line
Replaced my dumb way of calculating seconds to midnight with Tim Peters' much more sensible suggestion. What was I thinking ?!?
........
r45856 | andrew.kuchling | 2006-05-02 13:30:03 +0200 (Tue, 02 May 2006) | 1 line
Provide encoding as keyword argument; soften warning paragraph about encodings
........
r45858 | guido.van.rossum | 2006-05-02 19:36:09 +0200 (Tue, 02 May 2006) | 2 lines
Fix the formatting of KeyboardInterrupt -- a bad issubclass() call.
........
r45862 | guido.van.rossum | 2006-05-02 21:47:52 +0200 (Tue, 02 May 2006) | 7 lines
Get rid of __context__, per the latest changes to PEP 343 and python-dev
discussion.
There are two places of documentation that still mention __context__:
Doc/lib/libstdtypes.tex -- I wasn't quite sure how to rewrite that without
spending a whole lot of time thinking about it; and whatsnew, which Andrew
usually likes to change himself.
........
r45863 | armin.rigo | 2006-05-02 21:52:32 +0200 (Tue, 02 May 2006) | 4 lines
Documentation bug: PySet_Pop() returns a new reference (because the
caller becomes the owner of that reference).
........
r45864 | guido.van.rossum | 2006-05-02 22:47:36 +0200 (Tue, 02 May 2006) | 4 lines
Hopefully this will fix the spurious failures of test_mailbox.py that I'm
experiencing. (This code and mailbox.py itself are full of calls to file()
that should be calls to open() -- but I'm not fixing those.)
........
r45865 | andrew.kuchling | 2006-05-02 23:44:33 +0200 (Tue, 02 May 2006) | 1 line
Use open() instead of file()
........
r45866 | andrew.kuchling | 2006-05-03 00:47:49 +0200 (Wed, 03 May 2006) | 1 line
Update context manager section for removal of __context__
........
r45867 | fred.drake | 2006-05-03 03:46:52 +0200 (Wed, 03 May 2006) | 1 line
remove unnecessary assignment
........
r45868 | fred.drake | 2006-05-03 03:48:24 +0200 (Wed, 03 May 2006) | 4 lines
tell LaTeX2HTML to:
- use UTF-8 output
- not mess with the >>> prompt!
........
r45869 | fred.drake | 2006-05-03 04:04:40 +0200 (Wed, 03 May 2006) | 3 lines
avoid ugly markup based on the unfortunate conversions of ">>" and "<<" to
guillemets; no need for magic here
........
r45870 | fred.drake | 2006-05-03 04:12:47 +0200 (Wed, 03 May 2006) | 1 line
at least comment on why curly-quotes are not enabled
........
r45871 | fred.drake | 2006-05-03 04:27:40 +0200 (Wed, 03 May 2006) | 1 line
one more place to avoid extra markup
........
r45872 | fred.drake | 2006-05-03 04:29:09 +0200 (Wed, 03 May 2006) | 1 line
one more place to avoid extra markup (how many will there be?)
........
r45873 | fred.drake | 2006-05-03 04:29:39 +0200 (Wed, 03 May 2006) | 1 line
fix up whitespace in prompt strings
........
r45876 | tim.peters | 2006-05-03 06:46:14 +0200 (Wed, 03 May 2006) | 2 lines
Whitespace normalization.
........
r45877 | martin.v.loewis | 2006-05-03 06:52:04 +0200 (Wed, 03 May 2006) | 2 lines
Correct some formulations, fix XXX comments.
........
r45879 | georg.brandl | 2006-05-03 07:05:02 +0200 (Wed, 03 May 2006) | 2 lines
Patch #1480067: don't redirect HTTP digest auth in urllib2
........
r45881 | georg.brandl | 2006-05-03 07:15:10 +0200 (Wed, 03 May 2006) | 3 lines
Move network tests from test_urllib2 to test_urllib2net.
........
r45887 | nick.coghlan | 2006-05-03 15:02:47 +0200 (Wed, 03 May 2006) | 1 line
Finish bringing SVN into line with latest version of PEP 343 by getting rid of all remaining references to context objects that I could find. Without a __context__() method context objects no longer exist. Also get test_with working again, and adopt a suggestion from Neal for decimal.Context.get_manager()
........
r45888 | nick.coghlan | 2006-05-03 15:17:49 +0200 (Wed, 03 May 2006) | 1 line
Get rid of a couple more context object references, fix some markup and clarify what happens when a generator context function swallows an exception.
........
r45889 | georg.brandl | 2006-05-03 19:46:13 +0200 (Wed, 03 May 2006) | 3 lines
Add seamonkey to list of Windows browsers too.
........
r45890 | georg.brandl | 2006-05-03 20:03:22 +0200 (Wed, 03 May 2006) | 3 lines
RFE #1472176: In httplib, don't encode the netloc and hostname with "idna" if not necessary.
........
r45891 | georg.brandl | 2006-05-03 20:12:33 +0200 (Wed, 03 May 2006) | 2 lines
Bug #1472191: convert breakpoint indices to ints before comparing them to ints
........
r45893 | georg.brandl | 2006-05-03 20:18:32 +0200 (Wed, 03 May 2006) | 3 lines
Bug #1385040: don't allow "def foo(a=1, b): pass" in the compiler package.
........
r45894 | thomas.heller | 2006-05-03 20:35:39 +0200 (Wed, 03 May 2006) | 1 line
Don't fail the tests when libglut.so or libgle.so cannot be loaded.
........
r45895 | georg.brandl | 2006-05-04 07:08:10 +0200 (Thu, 04 May 2006) | 2 lines
Bug #1481530: allow "from os.path import ..." with imputil
........
r45897 | martin.v.loewis | 2006-05-04 07:51:03 +0200 (Thu, 04 May 2006) | 2 lines
Patch #1475845: Raise IndentationError for unexpected indent.
........
r45898 | martin.v.loewis | 2006-05-04 12:08:42 +0200 (Thu, 04 May 2006) | 1 line
Implement os.{chdir,rename,rmdir,remove} using Win32 directly.
........
r45899 | martin.v.loewis | 2006-05-04 14:04:27 +0200 (Thu, 04 May 2006) | 2 lines
Drop now-unnecessary arguments to posix_2str.
........
r45900 | martin.v.loewis | 2006-05-04 16:27:52 +0200 (Thu, 04 May 2006) | 1 line
Update checks to consider Windows error numbers.
........
r45913 | thomas.heller | 2006-05-05 20:42:14 +0200 (Fri, 05 May 2006) | 2 lines
Export the 'free' standard C function for use in the test suite.
........
r45914 | thomas.heller | 2006-05-05 20:43:24 +0200 (Fri, 05 May 2006) | 3 lines
Fix memory leaks in the ctypes test suite, reported by valgrind, by
free()ing the memory we allocate.
........
r45915 | thomas.heller | 2006-05-05 20:46:27 +0200 (Fri, 05 May 2006) | 1 line
oops - the function is exported as 'my_free', not 'free'.
........
r45916 | thomas.heller | 2006-05-05 21:14:24 +0200 (Fri, 05 May 2006) | 2 lines
Clean up.
........
r45920 | george.yoshida | 2006-05-06 15:09:45 +0200 (Sat, 06 May 2006) | 2 lines
describe optional arguments for DocFileSuite
........
r45924 | george.yoshida | 2006-05-06 16:16:51 +0200 (Sat, 06 May 2006) | 2 lines
Use \versionchanged for the feature change
........
r45925 | martin.v.loewis | 2006-05-06 18:32:54 +0200 (Sat, 06 May 2006) | 1 line
Port access, chmod, parts of getcwdu, mkdir, and utime to direct Win32 API.
........
r45926 | martin.v.loewis | 2006-05-06 22:04:08 +0200 (Sat, 06 May 2006) | 2 lines
Handle ERROR_ALREADY_EXISTS.
........
r45931 | andrew.kuchling | 2006-05-07 19:12:12 +0200 (Sun, 07 May 2006) | 1 line
[Patch #1479977] Revised version of urllib2 HOWTO, edited by John J. Lee
........
r45932 | andrew.kuchling | 2006-05-07 19:14:53 +0200 (Sun, 07 May 2006) | 1 line
Minor language edit
........
r45934 | georg.brandl | 2006-05-07 22:44:34 +0200 (Sun, 07 May 2006) | 3 lines
Patch #1483395: add new TLDs to cookielib
........
r45936 | martin.v.loewis | 2006-05-08 07:25:56 +0200 (Mon, 08 May 2006) | 2 lines
Add missing PyMem_Free.
........
r45938 | georg.brandl | 2006-05-08 19:28:47 +0200 (Mon, 08 May 2006) | 3 lines
Add test for rev. 45934.
........
r45939 | georg.brandl | 2006-05-08 19:36:08 +0200 (Mon, 08 May 2006) | 3 lines
Patch #1479302: Make urllib2 digest auth and basic auth play together.
........
r45940 | georg.brandl | 2006-05-08 19:48:01 +0200 (Mon, 08 May 2006) | 3 lines
Patch #1478993: take advantage of BaseException/Exception split in cookielib
........
r45941 | neal.norwitz | 2006-05-09 07:38:56 +0200 (Tue, 09 May 2006) | 5 lines
Micro optimization. In the first case, we know that frame->f_exc_type
is NULL, so there's no reason to do anything with it. In the second case,
we know frame->f_exc_type is not NULL, so we can just do an INCREF.
........
r45943 | thomas.heller | 2006-05-09 22:20:15 +0200 (Tue, 09 May 2006) | 2 lines
Disable a test that is unreliable.
........
r45944 | tim.peters | 2006-05-10 04:43:01 +0200 (Wed, 10 May 2006) | 4 lines
Variant of patch #1478292. doctest.register_optionflag(name)
shouldn't create a new flag when `name` is already the name of
an option flag.
........
r45947 | neal.norwitz | 2006-05-10 08:57:58 +0200 (Wed, 10 May 2006) | 14 lines
Fix problems found by Coverity.
longobject.c: also fix an ssize_t problem
<a> could have been NULL, so hoist the size calc to not use <a>.
_ssl.c: under fail: self is DECREF'd, but it would have been NULL.
_elementtree.c: delete self if there was an error.
_csv.c: I'm not sure if lineterminator could have been anything other than
a string. However, other string method calls are checked, so check this
one too.
........
r45948 | thomas.wouters | 2006-05-10 17:04:11 +0200 (Wed, 10 May 2006) | 4 lines
Ignore reflog.txt, too.
........
r45949 | georg.brandl | 2006-05-10 17:59:06 +0200 (Wed, 10 May 2006) | 3 lines
Bug #1482988: indicate more prominently that the Stats class is in the pstats module.
........
r45950 | georg.brandl | 2006-05-10 18:09:03 +0200 (Wed, 10 May 2006) | 2 lines
Bug #1485447: subprocess: document that the "cwd" parameter isn't used to find the executable. Misc. other markup fixes.
........
r45952 | georg.brandl | 2006-05-10 18:11:44 +0200 (Wed, 10 May 2006) | 2 lines
Bug #1484978: curses.panel: clarify that Panel objects are destroyed on garbage collection.
........
r45954 | georg.brandl | 2006-05-10 18:26:03 +0200 (Wed, 10 May 2006) | 4 lines
Patch #1484695: Update the tarfile module to version 0.8. This fixes
a couple of issues, notably handling of long file names using the
GNU LONGNAME extension.
........
r45955 | georg.brandl | 2006-05-10 19:13:20 +0200 (Wed, 10 May 2006) | 4 lines
Patch #721464: pdb.Pdb instances can now be given explicit stdin and
stdout arguments, making it possible to redirect input and output
for remote debugging.
........
r45956 | andrew.kuchling | 2006-05-10 19:19:04 +0200 (Wed, 10 May 2006) | 1 line
Clarify description of exception handling
........
r45957 | georg.brandl | 2006-05-10 22:09:23 +0200 (Wed, 10 May 2006) | 2 lines
Fix two small errors in argument lists.
........
r45960 | brett.cannon | 2006-05-11 07:11:33 +0200 (Thu, 11 May 2006) | 5 lines
Detect if %zd is supported by printf() during configure and sets
PY_FORMAT_SIZE_T appropriately. Removes warnings on
OS X under gcc 4.0.1 when PY_FORMAT_SIZE_T is set to "" instead of "z" as is
needed.
........
r45963 | neal.norwitz | 2006-05-11 09:51:59 +0200 (Thu, 11 May 2006) | 1 line
Don't mask a no memory error with a less meaningful one as discussed on python-checkins
........
r45964 | martin.v.loewis | 2006-05-11 15:28:43 +0200 (Thu, 11 May 2006) | 3 lines
Change WindowsError to carry the Win32 error code in winerror,
and the DOS error code in errno. Revert changes where
WindowsError catch blocks unnecessarily special-case OSError.
........
r45965 | george.yoshida | 2006-05-11 17:53:27 +0200 (Thu, 11 May 2006) | 2 lines
Grammar fix
........
r45967 | andrew.kuchling | 2006-05-11 18:32:24 +0200 (Thu, 11 May 2006) | 1 line
typo fix
........
r45968 | tim.peters | 2006-05-11 18:37:42 +0200 (Thu, 11 May 2006) | 5 lines
BaseThreadedTestCase.setup(): stop special-casing WindowsError.
Rev 45964 fiddled with WindowsError, and broke test_bsddb3 on all
the Windows buildbot slaves as a result. This should repair it.
........
r45969 | georg.brandl | 2006-05-11 21:57:09 +0200 (Thu, 11 May 2006) | 2 lines
Typo fix.
........
r45970 | tim.peters | 2006-05-12 03:57:59 +0200 (Fri, 12 May 2006) | 5 lines
SF patch #1473132: Improve docs for tp_clear and tp_traverse,
by Collin Winter.
Bugfix candidate (but I'm not going to bother).
........
r45974 | martin.v.loewis | 2006-05-12 14:27:28 +0200 (Fri, 12 May 2006) | 4 lines
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.
........
r45975 | martin.v.loewis | 2006-05-12 15:57:36 +0200 (Fri, 12 May 2006) | 1 line
Move icon files into DLLs dir. Fixes #1477968.
........
r45976 | george.yoshida | 2006-05-12 18:40:11 +0200 (Fri, 12 May 2006) | 2 lines
At first there were 6 steps, but one was removed after that.
........
r45977 | martin.v.loewis | 2006-05-12 19:22:04 +0200 (Fri, 12 May 2006) | 1 line
Fix alignment error on Itanium.
........
r45978 | george.yoshida | 2006-05-12 19:25:26 +0200 (Fri, 12 May 2006) | 3 lines
Duplicated description about the illegal continue usage can be found in nearly the same place.
They are same, so keep the original one and remove the later-added one.
........
r45980 | thomas.heller | 2006-05-12 20:16:03 +0200 (Fri, 12 May 2006) | 2 lines
Add missing svn properties.
........
r45981 | thomas.heller | 2006-05-12 20:47:35 +0200 (Fri, 12 May 2006) | 1 line
set svn properties
........
r45982 | thomas.heller | 2006-05-12 21:31:46 +0200 (Fri, 12 May 2006) | 1 line
add svn:eol-style native svn:keywords Id
........
r45987 | gerhard.haering | 2006-05-13 01:49:49 +0200 (Sat, 13 May 2006) | 3 lines
Integrated the rest of the pysqlite reference manual into the Python
documentation. Ready to be reviewed and improved upon.
........
r45988 | george.yoshida | 2006-05-13 08:53:31 +0200 (Sat, 13 May 2006) | 2 lines
Add \exception markup
........
r45990 | martin.v.loewis | 2006-05-13 15:34:04 +0200 (Sat, 13 May 2006) | 2 lines
Revert 43315: Printing of %zd must be signed.
........
r45992 | tim.peters | 2006-05-14 01:28:20 +0200 (Sun, 14 May 2006) | 11 lines
Teach PyString_FromFormat, PyErr_Format, and PyString_FromFormatV
about "%u", "%lu" and "%zu" formats.
Since PyString_FromFormat and PyErr_Format have exactly the same rules
(both inherited from PyString_FromFormatV), it would be good if someone
with more LaTeX Fu changed one of them to just point to the other.
Their docs were way out of synch before this patch, and I just did a
mass copy+paste to repair that.
Not a backport candidate (this is a new feature).
........
r45993 | tim.peters | 2006-05-14 01:31:05 +0200 (Sun, 14 May 2006) | 2 lines
Typo repair.
........
r45994 | tim.peters | 2006-05-14 01:33:19 +0200 (Sun, 14 May 2006) | 2 lines
Remove lie in new comment.
........
r45995 | ronald.oussoren | 2006-05-14 21:56:34 +0200 (Sun, 14 May 2006) | 11 lines
Rework the build system for osx applications:
* Don't use xcodebuild for building PythonLauncher, but use a normal unix
makefile. This makes it a lot easier to use the same build flags as for the
rest of python (e.g. make a universal version of python launcher)
* Convert the mac makefile-s to makefile.in-s and use configure to set makefile
variables instead of forwarding them as command-line arguments
* Add a C version of pythonw, that we you can use '#!/usr/local/bin/pythonw'
* Build IDLE.app using bundlebuilder instead of BuildApplet, that will allow
easier modification of the bundle contents later on.
........
r45996 | ronald.oussoren | 2006-05-14 22:35:41 +0200 (Sun, 14 May 2006) | 6 lines
A first cut at replacing the icons on MacOS X. This replaces all icons by icons
based on the new python.org logo. These are also the first icons that are
"proper" OSX icons.
These icons were created by Jacob Rus.
........
r45997 | ronald.oussoren | 2006-05-14 23:07:41 +0200 (Sun, 14 May 2006) | 3 lines
I missed one small detail in my rewrite of the osx build files: the path
to the Python.app template.
........
r45998 | martin.v.loewis | 2006-05-15 07:51:36 +0200 (Mon, 15 May 2006) | 2 lines
Fix memory leak.
........
r45999 | neal.norwitz | 2006-05-15 08:48:14 +0200 (Mon, 15 May 2006) | 1 line
Move items implemented after a2 into the new a3 section
........
r46000 | neal.norwitz | 2006-05-15 09:04:36 +0200 (Mon, 15 May 2006) | 5 lines
- Bug #1487966: Fix SystemError with conditional expression in assignment
Most of the test_syntax changes are just updating the numbers.
........
r46001 | neal.norwitz | 2006-05-15 09:17:23 +0200 (Mon, 15 May 2006) | 1 line
Patch #1488312, Fix memory alignment problem on SPARC in unicode. Will backport
........
r46003 | martin.v.loewis | 2006-05-15 11:22:27 +0200 (Mon, 15 May 2006) | 3 lines
Remove bogus DECREF of self.
Change __str__() functions to METH_O.
Change WindowsError__str__ to use PyTuple_Pack.
........
r46005 | georg.brandl | 2006-05-15 21:30:35 +0200 (Mon, 15 May 2006) | 3 lines
[ 1488881 ] tarfile.py: support for file-objects and bz2 (cp. #1488634)
........
r46007 | tim.peters | 2006-05-15 22:44:10 +0200 (Mon, 15 May 2006) | 9 lines
ReadDetectFileobjTest: repair Windows disasters by opening
the file object in binary mode.
The Windows buildbot slaves shouldn't swap themselves to death
anymore. However, test_tarfile may still fail because of a
temp directory left behind from a previous failing run.
Windows buildbot owners may need to remove that directory
by hand.
........
r46009 | tim.peters | 2006-05-15 23:32:25 +0200 (Mon, 15 May 2006) | 3 lines
test_directory(): Remove the leftover temp directory that's making
the Windows buildbots fail test_tarfile.
........
r46010 | martin.v.loewis | 2006-05-16 09:05:37 +0200 (Tue, 16 May 2006) | 4 lines
- 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
........
r46012 | georg.brandl | 2006-05-16 09:38:27 +0200 (Tue, 16 May 2006) | 3 lines
Patch #1435422: zlib's compress and decompress objects now have a
copy() method.
........
r46015 | andrew.kuchling | 2006-05-16 18:11:54 +0200 (Tue, 16 May 2006) | 1 line
Add item
........
r46016 | andrew.kuchling | 2006-05-16 18:27:31 +0200 (Tue, 16 May 2006) | 3 lines
PEP 243 has been withdrawn, so don't refer to it any more.
The PyPI upload material has been moved into the section on PEP314.
........
r46017 | george.yoshida | 2006-05-16 19:42:16 +0200 (Tue, 16 May 2006) | 2 lines
Update for 'ImportWarning'
........
r46018 | george.yoshida | 2006-05-16 20:07:00 +0200 (Tue, 16 May 2006) | 4 lines
Mention that Exception is now a subclass of BaseException.
Remove a sentence that says that BaseException inherits from BaseException.
(I guess this is just a copy & paste mistake.)
........
r46019 | george.yoshida | 2006-05-16 20:26:10 +0200 (Tue, 16 May 2006) | 2 lines
Document ImportWarning
........
r46020 | tim.peters | 2006-05-17 01:22:20 +0200 (Wed, 17 May 2006) | 2 lines
Whitespace normalization.
........
r46021 | tim.peters | 2006-05-17 01:24:08 +0200 (Wed, 17 May 2006) | 2 lines
Text files missing the SVN eol-style property.
........
r46022 | tim.peters | 2006-05-17 03:30:11 +0200 (Wed, 17 May 2006) | 2 lines
PyZlib_copy(), PyZlib_uncopy(): Repair leaks on the normal-case path.
........
r46023 | georg.brandl | 2006-05-17 16:06:07 +0200 (Wed, 17 May 2006) | 3 lines
Remove misleading comment about type-class unification.
........
r46024 | georg.brandl | 2006-05-17 16:11:36 +0200 (Wed, 17 May 2006) | 3 lines
Apply patch #1489784 from Michael Foord.
........
r46025 | georg.brandl | 2006-05-17 16:18:20 +0200 (Wed, 17 May 2006) | 3 lines
Fix typo in os.utime docstring (patch #1490189)
........
r46026 | georg.brandl | 2006-05-17 16:26:50 +0200 (Wed, 17 May 2006) | 3 lines
Patch #1490224: set time.altzone correctly on Cygwin.
........
r46027 | georg.brandl | 2006-05-17 16:45:06 +0200 (Wed, 17 May 2006) | 4 lines
Add global debug flag to cookielib to avoid heavy dependency on the logging module.
Resolves #1484758.
........
r46028 | georg.brandl | 2006-05-17 16:56:04 +0200 (Wed, 17 May 2006) | 3 lines
Patch #1486962: Several bugs in the turtle Tk demo module were fixed
and several features added, such as speed and geometry control.
........
r46029 | georg.brandl | 2006-05-17 17:17:00 +0200 (Wed, 17 May 2006) | 4 lines
Delay-import some large modules to speed up urllib2 import.
(fixes #1484793).
........
r46030 | georg.brandl | 2006-05-17 17:51:16 +0200 (Wed, 17 May 2006) | 3 lines
Patch #1180296: improve locale string formatting functions
........
r46032 | tim.peters | 2006-05-18 04:06:40 +0200 (Thu, 18 May 2006) | 2 lines
Whitespace normalization.
........
r46033 | georg.brandl | 2006-05-18 08:11:19 +0200 (Thu, 18 May 2006) | 3 lines
Amendments to patch #1484695.
........
r46034 | georg.brandl | 2006-05-18 08:18:06 +0200 (Thu, 18 May 2006) | 3 lines
Remove unused import.
........
r46035 | georg.brandl | 2006-05-18 08:33:27 +0200 (Thu, 18 May 2006) | 3 lines
Fix test_locale for platforms without a default thousands separator.
........
r46036 | neal.norwitz | 2006-05-18 08:51:46 +0200 (Thu, 18 May 2006) | 1 line
Little cleanup
........
r46037 | georg.brandl | 2006-05-18 09:01:27 +0200 (Thu, 18 May 2006) | 4 lines
Bug #1462152: file() now checks more thoroughly for invalid mode
strings and removes a possible "U" before passing the mode to the
C library function.
........
r46038 | georg.brandl | 2006-05-18 09:20:05 +0200 (Thu, 18 May 2006) | 3 lines
Bug #1490688: properly document %e, %f, %g format subtleties.
........
r46039 | vinay.sajip | 2006-05-18 09:28:58 +0200 (Thu, 18 May 2006) | 1 line
Changed status from "beta" to "production"; since logging has been part of the stdlib since 2.3, it should be safe to make this assertion ;-)
........
r46040 | ronald.oussoren | 2006-05-18 11:04:15 +0200 (Thu, 18 May 2006) | 2 lines
Fix some minor issues with the generated application bundles on MacOSX
........
r46041 | andrew.kuchling | 2006-05-19 02:03:55 +0200 (Fri, 19 May 2006) | 1 line
Typo fix; add clarifying word
........
r46044 | neal.norwitz | 2006-05-19 08:31:23 +0200 (Fri, 19 May 2006) | 3 lines
Fix #132 from Coverity, retval could have been derefed
if a continue inside a try failed.
........
r46045 | neal.norwitz | 2006-05-19 08:43:50 +0200 (Fri, 19 May 2006) | 2 lines
Fix #1474677, non-keyword argument following keyword.
........
r46046 | neal.norwitz | 2006-05-19 09:00:58 +0200 (Fri, 19 May 2006) | 4 lines
Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
I suppose this could be backported if anyone cares.
........
r46047 | neal.norwitz | 2006-05-19 09:05:01 +0200 (Fri, 19 May 2006) | 7 lines
Oops, I forgot to include this file in the last commit (46046):
Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
I suppose this could be backported if anyone cares.
........
r46050 | ronald.oussoren | 2006-05-19 20:17:31 +0200 (Fri, 19 May 2006) | 6 lines
* Change working directory to the users home
directory, that makes the file open/save
dialogs more useable.
* Don't use argv emulator, its not needed
for idle.
........
r46052 | tim.peters | 2006-05-19 21:16:34 +0200 (Fri, 19 May 2006) | 2 lines
Whitespace normalization.
........
r46054 | ronald.oussoren | 2006-05-20 08:17:01 +0200 (Sat, 20 May 2006) | 9 lines
Fix bug #1000914 (again).
This patches a file that is generated by bgen, however the code is now the
same as a current copy of bgen would generate. Without this patch most types
in the Carbon.CF module are unusable.
I haven't managed to coax bgen into generating a complete copy of _CFmodule.c
yet :-(, hence the manual patching.
........
r46055 | george.yoshida | 2006-05-20 17:36:19 +0200 (Sat, 20 May 2006) | 3 lines
- markup fix
- add clarifying words
........
r46057 | george.yoshida | 2006-05-20 18:29:14 +0200 (Sat, 20 May 2006) | 3 lines
- Add 'as' and 'with' as new keywords in 2.5.
- Regenerate keyword lists with reswords.py.
........
r46058 | george.yoshida | 2006-05-20 20:07:26 +0200 (Sat, 20 May 2006) | 2 lines
Apply patch #1492147 from Mike Foord.
........
r46059 | andrew.kuchling | 2006-05-20 21:25:16 +0200 (Sat, 20 May 2006) | 1 line
Minor edits
........
r46061 | george.yoshida | 2006-05-21 06:22:59 +0200 (Sun, 21 May 2006) | 2 lines
Fix the TeX compile error.
........
r46062 | george.yoshida | 2006-05-21 06:40:32 +0200 (Sun, 21 May 2006) | 2 lines
Apply patch #1492255 from Mike Foord.
........
r46063 | martin.v.loewis | 2006-05-22 10:48:14 +0200 (Mon, 22 May 2006) | 1 line
Patch 1490384: New Icons for the PC build.
........
r46064 | martin.v.loewis | 2006-05-22 11:15:18 +0200 (Mon, 22 May 2006) | 1 line
Patch #1492356: Port to Windows CE (patch set 1).
........
r46065 | tim.peters | 2006-05-22 13:29:41 +0200 (Mon, 22 May 2006) | 4 lines
Define SIZEOF_{DOUBLE,FLOAT} on Windows. Else
Michael Hudson's nice gimmicks for IEEE special
values (infinities, NaNs) don't work.
........
r46070 | bob.ippolito | 2006-05-22 16:31:24 +0200 (Mon, 22 May 2006) | 2 lines
GzipFile.readline performance improvement (~30-40%), patch #1281707
........
r46071 | bob.ippolito | 2006-05-22 17:22:46 +0200 (Mon, 22 May 2006) | 1 line
Revert gzip readline performance patch #1281707 until a more generic performance improvement can be found
........
r46073 | fredrik.lundh | 2006-05-22 17:35:12 +0200 (Mon, 22 May 2006) | 4 lines
docstring tweaks: count counts non-overlapping substrings, not
total number of occurences
........
r46075 | bob.ippolito | 2006-05-22 17:59:12 +0200 (Mon, 22 May 2006) | 1 line
Apply revised patch for GzipFile.readline performance #1281707
........
r46076 | fredrik.lundh | 2006-05-22 18:29:30 +0200 (Mon, 22 May 2006) | 3 lines
needforspeed: speed up unicode repeat, unicode string copy
........
r46079 | fredrik.lundh | 2006-05-22 19:12:58 +0200 (Mon, 22 May 2006) | 4 lines
needforspeed: use memcpy for "long" strings; use a better algorithm
for long repeats.
........
r46084 | tim.peters | 2006-05-22 21:17:04 +0200 (Mon, 22 May 2006) | 7 lines
PyUnicode_Join(): Recent code changes introduced new
compiler warnings on Windows (signed vs unsigned mismatch
in comparisons). Cleaned that up by switching more locals
to Py_ssize_t. Simplified overflow checking (it can _be_
simpler because while these things are declared as
Py_ssize_t, then should in fact never be negative).
........
r46085 | tim.peters | 2006-05-23 07:47:16 +0200 (Tue, 23 May 2006) | 3 lines
unicode_repeat(): Change type of local to Py_ssize_t,
since that's what it should be.
........
r46094 | fredrik.lundh | 2006-05-23 12:10:57 +0200 (Tue, 23 May 2006) | 3 lines
needforspeed: check first *and* last character before doing a full memcmp
........
r46095 | fredrik.lundh | 2006-05-23 12:12:21 +0200 (Tue, 23 May 2006) | 4 lines
needforspeed: fixed unicode "in" operator to use same implementation
approach as find/index
........
r46096 | richard.jones | 2006-05-23 12:37:38 +0200 (Tue, 23 May 2006) | 7 lines
Merge from rjones-funccall branch.
Applied patch zombie-frames-2.diff from sf patch 876206 with updates for
Python 2.5 and also modified to retain the free_list to avoid the 67%
slow-down in pybench recursion test. 5% speed up in function call pybench.
........
r46098 | ronald.oussoren | 2006-05-23 13:04:24 +0200 (Tue, 23 May 2006) | 2 lines
Avoid creating a mess when installing a framework for the second time.
........
r46101 | georg.brandl | 2006-05-23 13:17:21 +0200 (Tue, 23 May 2006) | 3 lines
PyErr_NewException now accepts a tuple of base classes as its
"base" parameter.
........
r46103 | ronald.oussoren | 2006-05-23 13:47:16 +0200 (Tue, 23 May 2006) | 3 lines
Disable linking extensions with -lpython2.5 for darwin. This should fix bug
#1487105.
........
r46104 | ronald.oussoren | 2006-05-23 14:01:11 +0200 (Tue, 23 May 2006) | 6 lines
Patch #1488098.
This patchs makes it possible to create a universal build on OSX 10.4 and use
the result to build extensions on 10.3. It also makes it possible to override
the '-arch' and '-isysroot' compiler arguments for specific extensions.
........
r46108 | andrew.kuchling | 2006-05-23 14:44:36 +0200 (Tue, 23 May 2006) | 1 line
Add some items; mention the sprint
........
r46109 | andrew.kuchling | 2006-05-23 14:47:01 +0200 (Tue, 23 May 2006) | 1 line
Mention string improvements
........
r46110 | andrew.kuchling | 2006-05-23 14:49:35 +0200 (Tue, 23 May 2006) | 4 lines
Use 'speed' instead of 'performance', because I agree with the argument
at http://zestyping.livejournal.com/193260.html that 'erformance' really means
something more general.
........
r46113 | ronald.oussoren | 2006-05-23 17:09:57 +0200 (Tue, 23 May 2006) | 2 lines
An improved script for building the binary distribution on MacOSX.
........
r46128 | richard.jones | 2006-05-23 20:28:17 +0200 (Tue, 23 May 2006) | 3 lines
Applied patch 1337051 by Neal Norwitz, saving 4 ints on frame objects.
........
r46129 | richard.jones | 2006-05-23 20:32:11 +0200 (Tue, 23 May 2006) | 1 line
fix broken merge
........
r46130 | bob.ippolito | 2006-05-23 20:41:17 +0200 (Tue, 23 May 2006) | 1 line
Update Misc/NEWS for gzip patch #1281707
........
r46131 | bob.ippolito | 2006-05-23 20:43:47 +0200 (Tue, 23 May 2006) | 1 line
Update Misc/NEWS for gzip patch #1281707
........
r46132 | fredrik.lundh | 2006-05-23 20:44:25 +0200 (Tue, 23 May 2006) | 7 lines
needforspeed: use append+reverse for rsplit, use "bloom filters" to
speed up splitlines and strip with charsets; etc. rsplit is now as
fast as split in all our tests (reverse takes no time at all), and
splitlines() is nearly as fast as a plain split("\n") in our tests.
and we're not done yet... ;-)
........
r46133 | tim.peters | 2006-05-23 20:45:30 +0200 (Tue, 23 May 2006) | 38 lines
Bug #1334662 / patch #1335972: int(string, base) wrong answers.
In rare cases of strings specifying true values near sys.maxint,
and oddball bases (not decimal or a power of 2), int(string, base)
could deliver insane answers. This repairs all such problems, and
also speeds string->int significantly. On my box, here are %
speedups for decimal strings of various lengths:
length speedup
------ -------
1 12.4%
2 15.7%
3 20.6%
4 28.1%
5 33.2%
6 37.5%
7 41.9%
8 46.3%
9 51.2%
10 19.5%
11 19.9%
12 23.9%
13 23.7%
14 23.3%
15 24.9%
16 25.3%
17 28.3%
18 27.9%
19 35.7%
Note that the difference between 9 and 10 is the difference between
short and long Python ints on a 32-bit box. The patch doesn't
actually do anything to speed conversion to long: the speedup is
due to detecting "unsigned long" overflow more quickly.
This is a bugfix candidate, but it's a non-trivial patch and it
would be painful to separate the "bug fix" from the "speed up" parts.
........
r46134 | bob.ippolito | 2006-05-23 20:46:41 +0200 (Tue, 23 May 2006) | 1 line
Patch #1493701: performance enhancements for struct module.
........
r46136 | andrew.kuchling | 2006-05-23 21:00:45 +0200 (Tue, 23 May 2006) | 1 line
Remove duplicate item
........
r46141 | bob.ippolito | 2006-05-23 21:09:51 +0200 (Tue, 23 May 2006) | 1 line
revert #1493701
........
r46142 | bob.ippolito | 2006-05-23 21:11:34 +0200 (Tue, 23 May 2006) | 1 line
patch #1493701: performance enhancements for struct module
........
r46144 | bob.ippolito | 2006-05-23 21:12:41 +0200 (Tue, 23 May 2006) | 1 line
patch #1493701: performance enhancements for struct module
........
r46148 | bob.ippolito | 2006-05-23 21:25:52 +0200 (Tue, 23 May 2006) | 1 line
fix linking issue, warnings, in struct
........
r46149 | andrew.kuchling | 2006-05-23 21:29:38 +0200 (Tue, 23 May 2006) | 1 line
Add two items
........
r46150 | bob.ippolito | 2006-05-23 21:31:23 +0200 (Tue, 23 May 2006) | 1 line
forward declaration for PyStructType
........
r46151 | bob.ippolito | 2006-05-23 21:32:25 +0200 (Tue, 23 May 2006) | 1 line
fix typo in _struct
........
r46152 | andrew.kuchling | 2006-05-23 21:32:35 +0200 (Tue, 23 May 2006) | 1 line
Add item
........
r46153 | tim.peters | 2006-05-23 21:34:37 +0200 (Tue, 23 May 2006) | 3 lines
Get the Windows build working again (recover from
`struct` module changes).
........
r46155 | fredrik.lundh | 2006-05-23 21:47:35 +0200 (Tue, 23 May 2006) | 3 lines
return 0 on misses, not -1.
........
r46156 | tim.peters | 2006-05-23 23:51:35 +0200 (Tue, 23 May 2006) | 4 lines
test_struct grew weird behavior under regrtest.py -R,
due to a module-level cache. Clearing the cache should
make it stop showing up in refleak reports.
........
r46157 | tim.peters | 2006-05-23 23:54:23 +0200 (Tue, 23 May 2006) | 2 lines
Whitespace normalization.
........
r46158 | tim.peters | 2006-05-23 23:55:53 +0200 (Tue, 23 May 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46161 | fredrik.lundh | 2006-05-24 12:20:36 +0200 (Wed, 24 May 2006) | 3 lines
use Py_ssize_t for string indexes (thanks, neal!)
........
r46173 | fredrik.lundh | 2006-05-24 16:28:11 +0200 (Wed, 24 May 2006) | 14 lines
needforspeed: use "fastsearch" for count and findstring helpers. this
results in a 2.5x speedup on the stringbench count tests, and a 20x (!)
speedup on the stringbench search/find/contains test, compared to 2.5a2.
for more on the algorithm, see:
http://effbot.org/zone/stringlib.htm
if you get weird results, you can disable the new algoritm by undefining
USE_FAST in Objects/unicodeobject.c.
enjoy /F
........
r46182 | fredrik.lundh | 2006-05-24 17:11:01 +0200 (Wed, 24 May 2006) | 3 lines
needforspeedindeed: use fastsearch also for __contains__
........
r46184 | bob.ippolito | 2006-05-24 17:32:06 +0200 (Wed, 24 May 2006) | 1 line
refactor unpack, add unpack_from
........
r46189 | fredrik.lundh | 2006-05-24 18:35:18 +0200 (Wed, 24 May 2006) | 4 lines
needforspeed: refactored the replace code slightly; special-case
constant-length changes; use fastsearch to locate the first match.
........
r46198 | andrew.dalke | 2006-05-24 20:55:37 +0200 (Wed, 24 May 2006) | 10 lines
Added a slew of test for string replace, based various corner cases from
the Need For Speed sprint coding. Includes commented out overflow tests
which will be uncommented once the code is fixed.
This test will break the 8-bit string tests because
"".replace("", "A") == "" when it should == "A"
We have a fix for it, which should be added tomorrow.
........
r46200 | tim.peters | 2006-05-24 22:27:18 +0200 (Wed, 24 May 2006) | 2 lines
We can't leave the checked-in tests broken.
........
r46201 | tim.peters | 2006-05-24 22:29:44 +0200 (Wed, 24 May 2006) | 2 lines
Whitespace normalization.
........
r46202 | tim.peters | 2006-05-24 23:00:45 +0200 (Wed, 24 May 2006) | 4 lines
Disable the damn empty-string replace test -- it can't
be make to pass now for unicode if it passes for str, or
vice versa.
........
r46203 | tim.peters | 2006-05-24 23:10:40 +0200 (Wed, 24 May 2006) | 58 lines
Heavily fiddled variant of patch #1442927: PyLong_FromString optimization.
``long(str, base)`` is now up to 6x faster for non-power-of-2 bases. The
largest speedup is for inputs with about 1000 decimal digits. Conversion
from non-power-of-2 bases remains quadratic-time in the number of input
digits (it was and remains linear-time for bases 2, 4, 8, 16 and 32).
Speedups at various lengths for decimal inputs, comparing 2.4.3 with
current trunk. Note that it's actually a bit slower for 1-digit strings:
len speedup
---- -------
1 -4.5%
2 4.6%
3 8.3%
4 12.7%
5 16.9%
6 28.6%
7 35.5%
8 44.3%
9 46.6%
10 55.3%
11 65.7%
12 77.7%
13 73.4%
14 75.3%
15 85.2%
16 103.0%
17 95.1%
18 112.8%
19 117.9%
20 128.3%
30 174.5%
40 209.3%
50 236.3%
60 254.3%
70 262.9%
80 295.8%
90 297.3%
100 324.5%
200 374.6%
300 403.1%
400 391.1%
500 388.7%
600 440.6%
700 468.7%
800 498.0%
900 507.2%
1000 501.2%
2000 450.2%
3000 463.2%
4000 452.5%
5000 440.6%
6000 439.6%
7000 424.8%
8000 418.1%
9000 417.7%
........
r46204 | andrew.kuchling | 2006-05-25 02:23:03 +0200 (Thu, 25 May 2006) | 1 line
Minor edits; add an item
........
r46205 | fred.drake | 2006-05-25 04:42:25 +0200 (Thu, 25 May 2006) | 3 lines
fix broken links in PDF
(SF patch #1281291, contributed by Rory Yorke)
........
r46208 | walter.doerwald | 2006-05-25 10:53:28 +0200 (Thu, 25 May 2006) | 2 lines
Replace tab inside comment with space.
........
r46209 | thomas.wouters | 2006-05-25 13:25:51 +0200 (Thu, 25 May 2006) | 4 lines
Fix #1488915, Multiple dots in relative import statement raise SyntaxError.
........
r46210 | thomas.wouters | 2006-05-25 13:26:25 +0200 (Thu, 25 May 2006) | 5 lines
Update graminit.c for the fix for #1488915, Multiple dots in relative import
statement raise SyntaxError, and add testcase.
........
r46211 | andrew.kuchling | 2006-05-25 14:27:59 +0200 (Thu, 25 May 2006) | 1 line
Add entry; and fix a typo
........
r46214 | fredrik.lundh | 2006-05-25 17:22:03 +0200 (Thu, 25 May 2006) | 7 lines
needforspeed: speed up upper and lower for 8-bit string objects.
(the unicode versions of these are still 2x faster on windows,
though...)
based on work by Andrew Dalke, with tweaks by yours truly.
........
r46216 | fredrik.lundh | 2006-05-25 17:49:45 +0200 (Thu, 25 May 2006) | 5 lines
needforspeed: make new upper/lower work properly for single-character
strings too... (thanks to georg brandl for spotting the exact problem
faster than anyone else)
........
r46217 | kristjan.jonsson | 2006-05-25 17:53:30 +0200 (Thu, 25 May 2006) | 1 line
Added a new macro, Py_IS_FINITE(X). On windows there is an intrinsic for this and it is more efficient than to use !Py_IS_INFINITE(X) && !Py_IS_NAN(X). No change on other platforms
........
r46219 | fredrik.lundh | 2006-05-25 18:10:12 +0200 (Thu, 25 May 2006) | 4 lines
needforspeed: _toupper/_tolower is a SUSv2 thing; fall back on ISO C
versions if they're not defined.
........
r46220 | andrew.kuchling | 2006-05-25 18:23:15 +0200 (Thu, 25 May 2006) | 1 line
Fix comment typos
........
r46221 | andrew.dalke | 2006-05-25 18:30:52 +0200 (Thu, 25 May 2006) | 2 lines
Added tests for implementation error we came up with in the need for speed sprint.
........
r46222 | andrew.kuchling | 2006-05-25 18:34:54 +0200 (Thu, 25 May 2006) | 1 line
Fix another typo
........
r46223 | kristjan.jonsson | 2006-05-25 18:39:27 +0200 (Thu, 25 May 2006) | 1 line
Fix incorrect documentation for the Py_IS_FINITE(X) macro.
........
r46224 | fredrik.lundh | 2006-05-25 18:46:54 +0200 (Thu, 25 May 2006) | 3 lines
needforspeed: check for overflow in replace (from Andrew Dalke)
........
r46226 | fredrik.lundh | 2006-05-25 19:08:14 +0200 (Thu, 25 May 2006) | 5 lines
needforspeed: new replace implementation by Andrew Dalke. replace is
now about 3x faster on my machine, for the replace tests from string-
bench.
........
r46227 | tim.peters | 2006-05-25 19:34:03 +0200 (Thu, 25 May 2006) | 5 lines
A new table to help string->integer conversion was added yesterday to
both mystrtoul.c and longobject.c. Share the table instead. Also
cut its size by 64 entries (they had been used for an inscrutable
trick originally, but the code no longer tries to use that trick).
........
r46229 | andrew.dalke | 2006-05-25 19:53:00 +0200 (Thu, 25 May 2006) | 11 lines
Fixed problem identified by Georg. The special-case in-place code for replace
made a copy of the string using PyString_FromStringAndSize(s, n) and modify
the copied string in-place. However, 1 (and 0) character strings are shared
from a cache. This cause "A".replace("A", "a") to change the cached version
of "A" -- used by everyone.
Now may the copy with NULL as the string and do the memcpy manually. I've
added regression tests to check if this happens in the future. Perhaps
there should be a PyString_Copy for this case?
........
r46230 | fredrik.lundh | 2006-05-25 19:55:31 +0200 (Thu, 25 May 2006) | 4 lines
needforspeed: use "fastsearch" for count. this results in a 3x speedup
for the related stringbench tests.
........
r46231 | andrew.dalke | 2006-05-25 20:03:25 +0200 (Thu, 25 May 2006) | 4 lines
Code had returned an ssize_t, upcast to long, then converted with PyInt_FromLong.
Now using PyInt_FromSsize_t.
........
r46233 | andrew.kuchling | 2006-05-25 20:11:16 +0200 (Thu, 25 May 2006) | 1 line
Comment typo
........
r46234 | andrew.dalke | 2006-05-25 20:18:39 +0200 (Thu, 25 May 2006) | 4 lines
Added overflow test for adding two (very) large strings where the
new string is over max Py_ssize_t. I have no way to test it on my
box or any box I have access to. At least it doesn't break anything.
........
r46235 | bob.ippolito | 2006-05-25 20:20:23 +0200 (Thu, 25 May 2006) | 1 line
Faster path for PyLong_FromLongLong, using PyLong_FromLong algorithm
........
r46238 | georg.brandl | 2006-05-25 20:44:09 +0200 (Thu, 25 May 2006) | 3 lines
Guard the _active.remove() call to avoid errors when there is no _active list.
........
r46239 | fredrik.lundh | 2006-05-25 20:44:29 +0200 (Thu, 25 May 2006) | 4 lines
needforspeed: use fastsearch also for find/index and contains. the
related tests are now about 10x faster.
........
r46240 | bob.ippolito | 2006-05-25 20:44:50 +0200 (Thu, 25 May 2006) | 1 line
Struct now unpacks to PY_LONG_LONG directly when possible, also include #ifdef'ed out code that will return int instead of long when in bounds (not active since it's an API and doc change)
........
r46241 | jack.diederich | 2006-05-25 20:47:15 +0200 (Thu, 25 May 2006) | 1 line
* eliminate warning by reverting tmp_s type to 'const char*'
........
r46242 | bob.ippolito | 2006-05-25 21:03:19 +0200 (Thu, 25 May 2006) | 1 line
Fix Cygwin compiler issue
........
r46243 | bob.ippolito | 2006-05-25 21:15:27 +0200 (Thu, 25 May 2006) | 1 line
fix a struct regression where long would be returned for short unsigned integers
........
r46244 | georg.brandl | 2006-05-25 21:15:31 +0200 (Thu, 25 May 2006) | 4 lines
Replace PyObject_CallFunction calls with only object args
with PyObject_CallFunctionObjArgs, which is 30% faster.
........
r46245 | fredrik.lundh | 2006-05-25 21:19:05 +0200 (Thu, 25 May 2006) | 3 lines
needforspeed: use insert+reverse instead of append
........
r46246 | bob.ippolito | 2006-05-25 21:33:38 +0200 (Thu, 25 May 2006) | 1 line
Use LONG_MIN and LONG_MAX to check Python integer bounds instead of the incorrect INT_MIN and INT_MAX
........
r46248 | bob.ippolito | 2006-05-25 21:56:56 +0200 (Thu, 25 May 2006) | 1 line
Use faster struct pack/unpack functions for the endian table that matches the host's
........
r46249 | bob.ippolito | 2006-05-25 21:59:56 +0200 (Thu, 25 May 2006) | 1 line
enable darwin/x86 support for libffi and hence ctypes (doesn't yet support --enable-universalsdk)
........
r46252 | georg.brandl | 2006-05-25 22:28:10 +0200 (Thu, 25 May 2006) | 4 lines
Someone seems to just have copy-pasted the docs of
tp_compare to tp_richcompare ;)
........
r46253 | brett.cannon | 2006-05-25 22:44:08 +0200 (Thu, 25 May 2006) | 2 lines
Swap out bare malloc()/free() use for PyMem_MALLOC()/PyMem_FREE() .
........
r46254 | bob.ippolito | 2006-05-25 22:52:38 +0200 (Thu, 25 May 2006) | 1 line
squelch gcc4 darwin/x86 compiler warnings
........
r46255 | bob.ippolito | 2006-05-25 23:09:45 +0200 (Thu, 25 May 2006) | 1 line
fix test_float regression and 64-bit size mismatch issue
........
r46256 | georg.brandl | 2006-05-25 23:11:56 +0200 (Thu, 25 May 2006) | 3 lines
Add a x-ref to newer calling APIs.
........
r46257 | ronald.oussoren | 2006-05-25 23:30:54 +0200 (Thu, 25 May 2006) | 2 lines
Fix minor typo in prep_cif.c
........
r46259 | brett.cannon | 2006-05-25 23:33:11 +0200 (Thu, 25 May 2006) | 4 lines
Change test_values so that it compares the lowercasing of group names since getgrall() can return all lowercase names while getgrgid() returns proper casing.
Discovered on Ubuntu 5.04 (custom).
........
r46261 | tim.peters | 2006-05-25 23:50:17 +0200 (Thu, 25 May 2006) | 7 lines
Some Win64 pre-release in 2000 didn't support
QueryPerformanceCounter(), but we believe Win64 does
support it now. So use in time.clock().
It would be peachy if someone with a Win64 box tried
this ;-)
........
r46262 | tim.peters | 2006-05-25 23:52:19 +0200 (Thu, 25 May 2006) | 2 lines
Whitespace normalization.
........
r46263 | bob.ippolito | 2006-05-25 23:58:05 +0200 (Thu, 25 May 2006) | 1 line
Add missing files from x86 darwin ctypes patch
........
r46264 | brett.cannon | 2006-05-26 00:00:14 +0200 (Fri, 26 May 2006) | 2 lines
Move over to use of METH_O and METH_NOARGS.
........
r46265 | tim.peters | 2006-05-26 00:25:25 +0200 (Fri, 26 May 2006) | 3 lines
Repair idiot typo, and complete the job of trying to
use the Windows time.clock() implementation on Win64.
........
r46266 | tim.peters | 2006-05-26 00:28:46 +0200 (Fri, 26 May 2006) | 9 lines
Patch #1494387: SVN longobject.c compiler warnings
The SIGCHECK macro defined here has always been bizarre, but
it apparently causes compiler warnings on "Sun Studio 11".
I believe the warnings are bogus, but it doesn't hurt to make
the macro definition saner.
Bugfix candidate (but I'm not going to bother).
........
r46268 | fredrik.lundh | 2006-05-26 01:27:53 +0200 (Fri, 26 May 2006) | 8 lines
needforspeed: partition for 8-bit strings. for some simple tests,
this is on par with a corresponding find, and nearly twice as fast
as split(sep, 1)
full tests, a unicode version, and documentation will follow to-
morrow.
........
r46271 | andrew.kuchling | 2006-05-26 03:46:22 +0200 (Fri, 26 May 2006) | 1 line
Add Soc student
........
r46272 | ronald.oussoren | 2006-05-26 10:41:25 +0200 (Fri, 26 May 2006) | 3 lines
Without this patch OSX users couldn't add new help sources because the code
tried to update one item in a tuple.
........
r46273 | fredrik.lundh | 2006-05-26 10:54:28 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: partition implementation, part two.
feel free to improve the documentation and the docstrings.
........
r46274 | georg.brandl | 2006-05-26 11:05:54 +0200 (Fri, 26 May 2006) | 3 lines
Clarify docs for str.partition().
........
r46278 | fredrik.lundh | 2006-05-26 11:46:59 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: use METH_O for argument handling, which made partition some
~15% faster for the current tests (which is noticable faster than a corre-
sponding find call). thanks to neal-who-never-sleeps for the tip.
........
r46280 | fredrik.lundh | 2006-05-26 12:27:17 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: use Py_ssize_t for the fastsearch counter and skip
length (thanks, neal!). and yes, I've verified that this doesn't
slow things down ;-)
........
r46285 | andrew.dalke | 2006-05-26 13:11:38 +0200 (Fri, 26 May 2006) | 2 lines
Added a few more test cases for whitespace split. These strings have leading whitespace.
........
r46286 | jack.diederich | 2006-05-26 13:15:17 +0200 (Fri, 26 May 2006) | 1 line
use Py_ssize_t in places that may need it
........
r46287 | andrew.dalke | 2006-05-26 13:15:22 +0200 (Fri, 26 May 2006) | 2 lines
Added split whitespace checks for characters other than space.
........
r46288 | ronald.oussoren | 2006-05-26 13:17:55 +0200 (Fri, 26 May 2006) | 2 lines
Fix buglet in postinstall script, it would generate an invalid .cshrc file.
........
r46290 | georg.brandl | 2006-05-26 13:26:11 +0200 (Fri, 26 May 2006) | 3 lines
Add "partition" to UserString.
........
r46291 | fredrik.lundh | 2006-05-26 13:29:39 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: added Py_LOCAL macro, based on the LOCAL macro used
for SRE and others. applied Py_LOCAL to relevant portion of ceval,
which gives a 1-2% speedup on my machine. ymmv.
........
r46292 | jack.diederich | 2006-05-26 13:37:20 +0200 (Fri, 26 May 2006) | 1 line
when generating python code prefer to generate valid python code
........
r46293 | fredrik.lundh | 2006-05-26 13:38:15 +0200 (Fri, 26 May 2006) | 3 lines
use Py_LOCAL also for string and unicode objects
........
r46294 | ronald.oussoren | 2006-05-26 13:38:39 +0200 (Fri, 26 May 2006) | 12 lines
- Search the sqlite specific search directories
after the normal include directories when looking
for the version of sqlite to use.
- On OSX:
* Extract additional include and link directories
from the CFLAGS and LDFLAGS, if the user has
bothered to specify them we might as wel use them.
* Add '-Wl,-search_paths_first' to the extra_link_args
for readline and sqlite. This makes it possible to
use a static library to override the system provided
dynamic library.
........
r46295 | ronald.oussoren | 2006-05-26 13:43:26 +0200 (Fri, 26 May 2006) | 6 lines
Integrate installing a framework in the 'make install'
target. Until now users had to use 'make frameworkinstall'
to install python when it is configured with '--enable-framework'.
This tends to confuse users that don't hunt for readme files
hidden in platform specific directories :-)
........
r46297 | fredrik.lundh | 2006-05-26 13:54:04 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: added PY_LOCAL_AGGRESSIVE macro to enable "aggressive"
LOCAL inlining; also added some missing whitespace
........
r46298 | andrew.kuchling | 2006-05-26 14:01:44 +0200 (Fri, 26 May 2006) | 1 line
Typo fixes
........
r46299 | fredrik.lundh | 2006-05-26 14:01:49 +0200 (Fri, 26 May 2006) | 4 lines
Py_LOCAL shouldn't be used for data; it works for some .NET 2003 compilers,
but Trent's copy thinks that it's an anachronism...
........
r46300 | martin.blais | 2006-05-26 14:03:27 +0200 (Fri, 26 May 2006) | 12 lines
Support for buffer protocol for socket and struct.
* Added socket.recv_buf() and socket.recvfrom_buf() methods, that use the buffer
protocol (send and sendto already did).
* Added struct.pack_to(), that is the corresponding buffer compatible method to
unpack_from().
* Fixed minor typos in arraymodule.
........
r46302 | ronald.oussoren | 2006-05-26 14:23:20 +0200 (Fri, 26 May 2006) | 6 lines
- Remove previous version of the binary distribution script for OSX
- Some small bugfixes for the IDLE.app wrapper
- Tweaks to build-installer to ensure that python gets build in the right way,
including sqlite3.
- Updated readme files
........
r46305 | tim.peters | 2006-05-26 14:26:21 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46307 | andrew.dalke | 2006-05-26 14:28:15 +0200 (Fri, 26 May 2006) | 7 lines
I like tests.
The new split functions use a preallocated list. Added tests which exceed
the preallocation size, to exercise list appends/resizes.
Also added more edge case tests.
........
r46308 | andrew.dalke | 2006-05-26 14:31:00 +0200 (Fri, 26 May 2006) | 2 lines
Test cases for off-by-one errors in string split with multicharacter pattern.
........
r46309 | tim.peters | 2006-05-26 14:31:20 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46313 | andrew.kuchling | 2006-05-26 14:39:48 +0200 (Fri, 26 May 2006) | 1 line
Add str.partition()
........
r46314 | bob.ippolito | 2006-05-26 14:52:53 +0200 (Fri, 26 May 2006) | 1 line
quick hack to fix busted binhex test
........
r46316 | andrew.dalke | 2006-05-26 15:05:55 +0200 (Fri, 26 May 2006) | 2 lines
Added more rstrip tests, including for prealloc'ed arrays
........
r46320 | bob.ippolito | 2006-05-26 15:15:44 +0200 (Fri, 26 May 2006) | 1 line
fix #1229380 No struct.pack exception for some out of range integers
........
r46325 | tim.peters | 2006-05-26 15:39:17 +0200 (Fri, 26 May 2006) | 2 lines
Use open() to open files (was using file()).
........
r46327 | andrew.dalke | 2006-05-26 16:00:45 +0200 (Fri, 26 May 2006) | 37 lines
Changes to string.split/rsplit on whitespace to preallocate space in the
results list.
Originally it allocated 0 items and used the list growth during append. Now
it preallocates 12 items so the first few appends don't need list reallocs.
("Here are some words ."*2).split(None, 1) is 7% faster
("Here are some words ."*2).split() is is 15% faster
(Your milage may vary, see dealership for details.)
File parsing like this
for line in f:
count += len(line.split())
is also about 15% faster. There is a slowdown of about 3% for large
strings because of the additional overhead of checking if the append is
to a preallocated region of the list or not. This will be the rare case.
It could be improved with special case code but we decided it was not
useful enough.
There is a cost of 12*sizeof(PyObject *) bytes per list. For the normal
case of file parsing this is not a problem because of the lists have
a short lifetime. We have not come up with cases where this is a problem
in real life.
I chose 12 because human text averages about 11 words per line in books,
one of my data sets averages 6.2 words with a final peak at 11 words per
line, and I work with a tab delimited data set with 8 tabs per line (or
9 words per line). 12 encompasses all of these.
Also changed the last rstrip code to append then reverse, rather than
doing insert(0). The strip() and rstrip() times are now comparable.
........
r46328 | tim.peters | 2006-05-26 16:02:05 +0200 (Fri, 26 May 2006) | 5 lines
Explicitly close files. I'm trying to stop the frequent spurious test_tarfile
failures on Windows buildbots, but it's hard to know how since the regrtest
failure output is useless here, and it never fails when a buildbot slave runs
test_tarfile the second time in verbose mode.
........
r46329 | andrew.kuchling | 2006-05-26 16:03:41 +0200 (Fri, 26 May 2006) | 1 line
Add buffer support for struct, socket
........
r46330 | andrew.kuchling | 2006-05-26 16:04:19 +0200 (Fri, 26 May 2006) | 1 line
Typo fix
........
r46331 | bob.ippolito | 2006-05-26 16:07:23 +0200 (Fri, 26 May 2006) | 1 line
Fix distutils so that libffi will cross-compile between darwin/x86 and darwin/ppc
........
r46333 | bob.ippolito | 2006-05-26 16:23:21 +0200 (Fri, 26 May 2006) | 1 line
Fix _struct typo that broke some 64-bit platforms
........
r46335 | bob.ippolito | 2006-05-26 16:29:35 +0200 (Fri, 26 May 2006) | 1 line
Enable PY_USE_INT_WHEN_POSSIBLE in struct
........
r46343 | andrew.dalke | 2006-05-26 17:21:01 +0200 (Fri, 26 May 2006) | 2 lines
Eeked out another 3% or so performance in split whitespace by cleaning up the algorithm.
........
r46352 | andrew.dalke | 2006-05-26 18:22:52 +0200 (Fri, 26 May 2006) | 3 lines
Test for more edge strip cases; leading and trailing separator gets removed
even with strip(..., 0)
........
r46354 | bob.ippolito | 2006-05-26 18:23:28 +0200 (Fri, 26 May 2006) | 1 line
fix signed/unsigned mismatch in struct
........
r46355 | steve.holden | 2006-05-26 18:27:59 +0200 (Fri, 26 May 2006) | 5 lines
Add -t option to allow easy test selection.
Action verbose option correctly.
Tweak operation counts. Add empty and new instances tests.
Enable comparisons across different warp factors. Change version.
........
r46356 | fredrik.lundh | 2006-05-26 18:32:42 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: use Py_LOCAL on a few more locals in stringobject.c
........
r46357 | thomas.heller | 2006-05-26 18:42:44 +0200 (Fri, 26 May 2006) | 4 lines
For now, I gave up with automatic conversion of reST to Python-latex,
so I'm writing this in latex now.
Skeleton for the ctypes reference.
........
r46358 | tim.peters | 2006-05-26 18:49:28 +0200 (Fri, 26 May 2006) | 3 lines
Repair Windows compiler warnings about mixing
signed and unsigned integral types in comparisons.
........
r46359 | tim.peters | 2006-05-26 18:52:04 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46360 | tim.peters | 2006-05-26 18:53:04 +0200 (Fri, 26 May 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46362 | fredrik.lundh | 2006-05-26 19:04:58 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: stringlib refactoring (in progress)
........
r46363 | thomas.heller | 2006-05-26 19:18:33 +0200 (Fri, 26 May 2006) | 1 line
Write some docs.
........
r46364 | fredrik.lundh | 2006-05-26 19:22:38 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: stringlib refactoring (in progress)
........
r46366 | fredrik.lundh | 2006-05-26 19:26:39 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: cleanup
........
r46367 | fredrik.lundh | 2006-05-26 19:31:41 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: remove remaining USE_FAST macros; if fastsearch was
broken, someone would have noticed by now ;-)
........
r46368 | steve.holden | 2006-05-26 19:41:32 +0200 (Fri, 26 May 2006) | 5 lines
Use minimum calibration time rather than avergae to avoid
the illusion of negative run times. Halt with an error if
run times go below 10 ms, indicating that results will be
unreliable.
........
r46370 | thomas.heller | 2006-05-26 19:47:40 +0200 (Fri, 26 May 2006) | 2 lines
Reordered, and wrote more docs.
........
r46372 | georg.brandl | 2006-05-26 20:03:31 +0200 (Fri, 26 May 2006) | 9 lines
Need for speed: Patch #921466 : sys.path_importer_cache is now used to cache valid and
invalid file paths for the built-in import machinery which leads to
fewer open calls on startup.
Also fix issue with PEP 302 style import hooks which lead to more open()
calls than necessary.
........
r46373 | fredrik.lundh | 2006-05-26 20:05:34 +0200 (Fri, 26 May 2006) | 3 lines
removed unnecessary include
........
r46377 | fredrik.lundh | 2006-05-26 20:15:38 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: added rpartition implementation
........
r46380 | fredrik.lundh | 2006-05-26 20:24:15 +0200 (Fri, 26 May 2006) | 5 lines
needspeed: rpartition documentation, tests, and a bug fixes.
feel free to add more tests and improve the documentation.
........
r46381 | steve.holden | 2006-05-26 20:26:21 +0200 (Fri, 26 May 2006) | 4 lines
Revert tests to MAL's original round sizes to retiain comparability
from long ago and far away. Stop calling this pybench 1.4 because it
isn't. Remove the empty test, which was a bad idea.
........
r46387 | andrew.kuchling | 2006-05-26 20:41:18 +0200 (Fri, 26 May 2006) | 1 line
Add rpartition() and path caching
........
r46388 | andrew.dalke | 2006-05-26 21:02:09 +0200 (Fri, 26 May 2006) | 10 lines
substring split now uses /F's fast string matching algorithm.
(If compiled without FAST search support, changed the pre-memcmp test
to check the last character as well as the first. This gave a 25%
speedup for my test case.)
Rewrote the split algorithms so they stop when maxsplit gets to 0.
Previously they did a string match first then checked if the maxsplit
was reached. The new way prevents a needless string search.
........
r46391 | brett.cannon | 2006-05-26 21:04:47 +0200 (Fri, 26 May 2006) | 2 lines
Change C spacing to 4 spaces by default to match PEP 7 for new C files.
........
r46392 | georg.brandl | 2006-05-26 21:04:47 +0200 (Fri, 26 May 2006) | 3 lines
Exception isn't the root of all exception classes anymore.
........
r46397 | fredrik.lundh | 2006-05-26 21:23:21 +0200 (Fri, 26 May 2006) | 3 lines
added rpartition method to UserString class
........
r46398 | fredrik.lundh | 2006-05-26 21:24:53 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: stringlib refactoring, continued. added count and
find helpers; updated unicodeobject to use stringlib_count
........
r46400 | fredrik.lundh | 2006-05-26 21:29:05 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: stringlib refactoring: use stringlib/find for unicode
find
........
r46403 | fredrik.lundh | 2006-05-26 21:33:03 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: use a macro to fix slice indexes
........
r46404 | thomas.heller | 2006-05-26 21:43:45 +0200 (Fri, 26 May 2006) | 1 line
Write more docs.
........
r46406 | fredrik.lundh | 2006-05-26 21:48:07 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: stringlib refactoring: use stringlib/find for string find
........
r46407 | andrew.kuchling | 2006-05-26 21:51:10 +0200 (Fri, 26 May 2006) | 1 line
Comment typo
........
r46409 | georg.brandl | 2006-05-26 22:04:44 +0200 (Fri, 26 May 2006) | 3 lines
Replace Py_BuildValue("OO") by PyTuple_Pack.
........
r46411 | georg.brandl | 2006-05-26 22:14:47 +0200 (Fri, 26 May 2006) | 2 lines
Patch #1492218: document None being a constant.
........
r46415 | georg.brandl | 2006-05-26 22:22:50 +0200 (Fri, 26 May 2006) | 3 lines
Simplify calling.
........
r46416 | andrew.dalke | 2006-05-26 22:25:22 +0200 (Fri, 26 May 2006) | 4 lines
Added limits to the replace code so it does not count all of the matching
patterns in a string, only the number needed by the max limit.
........
r46417 | bob.ippolito | 2006-05-26 22:25:23 +0200 (Fri, 26 May 2006) | 1 line
enable all of the struct tests, use ssize_t, fix some whitespace
........
r46418 | tim.peters | 2006-05-26 22:56:56 +0200 (Fri, 26 May 2006) | 2 lines
Record Iceland sprint attendees.
........
r46421 | tim.peters | 2006-05-26 23:51:13 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46422 | steve.holden | 2006-05-27 00:17:54 +0200 (Sat, 27 May 2006) | 2 lines
Add Richard Tew to developers
........
r46423 | steve.holden | 2006-05-27 00:33:20 +0200 (Sat, 27 May 2006) | 2 lines
Update help text and documentaition.
........
r46424 | steve.holden | 2006-05-27 00:39:27 +0200 (Sat, 27 May 2006) | 2 lines
Blasted typos ...
........
r46425 | andrew.dalke | 2006-05-27 00:49:03 +0200 (Sat, 27 May 2006) | 2 lines
Added description of why splitlines doesn't use the prealloc strategy
........
r46426 | tim.peters | 2006-05-27 01:14:37 +0200 (Sat, 27 May 2006) | 19 lines
Patch 1145039.
set_exc_info(), reset_exc_info(): By exploiting the
likely (who knows?) invariant that when an exception's
`type` is NULL, its `value` and `traceback` are also NULL,
save some cycles in heavily-executed code.
This is a "a kronar saved is a kronar earned" patch: the
speedup isn't reliably measurable, but it obviously does
reduce the operation count in the normal (no exception
raised) path through PyEval_EvalFrameEx().
The tim-exc_sanity branch tries to push this harder, but
is still blowing up (at least in part due to pre-existing
subtle bugs that appear to have no other visible
consequences!).
Not a bugfix candidate.
........
r46429 | steve.holden | 2006-05-27 02:51:52 +0200 (Sat, 27 May 2006) | 2 lines
Reinstate new-style object tests.
........
r46430 | neal.norwitz | 2006-05-27 07:18:57 +0200 (Sat, 27 May 2006) | 1 line
Fix compiler warning (and whitespace) on Mac OS 10.4. (A lot of this code looked duplicated, I wonder if a utility function could help reduce the duplication here.)
........
r46431 | neal.norwitz | 2006-05-27 07:21:30 +0200 (Sat, 27 May 2006) | 4 lines
Fix Coverity warnings.
- Check the correct variable (str_obj, not str) for NULL
- sep_len was already verified it wasn't 0
........
r46432 | martin.v.loewis | 2006-05-27 10:36:52 +0200 (Sat, 27 May 2006) | 2 lines
Patch 1494554: Update numeric properties to Unicode 4.1.
........
r46433 | martin.v.loewis | 2006-05-27 10:54:29 +0200 (Sat, 27 May 2006) | 2 lines
Explain why 'consumed' is initialized.
........
r46436 | fredrik.lundh | 2006-05-27 12:05:10 +0200 (Sat, 27 May 2006) | 3 lines
needforspeed: more stringlib refactoring
........
r46438 | fredrik.lundh | 2006-05-27 12:39:48 +0200 (Sat, 27 May 2006) | 5 lines
needforspeed: backed out the Py_LOCAL-isation of ceval; the massive in-
lining killed performance on certain Intel boxes, and the "aggressive"
macro itself gives most of the benefits on others.
........
r46439 | andrew.dalke | 2006-05-27 13:04:36 +0200 (Sat, 27 May 2006) | 2 lines
fixed typo
........
r46440 | martin.v.loewis | 2006-05-27 13:07:49 +0200 (Sat, 27 May 2006) | 2 lines
Revert bogus change committed in 46432 to this file.
........
r46444 | andrew.kuchling | 2006-05-27 13:26:33 +0200 (Sat, 27 May 2006) | 1 line
Add Py_LOCAL macros
........
r46450 | bob.ippolito | 2006-05-27 13:47:12 +0200 (Sat, 27 May 2006) | 1 line
Remove the range checking and int usage #defines from _struct and strip out the now-dead code
........
r46454 | bob.ippolito | 2006-05-27 14:11:36 +0200 (Sat, 27 May 2006) | 1 line
Fix up struct docstrings, add struct.pack_to function for symmetry
........
r46456 | richard.jones | 2006-05-27 14:29:24 +0200 (Sat, 27 May 2006) | 2 lines
Conversion of exceptions over from faked-up classes to new-style C types.
........
r46457 | georg.brandl | 2006-05-27 14:30:25 +0200 (Sat, 27 May 2006) | 3 lines
Add news item for new-style exception class branch merge.
........
r46458 | tim.peters | 2006-05-27 14:36:53 +0200 (Sat, 27 May 2006) | 3 lines
More random thrashing trying to understand spurious
Windows failures. Who's keeping a bz2 file open?
........
r46460 | andrew.kuchling | 2006-05-27 15:44:37 +0200 (Sat, 27 May 2006) | 1 line
Mention new-style exceptions
........
r46461 | richard.jones | 2006-05-27 15:50:42 +0200 (Sat, 27 May 2006) | 1 line
credit where credit is due
........
r46462 | georg.brandl | 2006-05-27 16:02:03 +0200 (Sat, 27 May 2006) | 3 lines
Always close BZ2Proxy object. Remove unnecessary struct usage.
........
r46463 | tim.peters | 2006-05-27 16:13:13 +0200 (Sat, 27 May 2006) | 2 lines
The cheery optimism of old age.
........
r46464 | andrew.dalke | 2006-05-27 16:16:40 +0200 (Sat, 27 May 2006) | 2 lines
cleanup - removed trailing whitespace
........
r46465 | georg.brandl | 2006-05-27 16:41:55 +0200 (Sat, 27 May 2006) | 3 lines
Remove spurious semicolons after macro invocations.
........
r46468 | fredrik.lundh | 2006-05-27 16:58:20 +0200 (Sat, 27 May 2006) | 4 lines
needforspeed: replace improvements, changed to Py_LOCAL_INLINE
where appropriate
........
r46469 | fredrik.lundh | 2006-05-27 17:20:22 +0200 (Sat, 27 May 2006) | 4 lines
needforspeed: stringlib refactoring: changed find_obj to find_slice,
to enable use from stringobject
........
r46470 | fredrik.lundh | 2006-05-27 17:26:19 +0200 (Sat, 27 May 2006) | 3 lines
needforspeed: stringlib refactoring: use find_slice for stringobject
........
r46472 | kristjan.jonsson | 2006-05-27 17:41:31 +0200 (Sat, 27 May 2006) | 1 line
Add a PCBuild8 build directory for building with Visual Studio .NET 2005. Contains a special project to perform profile guided optimizations on the pythoncore.dll, by instrumenting and running pybench.py
........
r46473 | jack.diederich | 2006-05-27 17:44:34 +0200 (Sat, 27 May 2006) | 3 lines
needforspeed: use PyObject_MALLOC instead of system malloc for small
allocations. Use PyMem_MALLOC for larger (1k+) chunks. 1%-2% speedup.
........
r46474 | bob.ippolito | 2006-05-27 17:53:49 +0200 (Sat, 27 May 2006) | 1 line
fix struct regression on 64-bit platforms
........
r46475 | richard.jones | 2006-05-27 18:07:28 +0200 (Sat, 27 May 2006) | 1 line
doc string additions and tweaks
........
r46477 | richard.jones | 2006-05-27 18:15:11 +0200 (Sat, 27 May 2006) | 1 line
move semicolons
........
r46478 | george.yoshida | 2006-05-27 18:32:44 +0200 (Sat, 27 May 2006) | 2 lines
minor markup nits
........
r46488 | george.yoshida | 2006-05-27 18:51:43 +0200 (Sat, 27 May 2006) | 3 lines
End of Ch.3 is now about "with statement".
Avoid obsolescence by directly referring to the section.
........
r46489 | george.yoshida | 2006-05-27 19:09:17 +0200 (Sat, 27 May 2006) | 2 lines
fix typo
........
2006-05-27 19:21:47 +00:00
|
|
|
#if defined(HAVE_STATVFS) && defined(HAVE_SYS_STATVFS_H)
|
1999-01-06 18:42:14 +00:00
|
|
|
#include <sys/statvfs.h>
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.statvfs
|
1999-01-06 18:42:14 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
path: path_t(allow_fd='PATH_HAVE_FSTATVFS')
|
|
|
|
|
|
|
|
|
|
Perform a statvfs system call on the given path.
|
|
|
|
|
|
|
|
|
|
path may always be specified as a string.
|
|
|
|
|
On some platforms, path may also be specified as an open file descriptor.
|
|
|
|
|
If this functionality is unavailable, using it raises an exception.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_statvfs_impl(PyObject *module, path_t *path)
|
|
|
|
|
/*[clinic end generated code: output=87106dd1beb8556e input=3f5c35791c669bd9]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
int result;
|
|
|
|
|
struct statvfs st;
|
2012-06-22 16:30:09 -07:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef HAVE_FSTATVFS
|
2014-08-05 14:04:04 +10:00
|
|
|
if (path->fd != -1) {
|
|
|
|
|
result = fstatvfs(path->fd, &st);
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
#endif
|
2014-08-05 14:04:04 +10:00
|
|
|
result = statvfs(path->narrow, &st);
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
2012-06-22 16:30:09 -07:00
|
|
|
|
|
|
|
|
if (result) {
|
2014-08-05 14:04:04 +10:00
|
|
|
return path_error(path);
|
2011-09-20 04:04:33 +02:00
|
|
|
}
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 20:34:25 +00:00
|
|
|
|
2020-05-10 11:05:29 +02:00
|
|
|
return _pystatvfs_fromstructstatvfs(module, st);
|
2014-08-05 14:04:04 +10:00
|
|
|
}
|
|
|
|
|
#endif /* defined(HAVE_STATVFS) && defined(HAVE_SYS_STATVFS_H) */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os._getdiskusage
|
|
|
|
|
|
2018-02-22 10:39:10 -08:00
|
|
|
path: path_t
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
Return disk usage statistics about the given path as a (total, free) tuple.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
2011-07-01 13:55:36 +02:00
|
|
|
static PyObject *
|
2018-02-22 10:39:10 -08:00
|
|
|
os__getdiskusage_impl(PyObject *module, path_t *path)
|
|
|
|
|
/*[clinic end generated code: output=3bd3991f5e5c5dfb input=6af8d1b7781cc042]*/
|
2011-07-01 13:55:36 +02:00
|
|
|
{
|
|
|
|
|
BOOL retval;
|
|
|
|
|
ULARGE_INTEGER _, total, free;
|
2018-09-25 10:57:36 -04:00
|
|
|
DWORD err = 0;
|
2011-07-01 13:55:36 +02:00
|
|
|
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2018-02-22 10:39:10 -08:00
|
|
|
retval = GetDiskFreeSpaceExW(path->wide, &_, &total, &free);
|
2011-07-01 13:55:36 +02:00
|
|
|
Py_END_ALLOW_THREADS
|
2018-09-25 10:57:36 -04:00
|
|
|
if (retval == 0) {
|
|
|
|
|
if (GetLastError() == ERROR_DIRECTORY) {
|
|
|
|
|
wchar_t *dir_path = NULL;
|
|
|
|
|
|
|
|
|
|
dir_path = PyMem_New(wchar_t, path->length + 1);
|
|
|
|
|
if (dir_path == NULL) {
|
|
|
|
|
return PyErr_NoMemory();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
wcscpy_s(dir_path, path->length + 1, path->wide);
|
|
|
|
|
|
|
|
|
|
if (_dirnameW(dir_path) != -1) {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
retval = GetDiskFreeSpaceExW(dir_path, &_, &total, &free);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
}
|
|
|
|
|
/* Record the last error in case it's modified by PyMem_Free. */
|
|
|
|
|
err = GetLastError();
|
|
|
|
|
PyMem_Free(dir_path);
|
|
|
|
|
if (retval) {
|
|
|
|
|
goto success;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return PyErr_SetFromWindowsErr(err);
|
|
|
|
|
}
|
2011-07-01 13:55:36 +02:00
|
|
|
|
2018-09-25 10:57:36 -04:00
|
|
|
success:
|
2011-07-01 13:55:36 +02:00
|
|
|
return Py_BuildValue("(LL)", total.QuadPart, free.QuadPart);
|
|
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* MS_WINDOWS */
|
2011-07-01 13:55:36 +02:00
|
|
|
|
|
|
|
|
|
1999-12-13 16:37:25 +00:00
|
|
|
/* This is used for fpathconf(), pathconf(), confstr() and sysconf().
|
|
|
|
|
* It maps strings representing configuration variable names to
|
|
|
|
|
* integer values, allowing those functions to be called with the
|
2000-07-16 12:04:32 +00:00
|
|
|
* magic names instead of polluting the module's namespace with tons of
|
1999-12-14 21:25:03 +00:00
|
|
|
* rarely-used constants. There are three separate tables that use
|
|
|
|
|
* these definitions.
|
1999-12-15 18:31:10 +00:00
|
|
|
*
|
|
|
|
|
* This code is always included, even if none of the interfaces that
|
|
|
|
|
* need it are included. The #if hackery needed to avoid it would be
|
|
|
|
|
* sufficiently pervasive that it's not worth the loss of readability.
|
1999-12-13 16:37:25 +00:00
|
|
|
*/
|
|
|
|
|
struct constdef {
|
2015-12-25 19:53:18 +02:00
|
|
|
const char *name;
|
2015-09-06 21:25:30 +03:00
|
|
|
int value;
|
1999-12-13 16:37:25 +00:00
|
|
|
};
|
|
|
|
|
|
1999-12-14 21:25:03 +00:00
|
|
|
static int
|
2000-07-08 22:48:53 +00:00
|
|
|
conv_confname(PyObject *arg, int *valuep, struct constdef *table,
|
2007-08-27 23:24:46 +00:00
|
|
|
size_t tablesize)
|
1999-12-14 21:25:03 +00:00
|
|
|
{
|
2007-12-02 14:31:20 +00:00
|
|
|
if (PyLong_Check(arg)) {
|
2015-09-06 21:25:30 +03:00
|
|
|
int value = _PyLong_AsInt(arg);
|
|
|
|
|
if (value == -1 && PyErr_Occurred())
|
|
|
|
|
return 0;
|
|
|
|
|
*valuep = value;
|
2010-11-26 16:16:47 +00:00
|
|
|
return 1;
|
1999-12-14 21:25:03 +00:00
|
|
|
}
|
2007-05-10 18:04:33 +00:00
|
|
|
else {
|
2010-11-26 16:16:47 +00:00
|
|
|
/* look up the value in the table using a binary search */
|
|
|
|
|
size_t lo = 0;
|
|
|
|
|
size_t mid;
|
|
|
|
|
size_t hi = tablesize;
|
|
|
|
|
int cmp;
|
|
|
|
|
const char *confname;
|
|
|
|
|
if (!PyUnicode_Check(arg)) {
|
|
|
|
|
PyErr_SetString(PyExc_TypeError,
|
|
|
|
|
"configuration names must be strings or integers");
|
|
|
|
|
return 0;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2016-11-20 09:13:07 +02:00
|
|
|
confname = PyUnicode_AsUTF8(arg);
|
2010-11-26 16:16:47 +00:00
|
|
|
if (confname == NULL)
|
|
|
|
|
return 0;
|
|
|
|
|
while (lo < hi) {
|
|
|
|
|
mid = (lo + hi) / 2;
|
|
|
|
|
cmp = strcmp(confname, table[mid].name);
|
|
|
|
|
if (cmp < 0)
|
|
|
|
|
hi = mid;
|
|
|
|
|
else if (cmp > 0)
|
|
|
|
|
lo = mid + 1;
|
|
|
|
|
else {
|
|
|
|
|
*valuep = table[mid].value;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
PyErr_SetString(PyExc_ValueError, "unrecognized configuration name");
|
|
|
|
|
return 0;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
1999-12-14 21:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(HAVE_FPATHCONF) || defined(HAVE_PATHCONF)
|
|
|
|
|
static struct constdef posix_constants_pathconf[] = {
|
1999-12-15 15:34:33 +00:00
|
|
|
#ifdef _PC_ABI_AIO_XFER_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"PC_ABI_AIO_XFER_MAX", _PC_ABI_AIO_XFER_MAX},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_ABI_ASYNC_IO
|
2010-05-06 00:08:46 +00:00
|
|
|
{"PC_ABI_ASYNC_IO", _PC_ABI_ASYNC_IO},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
1999-12-13 16:37:25 +00:00
|
|
|
#ifdef _PC_ASYNC_IO
|
2010-05-06 00:08:46 +00:00
|
|
|
{"PC_ASYNC_IO", _PC_ASYNC_IO},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_CHOWN_RESTRICTED
|
2010-05-06 00:08:46 +00:00
|
|
|
{"PC_CHOWN_RESTRICTED", _PC_CHOWN_RESTRICTED},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_FILESIZEBITS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"PC_FILESIZEBITS", _PC_FILESIZEBITS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_LAST
|
2010-05-06 00:08:46 +00:00
|
|
|
{"PC_LAST", _PC_LAST},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_LINK_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"PC_LINK_MAX", _PC_LINK_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_MAX_CANON
|
2010-05-06 00:08:46 +00:00
|
|
|
{"PC_MAX_CANON", _PC_MAX_CANON},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_MAX_INPUT
|
2010-05-06 00:08:46 +00:00
|
|
|
{"PC_MAX_INPUT", _PC_MAX_INPUT},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_NAME_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"PC_NAME_MAX", _PC_NAME_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_NO_TRUNC
|
2010-05-06 00:08:46 +00:00
|
|
|
{"PC_NO_TRUNC", _PC_NO_TRUNC},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_PATH_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"PC_PATH_MAX", _PC_PATH_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_PIPE_BUF
|
2010-05-06 00:08:46 +00:00
|
|
|
{"PC_PIPE_BUF", _PC_PIPE_BUF},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_PRIO_IO
|
2010-05-06 00:08:46 +00:00
|
|
|
{"PC_PRIO_IO", _PC_PRIO_IO},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_SOCK_MAXBUF
|
2010-05-06 00:08:46 +00:00
|
|
|
{"PC_SOCK_MAXBUF", _PC_SOCK_MAXBUF},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_SYNC_IO
|
2010-05-06 00:08:46 +00:00
|
|
|
{"PC_SYNC_IO", _PC_SYNC_IO},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_VDISABLE
|
2010-05-06 00:08:46 +00:00
|
|
|
{"PC_VDISABLE", _PC_VDISABLE},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
2010-10-25 13:02:04 +00:00
|
|
|
#ifdef _PC_ACL_ENABLED
|
|
|
|
|
{"PC_ACL_ENABLED", _PC_ACL_ENABLED},
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_MIN_HOLE_SIZE
|
|
|
|
|
{"PC_MIN_HOLE_SIZE", _PC_MIN_HOLE_SIZE},
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_ALLOC_SIZE_MIN
|
|
|
|
|
{"PC_ALLOC_SIZE_MIN", _PC_ALLOC_SIZE_MIN},
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_REC_INCR_XFER_SIZE
|
|
|
|
|
{"PC_REC_INCR_XFER_SIZE", _PC_REC_INCR_XFER_SIZE},
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_REC_MAX_XFER_SIZE
|
|
|
|
|
{"PC_REC_MAX_XFER_SIZE", _PC_REC_MAX_XFER_SIZE},
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_REC_MIN_XFER_SIZE
|
|
|
|
|
{"PC_REC_MIN_XFER_SIZE", _PC_REC_MIN_XFER_SIZE},
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_REC_XFER_ALIGN
|
|
|
|
|
{"PC_REC_XFER_ALIGN", _PC_REC_XFER_ALIGN},
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_SYMLINK_MAX
|
|
|
|
|
{"PC_SYMLINK_MAX", _PC_SYMLINK_MAX},
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_XATTR_ENABLED
|
|
|
|
|
{"PC_XATTR_ENABLED", _PC_XATTR_ENABLED},
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_XATTR_EXISTS
|
|
|
|
|
{"PC_XATTR_EXISTS", _PC_XATTR_EXISTS},
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef _PC_TIMESTAMP_RESOLUTION
|
|
|
|
|
{"PC_TIMESTAMP_RESOLUTION", _PC_TIMESTAMP_RESOLUTION},
|
|
|
|
|
#endif
|
1999-12-13 16:37:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static int
|
2000-07-08 22:48:53 +00:00
|
|
|
conv_path_confname(PyObject *arg, int *valuep)
|
1999-12-13 16:37:25 +00:00
|
|
|
{
|
|
|
|
|
return conv_confname(arg, valuep, posix_constants_pathconf,
|
|
|
|
|
sizeof(posix_constants_pathconf)
|
|
|
|
|
/ sizeof(struct constdef));
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
1999-12-13 16:37:25 +00:00
|
|
|
#ifdef HAVE_FPATHCONF
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.fpathconf -> long
|
1999-12-13 16:37:25 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
fd: int
|
|
|
|
|
name: path_confname
|
|
|
|
|
/
|
1999-12-13 16:37:25 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Return the configuration limit name for the file descriptor fd.
|
1999-12-13 16:37:25 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
If there is no limit, return -1.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static long
|
2016-07-07 17:35:15 +03:00
|
|
|
os_fpathconf_impl(PyObject *module, int fd, int name)
|
|
|
|
|
/*[clinic end generated code: output=d5b7042425fc3e21 input=5942a024d3777810]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
long limit;
|
|
|
|
|
|
|
|
|
|
errno = 0;
|
2014-08-05 14:04:04 +10:00
|
|
|
limit = fpathconf(fd, name);
|
|
|
|
|
if (limit == -1 && errno != 0)
|
|
|
|
|
posix_error();
|
|
|
|
|
|
|
|
|
|
return limit;
|
1999-12-13 16:37:25 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_FPATHCONF */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_PATHCONF
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.pathconf -> long
|
|
|
|
|
path: path_t(allow_fd='PATH_HAVE_FPATHCONF')
|
|
|
|
|
name: path_confname
|
|
|
|
|
|
|
|
|
|
Return the configuration limit name for the file or directory path.
|
|
|
|
|
|
|
|
|
|
If there is no limit, return -1.
|
|
|
|
|
On some platforms, path may also be specified as an open file descriptor.
|
|
|
|
|
If this functionality is unavailable, using it raises an exception.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static long
|
2016-07-07 17:35:15 +03:00
|
|
|
os_pathconf_impl(PyObject *module, path_t *path, int name)
|
|
|
|
|
/*[clinic end generated code: output=5bedee35b293a089 input=bc3e2a985af27e5e]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
long limit;
|
|
|
|
|
|
|
|
|
|
errno = 0;
|
|
|
|
|
#ifdef HAVE_FPATHCONF
|
|
|
|
|
if (path->fd != -1)
|
|
|
|
|
limit = fpathconf(path->fd, name);
|
|
|
|
|
else
|
|
|
|
|
#endif
|
|
|
|
|
limit = pathconf(path->narrow, name);
|
|
|
|
|
if (limit == -1 && errno != 0) {
|
|
|
|
|
if (errno == EINVAL)
|
|
|
|
|
/* could be a path or name problem */
|
|
|
|
|
posix_error();
|
|
|
|
|
else
|
|
|
|
|
path_error(path);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return limit;
|
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_PATHCONF */
|
1999-12-13 16:37:25 +00:00
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFSTR
|
|
|
|
|
static struct constdef posix_constants_confstr[] = {
|
1999-12-15 15:34:33 +00:00
|
|
|
#ifdef _CS_ARCHITECTURE
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_ARCHITECTURE", _CS_ARCHITECTURE},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
2010-04-16 12:47:52 +00:00
|
|
|
#ifdef _CS_GNU_LIBC_VERSION
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_GNU_LIBC_VERSION", _CS_GNU_LIBC_VERSION},
|
2010-04-16 12:47:52 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_GNU_LIBPTHREAD_VERSION
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_GNU_LIBPTHREAD_VERSION", _CS_GNU_LIBPTHREAD_VERSION},
|
2010-04-16 12:47:52 +00:00
|
|
|
#endif
|
1999-12-15 15:34:33 +00:00
|
|
|
#ifdef _CS_HOSTNAME
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_HOSTNAME", _CS_HOSTNAME},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_HW_PROVIDER
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_HW_PROVIDER", _CS_HW_PROVIDER},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_HW_SERIAL
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_HW_SERIAL", _CS_HW_SERIAL},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_INITTAB_NAME
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_INITTAB_NAME", _CS_INITTAB_NAME},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
1999-12-13 16:37:25 +00:00
|
|
|
#ifdef _CS_LFS64_CFLAGS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_LFS64_CFLAGS", _CS_LFS64_CFLAGS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_LFS64_LDFLAGS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_LFS64_LDFLAGS", _CS_LFS64_LDFLAGS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_LFS64_LIBS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_LFS64_LIBS", _CS_LFS64_LIBS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_LFS64_LINTFLAGS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_LFS64_LINTFLAGS", _CS_LFS64_LINTFLAGS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_LFS_CFLAGS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_LFS_CFLAGS", _CS_LFS_CFLAGS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_LFS_LDFLAGS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_LFS_LDFLAGS", _CS_LFS_LDFLAGS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_LFS_LIBS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_LFS_LIBS", _CS_LFS_LIBS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_LFS_LINTFLAGS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_LFS_LINTFLAGS", _CS_LFS_LINTFLAGS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
1999-12-15 15:34:33 +00:00
|
|
|
#ifdef _CS_MACHINE
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_MACHINE", _CS_MACHINE},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
1999-12-13 16:37:25 +00:00
|
|
|
#ifdef _CS_PATH
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_PATH", _CS_PATH},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
1999-12-15 15:34:33 +00:00
|
|
|
#ifdef _CS_RELEASE
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_RELEASE", _CS_RELEASE},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_SRPC_DOMAIN
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_SRPC_DOMAIN", _CS_SRPC_DOMAIN},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_SYSNAME
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_SYSNAME", _CS_SYSNAME},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_VERSION
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_VERSION", _CS_VERSION},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
1999-12-13 16:37:25 +00:00
|
|
|
#ifdef _CS_XBS5_ILP32_OFF32_CFLAGS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_XBS5_ILP32_OFF32_CFLAGS", _CS_XBS5_ILP32_OFF32_CFLAGS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_XBS5_ILP32_OFF32_LDFLAGS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_XBS5_ILP32_OFF32_LDFLAGS", _CS_XBS5_ILP32_OFF32_LDFLAGS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_XBS5_ILP32_OFF32_LIBS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_XBS5_ILP32_OFF32_LIBS", _CS_XBS5_ILP32_OFF32_LIBS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_XBS5_ILP32_OFF32_LINTFLAGS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_XBS5_ILP32_OFF32_LINTFLAGS", _CS_XBS5_ILP32_OFF32_LINTFLAGS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_XBS5_ILP32_OFFBIG_CFLAGS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_XBS5_ILP32_OFFBIG_CFLAGS", _CS_XBS5_ILP32_OFFBIG_CFLAGS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_XBS5_ILP32_OFFBIG_LDFLAGS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_XBS5_ILP32_OFFBIG_LDFLAGS", _CS_XBS5_ILP32_OFFBIG_LDFLAGS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_XBS5_ILP32_OFFBIG_LIBS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_XBS5_ILP32_OFFBIG_LIBS", _CS_XBS5_ILP32_OFFBIG_LIBS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_XBS5_ILP32_OFFBIG_LINTFLAGS", _CS_XBS5_ILP32_OFFBIG_LINTFLAGS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_XBS5_LP64_OFF64_CFLAGS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_XBS5_LP64_OFF64_CFLAGS", _CS_XBS5_LP64_OFF64_CFLAGS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_XBS5_LP64_OFF64_LDFLAGS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_XBS5_LP64_OFF64_LDFLAGS", _CS_XBS5_LP64_OFF64_LDFLAGS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_XBS5_LP64_OFF64_LIBS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_XBS5_LP64_OFF64_LIBS", _CS_XBS5_LP64_OFF64_LIBS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_XBS5_LP64_OFF64_LINTFLAGS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_XBS5_LP64_OFF64_LINTFLAGS", _CS_XBS5_LP64_OFF64_LINTFLAGS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_XBS5_LPBIG_OFFBIG_CFLAGS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_XBS5_LPBIG_OFFBIG_CFLAGS", _CS_XBS5_LPBIG_OFFBIG_CFLAGS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_XBS5_LPBIG_OFFBIG_LDFLAGS", _CS_XBS5_LPBIG_OFFBIG_LDFLAGS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_XBS5_LPBIG_OFFBIG_LIBS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_XBS5_LPBIG_OFFBIG_LIBS", _CS_XBS5_LPBIG_OFFBIG_LIBS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"CS_XBS5_LPBIG_OFFBIG_LINTFLAGS", _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
1999-12-15 15:34:33 +00:00
|
|
|
#ifdef _MIPS_CS_AVAIL_PROCESSORS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"MIPS_CS_AVAIL_PROCESSORS", _MIPS_CS_AVAIL_PROCESSORS},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _MIPS_CS_BASE
|
2010-05-06 00:08:46 +00:00
|
|
|
{"MIPS_CS_BASE", _MIPS_CS_BASE},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _MIPS_CS_HOSTID
|
2010-05-06 00:08:46 +00:00
|
|
|
{"MIPS_CS_HOSTID", _MIPS_CS_HOSTID},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _MIPS_CS_HW_NAME
|
2010-05-06 00:08:46 +00:00
|
|
|
{"MIPS_CS_HW_NAME", _MIPS_CS_HW_NAME},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _MIPS_CS_NUM_PROCESSORS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"MIPS_CS_NUM_PROCESSORS", _MIPS_CS_NUM_PROCESSORS},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _MIPS_CS_OSREL_MAJ
|
2010-05-06 00:08:46 +00:00
|
|
|
{"MIPS_CS_OSREL_MAJ", _MIPS_CS_OSREL_MAJ},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _MIPS_CS_OSREL_MIN
|
2010-05-06 00:08:46 +00:00
|
|
|
{"MIPS_CS_OSREL_MIN", _MIPS_CS_OSREL_MIN},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _MIPS_CS_OSREL_PATCH
|
2010-05-06 00:08:46 +00:00
|
|
|
{"MIPS_CS_OSREL_PATCH", _MIPS_CS_OSREL_PATCH},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _MIPS_CS_OS_NAME
|
2010-05-06 00:08:46 +00:00
|
|
|
{"MIPS_CS_OS_NAME", _MIPS_CS_OS_NAME},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _MIPS_CS_OS_PROVIDER
|
2010-05-06 00:08:46 +00:00
|
|
|
{"MIPS_CS_OS_PROVIDER", _MIPS_CS_OS_PROVIDER},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _MIPS_CS_PROCESSORS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"MIPS_CS_PROCESSORS", _MIPS_CS_PROCESSORS},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _MIPS_CS_SERIAL
|
2010-05-06 00:08:46 +00:00
|
|
|
{"MIPS_CS_SERIAL", _MIPS_CS_SERIAL},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _MIPS_CS_VENDOR
|
2010-05-06 00:08:46 +00:00
|
|
|
{"MIPS_CS_VENDOR", _MIPS_CS_VENDOR},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
1999-12-13 16:37:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static int
|
2000-07-08 22:48:53 +00:00
|
|
|
conv_confstr_confname(PyObject *arg, int *valuep)
|
1999-12-13 16:37:25 +00:00
|
|
|
{
|
|
|
|
|
return conv_confname(arg, valuep, posix_constants_confstr,
|
|
|
|
|
sizeof(posix_constants_confstr)
|
|
|
|
|
/ sizeof(struct constdef));
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.confstr
|
|
|
|
|
|
|
|
|
|
name: confstr_confname
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Return a string-valued system configuration variable.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_confstr_impl(PyObject *module, int name)
|
|
|
|
|
/*[clinic end generated code: output=bfb0b1b1e49b9383 input=18fb4d0567242e65]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
PyObject *result = NULL;
|
2010-09-10 23:49:04 +00:00
|
|
|
char buffer[255];
|
2013-06-25 23:13:47 +02:00
|
|
|
size_t len;
|
1999-12-13 16:37:25 +00:00
|
|
|
|
2010-09-10 23:49:04 +00:00
|
|
|
errno = 0;
|
|
|
|
|
len = confstr(name, buffer, sizeof(buffer));
|
|
|
|
|
if (len == 0) {
|
|
|
|
|
if (errno) {
|
|
|
|
|
posix_error();
|
|
|
|
|
return NULL;
|
1999-12-13 16:37:25 +00:00
|
|
|
}
|
|
|
|
|
else {
|
2010-09-10 23:49:04 +00:00
|
|
|
Py_RETURN_NONE;
|
1999-12-13 16:37:25 +00:00
|
|
|
}
|
|
|
|
|
}
|
2010-09-10 23:49:04 +00:00
|
|
|
|
2013-06-25 23:13:47 +02:00
|
|
|
if (len >= sizeof(buffer)) {
|
2014-12-05 22:51:51 +01:00
|
|
|
size_t len2;
|
2010-09-10 23:49:04 +00:00
|
|
|
char *buf = PyMem_Malloc(len);
|
|
|
|
|
if (buf == NULL)
|
|
|
|
|
return PyErr_NoMemory();
|
2014-12-05 22:51:51 +01:00
|
|
|
len2 = confstr(name, buf, len);
|
|
|
|
|
assert(len == len2);
|
2015-04-21 10:57:41 +02:00
|
|
|
result = PyUnicode_DecodeFSDefaultAndSize(buf, len2-1);
|
2010-09-10 23:49:04 +00:00
|
|
|
PyMem_Free(buf);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
result = PyUnicode_DecodeFSDefaultAndSize(buffer, len-1);
|
1999-12-13 16:37:25 +00:00
|
|
|
return result;
|
|
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_CONFSTR */
|
1999-12-13 16:37:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SYSCONF
|
|
|
|
|
static struct constdef posix_constants_sysconf[] = {
|
|
|
|
|
#ifdef _SC_2_CHAR_TERM
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_2_CHAR_TERM", _SC_2_CHAR_TERM},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_2_C_BIND
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_2_C_BIND", _SC_2_C_BIND},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_2_C_DEV
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_2_C_DEV", _SC_2_C_DEV},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_2_C_VERSION
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_2_C_VERSION", _SC_2_C_VERSION},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_2_FORT_DEV
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_2_FORT_DEV", _SC_2_FORT_DEV},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_2_FORT_RUN
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_2_FORT_RUN", _SC_2_FORT_RUN},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_2_LOCALEDEF
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_2_LOCALEDEF", _SC_2_LOCALEDEF},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_2_SW_DEV
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_2_SW_DEV", _SC_2_SW_DEV},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_2_UPE
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_2_UPE", _SC_2_UPE},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_2_VERSION
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_2_VERSION", _SC_2_VERSION},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
1999-12-15 15:34:33 +00:00
|
|
|
#ifdef _SC_ABI_ASYNCHRONOUS_IO
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_ABI_ASYNCHRONOUS_IO", _SC_ABI_ASYNCHRONOUS_IO},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_ACL
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_ACL", _SC_ACL},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
1999-12-13 16:37:25 +00:00
|
|
|
#ifdef _SC_AIO_LISTIO_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_AIO_LISTIO_MAX", _SC_AIO_LISTIO_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_AIO_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_AIO_MAX", _SC_AIO_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_AIO_PRIO_DELTA_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_AIO_PRIO_DELTA_MAX", _SC_AIO_PRIO_DELTA_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_ARG_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_ARG_MAX", _SC_ARG_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_ASYNCHRONOUS_IO
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_ASYNCHRONOUS_IO", _SC_ASYNCHRONOUS_IO},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_ATEXIT_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_ATEXIT_MAX", _SC_ATEXIT_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
1999-12-15 15:34:33 +00:00
|
|
|
#ifdef _SC_AUDIT
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_AUDIT", _SC_AUDIT},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
1999-12-13 16:37:25 +00:00
|
|
|
#ifdef _SC_AVPHYS_PAGES
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_AVPHYS_PAGES", _SC_AVPHYS_PAGES},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_BC_BASE_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_BC_BASE_MAX", _SC_BC_BASE_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_BC_DIM_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_BC_DIM_MAX", _SC_BC_DIM_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_BC_SCALE_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_BC_SCALE_MAX", _SC_BC_SCALE_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_BC_STRING_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_BC_STRING_MAX", _SC_BC_STRING_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
1999-12-15 15:34:33 +00:00
|
|
|
#ifdef _SC_CAP
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_CAP", _SC_CAP},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
1999-12-13 16:37:25 +00:00
|
|
|
#ifdef _SC_CHARCLASS_NAME_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_CHARCLASS_NAME_MAX", _SC_CHARCLASS_NAME_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_CHAR_BIT
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_CHAR_BIT", _SC_CHAR_BIT},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_CHAR_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_CHAR_MAX", _SC_CHAR_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_CHAR_MIN
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_CHAR_MIN", _SC_CHAR_MIN},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_CHILD_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_CHILD_MAX", _SC_CHILD_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_CLK_TCK
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_CLK_TCK", _SC_CLK_TCK},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_COHER_BLKSZ
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_COHER_BLKSZ", _SC_COHER_BLKSZ},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_COLL_WEIGHTS_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_COLL_WEIGHTS_MAX", _SC_COLL_WEIGHTS_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_DCACHE_ASSOC
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_DCACHE_ASSOC", _SC_DCACHE_ASSOC},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_DCACHE_BLKSZ
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_DCACHE_BLKSZ", _SC_DCACHE_BLKSZ},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_DCACHE_LINESZ
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_DCACHE_LINESZ", _SC_DCACHE_LINESZ},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_DCACHE_SZ
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_DCACHE_SZ", _SC_DCACHE_SZ},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_DCACHE_TBLKSZ
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_DCACHE_TBLKSZ", _SC_DCACHE_TBLKSZ},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_DELAYTIMER_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_DELAYTIMER_MAX", _SC_DELAYTIMER_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_EQUIV_CLASS_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_EQUIV_CLASS_MAX", _SC_EQUIV_CLASS_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_EXPR_NEST_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_EXPR_NEST_MAX", _SC_EXPR_NEST_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_FSYNC
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_FSYNC", _SC_FSYNC},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_GETGR_R_SIZE_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_GETGR_R_SIZE_MAX", _SC_GETGR_R_SIZE_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_GETPW_R_SIZE_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_GETPW_R_SIZE_MAX", _SC_GETPW_R_SIZE_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_ICACHE_ASSOC
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_ICACHE_ASSOC", _SC_ICACHE_ASSOC},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_ICACHE_BLKSZ
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_ICACHE_BLKSZ", _SC_ICACHE_BLKSZ},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_ICACHE_LINESZ
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_ICACHE_LINESZ", _SC_ICACHE_LINESZ},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_ICACHE_SZ
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_ICACHE_SZ", _SC_ICACHE_SZ},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
1999-12-15 15:34:33 +00:00
|
|
|
#ifdef _SC_INF
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_INF", _SC_INF},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
1999-12-13 16:37:25 +00:00
|
|
|
#ifdef _SC_INT_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_INT_MAX", _SC_INT_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_INT_MIN
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_INT_MIN", _SC_INT_MIN},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_IOV_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_IOV_MAX", _SC_IOV_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
1999-12-15 15:34:33 +00:00
|
|
|
#ifdef _SC_IP_SECOPTS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_IP_SECOPTS", _SC_IP_SECOPTS},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
1999-12-13 16:37:25 +00:00
|
|
|
#ifdef _SC_JOB_CONTROL
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_JOB_CONTROL", _SC_JOB_CONTROL},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
1999-12-15 15:34:33 +00:00
|
|
|
#ifdef _SC_KERN_POINTERS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_KERN_POINTERS", _SC_KERN_POINTERS},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_KERN_SIM
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_KERN_SIM", _SC_KERN_SIM},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
1999-12-13 16:37:25 +00:00
|
|
|
#ifdef _SC_LINE_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_LINE_MAX", _SC_LINE_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_LOGIN_NAME_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_LOGIN_NAME_MAX", _SC_LOGIN_NAME_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_LOGNAME_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_LOGNAME_MAX", _SC_LOGNAME_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_LONG_BIT
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_LONG_BIT", _SC_LONG_BIT},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
1999-12-15 15:34:33 +00:00
|
|
|
#ifdef _SC_MAC
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_MAC", _SC_MAC},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
1999-12-13 16:37:25 +00:00
|
|
|
#ifdef _SC_MAPPED_FILES
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_MAPPED_FILES", _SC_MAPPED_FILES},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_MAXPID
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_MAXPID", _SC_MAXPID},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_MB_LEN_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_MB_LEN_MAX", _SC_MB_LEN_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_MEMLOCK
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_MEMLOCK", _SC_MEMLOCK},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_MEMLOCK_RANGE
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_MEMLOCK_RANGE", _SC_MEMLOCK_RANGE},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_MEMORY_PROTECTION
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_MEMORY_PROTECTION", _SC_MEMORY_PROTECTION},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_MESSAGE_PASSING
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_MESSAGE_PASSING", _SC_MESSAGE_PASSING},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
1999-12-15 15:34:33 +00:00
|
|
|
#ifdef _SC_MMAP_FIXED_ALIGNMENT
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_MMAP_FIXED_ALIGNMENT", _SC_MMAP_FIXED_ALIGNMENT},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
1999-12-13 16:37:25 +00:00
|
|
|
#ifdef _SC_MQ_OPEN_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_MQ_OPEN_MAX", _SC_MQ_OPEN_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_MQ_PRIO_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_MQ_PRIO_MAX", _SC_MQ_PRIO_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
1999-12-15 15:34:33 +00:00
|
|
|
#ifdef _SC_NACLS_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_NACLS_MAX", _SC_NACLS_MAX},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
1999-12-13 16:37:25 +00:00
|
|
|
#ifdef _SC_NGROUPS_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_NGROUPS_MAX", _SC_NGROUPS_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_NL_ARGMAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_NL_ARGMAX", _SC_NL_ARGMAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_NL_LANGMAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_NL_LANGMAX", _SC_NL_LANGMAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_NL_MSGMAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_NL_MSGMAX", _SC_NL_MSGMAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_NL_NMAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_NL_NMAX", _SC_NL_NMAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_NL_SETMAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_NL_SETMAX", _SC_NL_SETMAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_NL_TEXTMAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_NL_TEXTMAX", _SC_NL_TEXTMAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_NPROCESSORS_CONF
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_NPROCESSORS_CONF", _SC_NPROCESSORS_CONF},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_NPROCESSORS_ONLN
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_NPROCESSORS_ONLN", _SC_NPROCESSORS_ONLN},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
1999-12-15 15:34:33 +00:00
|
|
|
#ifdef _SC_NPROC_CONF
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_NPROC_CONF", _SC_NPROC_CONF},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_NPROC_ONLN
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_NPROC_ONLN", _SC_NPROC_ONLN},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
1999-12-13 16:37:25 +00:00
|
|
|
#ifdef _SC_NZERO
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_NZERO", _SC_NZERO},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_OPEN_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_OPEN_MAX", _SC_OPEN_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_PAGESIZE
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_PAGESIZE", _SC_PAGESIZE},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_PAGE_SIZE
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_PAGE_SIZE", _SC_PAGE_SIZE},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
2020-04-05 03:40:49 +03:00
|
|
|
#ifdef _SC_AIX_REALMEM
|
|
|
|
|
{"SC_AIX_REALMEM", _SC_AIX_REALMEM},
|
|
|
|
|
#endif
|
1999-12-13 16:37:25 +00:00
|
|
|
#ifdef _SC_PASS_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_PASS_MAX", _SC_PASS_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_PHYS_PAGES
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_PHYS_PAGES", _SC_PHYS_PAGES},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_PII
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_PII", _SC_PII},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_PII_INTERNET
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_PII_INTERNET", _SC_PII_INTERNET},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_PII_INTERNET_DGRAM
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_PII_INTERNET_DGRAM", _SC_PII_INTERNET_DGRAM},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_PII_INTERNET_STREAM
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_PII_INTERNET_STREAM", _SC_PII_INTERNET_STREAM},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_PII_OSI
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_PII_OSI", _SC_PII_OSI},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_PII_OSI_CLTS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_PII_OSI_CLTS", _SC_PII_OSI_CLTS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_PII_OSI_COTS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_PII_OSI_COTS", _SC_PII_OSI_COTS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_PII_OSI_M
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_PII_OSI_M", _SC_PII_OSI_M},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_PII_SOCKET
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_PII_SOCKET", _SC_PII_SOCKET},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_PII_XTI
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_PII_XTI", _SC_PII_XTI},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_POLL
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_POLL", _SC_POLL},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_PRIORITIZED_IO
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_PRIORITIZED_IO", _SC_PRIORITIZED_IO},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_PRIORITY_SCHEDULING
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_PRIORITY_SCHEDULING", _SC_PRIORITY_SCHEDULING},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_REALTIME_SIGNALS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_REALTIME_SIGNALS", _SC_REALTIME_SIGNALS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_RE_DUP_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_RE_DUP_MAX", _SC_RE_DUP_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_RTSIG_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_RTSIG_MAX", _SC_RTSIG_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_SAVED_IDS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_SAVED_IDS", _SC_SAVED_IDS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_SCHAR_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_SCHAR_MAX", _SC_SCHAR_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_SCHAR_MIN
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_SCHAR_MIN", _SC_SCHAR_MIN},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_SELECT
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_SELECT", _SC_SELECT},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_SEMAPHORES
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_SEMAPHORES", _SC_SEMAPHORES},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_SEM_NSEMS_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_SEM_NSEMS_MAX", _SC_SEM_NSEMS_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_SEM_VALUE_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_SEM_VALUE_MAX", _SC_SEM_VALUE_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_SHARED_MEMORY_OBJECTS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_SHARED_MEMORY_OBJECTS", _SC_SHARED_MEMORY_OBJECTS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_SHRT_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_SHRT_MAX", _SC_SHRT_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_SHRT_MIN
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_SHRT_MIN", _SC_SHRT_MIN},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_SIGQUEUE_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_SIGQUEUE_MAX", _SC_SIGQUEUE_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_SIGRT_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_SIGRT_MAX", _SC_SIGRT_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_SIGRT_MIN
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_SIGRT_MIN", _SC_SIGRT_MIN},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
1999-12-15 15:34:33 +00:00
|
|
|
#ifdef _SC_SOFTPOWER
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_SOFTPOWER", _SC_SOFTPOWER},
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
1999-12-13 16:37:25 +00:00
|
|
|
#ifdef _SC_SPLIT_CACHE
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_SPLIT_CACHE", _SC_SPLIT_CACHE},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_SSIZE_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_SSIZE_MAX", _SC_SSIZE_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_STACK_PROT
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_STACK_PROT", _SC_STACK_PROT},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_STREAM_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_STREAM_MAX", _SC_STREAM_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_SYNCHRONIZED_IO
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_SYNCHRONIZED_IO", _SC_SYNCHRONIZED_IO},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_THREADS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_THREADS", _SC_THREADS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_THREAD_ATTR_STACKADDR
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_THREAD_ATTR_STACKADDR", _SC_THREAD_ATTR_STACKADDR},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_THREAD_ATTR_STACKSIZE
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_THREAD_ATTR_STACKSIZE", _SC_THREAD_ATTR_STACKSIZE},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_THREAD_DESTRUCTOR_ITERATIONS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_THREAD_DESTRUCTOR_ITERATIONS", _SC_THREAD_DESTRUCTOR_ITERATIONS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_THREAD_KEYS_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_THREAD_KEYS_MAX", _SC_THREAD_KEYS_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_THREAD_PRIORITY_SCHEDULING
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_THREAD_PRIORITY_SCHEDULING", _SC_THREAD_PRIORITY_SCHEDULING},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_THREAD_PRIO_INHERIT
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_THREAD_PRIO_INHERIT", _SC_THREAD_PRIO_INHERIT},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_THREAD_PRIO_PROTECT
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_THREAD_PRIO_PROTECT", _SC_THREAD_PRIO_PROTECT},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_THREAD_PROCESS_SHARED
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_THREAD_PROCESS_SHARED", _SC_THREAD_PROCESS_SHARED},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_THREAD_SAFE_FUNCTIONS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_THREAD_SAFE_FUNCTIONS", _SC_THREAD_SAFE_FUNCTIONS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_THREAD_STACK_MIN
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_THREAD_STACK_MIN", _SC_THREAD_STACK_MIN},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_THREAD_THREADS_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_THREAD_THREADS_MAX", _SC_THREAD_THREADS_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_TIMERS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_TIMERS", _SC_TIMERS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_TIMER_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_TIMER_MAX", _SC_TIMER_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_TTY_NAME_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_TTY_NAME_MAX", _SC_TTY_NAME_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_TZNAME_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_TZNAME_MAX", _SC_TZNAME_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_T_IOV_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_T_IOV_MAX", _SC_T_IOV_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_UCHAR_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_UCHAR_MAX", _SC_UCHAR_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_UINT_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_UINT_MAX", _SC_UINT_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_UIO_MAXIOV
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_UIO_MAXIOV", _SC_UIO_MAXIOV},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_ULONG_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_ULONG_MAX", _SC_ULONG_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_USHRT_MAX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_USHRT_MAX", _SC_USHRT_MAX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_VERSION
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_VERSION", _SC_VERSION},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_WORD_BIT
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_WORD_BIT", _SC_WORD_BIT},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_XBS5_ILP32_OFF32
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_XBS5_ILP32_OFF32", _SC_XBS5_ILP32_OFF32},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_XBS5_ILP32_OFFBIG
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_XBS5_ILP32_OFFBIG", _SC_XBS5_ILP32_OFFBIG},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_XBS5_LP64_OFF64
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_XBS5_LP64_OFF64", _SC_XBS5_LP64_OFF64},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_XBS5_LPBIG_OFFBIG
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_XBS5_LPBIG_OFFBIG", _SC_XBS5_LPBIG_OFFBIG},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_XOPEN_CRYPT
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_XOPEN_CRYPT", _SC_XOPEN_CRYPT},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_XOPEN_ENH_I18N
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_XOPEN_ENH_I18N", _SC_XOPEN_ENH_I18N},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_XOPEN_LEGACY
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_XOPEN_LEGACY", _SC_XOPEN_LEGACY},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_XOPEN_REALTIME
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_XOPEN_REALTIME", _SC_XOPEN_REALTIME},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_XOPEN_REALTIME_THREADS
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_XOPEN_REALTIME_THREADS", _SC_XOPEN_REALTIME_THREADS},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_XOPEN_SHM
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_XOPEN_SHM", _SC_XOPEN_SHM},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_XOPEN_UNIX
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_XOPEN_UNIX", _SC_XOPEN_UNIX},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_XOPEN_VERSION
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_XOPEN_VERSION", _SC_XOPEN_VERSION},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_XOPEN_XCU_VERSION
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_XOPEN_XCU_VERSION", _SC_XOPEN_XCU_VERSION},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_XOPEN_XPG2
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_XOPEN_XPG2", _SC_XOPEN_XPG2},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_XOPEN_XPG3
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_XOPEN_XPG3", _SC_XOPEN_XPG3},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _SC_XOPEN_XPG4
|
2010-05-06 00:08:46 +00:00
|
|
|
{"SC_XOPEN_XPG4", _SC_XOPEN_XPG4},
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static int
|
2000-07-08 22:48:53 +00:00
|
|
|
conv_sysconf_confname(PyObject *arg, int *valuep)
|
1999-12-13 16:37:25 +00:00
|
|
|
{
|
|
|
|
|
return conv_confname(arg, valuep, posix_constants_sysconf,
|
|
|
|
|
sizeof(posix_constants_sysconf)
|
|
|
|
|
/ sizeof(struct constdef));
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.sysconf -> long
|
|
|
|
|
name: sysconf_confname
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Return an integer-valued system configuration variable.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static long
|
2016-07-07 17:35:15 +03:00
|
|
|
os_sysconf_impl(PyObject *module, int name)
|
|
|
|
|
/*[clinic end generated code: output=3662f945fc0cc756 input=279e3430a33f29e4]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
long value;
|
|
|
|
|
|
|
|
|
|
errno = 0;
|
|
|
|
|
value = sysconf(name);
|
|
|
|
|
if (value == -1 && errno != 0)
|
|
|
|
|
posix_error();
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_SYSCONF */
|
1999-12-13 16:37:25 +00:00
|
|
|
|
|
|
|
|
|
1999-12-15 18:31:10 +00:00
|
|
|
/* This code is used to ensure that the tables of configuration value names
|
2014-12-01 18:28:43 +02:00
|
|
|
* are in sorted order as required by conv_confname(), and also to build
|
1999-12-15 18:31:10 +00:00
|
|
|
* the exported dictionaries that are used to publish information about the
|
|
|
|
|
* names available on the host platform.
|
|
|
|
|
*
|
|
|
|
|
* Sorting the table at runtime ensures that the table is properly ordered
|
|
|
|
|
* when used, even for platforms we're not able to test on. It also makes
|
|
|
|
|
* it easier to add additional entries to the tables.
|
1999-12-15 15:34:33 +00:00
|
|
|
*/
|
1999-12-15 18:31:10 +00:00
|
|
|
|
|
|
|
|
static int
|
2000-07-08 22:48:53 +00:00
|
|
|
cmp_constdefs(const void *v1, const void *v2)
|
1999-12-15 18:31:10 +00:00
|
|
|
{
|
|
|
|
|
const struct constdef *c1 =
|
2010-05-06 00:08:46 +00:00
|
|
|
(const struct constdef *) v1;
|
1999-12-15 18:31:10 +00:00
|
|
|
const struct constdef *c2 =
|
2010-05-06 00:08:46 +00:00
|
|
|
(const struct constdef *) v2;
|
1999-12-15 18:31:10 +00:00
|
|
|
|
|
|
|
|
return strcmp(c1->name, c2->name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
2000-07-08 22:48:53 +00:00
|
|
|
setup_confname_table(struct constdef *table, size_t tablesize,
|
2016-05-07 16:45:18 +03:00
|
|
|
const char *tablename, PyObject *module)
|
1999-12-15 15:34:33 +00:00
|
|
|
{
|
1999-12-15 18:31:10 +00:00
|
|
|
PyObject *d = NULL;
|
2000-04-13 15:20:40 +00:00
|
|
|
size_t i;
|
1999-12-15 15:34:33 +00:00
|
|
|
|
1999-12-15 18:31:10 +00:00
|
|
|
qsort(table, tablesize, sizeof(struct constdef), cmp_constdefs);
|
|
|
|
|
d = PyDict_New();
|
2000-04-13 15:20:40 +00:00
|
|
|
if (d == NULL)
|
2010-05-06 00:08:46 +00:00
|
|
|
return -1;
|
2000-04-13 15:20:40 +00:00
|
|
|
|
|
|
|
|
for (i=0; i < tablesize; ++i) {
|
2010-05-06 00:08:46 +00:00
|
|
|
PyObject *o = PyLong_FromLong(table[i].value);
|
|
|
|
|
if (o == NULL || PyDict_SetItemString(d, table[i].name, o) == -1) {
|
|
|
|
|
Py_XDECREF(o);
|
|
|
|
|
Py_DECREF(d);
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
Py_DECREF(o);
|
1999-12-15 15:34:33 +00:00
|
|
|
}
|
2002-04-15 19:40:07 +00:00
|
|
|
return PyModule_AddObject(module, tablename, d);
|
1999-12-15 15:34:33 +00:00
|
|
|
}
|
|
|
|
|
|
1999-12-15 18:31:10 +00:00
|
|
|
/* Return -1 on failure, 0 on success. */
|
|
|
|
|
static int
|
2002-04-15 19:40:07 +00:00
|
|
|
setup_confname_tables(PyObject *module)
|
1999-12-15 15:34:33 +00:00
|
|
|
{
|
|
|
|
|
#if defined(HAVE_FPATHCONF) || defined(HAVE_PATHCONF)
|
1999-12-15 18:31:10 +00:00
|
|
|
if (setup_confname_table(posix_constants_pathconf,
|
1999-12-15 15:34:33 +00:00
|
|
|
sizeof(posix_constants_pathconf)
|
|
|
|
|
/ sizeof(struct constdef),
|
2002-04-15 19:40:07 +00:00
|
|
|
"pathconf_names", module))
|
2010-11-26 16:16:47 +00:00
|
|
|
return -1;
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_CONFSTR
|
1999-12-15 18:31:10 +00:00
|
|
|
if (setup_confname_table(posix_constants_confstr,
|
1999-12-15 15:34:33 +00:00
|
|
|
sizeof(posix_constants_confstr)
|
|
|
|
|
/ sizeof(struct constdef),
|
2002-04-15 19:40:07 +00:00
|
|
|
"confstr_names", module))
|
2010-11-26 16:16:47 +00:00
|
|
|
return -1;
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_SYSCONF
|
1999-12-15 18:31:10 +00:00
|
|
|
if (setup_confname_table(posix_constants_sysconf,
|
1999-12-15 15:34:33 +00:00
|
|
|
sizeof(posix_constants_sysconf)
|
|
|
|
|
/ sizeof(struct constdef),
|
2002-04-15 19:40:07 +00:00
|
|
|
"sysconf_names", module))
|
2010-11-26 16:16:47 +00:00
|
|
|
return -1;
|
1999-12-15 15:34:33 +00:00
|
|
|
#endif
|
1999-12-15 18:31:10 +00:00
|
|
|
return 0;
|
1999-12-15 15:34:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.abort
|
|
|
|
|
|
|
|
|
|
Abort the interpreter immediately.
|
|
|
|
|
|
|
|
|
|
This function 'dumps core' or otherwise fails in the hardest way possible
|
|
|
|
|
on the hosting operating system. This function never returns.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
1999-12-09 21:13:07 +00:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_abort_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=dcf52586dad2467c input=cf2c7d98bc504047]*/
|
1999-12-09 21:13:07 +00:00
|
|
|
{
|
|
|
|
|
abort();
|
|
|
|
|
/*NOTREACHED*/
|
2016-12-05 17:56:36 +01:00
|
|
|
#ifndef __clang__
|
|
|
|
|
/* Issue #28152: abort() is declared with __attribute__((__noreturn__)).
|
|
|
|
|
GCC emits a warning without "return NULL;" (compiler bug?), but Clang
|
|
|
|
|
is smarter and emits a warning on the return. */
|
1999-12-09 21:13:07 +00:00
|
|
|
Py_FatalError("abort() called from Python code didn't abort!");
|
|
|
|
|
return NULL;
|
2016-12-05 17:56:36 +01:00
|
|
|
#endif
|
1999-12-09 21:13:07 +00:00
|
|
|
}
|
1999-12-15 18:31:10 +00:00
|
|
|
|
2002-06-30 15:26:10 +00:00
|
|
|
#ifdef MS_WINDOWS
|
2015-01-24 08:18:24 -08:00
|
|
|
/* Grab ShellExecute dynamically from shell32 */
|
|
|
|
|
static int has_ShellExecute = -1;
|
|
|
|
|
static HINSTANCE (CALLBACK *Py_ShellExecuteW)(HWND, LPCWSTR, LPCWSTR, LPCWSTR,
|
|
|
|
|
LPCWSTR, INT);
|
|
|
|
|
static int
|
|
|
|
|
check_ShellExecute()
|
|
|
|
|
{
|
|
|
|
|
HINSTANCE hShell32;
|
|
|
|
|
|
|
|
|
|
/* only recheck */
|
|
|
|
|
if (-1 == has_ShellExecute) {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2017-10-13 13:46:57 -07:00
|
|
|
/* Security note: this call is not vulnerable to "DLL hijacking".
|
|
|
|
|
SHELL32 is part of "KnownDLLs" and so Windows always load
|
|
|
|
|
the system SHELL32.DLL, even if there is another SHELL32.DLL
|
|
|
|
|
in the DLL search path. */
|
2015-01-24 08:18:24 -08:00
|
|
|
hShell32 = LoadLibraryW(L"SHELL32");
|
|
|
|
|
if (hShell32) {
|
|
|
|
|
*(FARPROC*)&Py_ShellExecuteW = GetProcAddress(hShell32,
|
|
|
|
|
"ShellExecuteW");
|
2016-09-08 10:35:16 -07:00
|
|
|
has_ShellExecute = Py_ShellExecuteW != NULL;
|
2015-01-24 08:18:24 -08:00
|
|
|
} else {
|
|
|
|
|
has_ShellExecute = 0;
|
|
|
|
|
}
|
2019-02-02 18:16:42 +01:00
|
|
|
Py_END_ALLOW_THREADS
|
2015-01-24 08:18:24 -08:00
|
|
|
}
|
|
|
|
|
return has_ShellExecute;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2016-09-08 10:35:16 -07:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.startfile
|
|
|
|
|
filepath: path_t
|
|
|
|
|
operation: Py_UNICODE = NULL
|
|
|
|
|
|
|
|
|
|
Start a file with its associated application.
|
|
|
|
|
|
|
|
|
|
When "operation" is not specified or "open", this acts like
|
|
|
|
|
double-clicking the file in Explorer, or giving the file name as an
|
|
|
|
|
argument to the DOS "start" command: the file is opened with whatever
|
|
|
|
|
application (if any) its extension is associated.
|
|
|
|
|
When another "operation" is given, it specifies what should be done with
|
|
|
|
|
the file. A typical operation is "print".
|
|
|
|
|
|
|
|
|
|
startfile returns as soon as the associated application is launched.
|
|
|
|
|
There is no option to wait for the application to close, and no way
|
|
|
|
|
to retrieve the application's exit status.
|
|
|
|
|
|
|
|
|
|
The filepath is relative to the current directory. If you want to use
|
|
|
|
|
an absolute path, make sure the first character is not a slash ("/");
|
|
|
|
|
the underlying Win32 ShellExecute function doesn't work if it is.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
2000-09-22 10:05:54 +00:00
|
|
|
static PyObject *
|
2018-12-14 11:19:51 +02:00
|
|
|
os_startfile_impl(PyObject *module, path_t *filepath,
|
|
|
|
|
const Py_UNICODE *operation)
|
2019-09-14 12:24:05 +03:00
|
|
|
/*[clinic end generated code: output=66dc311c94d50797 input=c940888a5390f039]*/
|
2000-09-22 10:05:54 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
HINSTANCE rc;
|
|
|
|
|
|
2015-01-24 08:18:24 -08:00
|
|
|
if(!check_ShellExecute()) {
|
|
|
|
|
/* If the OS doesn't have ShellExecute, return a
|
|
|
|
|
NotImplementedError. */
|
|
|
|
|
return PyErr_Format(PyExc_NotImplementedError,
|
|
|
|
|
"startfile not available on this platform");
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.startfile", "Ou", filepath->object, operation) < 0) {
|
2020-02-04 16:15:00 -08:00
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2016-09-08 10:35:16 -07:00
|
|
|
rc = Py_ShellExecuteW((HWND)0, operation, filepath->wide,
|
2015-01-24 08:18:24 -08:00
|
|
|
NULL, NULL, SW_SHOWNORMAL);
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
|
|
|
|
|
if (rc <= (HINSTANCE)32) {
|
2016-09-08 10:35:16 -07:00
|
|
|
win32_error_object("startfile", filepath->object);
|
2011-11-15 22:27:41 +01:00
|
|
|
return NULL;
|
|
|
|
|
}
|
2016-09-08 10:35:16 -07:00
|
|
|
Py_RETURN_NONE;
|
2000-09-22 10:05:54 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* MS_WINDOWS */
|
|
|
|
|
|
1999-12-09 21:13:07 +00:00
|
|
|
|
2002-12-27 10:16:42 +00:00
|
|
|
#ifdef HAVE_GETLOADAVG
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.getloadavg
|
|
|
|
|
|
|
|
|
|
Return average recent system load information.
|
|
|
|
|
|
|
|
|
|
Return the number of processes in the system run queue averaged over
|
|
|
|
|
the last 1, 5, and 15 minutes as a tuple of three floats.
|
|
|
|
|
Raises OSError if the load average was unobtainable.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_getloadavg_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=9ad3a11bfb4f4bd2 input=3d6d826b76d8a34e]*/
|
2002-12-27 10:16:42 +00:00
|
|
|
{
|
|
|
|
|
double loadavg[3];
|
|
|
|
|
if (getloadavg(loadavg, 3)!=3) {
|
2010-11-26 16:16:47 +00:00
|
|
|
PyErr_SetString(PyExc_OSError, "Load averages are unobtainable");
|
|
|
|
|
return NULL;
|
2002-12-27 10:16:42 +00:00
|
|
|
} else
|
2010-11-26 16:16:47 +00:00
|
|
|
return Py_BuildValue("ddd", loadavg[0], loadavg[1], loadavg[2]);
|
2002-12-27 10:16:42 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_GETLOADAVG */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.device_encoding
|
|
|
|
|
fd: int
|
|
|
|
|
|
|
|
|
|
Return a string describing the encoding of a terminal's file descriptor.
|
|
|
|
|
|
|
|
|
|
The file descriptor must be attached to a terminal.
|
|
|
|
|
If the device is not a terminal, return None.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_device_encoding_impl(PyObject *module, int fd)
|
|
|
|
|
/*[clinic end generated code: output=e0d294bbab7e8c2b input=9e1d4a42b66df312]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2012-02-29 18:31:31 -05:00
|
|
|
return _Py_device_encoding(fd);
|
2007-08-11 14:02:14 +00:00
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2009-11-27 14:09:49 +00:00
|
|
|
#ifdef HAVE_SETRESUID
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.setresuid
|
2009-11-27 14:09:49 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
ruid: uid_t
|
|
|
|
|
euid: uid_t
|
|
|
|
|
suid: uid_t
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Set the current process's real, effective, and saved user ids.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_setresuid_impl(PyObject *module, uid_t ruid, uid_t euid, uid_t suid)
|
|
|
|
|
/*[clinic end generated code: output=834a641e15373e97 input=9e33cb79a82792f3]*/
|
2009-11-27 14:09:49 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
if (setresuid(ruid, euid, suid) < 0)
|
|
|
|
|
return posix_error();
|
|
|
|
|
Py_RETURN_NONE;
|
2009-11-27 14:09:49 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_SETRESUID */
|
|
|
|
|
|
2009-11-27 14:09:49 +00:00
|
|
|
|
|
|
|
|
#ifdef HAVE_SETRESGID
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.setresgid
|
2009-11-27 14:09:49 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
rgid: gid_t
|
|
|
|
|
egid: gid_t
|
|
|
|
|
sgid: gid_t
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Set the current process's real, effective, and saved group ids.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_setresgid_impl(PyObject *module, gid_t rgid, gid_t egid, gid_t sgid)
|
|
|
|
|
/*[clinic end generated code: output=6aa402f3d2e514a9 input=33e9e0785ef426b1]*/
|
2009-11-27 14:09:49 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
if (setresgid(rgid, egid, sgid) < 0)
|
|
|
|
|
return posix_error();
|
|
|
|
|
Py_RETURN_NONE;
|
2009-11-27 14:09:49 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_SETRESGID */
|
|
|
|
|
|
2009-11-27 14:09:49 +00:00
|
|
|
|
|
|
|
|
#ifdef HAVE_GETRESUID
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.getresuid
|
2009-11-27 14:09:49 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Return a tuple of the current process's real, effective, and saved user ids.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_getresuid_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=8e0becff5dece5bf input=41ccfa8e1f6517ad]*/
|
2009-11-27 14:09:49 +00:00
|
|
|
{
|
2010-05-06 00:08:46 +00:00
|
|
|
uid_t ruid, euid, suid;
|
|
|
|
|
if (getresuid(&ruid, &euid, &suid) < 0)
|
|
|
|
|
return posix_error();
|
2013-02-10 21:56:49 +02:00
|
|
|
return Py_BuildValue("(NNN)", _PyLong_FromUid(ruid),
|
|
|
|
|
_PyLong_FromUid(euid),
|
|
|
|
|
_PyLong_FromUid(suid));
|
2009-11-27 14:09:49 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* HAVE_GETRESUID */
|
|
|
|
|
|
2009-11-27 14:09:49 +00:00
|
|
|
|
|
|
|
|
#ifdef HAVE_GETRESGID
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.getresgid
|
2009-11-27 14:09:49 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Return a tuple of the current process's real, effective, and saved group ids.
|
|
|
|
|
[clinic start generated code]*/
|
2009-11-27 14:09:49 +00:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_getresgid_impl(PyObject *module)
|
|
|
|
|
/*[clinic end generated code: output=2719c4bfcf27fb9f input=517e68db9ca32df6]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
gid_t rgid, egid, sgid;
|
|
|
|
|
if (getresgid(&rgid, &egid, &sgid) < 0)
|
|
|
|
|
return posix_error();
|
|
|
|
|
return Py_BuildValue("(NNN)", _PyLong_FromGid(rgid),
|
|
|
|
|
_PyLong_FromGid(egid),
|
|
|
|
|
_PyLong_FromGid(sgid));
|
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_GETRESGID */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef USE_XATTRS
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.getxattr
|
|
|
|
|
|
|
|
|
|
path: path_t(allow_fd=True)
|
|
|
|
|
attribute: path_t
|
|
|
|
|
*
|
|
|
|
|
follow_symlinks: bool = True
|
|
|
|
|
|
|
|
|
|
Return the value of extended attribute attribute on path.
|
|
|
|
|
|
2018-11-02 15:20:19 +00:00
|
|
|
path may be either a string, a path-like object, or an open file descriptor.
|
2015-04-03 23:53:51 +03:00
|
|
|
If follow_symlinks is False, and the last element of the path is a symbolic
|
|
|
|
|
link, getxattr will examine the symbolic link itself instead of the file
|
|
|
|
|
the link points to.
|
2014-08-05 14:04:04 +10:00
|
|
|
|
2015-04-03 23:53:51 +03:00
|
|
|
[clinic start generated code]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_getxattr_impl(PyObject *module, path_t *path, path_t *attribute,
|
2015-04-14 18:07:59 -04:00
|
|
|
int follow_symlinks)
|
2018-11-02 15:20:19 +00:00
|
|
|
/*[clinic end generated code: output=5f2f44200a43cff2 input=025789491708f7eb]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
Py_ssize_t i;
|
2012-06-22 16:30:09 -07:00
|
|
|
PyObject *buffer = NULL;
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
if (fd_and_follow_symlinks_invalid("getxattr", path->fd, follow_symlinks))
|
2011-02-25 23:25:17 +00:00
|
|
|
return NULL;
|
|
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.getxattr", "OO", path->object, attribute->object) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
for (i = 0; ; i++) {
|
|
|
|
|
void *ptr;
|
|
|
|
|
ssize_t result;
|
2015-12-25 19:53:18 +02:00
|
|
|
static const Py_ssize_t buffer_sizes[] = {128, XATTR_SIZE_MAX, 0};
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_ssize_t buffer_size = buffer_sizes[i];
|
|
|
|
|
if (!buffer_size) {
|
2014-08-05 14:04:04 +10:00
|
|
|
path_error(path);
|
|
|
|
|
return NULL;
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
|
|
|
|
buffer = PyBytes_FromStringAndSize(NULL, buffer_size);
|
|
|
|
|
if (!buffer)
|
2014-08-05 14:04:04 +10:00
|
|
|
return NULL;
|
2012-06-22 16:30:09 -07:00
|
|
|
ptr = PyBytes_AS_STRING(buffer);
|
2011-02-25 23:25:17 +00:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_BEGIN_ALLOW_THREADS;
|
2014-08-05 14:04:04 +10:00
|
|
|
if (path->fd >= 0)
|
|
|
|
|
result = fgetxattr(path->fd, attribute->narrow, ptr, buffer_size);
|
2012-06-22 16:30:09 -07:00
|
|
|
else if (follow_symlinks)
|
2014-08-05 14:04:04 +10:00
|
|
|
result = getxattr(path->narrow, attribute->narrow, ptr, buffer_size);
|
2012-06-22 16:30:09 -07:00
|
|
|
else
|
2014-08-05 14:04:04 +10:00
|
|
|
result = lgetxattr(path->narrow, attribute->narrow, ptr, buffer_size);
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_END_ALLOW_THREADS;
|
|
|
|
|
|
|
|
|
|
if (result < 0) {
|
|
|
|
|
Py_DECREF(buffer);
|
|
|
|
|
if (errno == ERANGE)
|
|
|
|
|
continue;
|
2014-08-05 14:04:04 +10:00
|
|
|
path_error(path);
|
|
|
|
|
return NULL;
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
2011-02-25 23:25:17 +00:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
if (result != buffer_size) {
|
|
|
|
|
/* Can only shrink. */
|
|
|
|
|
_PyBytes_Resize(&buffer, result);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
2011-02-25 23:25:17 +00:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
return buffer;
|
2011-02-25 23:25:17 +00:00
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.setxattr
|
|
|
|
|
|
|
|
|
|
path: path_t(allow_fd=True)
|
|
|
|
|
attribute: path_t
|
|
|
|
|
value: Py_buffer
|
|
|
|
|
flags: int = 0
|
|
|
|
|
*
|
|
|
|
|
follow_symlinks: bool = True
|
|
|
|
|
|
|
|
|
|
Set extended attribute attribute on path to value.
|
|
|
|
|
|
2018-11-02 15:20:19 +00:00
|
|
|
path may be either a string, a path-like object, or an open file descriptor.
|
2014-08-05 14:04:04 +10:00
|
|
|
If follow_symlinks is False, and the last element of the path is a symbolic
|
|
|
|
|
link, setxattr will modify the symbolic link itself instead of the file
|
|
|
|
|
the link points to.
|
|
|
|
|
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_setxattr_impl(PyObject *module, path_t *path, path_t *attribute,
|
2015-04-14 18:07:59 -04:00
|
|
|
Py_buffer *value, int flags, int follow_symlinks)
|
2018-11-02 15:20:19 +00:00
|
|
|
/*[clinic end generated code: output=98b83f63fdde26bb input=c17c0103009042f0]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
ssize_t result;
|
|
|
|
|
|
|
|
|
|
if (fd_and_follow_symlinks_invalid("setxattr", path->fd, follow_symlinks))
|
|
|
|
|
return NULL;
|
2011-04-19 09:47:16 +02:00
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.setxattr", "OOy#i", path->object, attribute->object,
|
|
|
|
|
value->buf, value->len, flags) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2011-08-31 22:15:17 -04:00
|
|
|
Py_BEGIN_ALLOW_THREADS;
|
2014-08-05 14:04:04 +10:00
|
|
|
if (path->fd > -1)
|
|
|
|
|
result = fsetxattr(path->fd, attribute->narrow,
|
|
|
|
|
value->buf, value->len, flags);
|
2012-06-22 16:30:09 -07:00
|
|
|
else if (follow_symlinks)
|
2014-08-05 14:04:04 +10:00
|
|
|
result = setxattr(path->narrow, attribute->narrow,
|
|
|
|
|
value->buf, value->len, flags);
|
2012-06-22 16:30:09 -07:00
|
|
|
else
|
2014-08-05 14:04:04 +10:00
|
|
|
result = lsetxattr(path->narrow, attribute->narrow,
|
|
|
|
|
value->buf, value->len, flags);
|
2011-08-31 22:15:17 -04:00
|
|
|
Py_END_ALLOW_THREADS;
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
if (result) {
|
2014-08-05 14:04:04 +10:00
|
|
|
path_error(path);
|
|
|
|
|
return NULL;
|
2012-06-22 16:30:09 -07:00
|
|
|
}
|
2011-08-31 22:15:17 -04:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.removexattr
|
|
|
|
|
|
|
|
|
|
path: path_t(allow_fd=True)
|
|
|
|
|
attribute: path_t
|
|
|
|
|
*
|
|
|
|
|
follow_symlinks: bool = True
|
|
|
|
|
|
|
|
|
|
Remove extended attribute attribute on path.
|
|
|
|
|
|
2018-11-02 15:20:19 +00:00
|
|
|
path may be either a string, a path-like object, or an open file descriptor.
|
2014-08-05 14:04:04 +10:00
|
|
|
If follow_symlinks is False, and the last element of the path is a symbolic
|
|
|
|
|
link, removexattr will modify the symbolic link itself instead of the file
|
|
|
|
|
the link points to.
|
|
|
|
|
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
2011-08-31 22:15:17 -04:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_removexattr_impl(PyObject *module, path_t *path, path_t *attribute,
|
2015-04-14 18:07:59 -04:00
|
|
|
int follow_symlinks)
|
2018-11-02 15:20:19 +00:00
|
|
|
/*[clinic end generated code: output=521a51817980cda6 input=3d9a7d36fe2f7c4e]*/
|
2011-08-31 22:15:17 -04:00
|
|
|
{
|
2014-08-05 14:04:04 +10:00
|
|
|
ssize_t result;
|
2011-08-31 22:15:17 -04:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
if (fd_and_follow_symlinks_invalid("removexattr", path->fd, follow_symlinks))
|
2011-08-31 22:15:17 -04:00
|
|
|
return NULL;
|
|
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.removexattr", "OO", path->object, attribute->object) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2011-08-31 22:15:17 -04:00
|
|
|
Py_BEGIN_ALLOW_THREADS;
|
2014-08-05 14:04:04 +10:00
|
|
|
if (path->fd > -1)
|
|
|
|
|
result = fremovexattr(path->fd, attribute->narrow);
|
2012-06-22 16:30:09 -07:00
|
|
|
else if (follow_symlinks)
|
2014-08-05 14:04:04 +10:00
|
|
|
result = removexattr(path->narrow, attribute->narrow);
|
2012-06-22 16:30:09 -07:00
|
|
|
else
|
2014-08-05 14:04:04 +10:00
|
|
|
result = lremovexattr(path->narrow, attribute->narrow);
|
2011-08-31 22:15:17 -04:00
|
|
|
Py_END_ALLOW_THREADS;
|
2012-06-22 16:30:09 -07:00
|
|
|
|
|
|
|
|
if (result) {
|
2014-08-05 14:04:04 +10:00
|
|
|
return path_error(path);
|
2011-08-31 22:15:17 -04:00
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.listxattr
|
|
|
|
|
|
|
|
|
|
path: path_t(allow_fd=True, nullable=True) = None
|
|
|
|
|
*
|
|
|
|
|
follow_symlinks: bool = True
|
|
|
|
|
|
|
|
|
|
Return a list of extended attributes on path.
|
|
|
|
|
|
2018-11-02 15:20:19 +00:00
|
|
|
path may be either None, a string, a path-like object, or an open file descriptor.
|
2014-08-05 14:04:04 +10:00
|
|
|
if path is None, listxattr will examine the current directory.
|
|
|
|
|
If follow_symlinks is False, and the last element of the path is a symbolic
|
|
|
|
|
link, listxattr will examine the symbolic link itself instead of the file
|
|
|
|
|
the link points to.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
2011-08-31 22:15:17 -04:00
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_listxattr_impl(PyObject *module, path_t *path, int follow_symlinks)
|
2018-11-02 15:20:19 +00:00
|
|
|
/*[clinic end generated code: output=bebdb4e2ad0ce435 input=9826edf9fdb90869]*/
|
2011-08-31 22:15:17 -04:00
|
|
|
{
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_ssize_t i;
|
|
|
|
|
PyObject *result = NULL;
|
2014-08-05 14:04:04 +10:00
|
|
|
const char *name;
|
2012-06-22 16:30:09 -07:00
|
|
|
char *buffer = NULL;
|
2011-08-31 22:15:17 -04:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
if (fd_and_follow_symlinks_invalid("listxattr", path->fd, follow_symlinks))
|
2012-06-22 16:30:09 -07:00
|
|
|
goto exit;
|
2011-08-31 22:15:17 -04:00
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.listxattr", "(O)",
|
|
|
|
|
path->object ? path->object : Py_None) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
name = path->narrow ? path->narrow : ".";
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
for (i = 0; ; i++) {
|
2016-05-07 16:45:18 +03:00
|
|
|
const char *start, *trace, *end;
|
2012-06-22 16:30:09 -07:00
|
|
|
ssize_t length;
|
2015-12-25 19:53:18 +02:00
|
|
|
static const Py_ssize_t buffer_sizes[] = { 256, XATTR_LIST_MAX, 0 };
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_ssize_t buffer_size = buffer_sizes[i];
|
|
|
|
|
if (!buffer_size) {
|
2012-09-23 16:11:15 +02:00
|
|
|
/* ERANGE */
|
2014-08-05 14:04:04 +10:00
|
|
|
path_error(path);
|
2012-06-22 16:30:09 -07:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
buffer = PyMem_MALLOC(buffer_size);
|
|
|
|
|
if (!buffer) {
|
|
|
|
|
PyErr_NoMemory();
|
|
|
|
|
break;
|
|
|
|
|
}
|
2011-08-31 22:15:17 -04:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_BEGIN_ALLOW_THREADS;
|
2014-08-05 14:04:04 +10:00
|
|
|
if (path->fd > -1)
|
|
|
|
|
length = flistxattr(path->fd, buffer, buffer_size);
|
2012-06-22 16:30:09 -07:00
|
|
|
else if (follow_symlinks)
|
|
|
|
|
length = listxattr(name, buffer, buffer_size);
|
|
|
|
|
else
|
|
|
|
|
length = llistxattr(name, buffer, buffer_size);
|
|
|
|
|
Py_END_ALLOW_THREADS;
|
2011-08-31 22:15:17 -04:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
if (length < 0) {
|
2013-05-13 19:46:29 +02:00
|
|
|
if (errno == ERANGE) {
|
|
|
|
|
PyMem_FREE(buffer);
|
2013-05-13 19:55:40 -05:00
|
|
|
buffer = NULL;
|
2012-06-22 16:30:09 -07:00
|
|
|
continue;
|
2013-05-13 19:46:29 +02:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
path_error(path);
|
2012-06-22 16:30:09 -07:00
|
|
|
break;
|
|
|
|
|
}
|
2011-08-31 22:15:17 -04:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
result = PyList_New(0);
|
|
|
|
|
if (!result) {
|
|
|
|
|
goto exit;
|
|
|
|
|
}
|
2011-08-31 22:15:17 -04:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
end = buffer + length;
|
|
|
|
|
for (trace = start = buffer; trace != end; trace++) {
|
|
|
|
|
if (!*trace) {
|
|
|
|
|
int error;
|
|
|
|
|
PyObject *attribute = PyUnicode_DecodeFSDefaultAndSize(start,
|
|
|
|
|
trace - start);
|
|
|
|
|
if (!attribute) {
|
|
|
|
|
Py_DECREF(result);
|
|
|
|
|
result = NULL;
|
|
|
|
|
goto exit;
|
|
|
|
|
}
|
|
|
|
|
error = PyList_Append(result, attribute);
|
|
|
|
|
Py_DECREF(attribute);
|
|
|
|
|
if (error) {
|
|
|
|
|
Py_DECREF(result);
|
|
|
|
|
result = NULL;
|
|
|
|
|
goto exit;
|
|
|
|
|
}
|
|
|
|
|
start = trace + 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
exit:
|
|
|
|
|
if (buffer)
|
|
|
|
|
PyMem_FREE(buffer);
|
|
|
|
|
return result;
|
2011-08-31 22:15:17 -04:00
|
|
|
}
|
2011-09-14 11:45:52 -04:00
|
|
|
#endif /* USE_XATTRS */
|
2011-08-31 22:15:17 -04:00
|
|
|
|
2012-02-08 23:28:36 +01:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.urandom
|
|
|
|
|
|
|
|
|
|
size: Py_ssize_t
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Return a bytes object containing random bytes suitable for cryptographic use.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_urandom_impl(PyObject *module, Py_ssize_t size)
|
|
|
|
|
/*[clinic end generated code: output=42c5cca9d18068e9 input=4067cdb1b6776c29]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
PyObject *bytes;
|
|
|
|
|
int result;
|
|
|
|
|
|
2012-02-20 19:54:16 +01:00
|
|
|
if (size < 0)
|
2010-05-06 00:08:46 +00:00
|
|
|
return PyErr_Format(PyExc_ValueError,
|
|
|
|
|
"negative argument not allowed");
|
2014-08-05 14:04:04 +10:00
|
|
|
bytes = PyBytes_FromStringAndSize(NULL, size);
|
|
|
|
|
if (bytes == NULL)
|
2012-02-20 19:54:16 +01:00
|
|
|
return NULL;
|
2010-05-06 00:08:46 +00:00
|
|
|
|
2016-09-06 16:33:52 -07:00
|
|
|
result = _PyOS_URandom(PyBytes_AS_STRING(bytes), PyBytes_GET_SIZE(bytes));
|
2014-08-05 14:04:04 +10:00
|
|
|
if (result == -1) {
|
|
|
|
|
Py_DECREF(bytes);
|
2012-02-20 19:54:16 +01:00
|
|
|
return NULL;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
return bytes;
|
Merged revisions 46753-51188 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r46755 | brett.cannon | 2006-06-08 18:23:04 +0200 (Thu, 08 Jun 2006) | 4 lines
Make binascii.hexlify() use s# for its arguments instead of t# to actually
match its documentation stating it accepts any read-only buffer.
........
r46757 | brett.cannon | 2006-06-08 19:00:45 +0200 (Thu, 08 Jun 2006) | 8 lines
Buffer objects would return the read or write buffer for a wrapped object when
the char buffer was requested. Now it actually returns the char buffer if
available or raises a TypeError if it isn't (as is raised for the other buffer
types if they are not present but requested).
Not a backport candidate since it does change semantics of the buffer object
(although it could be argued this is enough of a bug to bother backporting).
........
r46760 | andrew.kuchling | 2006-06-09 03:10:17 +0200 (Fri, 09 Jun 2006) | 1 line
Update functools section
........
r46762 | tim.peters | 2006-06-09 04:11:02 +0200 (Fri, 09 Jun 2006) | 6 lines
Whitespace normalization.
Since test_file is implicated in mysterious test failures
when followed by test_optparse, if I had any brains I'd
look at the checkin that last changed test_file ;-)
........
r46763 | tim.peters | 2006-06-09 05:09:42 +0200 (Fri, 09 Jun 2006) | 5 lines
To boost morale :-), force test_optparse to run immediately
after test_file until we can figure out how to fix it.
(See python-dev; at the moment we don't even know which checkin
caused the problem.)
........
r46764 | tim.peters | 2006-06-09 05:51:41 +0200 (Fri, 09 Jun 2006) | 6 lines
AutoFileTests.tearDown(): Removed mysterious undocumented
try/except. Remove TESTFN.
Throughout: used open() instead of file(), and wrapped
long lines.
........
r46765 | tim.peters | 2006-06-09 06:02:06 +0200 (Fri, 09 Jun 2006) | 8 lines
testUnicodeOpen(): I have no idea why, but making this
test clean up after itself appears to fix the test failures
when test_optparse follows test_file.
test_main(): Get rid of TESTFN no matter what. That's
also enough to fix the mystery failures. Doesn't hurt
to fix them twice :-)
........
r46766 | tim.peters | 2006-06-09 07:12:40 +0200 (Fri, 09 Jun 2006) | 6 lines
Remove the temporary hack to force test_optparse to
run immediately after test_file. At least 8 buildbot
boxes passed since the underlying problem got fixed,
and they all failed before the fix, so there's no point
to this anymore.
........
r46767 | neal.norwitz | 2006-06-09 07:54:18 +0200 (Fri, 09 Jun 2006) | 1 line
Fix grammar and reflow
........
r46769 | andrew.kuchling | 2006-06-09 12:22:35 +0200 (Fri, 09 Jun 2006) | 1 line
Markup fix
........
r46773 | andrew.kuchling | 2006-06-09 15:15:57 +0200 (Fri, 09 Jun 2006) | 1 line
[Bug #1472827] Make saxutils.XMLGenerator handle \r\n\t in attribute values by escaping them properly. 2.4 bugfix candidate.
........
r46778 | kristjan.jonsson | 2006-06-09 18:28:01 +0200 (Fri, 09 Jun 2006) | 2 lines
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.
........
r46779 | phillip.eby | 2006-06-09 18:40:18 +0200 (Fri, 09 Jun 2006) | 2 lines
Import wsgiref into the stdlib, as of the external version 0.1-r2181.
........
r46783 | andrew.kuchling | 2006-06-09 18:44:40 +0200 (Fri, 09 Jun 2006) | 1 line
Add note about XMLGenerator bugfix
........
r46784 | andrew.kuchling | 2006-06-09 18:46:51 +0200 (Fri, 09 Jun 2006) | 1 line
Add note about wsgiref
........
r46785 | brett.cannon | 2006-06-09 19:05:48 +0200 (Fri, 09 Jun 2006) | 2 lines
Fix inconsistency in naming within an enum.
........
r46787 | tim.peters | 2006-06-09 19:47:00 +0200 (Fri, 09 Jun 2006) | 2 lines
Whitespace normalization.
........
r46792 | georg.brandl | 2006-06-09 20:29:52 +0200 (Fri, 09 Jun 2006) | 3 lines
Test file.__exit__.
........
r46794 | brett.cannon | 2006-06-09 20:40:46 +0200 (Fri, 09 Jun 2006) | 2 lines
svn:ignore .pyc and .pyo files.
........
r46795 | georg.brandl | 2006-06-09 20:45:48 +0200 (Fri, 09 Jun 2006) | 3 lines
RFE #1491485: str/unicode.endswith()/startswith() now accept a tuple as first argument.
........
r46798 | andrew.kuchling | 2006-06-09 21:03:16 +0200 (Fri, 09 Jun 2006) | 1 line
Describe startswith()/endswiith() change; add reminder about wsgiref
........
r46799 | tim.peters | 2006-06-09 21:24:44 +0200 (Fri, 09 Jun 2006) | 11 lines
Implementing a happy idea from Georg Brandl: make runtest() try to
clean up files and directories the tests often leave behind by
mistake. This is the first time in history I don't have a bogus
"db_home" directory after running the tests ;-)
Also worked on runtest's docstring, to say something about all the
arguments, and to document the non-obvious return values.
New functions runtest_inner() and cleanup_test_droppings() in
support of the above.
........
r46800 | andrew.kuchling | 2006-06-09 21:43:25 +0200 (Fri, 09 Jun 2006) | 1 line
Remove unused variable
........
r46801 | andrew.kuchling | 2006-06-09 21:56:05 +0200 (Fri, 09 Jun 2006) | 1 line
Add some wsgiref text
........
r46803 | thomas.heller | 2006-06-09 21:59:11 +0200 (Fri, 09 Jun 2006) | 1 line
set eol-style svn property
........
r46804 | thomas.heller | 2006-06-09 22:01:01 +0200 (Fri, 09 Jun 2006) | 1 line
set eol-style svn property
........
r46805 | georg.brandl | 2006-06-09 22:43:48 +0200 (Fri, 09 Jun 2006) | 3 lines
Make use of new str.startswith/endswith semantics.
Occurences in email and compiler were ignored due to backwards compat requirements.
........
r46806 | brett.cannon | 2006-06-10 00:31:23 +0200 (Sat, 10 Jun 2006) | 4 lines
An object with __call__ as an attribute, when called, will have that attribute checked for __call__ itself, and will continue to look until it finds an object without the attribute. This can lead to an infinite recursion.
Closes bug #532646, again. Will be backported.
........
r46808 | brett.cannon | 2006-06-10 00:45:54 +0200 (Sat, 10 Jun 2006) | 2 lines
Fix bug introduced in rev. 46806 by not having variable declaration at the top of a block.
........
r46812 | georg.brandl | 2006-06-10 08:40:50 +0200 (Sat, 10 Jun 2006) | 4 lines
Apply perky's fix for #1503157: "/".join([u"", u""]) raising OverflowError.
Also improve error message on overflow.
........
r46817 | martin.v.loewis | 2006-06-10 10:14:03 +0200 (Sat, 10 Jun 2006) | 2 lines
Port cygwin kill_python changes from 2.4 branch.
........
r46818 | armin.rigo | 2006-06-10 12:57:40 +0200 (Sat, 10 Jun 2006) | 4 lines
SF bug #1503294.
PyThreadState_GET() complains if the tstate is NULL, but only in debug mode.
........
r46819 | martin.v.loewis | 2006-06-10 14:23:46 +0200 (Sat, 10 Jun 2006) | 4 lines
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
........
r46820 | skip.montanaro | 2006-06-10 16:09:11 +0200 (Sat, 10 Jun 2006) | 1 line
document the class, not its initializer
........
r46821 | greg.ward | 2006-06-10 18:40:01 +0200 (Sat, 10 Jun 2006) | 4 lines
Sync with Optik docs (rev 518):
* restore "Extending optparse" section
* document ALWAYS_TYPED_ACTIONS (SF #1449311)
........
r46824 | thomas.heller | 2006-06-10 21:51:46 +0200 (Sat, 10 Jun 2006) | 8 lines
Upgrade to ctypes version 0.9.9.7.
Summary of changes:
- support for 'variable sized' data
- support for anonymous structure/union fields
- fix severe bug with certain arrays or structures containing more than 256 fields
........
r46825 | thomas.heller | 2006-06-10 21:55:36 +0200 (Sat, 10 Jun 2006) | 8 lines
Upgrade to ctypes version 0.9.9.7.
Summary of changes:
- support for 'variable sized' data
- support for anonymous structure/union fields
- fix severe bug with certain arrays or structures containing more than 256 fields
........
r46826 | fred.drake | 2006-06-10 22:01:34 +0200 (Sat, 10 Jun 2006) | 4 lines
SF patch #1303595: improve description of __builtins__, explaining how it
varies between __main__ and other modules, and strongly suggest not touching
it but using __builtin__ if absolutely necessary
........
r46827 | fred.drake | 2006-06-10 22:02:58 +0200 (Sat, 10 Jun 2006) | 1 line
credit for SF patch #1303595
........
r46831 | thomas.heller | 2006-06-10 22:29:34 +0200 (Sat, 10 Jun 2006) | 2 lines
New docs for ctypes.
........
r46834 | thomas.heller | 2006-06-10 23:07:19 +0200 (Sat, 10 Jun 2006) | 1 line
Fix a wrong printf format.
........
r46835 | thomas.heller | 2006-06-10 23:17:58 +0200 (Sat, 10 Jun 2006) | 1 line
Fix the second occurrence of the problematic printf format.
........
r46837 | thomas.heller | 2006-06-10 23:56:03 +0200 (Sat, 10 Jun 2006) | 1 line
Don't use C++ comment.
........
r46838 | thomas.heller | 2006-06-11 00:01:50 +0200 (Sun, 11 Jun 2006) | 1 line
Handle failure of PyMem_Realloc.
........
r46839 | skip.montanaro | 2006-06-11 00:38:13 +0200 (Sun, 11 Jun 2006) | 2 lines
Suppress warning on MacOSX about possible use before set of proc.
........
r46840 | tim.peters | 2006-06-11 00:51:45 +0200 (Sun, 11 Jun 2006) | 8 lines
shuffle() doscstring: Removed warning about sequence length
versus generator period. While this was a real weakness of the
older WH generator for lists with just a few dozen elements,
and so could potentially bite the naive ;-), the Twister should
show excellent behavior up to at least 600 elements.
Module docstring: reflowed some jarringly short lines.
........
r46844 | greg.ward | 2006-06-11 02:40:49 +0200 (Sun, 11 Jun 2006) | 4 lines
Bug #1361643: fix textwrap.dedent() so it handles tabs appropriately,
i.e. do *not* expand tabs, but treat them as whitespace that is not
equivalent to spaces. Add a couple of test cases. Clarify docs.
........
r46850 | neal.norwitz | 2006-06-11 07:44:18 +0200 (Sun, 11 Jun 2006) | 5 lines
Fix Coverity # 146. newDBSequenceObject would deref dbobj, so it can't be NULL.
We know it's not NULL from the ParseTuple and DbObject_Check will verify
it's not NULL.
........
r46851 | neal.norwitz | 2006-06-11 07:45:25 +0200 (Sun, 11 Jun 2006) | 4 lines
Wrap some long lines
Top/Bottom factor out some common expressions
Add a XXX comment about widing offset.
........
r46852 | neal.norwitz | 2006-06-11 07:45:47 +0200 (Sun, 11 Jun 2006) | 1 line
Add versionadded to doc
........
r46853 | neal.norwitz | 2006-06-11 07:47:14 +0200 (Sun, 11 Jun 2006) | 3 lines
Update doc to make it agree with code.
Bottom factor out some common code.
........
r46854 | neal.norwitz | 2006-06-11 07:48:14 +0200 (Sun, 11 Jun 2006) | 3 lines
f_code can't be NULL based on Frame_New and other code that derefs it.
So there doesn't seem to be much point to checking here.
........
r46855 | neal.norwitz | 2006-06-11 09:26:27 +0200 (Sun, 11 Jun 2006) | 1 line
Fix errors found by pychecker
........
r46856 | neal.norwitz | 2006-06-11 09:26:50 +0200 (Sun, 11 Jun 2006) | 1 line
warnings was imported at module scope, no need to import again
........
r46857 | neal.norwitz | 2006-06-11 09:27:56 +0200 (Sun, 11 Jun 2006) | 5 lines
Fix errors found by pychecker.
I think these changes are correct, but I'm not sure. Could someone
who knows how this module works test it? It can at least start on
the cmd line.
........
r46858 | neal.norwitz | 2006-06-11 10:35:14 +0200 (Sun, 11 Jun 2006) | 1 line
Fix errors found by pychecker
........
r46859 | ronald.oussoren | 2006-06-11 16:33:36 +0200 (Sun, 11 Jun 2006) | 4 lines
This patch improves the L&F of IDLE on OSX. The changes are conditionalized on
being in an IDLE.app bundle on darwin. This does a slight reorganisation of the
menus and adds support for file-open events.
........
r46860 | greg.ward | 2006-06-11 16:42:41 +0200 (Sun, 11 Jun 2006) | 1 line
SF #1366250: optparse docs: fix inconsistency in variable name; minor tweaks.
........
r46861 | greg.ward | 2006-06-11 18:24:11 +0200 (Sun, 11 Jun 2006) | 3 lines
Bug #1498146: fix optparse to handle Unicode strings in option help,
description, and epilog.
........
r46862 | thomas.heller | 2006-06-11 19:04:22 +0200 (Sun, 11 Jun 2006) | 2 lines
Release the GIL during COM method calls, to avoid deadlocks in
Python coded COM objects.
........
r46863 | tim.peters | 2006-06-11 21:42:51 +0200 (Sun, 11 Jun 2006) | 2 lines
Whitespace normalization.
........
r46864 | tim.peters | 2006-06-11 21:43:49 +0200 (Sun, 11 Jun 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46865 | ronald.oussoren | 2006-06-11 21:45:57 +0200 (Sun, 11 Jun 2006) | 2 lines
Remove message about using make frameworkinstall, that's no longer necesssary
........
r46866 | ronald.oussoren | 2006-06-11 22:23:29 +0200 (Sun, 11 Jun 2006) | 2 lines
Use configure to substitute the correct prefix instead of hardcoding
........
r46867 | ronald.oussoren | 2006-06-11 22:24:45 +0200 (Sun, 11 Jun 2006) | 4 lines
- Change fixapplepython23.py to ensure that it will run with /usr/bin/python
on intel macs.
- Fix some minor problems in the installer for OSX
........
r46868 | neal.norwitz | 2006-06-11 22:25:56 +0200 (Sun, 11 Jun 2006) | 5 lines
Try to fix several networking tests. The problem is that if hosts have
a search path setup, some of these hosts resolve to the wrong address.
By appending a period to the hostname, the hostname should only resolve
to what we want it to resolve to. Hopefully this doesn't break different bots.
........
r46869 | neal.norwitz | 2006-06-11 22:42:02 +0200 (Sun, 11 Jun 2006) | 7 lines
Try to fix another networking test. The problem is that if hosts have
a search path setup, some of these hosts resolve to the wrong address.
By appending a period to the hostname, the hostname should only resolve
to what we want it to resolve to. Hopefully this doesn't break different bots.
Also add more info to failure message to aid debugging test failure.
........
r46870 | neal.norwitz | 2006-06-11 22:46:46 +0200 (Sun, 11 Jun 2006) | 4 lines
Fix test on PPC64 buildbot. It raised an IOError (really an URLError which
derives from an IOError). That seems valid. Env Error includes both OSError
and IOError, so this seems like a reasonable fix.
........
r46871 | tim.peters | 2006-06-11 22:52:59 +0200 (Sun, 11 Jun 2006) | 10 lines
compare_generic_iter(): Fixed the failure of test_wsgiref's testFileWrapper
when running with -O.
test_simple_validation_error still fails under -O. That appears to be because
wsgiref's validate.py uses `assert` statements all over the place to check
arguments for sanity. That should all be changed (it's not a logical error
in the software if a user passes bogus arguments, so this isn't a reasonable
use for `assert` -- checking external preconditions should generally raise
ValueError or TypeError instead, as appropriate).
........
r46872 | neal.norwitz | 2006-06-11 23:38:38 +0200 (Sun, 11 Jun 2006) | 1 line
Get test to pass on S/390. Shout if you think this change is incorrect.
........
r46873 | neal.norwitz | 2006-06-12 04:05:55 +0200 (Mon, 12 Jun 2006) | 1 line
Cleanup Py_ssize_t a little (get rid of second #ifdef)
........
r46874 | neal.norwitz | 2006-06-12 04:06:17 +0200 (Mon, 12 Jun 2006) | 1 line
Fix some Py_ssize_t issues
........
r46875 | neal.norwitz | 2006-06-12 04:06:42 +0200 (Mon, 12 Jun 2006) | 1 line
Fix some Py_ssize_t issues
........
r46876 | neal.norwitz | 2006-06-12 04:07:24 +0200 (Mon, 12 Jun 2006) | 2 lines
Cleanup: Remove import of types to get StringTypes, we can just use basestring.
........
r46877 | neal.norwitz | 2006-06-12 04:07:57 +0200 (Mon, 12 Jun 2006) | 1 line
Don't truncate if size_t is bigger than uint
........
r46878 | neal.norwitz | 2006-06-12 04:08:41 +0200 (Mon, 12 Jun 2006) | 1 line
Don't leak the list object if there's an error allocating the item storage. Backport candidate
........
r46879 | neal.norwitz | 2006-06-12 04:09:03 +0200 (Mon, 12 Jun 2006) | 1 line
Fix typo. Backport if anyone cares. :-)
........
r46880 | neal.norwitz | 2006-06-12 04:09:34 +0200 (Mon, 12 Jun 2006) | 1 line
Fix indentation of case and a Py_ssize_t issue.
........
r46881 | neal.norwitz | 2006-06-12 04:11:18 +0200 (Mon, 12 Jun 2006) | 3 lines
Get rid of f_restricted too. Doc the other 4 ints that were already removed
at the NeedForSpeed sprint.
........
r46882 | neal.norwitz | 2006-06-12 04:13:21 +0200 (Mon, 12 Jun 2006) | 1 line
Fix the socket tests so they can be run concurrently. Backport candidate
........
r46883 | neal.norwitz | 2006-06-12 04:16:10 +0200 (Mon, 12 Jun 2006) | 1 line
i and j are initialized below when used. No need to do it twice
........
r46884 | neal.norwitz | 2006-06-12 05:05:03 +0200 (Mon, 12 Jun 2006) | 1 line
Remove unused import
........
r46885 | neal.norwitz | 2006-06-12 05:05:40 +0200 (Mon, 12 Jun 2006) | 1 line
Impl ssize_t
........
r46886 | neal.norwitz | 2006-06-12 05:33:09 +0200 (Mon, 12 Jun 2006) | 6 lines
Patch #1503046, Conditional compilation of zlib.(de)compressobj.copy
copy is only in newer versions of zlib. This should allow zlibmodule
to work with older versions like the Tru64 buildbot.
........
r46887 | phillip.eby | 2006-06-12 06:04:32 +0200 (Mon, 12 Jun 2006) | 2 lines
Sync w/external release 0.1.2. Please see PEP 360 before making changes to external packages.
........
r46888 | martin.v.loewis | 2006-06-12 06:26:31 +0200 (Mon, 12 Jun 2006) | 2 lines
Get rid of function pointer cast.
........
r46889 | thomas.heller | 2006-06-12 08:05:57 +0200 (Mon, 12 Jun 2006) | 3 lines
I don't know how that happend, but the entire file contents was
duplicated. Thanks to Simon Percivall for the heads up.
........
r46890 | nick.coghlan | 2006-06-12 10:19:37 +0200 (Mon, 12 Jun 2006) | 1 line
Fix site module docstring to match the code
........
r46891 | nick.coghlan | 2006-06-12 10:23:02 +0200 (Mon, 12 Jun 2006) | 1 line
Fix site module docstring to match the code for Mac OSX, too
........
r46892 | nick.coghlan | 2006-06-12 10:27:13 +0200 (Mon, 12 Jun 2006) | 1 line
The site module documentation also described the Windows behaviour incorrectly.
........
r46893 | nick.coghlan | 2006-06-12 12:17:11 +0200 (Mon, 12 Jun 2006) | 1 line
Make the -m switch conform to the documentation of sys.path by behaving like the -c switch
........
r46894 | kristjan.jonsson | 2006-06-12 17:45:12 +0200 (Mon, 12 Jun 2006) | 2 lines
Fix the CRT argument error handling for VisualStudio .NET 2005. Install a CRT error handler and disable the assertion for debug builds. This causes CRT to set errno to EINVAL.
This update fixes crash cases in the test suite where the default CRT error handler would cause process exit.
........
r46899 | thomas.heller | 2006-06-12 22:56:48 +0200 (Mon, 12 Jun 2006) | 1 line
Add pep-291 compatibility markers.
........
r46901 | ka-ping.yee | 2006-06-13 01:47:52 +0200 (Tue, 13 Jun 2006) | 5 lines
Add the uuid module.
This module has been tested so far on Windows XP (Python 2.4 and 2.5a2),
Mac OS X (Python 2.3, 2.4, and 2.5a2), and Linux (Python 2.4 and 2.5a2).
........
r46902 | tim.peters | 2006-06-13 02:30:01 +0200 (Tue, 13 Jun 2006) | 2 lines
Whitespace normalization.
........
r46903 | tim.peters | 2006-06-13 02:30:50 +0200 (Tue, 13 Jun 2006) | 2 lines
Added missing svn:eol-style property to text files.
........
r46905 | tim.peters | 2006-06-13 05:30:07 +0200 (Tue, 13 Jun 2006) | 5 lines
get_matching_blocks(): rewrote code & comments so they match; added
more comments about why it's this way at all; and removed what looked
like needless expense (sorting (i, j, k) triples directly should give
exactly the same order as sorting (i, (i, j, k)) pairs).
........
r46906 | neal.norwitz | 2006-06-13 06:08:53 +0200 (Tue, 13 Jun 2006) | 1 line
Don't fail if another process is listening on our port.
........
r46908 | neal.norwitz | 2006-06-13 10:28:19 +0200 (Tue, 13 Jun 2006) | 2 lines
Initialize the type object so pychecker can't crash the interpreter.
........
r46909 | neal.norwitz | 2006-06-13 10:41:06 +0200 (Tue, 13 Jun 2006) | 1 line
Verify the crash due to EncodingMap not initialized does not return
........
r46910 | thomas.heller | 2006-06-13 10:56:14 +0200 (Tue, 13 Jun 2006) | 3 lines
Add some windows datatypes that were missing from this file, and add
the aliases defined in windows header files for the structures.
........
r46911 | thomas.heller | 2006-06-13 11:40:14 +0200 (Tue, 13 Jun 2006) | 3 lines
Add back WCHAR, UINT, DOUBLE, _LARGE_INTEGER, _ULARGE_INTEGER.
VARIANT_BOOL is a special _ctypes data type, not c_short.
........
r46912 | ronald.oussoren | 2006-06-13 13:19:56 +0200 (Tue, 13 Jun 2006) | 4 lines
Linecache contains support for PEP302 loaders, but fails to deal with loaders
that return None to indicate that the module is valid but no source is
available. This patch fixes that.
........
r46913 | andrew.kuchling | 2006-06-13 13:57:04 +0200 (Tue, 13 Jun 2006) | 1 line
Mention uuid module
........
r46915 | walter.doerwald | 2006-06-13 14:02:12 +0200 (Tue, 13 Jun 2006) | 2 lines
Fix passing errors to the encoder and decoder functions.
........
r46917 | walter.doerwald | 2006-06-13 14:04:43 +0200 (Tue, 13 Jun 2006) | 3 lines
errors is an attribute in the incremental decoder
not an argument.
........
r46919 | andrew.macintyre | 2006-06-13 17:04:24 +0200 (Tue, 13 Jun 2006) | 11 lines
Patch #1454481: Make thread stack size runtime tunable.
Heavily revised, comprising revisions:
46640 - original trunk revision (backed out in r46655)
46647 - markup fix (backed out in r46655)
46692:46918 merged from branch aimacintyre-sf1454481
branch tested on buildbots (Windows buildbots had problems
not related to these changes).
........
r46920 | brett.cannon | 2006-06-13 18:06:55 +0200 (Tue, 13 Jun 2006) | 2 lines
Remove unused variable.
........
r46921 | andrew.kuchling | 2006-06-13 18:41:41 +0200 (Tue, 13 Jun 2006) | 1 line
Add ability to set stack size
........
r46923 | marc-andre.lemburg | 2006-06-13 19:04:26 +0200 (Tue, 13 Jun 2006) | 2 lines
Update pybench to version 2.0.
........
r46924 | marc-andre.lemburg | 2006-06-13 19:07:14 +0200 (Tue, 13 Jun 2006) | 2 lines
Revert wrong svn copy.
........
r46925 | andrew.macintyre | 2006-06-13 19:14:36 +0200 (Tue, 13 Jun 2006) | 2 lines
fix exception usage
........
r46927 | tim.peters | 2006-06-13 20:37:07 +0200 (Tue, 13 Jun 2006) | 2 lines
Whitespace normalization.
........
r46928 | marc-andre.lemburg | 2006-06-13 20:56:56 +0200 (Tue, 13 Jun 2006) | 9 lines
Updated to pybench 2.0.
See svn.python.org/external/pybench-2.0 for the original import of that
version.
Note that platform.py was not copied over from pybench-2.0 since
it is already part of Python 2.5.
........
r46929 | andrew.macintyre | 2006-06-13 21:02:35 +0200 (Tue, 13 Jun 2006) | 5 lines
Increase the small thread stack size to get the test
to pass reliably on the one buildbot that insists on
more than 32kB of thread stack.
........
r46930 | marc-andre.lemburg | 2006-06-13 21:20:07 +0200 (Tue, 13 Jun 2006) | 2 lines
Whitespace normalization.
........
r46931 | thomas.heller | 2006-06-13 22:18:43 +0200 (Tue, 13 Jun 2006) | 2 lines
More docs for ctypes.
........
r46932 | brett.cannon | 2006-06-13 23:34:24 +0200 (Tue, 13 Jun 2006) | 2 lines
Ignore .pyc and .pyo files in Pybench.
........
r46933 | brett.cannon | 2006-06-13 23:46:41 +0200 (Tue, 13 Jun 2006) | 7 lines
If a classic class defined a __coerce__() method that just returned its two
arguments in reverse, the interpreter would infinitely recourse trying to get a
coercion that worked. So put in a recursion check after a coercion is made and
the next call to attempt to use the coerced values.
Fixes bug #992017 and closes crashers/coerce.py .
........
r46936 | gerhard.haering | 2006-06-14 00:24:47 +0200 (Wed, 14 Jun 2006) | 3 lines
Merged changes from external pysqlite 2.3.0 release. Documentation updates will
follow in a few hours at the latest. Then we should be ready for beta1.
........
r46937 | brett.cannon | 2006-06-14 00:26:13 +0200 (Wed, 14 Jun 2006) | 2 lines
Missed test for rev. 46933; infinite recursion from __coerce__() returning its arguments reversed.
........
r46938 | gerhard.haering | 2006-06-14 00:53:48 +0200 (Wed, 14 Jun 2006) | 2 lines
Updated documentation for pysqlite 2.3.0 API.
........
r46939 | tim.peters | 2006-06-14 06:09:25 +0200 (Wed, 14 Jun 2006) | 10 lines
SequenceMatcher.get_matching_blocks(): This now guarantees that
adjacent triples in the result list describe non-adjacent matching
blocks. That's _nice_ to have, and Guido said he wanted it.
Not a bugfix candidate: Guido or not ;-), this changes visible
endcase semantics (note that some tests had to change), and
nothing about this was documented before. Since it was working
as designed, and behavior was consistent with the docs, it wasn't
"a bug".
........
r46940 | tim.peters | 2006-06-14 06:13:00 +0200 (Wed, 14 Jun 2006) | 2 lines
Repaired typo in new comment.
........
r46941 | tim.peters | 2006-06-14 06:15:27 +0200 (Wed, 14 Jun 2006) | 2 lines
Whitespace normalization.
........
r46942 | fred.drake | 2006-06-14 06:25:02 +0200 (Wed, 14 Jun 2006) | 3 lines
- make some disabled tests run what they intend when enabled
- remove some over-zealous triple-quoting
........
r46943 | fred.drake | 2006-06-14 07:04:47 +0200 (Wed, 14 Jun 2006) | 3 lines
add tests for two cases that are handled correctly in the current code,
but that SF patch 1504676 as written mis-handles
........
r46944 | fred.drake | 2006-06-14 07:15:51 +0200 (Wed, 14 Jun 2006) | 1 line
explain an XXX in more detail
........
r46945 | martin.v.loewis | 2006-06-14 07:21:04 +0200 (Wed, 14 Jun 2006) | 1 line
Patch #1455898: Incremental mode for "mbcs" codec.
........
r46946 | georg.brandl | 2006-06-14 08:08:31 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1339007: Shelf objects now don't raise an exception in their
__del__ method when initialization failed.
........
r46948 | thomas.heller | 2006-06-14 08:18:15 +0200 (Wed, 14 Jun 2006) | 1 line
Fix docstring.
........
r46949 | georg.brandl | 2006-06-14 08:29:07 +0200 (Wed, 14 Jun 2006) | 2 lines
Bug #1501122: mention __gt__ &co in description of comparison order.
........
r46951 | thomas.heller | 2006-06-14 09:08:38 +0200 (Wed, 14 Jun 2006) | 1 line
Write more docs.
........
r46952 | georg.brandl | 2006-06-14 10:31:39 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1153163: describe __add__ vs __radd__ behavior when adding
objects of same type/of subclasses of the other.
........
r46954 | georg.brandl | 2006-06-14 10:42:11 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1202018: add some common mime.types locations.
........
r46955 | georg.brandl | 2006-06-14 10:50:03 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #1117556: SimpleHTTPServer now tries to find and use the system's
mime.types file for determining MIME types.
........
r46957 | thomas.heller | 2006-06-14 11:09:08 +0200 (Wed, 14 Jun 2006) | 1 line
Document paramflags.
........
r46958 | thomas.heller | 2006-06-14 11:20:11 +0200 (Wed, 14 Jun 2006) | 1 line
Add an __all__ list, since this module does 'from ctypes import *'.
........
r46959 | andrew.kuchling | 2006-06-14 15:59:15 +0200 (Wed, 14 Jun 2006) | 1 line
Add item
........
r46961 | georg.brandl | 2006-06-14 18:46:43 +0200 (Wed, 14 Jun 2006) | 3 lines
Bug #805015: doc error in PyUnicode_FromEncodedObject.
........
r46962 | gerhard.haering | 2006-06-15 00:28:37 +0200 (Thu, 15 Jun 2006) | 10 lines
- Added version checks in C code to make sure we don't trigger bugs in older
SQLite versions.
- Added version checks in test suite so that we don't execute tests that we
know will fail with older (buggy) SQLite versions.
Now, all tests should run against all SQLite versions from 3.0.8 until 3.3.6
(latest one now). The sqlite3 module can be built against all these SQLite
versions and the sqlite3 module does its best to not trigger bugs in SQLite,
but using SQLite 3.3.3 or later is recommended.
........
r46963 | tim.peters | 2006-06-15 00:38:13 +0200 (Thu, 15 Jun 2006) | 2 lines
Whitespace normalization.
........
r46964 | neal.norwitz | 2006-06-15 06:54:29 +0200 (Thu, 15 Jun 2006) | 9 lines
Speculative checkin (requires approval of Gerhard Haering)
This backs out the test changes in 46962 which prevented crashes
by not running the tests via a version check. All the version checks
added in that rev were removed from the tests.
Code was added to the error handler in connection.c that seems
to work with older versions of sqlite including 3.1.3.
........
r46965 | neal.norwitz | 2006-06-15 07:55:49 +0200 (Thu, 15 Jun 2006) | 1 line
Try to narrow window of failure on slow/busy boxes (ppc64 buildbot)
........
r46966 | martin.v.loewis | 2006-06-15 08:45:05 +0200 (Thu, 15 Jun 2006) | 2 lines
Make import/lookup of mbcs fail on non-Windows systems.
........
r46967 | ronald.oussoren | 2006-06-15 10:14:18 +0200 (Thu, 15 Jun 2006) | 2 lines
Patch #1446489 (zipfile: support for ZIP64)
........
r46968 | neal.norwitz | 2006-06-15 10:16:44 +0200 (Thu, 15 Jun 2006) | 6 lines
Re-revert this change. Install the version check and don't run the test
until Gerhard has time to fully debug the issue. This affects versions
before 3.2.1 (possibly only versions earlier than 3.1.3).
Based on discussion on python-checkins.
........
r46969 | gregory.p.smith | 2006-06-15 10:52:32 +0200 (Thu, 15 Jun 2006) | 6 lines
- bsddb: multithreaded DB access using the simple bsddb module interface
now works reliably. It has been updated to use automatic BerkeleyDB
deadlock detection and the bsddb.dbutils.DeadlockWrap wrapper to retry
database calls that would previously deadlock. [SF python bug #775414]
........
r46970 | gregory.p.smith | 2006-06-15 11:23:52 +0200 (Thu, 15 Jun 2006) | 2 lines
minor documentation cleanup. mention the bsddb.db interface explicitly by name.
........
r46971 | neal.norwitz | 2006-06-15 11:57:03 +0200 (Thu, 15 Jun 2006) | 5 lines
Steal the trick from test_compiler to print out a slow msg.
This will hopefully get the buildbots to pass. Not sure this
test will be feasible or even work. But everything is red now,
so it can't get much worse.
........
r46972 | neal.norwitz | 2006-06-15 12:24:49 +0200 (Thu, 15 Jun 2006) | 1 line
Print some more info to get an idea of how much longer the test will last
........
r46981 | tim.peters | 2006-06-15 20:04:40 +0200 (Thu, 15 Jun 2006) | 6 lines
Try to reduce the extreme peak memory and disk-space use
of this test. It probably still requires more disk space
than most buildbots have, and in any case is still so
intrusive that if we don't find another way to test this I'm
taking my buildbot offline permanently ;-)
........
r46982 | tim.peters | 2006-06-15 20:06:29 +0200 (Thu, 15 Jun 2006) | 2 lines
Whitespace normalization.
........
r46983 | tim.peters | 2006-06-15 20:07:28 +0200 (Thu, 15 Jun 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46984 | tim.peters | 2006-06-15 20:38:19 +0200 (Thu, 15 Jun 2006) | 2 lines
Oops -- I introduced an off-by-6436159488 error.
........
r46990 | neal.norwitz | 2006-06-16 06:30:34 +0200 (Fri, 16 Jun 2006) | 1 line
Disable this test until we can determine what to do about it
........
r46991 | neal.norwitz | 2006-06-16 06:31:06 +0200 (Fri, 16 Jun 2006) | 1 line
Param name is dir, not directory. Update docstring. Backport candidate
........
r46992 | neal.norwitz | 2006-06-16 06:31:28 +0200 (Fri, 16 Jun 2006) | 1 line
Add missing period in comment.
........
r46993 | neal.norwitz | 2006-06-16 06:32:43 +0200 (Fri, 16 Jun 2006) | 1 line
Fix whitespace, there are memory leaks in this module.
........
r46995 | fred.drake | 2006-06-17 01:45:06 +0200 (Sat, 17 Jun 2006) | 3 lines
SF patch 1504676: Make sgmllib char and entity references pluggable
(implementation/tests contributed by Sam Ruby)
........
r46996 | fred.drake | 2006-06-17 03:07:54 +0200 (Sat, 17 Jun 2006) | 1 line
fix change that broke the htmllib tests
........
r46998 | martin.v.loewis | 2006-06-17 11:15:14 +0200 (Sat, 17 Jun 2006) | 3 lines
Patch #763580: Add name and value arguments to
Tkinter variable classes.
........
r46999 | martin.v.loewis | 2006-06-17 11:20:41 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #1096231: Add default argument to wm_iconbitmap.
........
r47000 | martin.v.loewis | 2006-06-17 11:25:15 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #1494750: Destroy master after deleting children.
........
r47003 | george.yoshida | 2006-06-17 18:31:52 +0200 (Sat, 17 Jun 2006) | 2 lines
markup fix
........
r47005 | george.yoshida | 2006-06-17 18:39:13 +0200 (Sat, 17 Jun 2006) | 4 lines
Update url.
Old url returned status code:301 Moved permanently.
........
r47007 | martin.v.loewis | 2006-06-17 20:44:27 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #812986: Update the canvas even if not tracing.
........
r47008 | martin.v.loewis | 2006-06-17 21:03:26 +0200 (Sat, 17 Jun 2006) | 2 lines
Patch #815924: Restore ability to pass type= and icon=
........
r47009 | neal.norwitz | 2006-06-18 00:37:45 +0200 (Sun, 18 Jun 2006) | 1 line
Fix typo in docstring
........
r47010 | neal.norwitz | 2006-06-18 00:38:15 +0200 (Sun, 18 Jun 2006) | 1 line
Fix memory leak reported by valgrind while running test_subprocess
........
r47011 | fred.drake | 2006-06-18 04:57:35 +0200 (Sun, 18 Jun 2006) | 1 line
remove unnecessary markup
........
r47013 | neal.norwitz | 2006-06-18 21:35:01 +0200 (Sun, 18 Jun 2006) | 7 lines
Prevent spurious leaks when running regrtest.py -R. There may be more
issues that crop up from time to time, but this change seems to have been
pretty stable (no spurious warnings) for about a week.
Other modules which use threads may require similar use of
threading_setup/threading_cleanup from test_support.
........
r47014 | neal.norwitz | 2006-06-18 21:37:40 +0200 (Sun, 18 Jun 2006) | 9 lines
The hppa ubuntu box sometimes hangs forever in these tests. My guess
is that the wait is failing for some reason. Use WNOHANG, so we won't
wait until the buildbot kills the test suite.
I haven't been able to reproduce the failure, so I'm not sure if
this will help or not. Hopefully, this change will cause the test
to fail, rather than hang. That will be better since we will get
the rest of the test results. It may also help us debug the real problem.
........
r47015 | neal.norwitz | 2006-06-18 22:10:24 +0200 (Sun, 18 Jun 2006) | 1 line
Revert 47014 until it is more robust
........
r47016 | thomas.heller | 2006-06-18 23:27:04 +0200 (Sun, 18 Jun 2006) | 6 lines
Fix typos.
Fix doctest example.
Mention in the tutorial that 'errcheck' is explained in the ref manual.
Use better wording in some places.
Remoce code examples that shouldn't be in the tutorial.
Remove some XXX notices.
........
r47017 | georg.brandl | 2006-06-19 00:17:29 +0200 (Mon, 19 Jun 2006) | 3 lines
Patch #1507676: improve exception messages in abstract.c, object.c and typeobject.c.
........
r47018 | neal.norwitz | 2006-06-19 07:40:44 +0200 (Mon, 19 Jun 2006) | 1 line
Use Py_ssize_t
........
r47019 | georg.brandl | 2006-06-19 08:35:54 +0200 (Mon, 19 Jun 2006) | 3 lines
Add news entry about error msg improvement.
........
r47020 | thomas.heller | 2006-06-19 09:07:49 +0200 (Mon, 19 Jun 2006) | 2 lines
Try to repair the failing test on the OpenBSD buildbot. Trial and error...
........
r47021 | tim.peters | 2006-06-19 09:45:16 +0200 (Mon, 19 Jun 2006) | 2 lines
Whitespace normalization.
........
r47022 | walter.doerwald | 2006-06-19 10:07:50 +0200 (Mon, 19 Jun 2006) | 4 lines
Patch #1506645: add Python wrappers for the curses functions
is_term_resized, resize_term and resizeterm. This uses three
separate configure checks (one for each function).
........
r47023 | walter.doerwald | 2006-06-19 10:14:09 +0200 (Mon, 19 Jun 2006) | 2 lines
Make check order match in configure and configure.in.
........
r47024 | tim.peters | 2006-06-19 10:14:28 +0200 (Mon, 19 Jun 2006) | 3 lines
Repair KeyError when running test_threaded_import under -R,
as reported by Neal on python-dev.
........
r47025 | thomas.heller | 2006-06-19 10:32:46 +0200 (Mon, 19 Jun 2006) | 3 lines
Next try to fix the OpenBSD buildbot tests:
Use ctypes.util.find_library to locate the C runtime library
on platforms where is returns useful results.
........
r47026 | tim.peters | 2006-06-19 11:09:44 +0200 (Mon, 19 Jun 2006) | 13 lines
TestHelp.make_parser(): This was making a permanent change to
os.environ (setting envar COLUMNS), which at least caused
test_float_default() to fail if the tests were run more than once.
This repairs the test_optparse -R failures Neal reported on
python-dev. It also explains some seemingly bizarre test_optparse
failures we saw a couple weeks ago on the buildbots, when
test_optparse failed due to test_file failing to clean up after
itself, and then test_optparse failed in an entirely different
way when regrtest's -w option ran test_optparse a second time.
It's now obvious that make_parser() permanently changing os.environ
was responsible for the second half of that.
........
r47027 | anthony.baxter | 2006-06-19 14:04:15 +0200 (Mon, 19 Jun 2006) | 2 lines
Preparing for 2.5b1.
........
r47029 | fred.drake | 2006-06-19 19:31:16 +0200 (Mon, 19 Jun 2006) | 1 line
remove non-working document formats from edist
........
r47030 | gerhard.haering | 2006-06-19 23:17:35 +0200 (Mon, 19 Jun 2006) | 5 lines
Fixed a memory leak that was introduced with incorrect usage of the Python weak
reference API in pysqlite 2.2.1.
Bumbed pysqlite version number to upcoming pysqlite 2.3.1 release.
........
r47032 | ka-ping.yee | 2006-06-20 00:49:36 +0200 (Tue, 20 Jun 2006) | 2 lines
Remove Python 2.3 compatibility comment.
........
r47033 | trent.mick | 2006-06-20 01:21:25 +0200 (Tue, 20 Jun 2006) | 2 lines
Upgrade pyexpat to expat 2.0.0 (http://python.org/sf/1462338).
........
r47034 | trent.mick | 2006-06-20 01:57:41 +0200 (Tue, 20 Jun 2006) | 3 lines
[ 1295808 ] expat symbols should be namespaced in pyexpat
(http://python.org/sf/1295808)
........
r47039 | andrew.kuchling | 2006-06-20 13:52:16 +0200 (Tue, 20 Jun 2006) | 1 line
Uncomment wsgiref section
........
r47040 | andrew.kuchling | 2006-06-20 14:15:09 +0200 (Tue, 20 Jun 2006) | 1 line
Add four library items
........
r47041 | andrew.kuchling | 2006-06-20 14:19:54 +0200 (Tue, 20 Jun 2006) | 1 line
Terminology and typography fixes
........
r47042 | andrew.kuchling | 2006-06-20 15:05:12 +0200 (Tue, 20 Jun 2006) | 1 line
Add introductory paragraphs summarizing the release; minor edits
........
r47043 | andrew.kuchling | 2006-06-20 15:11:29 +0200 (Tue, 20 Jun 2006) | 1 line
Minor edits and rearrangements; markup fix
........
r47044 | andrew.kuchling | 2006-06-20 15:20:30 +0200 (Tue, 20 Jun 2006) | 1 line
[Bug #1504456] Mention xml -> xmlcore change
........
r47047 | brett.cannon | 2006-06-20 19:30:26 +0200 (Tue, 20 Jun 2006) | 2 lines
Raise TestSkipped when the test socket connection is refused.
........
r47049 | brett.cannon | 2006-06-20 21:20:17 +0200 (Tue, 20 Jun 2006) | 2 lines
Fix typo of exception name.
........
r47053 | brett.cannon | 2006-06-21 18:57:57 +0200 (Wed, 21 Jun 2006) | 5 lines
At the C level, tuple arguments are passed in directly to the exception
constructor, meaning it is treated as *args, not as a single argument. This
means using the 'message' attribute won't work (until Py3K comes around),
and so one must grab from 'arg' to get the error number.
........
r47054 | andrew.kuchling | 2006-06-21 19:10:18 +0200 (Wed, 21 Jun 2006) | 1 line
Link to LibRef module documentation
........
r47055 | andrew.kuchling | 2006-06-21 19:17:10 +0200 (Wed, 21 Jun 2006) | 1 line
Note some of Barry's work
........
r47056 | andrew.kuchling | 2006-06-21 19:17:28 +0200 (Wed, 21 Jun 2006) | 1 line
Bump version
........
r47057 | georg.brandl | 2006-06-21 19:45:17 +0200 (Wed, 21 Jun 2006) | 3 lines
fix [ 1509132 ] compiler module builds incorrect AST for TryExceptFinally
........
r47058 | georg.brandl | 2006-06-21 19:52:36 +0200 (Wed, 21 Jun 2006) | 3 lines
Make test_fcntl aware of netbsd3.
........
r47059 | georg.brandl | 2006-06-21 19:53:17 +0200 (Wed, 21 Jun 2006) | 3 lines
Patch #1509001: expected skips for netbsd3.
........
r47060 | gerhard.haering | 2006-06-21 22:55:04 +0200 (Wed, 21 Jun 2006) | 2 lines
Removed call to enable_callback_tracebacks that slipped in by accident.
........
r47061 | armin.rigo | 2006-06-21 23:58:50 +0200 (Wed, 21 Jun 2006) | 13 lines
Fix for an obscure bug introduced by revs 46806 and 46808, with a test.
The problem of checking too eagerly for recursive calls is the
following: if a RuntimeError is caused by recursion, and if code needs
to normalize it immediately (as in the 2nd test), then
PyErr_NormalizeException() needs a call to the RuntimeError class to
instantiate it, and this hits the recursion limit again... causing
PyErr_NormalizeException() to never finish.
Moved this particular recursion check to slot_tp_call(), which is not
involved in instantiating built-in exceptions.
Backport candidate.
........
r47064 | neal.norwitz | 2006-06-22 08:30:50 +0200 (Thu, 22 Jun 2006) | 3 lines
Copy the wsgiref package during make install.
........
r47065 | neal.norwitz | 2006-06-22 08:35:30 +0200 (Thu, 22 Jun 2006) | 1 line
Reset the doc date to today for the automatic doc builds
........
r47067 | andrew.kuchling | 2006-06-22 15:10:23 +0200 (Thu, 22 Jun 2006) | 1 line
Mention how to suppress warnings
........
r47069 | georg.brandl | 2006-06-22 16:46:17 +0200 (Thu, 22 Jun 2006) | 3 lines
Set lineno correctly on list, tuple and dict literals.
........
r47070 | georg.brandl | 2006-06-22 16:46:46 +0200 (Thu, 22 Jun 2006) | 4 lines
Test for correct compilation of try-except-finally stmt.
Test for correct lineno on list, tuple, dict literals.
........
r47071 | fred.drake | 2006-06-22 17:50:08 +0200 (Thu, 22 Jun 2006) | 1 line
fix markup nit
........
r47072 | brett.cannon | 2006-06-22 18:49:14 +0200 (Thu, 22 Jun 2006) | 6 lines
'warning's was improperly requiring that a command-line Warning category be
both a subclass of Warning and a subclass of types.ClassType. The latter is no
longer true thanks to new-style exceptions.
Closes bug #1510580. Thanks to AMK for the test.
........
r47073 | ronald.oussoren | 2006-06-22 20:33:54 +0200 (Thu, 22 Jun 2006) | 3 lines
MacOSX: Add a message to the first screen of the installer that tells
users how to avoid updates to their shell profile.
........
r47074 | georg.brandl | 2006-06-22 21:02:18 +0200 (Thu, 22 Jun 2006) | 3 lines
Fix my name ;)
........
r47075 | thomas.heller | 2006-06-22 21:07:36 +0200 (Thu, 22 Jun 2006) | 2 lines
Small fixes, mostly in the markup.
........
r47076 | peter.astrand | 2006-06-22 22:06:46 +0200 (Thu, 22 Jun 2006) | 1 line
Make it possible to run test_subprocess.py on Python 2.2, which lacks test_support.is_resource_enabled.
........
r47077 | peter.astrand | 2006-06-22 22:21:26 +0200 (Thu, 22 Jun 2006) | 1 line
Applied patch #1506758: Prevent MemoryErrors with large MAXFD.
........
r47079 | neal.norwitz | 2006-06-23 05:32:44 +0200 (Fri, 23 Jun 2006) | 1 line
Fix refleak
........
r47080 | fred.drake | 2006-06-23 08:03:45 +0200 (Fri, 23 Jun 2006) | 9 lines
- SF bug #853506: IP6 address parsing in sgmllib
('[' and ']' were not accepted in unquoted attribute values)
- cleaned up tests of character and entity reference decoding so the
tests cover the documented relationships among handle_charref,
handle_entityref, convert_charref, convert_codepoint, and
convert_entityref, without bringing up Unicode issues that sgmllib
cannot be involved in
........
r47085 | andrew.kuchling | 2006-06-23 21:23:40 +0200 (Fri, 23 Jun 2006) | 11 lines
Fit Makefile for the Python doc environment better; this is a step toward
including the howtos in the build process.
* Put LaTeX output in ../paper-<whatever>/.
* Put HTML output in ../html/
* Explain some of the Makefile variables
* Remove some cruft dating to my environment (e.g. the 'web' target)
This makefile isn't currently invoked by the documentation build process,
so these changes won't destabilize anything.
........
r47086 | hyeshik.chang | 2006-06-23 23:16:18 +0200 (Fri, 23 Jun 2006) | 5 lines
Bug #1511381: codec_getstreamcodec() in codec.c is corrected to
omit a default "error" argument for NULL pointer. This allows
the parser to take a codec from cjkcodecs again.
(Reported by Taewook Kang and reviewed by Walter Doerwald)
........
r47091 | ronald.oussoren | 2006-06-25 22:44:16 +0200 (Sun, 25 Jun 2006) | 6 lines
Workaround for bug #1512124
Without this patch IDLE will get unresponsive when you open the debugger
window on OSX. This is both using the system Tcl/Tk on Tiger as the latest
universal download from tk-components.sf.net.
........
r47092 | ronald.oussoren | 2006-06-25 23:14:19 +0200 (Sun, 25 Jun 2006) | 3 lines
Drop the calldll demo's for macos, calldll isn't present anymore, no need
to keep the demo's around.
........
r47093 | ronald.oussoren | 2006-06-25 23:15:58 +0200 (Sun, 25 Jun 2006) | 3 lines
Use a path without a double slash to compile the .py files after installation
(macosx, binary installer). This fixes bug #1508369 for python 2.5.
........
r47094 | ronald.oussoren | 2006-06-25 23:19:06 +0200 (Sun, 25 Jun 2006) | 3 lines
Also install the .egg-info files in Lib. This will cause wsgiref.egg-info to
be installed.
........
r47097 | andrew.kuchling | 2006-06-26 14:40:02 +0200 (Mon, 26 Jun 2006) | 1 line
[Bug #1511998] Various comments from Nick Coghlan; thanks!
........
r47098 | andrew.kuchling | 2006-06-26 14:43:43 +0200 (Mon, 26 Jun 2006) | 1 line
Describe workaround for PyRange_New()'s removal
........
r47099 | andrew.kuchling | 2006-06-26 15:08:24 +0200 (Mon, 26 Jun 2006) | 5 lines
[Bug #1512163] Fix typo.
This change will probably break tests on FreeBSD buildbots, but I'll check in
a fix for that next.
........
r47100 | andrew.kuchling | 2006-06-26 15:12:16 +0200 (Mon, 26 Jun 2006) | 9 lines
[Bug #1512163] Use one set of locking methods, lockf();
remove the flock() calls.
On FreeBSD, the two methods lockf() and flock() end up using the same
mechanism and the second one fails. A Linux man page claims that the
two methods are orthogonal (so locks acquired one way don't interact
with locks acquired the other way) but that clearly must be false.
........
r47101 | andrew.kuchling | 2006-06-26 15:23:10 +0200 (Mon, 26 Jun 2006) | 5 lines
Add a test for a conflicting lock.
On slow machines, maybe the time intervals (2 sec, 0.5 sec) will be too tight.
I'll see how the buildbots like it.
........
r47103 | andrew.kuchling | 2006-06-26 16:33:24 +0200 (Mon, 26 Jun 2006) | 1 line
Windows doesn't have os.fork(). I'll just disable this test for now
........
r47106 | andrew.kuchling | 2006-06-26 19:00:35 +0200 (Mon, 26 Jun 2006) | 9 lines
Attempt to fix build failure on OS X and Debian alpha; the symptom is
consistent with os.wait() returning immediately because some other
subprocess had previously exited; the test suite then immediately
tries to lock the mailbox and gets an error saying it's already
locked.
To fix this, do a waitpid() so the test suite only continues once
the intended child process has exited.
........
r47113 | neal.norwitz | 2006-06-27 06:06:46 +0200 (Tue, 27 Jun 2006) | 1 line
Ignore some more warnings in the dynamic linker on an older gentoo
........
r47114 | neal.norwitz | 2006-06-27 06:09:13 +0200 (Tue, 27 Jun 2006) | 6 lines
Instead of doing a make test, run the regression tests out of the installed
copy. This will hopefully catch problems where directories are added
under Lib/ but not to Makefile.pre.in. This breaks out the 2 runs
of the test suite with and without -O which is also nicer.
........
r47115 | neal.norwitz | 2006-06-27 06:12:58 +0200 (Tue, 27 Jun 2006) | 5 lines
Fix SF bug #1513032, 'make install' failure on FreeBSD 5.3.
No need to install lib-old, it's empty in 2.5.
........
r47116 | neal.norwitz | 2006-06-27 06:23:06 +0200 (Tue, 27 Jun 2006) | 1 line
Test unimportant change to verify buildbot does not try to build
........
r47117 | neal.norwitz | 2006-06-27 06:26:30 +0200 (Tue, 27 Jun 2006) | 1 line
Try again: test unimportant change to verify buildbot does not try to build
........
r47118 | neal.norwitz | 2006-06-27 06:28:56 +0200 (Tue, 27 Jun 2006) | 1 line
Verify buildbot picks up these changes (really needs testing after last change to Makefile.pre.in)
........
r47121 | vinay.sajip | 2006-06-27 09:34:37 +0200 (Tue, 27 Jun 2006) | 1 line
Removed buggy exception handling in doRollover of rotating file handlers. Exceptions now propagate to caller.
........
r47123 | ronald.oussoren | 2006-06-27 12:08:25 +0200 (Tue, 27 Jun 2006) | 3 lines
MacOSX: fix rather dumb buglet that made it impossible to create extensions on
OSX 10.3 when using a binary distribution build on 10.4.
........
r47125 | tim.peters | 2006-06-27 13:52:49 +0200 (Tue, 27 Jun 2006) | 2 lines
Whitespace normalization.
........
r47128 | ronald.oussoren | 2006-06-27 14:53:52 +0200 (Tue, 27 Jun 2006) | 8 lines
Use staticly build copies of zlib and bzip2 to build the OSX installer, that
way the resulting binaries have a better change of running on 10.3.
This patch also updates the search logic for sleepycat db3/4, without this
patch you cannot use a sleepycat build with a non-standard prefix; with this
you can (at least on OSX) if you add the prefix to CPPFLAGS/LDFLAGS at
configure-time. This change is needed to build the binary installer for OSX.
........
r47131 | ronald.oussoren | 2006-06-27 17:45:32 +0200 (Tue, 27 Jun 2006) | 5 lines
macosx: Install a libpython2.5.a inside the framework as a symlink to the actual
dylib at the root of the framework, that way tools that expect a unix-like
install (python-config, but more importantly external products like
mod_python) work correctly.
........
r47137 | neal.norwitz | 2006-06-28 07:03:22 +0200 (Wed, 28 Jun 2006) | 4 lines
According to the man pages on Gentoo Linux and Tru64, EACCES or EAGAIN
can be returned if fcntl (lockf) fails. This fixes the test failure
on Tru64 by checking for either error rather than just EAGAIN.
........
r47139 | neal.norwitz | 2006-06-28 08:28:31 +0200 (Wed, 28 Jun 2006) | 5 lines
Fix bug #1512695: cPickle.loads could crash if it was interrupted with
a KeyboardInterrupt since PyTuple_Pack was passed a NULL.
Will backport.
........
r47142 | nick.coghlan | 2006-06-28 12:41:47 +0200 (Wed, 28 Jun 2006) | 1 line
Make full module name available as __module_name__ even when __name__ is set to something else (like '__main__')
........
r47143 | armin.rigo | 2006-06-28 12:49:51 +0200 (Wed, 28 Jun 2006) | 2 lines
A couple of crashers of the "won't fix" kind.
........
r47147 | andrew.kuchling | 2006-06-28 16:25:20 +0200 (Wed, 28 Jun 2006) | 1 line
[Bug #1508766] Add docs for uuid module; docs written by George Yoshida, with minor rearrangements by me.
........
r47148 | andrew.kuchling | 2006-06-28 16:27:21 +0200 (Wed, 28 Jun 2006) | 1 line
[Bug #1508766] Add docs for uuid module; this puts the module in the 'Internet Protocols' section. Arguably this module could also have gone in the chapters on strings or encodings, maybe even the crypto chapter. Fred, please move if you see fit.
........
r47151 | georg.brandl | 2006-06-28 22:23:25 +0200 (Wed, 28 Jun 2006) | 3 lines
Fix end_fill().
........
r47153 | trent.mick | 2006-06-28 22:30:41 +0200 (Wed, 28 Jun 2006) | 2 lines
Mention the expat upgrade and pyexpat fix I put in 2.5b1.
........
r47154 | fred.drake | 2006-06-29 02:51:53 +0200 (Thu, 29 Jun 2006) | 6 lines
SF bug #1504333: sgmlib should allow angle brackets in quoted values
(modified patch by Sam Ruby; changed to use separate REs for start and end
tags to reduce matching cost for end tags; extended tests; updated to avoid
breaking previous changes to support IPv6 addresses in unquoted attribute
values)
........
r47156 | fred.drake | 2006-06-29 04:57:48 +0200 (Thu, 29 Jun 2006) | 1 line
document recent bugfixes in sgmllib
........
r47158 | neal.norwitz | 2006-06-29 06:10:08 +0200 (Thu, 29 Jun 2006) | 10 lines
Add new utility function, reap_children(), to test_support. This should
be called at the end of each test that spawns children (perhaps it
should be called from regrtest instead?). This will hopefully prevent
some of the unexplained failures in the buildbots (hppa and alpha)
during tests that spawn children. The problems were not reproducible.
There were many zombies that remained at the end of several tests.
In the worst case, this shouldn't cause any more problems,
though it may not help either. Time will tell.
........
r47159 | neal.norwitz | 2006-06-29 07:48:14 +0200 (Thu, 29 Jun 2006) | 5 lines
This should fix the buildbot failure on s/390 which can't connect to gmail.org.
It makes the error message consistent and always sends to stderr.
It would be much better for all the networking tests to hit only python.org.
........
r47161 | thomas.heller | 2006-06-29 20:34:15 +0200 (Thu, 29 Jun 2006) | 3 lines
Protect the thread api calls in the _ctypes extension module within
#ifdef WITH_THREADS/#endif blocks. Found by Sam Rushing.
........
r47162 | martin.v.loewis | 2006-06-29 20:58:44 +0200 (Thu, 29 Jun 2006) | 2 lines
Patch #1509163: MS Toolkit Compiler no longer available
........
r47163 | skip.montanaro | 2006-06-29 21:20:09 +0200 (Thu, 29 Jun 2006) | 1 line
add string methods to index
........
r47164 | vinay.sajip | 2006-06-30 02:13:08 +0200 (Fri, 30 Jun 2006) | 1 line
Fixed bug in fileConfig() which failed to clear logging._handlerList
........
r47166 | tim.peters | 2006-06-30 08:18:39 +0200 (Fri, 30 Jun 2006) | 2 lines
Whitespace normalization.
........
r47170 | neal.norwitz | 2006-06-30 09:32:16 +0200 (Fri, 30 Jun 2006) | 1 line
Silence compiler warning
........
r47171 | neal.norwitz | 2006-06-30 09:32:46 +0200 (Fri, 30 Jun 2006) | 1 line
Another problem reported by Coverity. Backport candidate.
........
r47175 | thomas.heller | 2006-06-30 19:44:54 +0200 (Fri, 30 Jun 2006) | 2 lines
Revert the use of PY_FORMAT_SIZE_T in PyErr_Format.
........
r47176 | tim.peters | 2006-06-30 20:34:51 +0200 (Fri, 30 Jun 2006) | 2 lines
Remove now-unused fidding with PY_FORMAT_SIZE_T.
........
r47177 | georg.brandl | 2006-06-30 20:47:56 +0200 (Fri, 30 Jun 2006) | 3 lines
Document decorator usage of property.
........
r47181 | fred.drake | 2006-06-30 21:29:25 +0200 (Fri, 30 Jun 2006) | 4 lines
- consistency nit: always include "()" in \function and \method
(*should* be done by the presentation, but that requires changes all over)
- avoid spreading the __name meme
........
r47188 | vinay.sajip | 2006-07-01 12:45:20 +0200 (Sat, 01 Jul 2006) | 1 line
Added entry for fileConfig() bugfix.
........
r47189 | vinay.sajip | 2006-07-01 12:47:20 +0200 (Sat, 01 Jul 2006) | 1 line
Added duplicate call to fileConfig() to ensure that it cleans up after itself correctly.
........
r47190 | martin.v.loewis | 2006-07-01 17:33:37 +0200 (Sat, 01 Jul 2006) | 2 lines
Release all forwarded functions in .close. Fixes #1513223.
........
r47191 | fred.drake | 2006-07-01 18:28:20 +0200 (Sat, 01 Jul 2006) | 7 lines
SF bug #1296433 (Expat bug #1515266): Unchecked calls to character data
handler would cause a segfault. This merges in Expat's lib/xmlparse.c
revisions 1.154 and 1.155, which fix this and a closely related problem
(the later does not affect Python).
Moved the crasher test to the tests for xml.parsers.expat.
........
r47197 | gerhard.haering | 2006-07-02 19:48:30 +0200 (Sun, 02 Jul 2006) | 4 lines
The sqlite3 module did cut off data from the SQLite database at the first null
character before sending it to a custom converter. This has been fixed now.
........
r47198 | martin.v.loewis | 2006-07-02 20:44:00 +0200 (Sun, 02 Jul 2006) | 1 line
Correct arithmetic in access on Win32. Fixes #1513646.
........
r47203 | thomas.heller | 2006-07-03 09:58:09 +0200 (Mon, 03 Jul 2006) | 1 line
Cleanup: Remove commented out code.
........
r47204 | thomas.heller | 2006-07-03 09:59:50 +0200 (Mon, 03 Jul 2006) | 1 line
Don't run the doctests with Python 2.3 because it doesn't have the ELLIPSIS flag.
........
r47205 | thomas.heller | 2006-07-03 10:04:05 +0200 (Mon, 03 Jul 2006) | 7 lines
Fixes so that _ctypes can be compiled with the MingW compiler.
It seems that the definition of '__attribute__(x)' was responsible for
the compiler ignoring the '__fastcall' attribute on the
ffi_closure_SYSV function in libffi_msvc/ffi.c, took me quite some
time to figure this out.
........
r47206 | thomas.heller | 2006-07-03 10:08:14 +0200 (Mon, 03 Jul 2006) | 11 lines
Add a new function uses_seh() to the _ctypes extension module. This
will return True if Windows Structured Exception handling (SEH) is
used when calling functions, False otherwise.
Currently, only MSVC supports SEH.
Fix the test so that it doesn't crash when run with MingW compiled
_ctypes. Note that two tests are still failing when mingw is used, I
suspect structure layout differences and function calling conventions
between MSVC and MingW.
........
r47207 | tim.peters | 2006-07-03 10:23:19 +0200 (Mon, 03 Jul 2006) | 2 lines
Whitespace normalization.
........
r47208 | martin.v.loewis | 2006-07-03 11:44:00 +0200 (Mon, 03 Jul 2006) | 3 lines
Only setup canvas when it is first created.
Fixes #1514703
........
r47209 | martin.v.loewis | 2006-07-03 12:05:30 +0200 (Mon, 03 Jul 2006) | 3 lines
Reimplement turtle.circle using a polyline, to allow correct
filling of arcs. Also fixes #1514693.
........
r47210 | martin.v.loewis | 2006-07-03 12:19:49 +0200 (Mon, 03 Jul 2006) | 3 lines
Bug #1514693: Update turtle's heading when switching between
degrees and radians.
........
r47211 | martin.v.loewis | 2006-07-03 13:12:06 +0200 (Mon, 03 Jul 2006) | 2 lines
Document functions added in 2.3 and 2.5.
........
r47212 | martin.v.loewis | 2006-07-03 14:19:50 +0200 (Mon, 03 Jul 2006) | 3 lines
Bug #1417699: Reject locale-specific decimal point in float()
and atof().
........
r47213 | martin.v.loewis | 2006-07-03 14:28:58 +0200 (Mon, 03 Jul 2006) | 3 lines
Bug #1267547: Put proper recursive setup.py call into the
spec file generated by bdist_rpm.
........
r47215 | martin.v.loewis | 2006-07-03 15:01:35 +0200 (Mon, 03 Jul 2006) | 3 lines
Patch #825417: Fix timeout processing in expect,
read_until. Will backport to 2.4.
........
r47218 | martin.v.loewis | 2006-07-03 15:47:40 +0200 (Mon, 03 Jul 2006) | 2 lines
Put method-wrappers into trashcan. Fixes #927248.
........
r47219 | andrew.kuchling | 2006-07-03 16:07:30 +0200 (Mon, 03 Jul 2006) | 1 line
[Bug #1515932] Clarify description of slice assignment
........
r47220 | andrew.kuchling | 2006-07-03 16:16:09 +0200 (Mon, 03 Jul 2006) | 4 lines
[Bug #1511911] Clarify description of optional arguments to sorted()
by improving the xref to the section on lists, and by
copying the explanations of the arguments (with a slight modification).
........
r47223 | kristjan.jonsson | 2006-07-03 16:59:05 +0200 (Mon, 03 Jul 2006) | 1 line
Fix build problems with the platform SDK on windows. It is not sufficient to test for the C compiler version when determining if we have the secure CRT from microsoft. Must test with an undocumented macro, __STDC_SECURE_LIB__ too.
........
r47224 | ronald.oussoren | 2006-07-04 14:30:22 +0200 (Tue, 04 Jul 2006) | 7 lines
Sync the darwin/x86 port libffi with the copy in PyObjC. This fixes a number
of bugs in that port. The most annoying ones were due to some subtle differences
between the document ABI and the actual implementation :-(
(there are no python unittests that fail without this patch, but without it
some of libffi's unittests fail).
........
r47234 | georg.brandl | 2006-07-05 10:21:00 +0200 (Wed, 05 Jul 2006) | 3 lines
Remove remaining references to OverflowWarning.
........
r47236 | thomas.heller | 2006-07-05 11:13:56 +0200 (Wed, 05 Jul 2006) | 3 lines
Fix the bitfield test when _ctypes is compiled with MingW. Structures
containing bitfields may have different layout on MSVC and MingW .
........
r47237 | thomas.wouters | 2006-07-05 13:03:49 +0200 (Wed, 05 Jul 2006) | 15 lines
Fix bug in passing tuples to string.Template. All other values (with working
str() or repr()) would work, just not multi-value tuples. Probably not a
backport candidate, since it changes the behaviour of passing a
single-element tuple:
>>> string.Template("$foo").substitute(dict(foo=(1,)))
'(1,)'
versus
'1'
........
r47241 | georg.brandl | 2006-07-05 16:18:45 +0200 (Wed, 05 Jul 2006) | 2 lines
Patch #1517490: fix glitches in filter() docs.
........
r47244 | georg.brandl | 2006-07-05 17:50:05 +0200 (Wed, 05 Jul 2006) | 2 lines
no need to elaborate "string".
........
r47251 | neal.norwitz | 2006-07-06 06:28:59 +0200 (Thu, 06 Jul 2006) | 3 lines
Fix refleaks reported by Shane Hathaway in SF patch #1515361. This change
contains only the changes related to leaking the copy variable.
........
r47253 | fred.drake | 2006-07-06 07:13:22 +0200 (Thu, 06 Jul 2006) | 4 lines
- back out Expat change; the final fix to Expat will be different
- change the pyexpat wrapper to not be so sensitive to this detail of the
Expat implementation (the ex-crasher test still passes)
........
r47257 | neal.norwitz | 2006-07-06 08:45:08 +0200 (Thu, 06 Jul 2006) | 1 line
Add a NEWS entry for a recent pyexpat fix
........
r47258 | martin.v.loewis | 2006-07-06 08:55:58 +0200 (Thu, 06 Jul 2006) | 2 lines
Add sqlite3.dll to the DLLs component, not to the TkDLLs component.
Fixes #1517388.
........
r47259 | martin.v.loewis | 2006-07-06 09:05:21 +0200 (Thu, 06 Jul 2006) | 1 line
Properly quote compileall and Lib paths in case TARGETDIR has a space.
........
r47260 | thomas.heller | 2006-07-06 09:50:18 +0200 (Thu, 06 Jul 2006) | 5 lines
Revert the change done in svn revision 47206:
Add a new function uses_seh() to the _ctypes extension module. This
will return True if Windows Structured Exception handling (SEH) is
used when calling functions, False otherwise.
........
r47261 | armin.rigo | 2006-07-06 09:58:18 +0200 (Thu, 06 Jul 2006) | 3 lines
A couple of examples about how to attack the fact that _PyType_Lookup()
returns a borrowed ref. Many of the calls are open to attack.
........
r47262 | thomas.heller | 2006-07-06 10:28:14 +0200 (Thu, 06 Jul 2006) | 2 lines
The test that calls a function with invalid arguments and catches the
resulting Windows access violation will not be run by default.
........
r47263 | thomas.heller | 2006-07-06 10:48:35 +0200 (Thu, 06 Jul 2006) | 5 lines
Patch #1517790: It is now possible to use custom objects in the ctypes
foreign function argtypes sequence as long as they provide a
from_param method, no longer is it required that the object is a
ctypes type.
........
r47264 | thomas.heller | 2006-07-06 10:58:40 +0200 (Thu, 06 Jul 2006) | 2 lines
Document the Struture and Union constructors.
........
r47265 | thomas.heller | 2006-07-06 11:11:22 +0200 (Thu, 06 Jul 2006) | 2 lines
Document the changes in svn revision 47263, from patch #1517790.
........
r47267 | ronald.oussoren | 2006-07-06 12:13:35 +0200 (Thu, 06 Jul 2006) | 7 lines
This patch solves the problem Skip was seeing with zlib, this patch ensures that
configure uses similar compiler flags as setup.py when doing the zlib test.
Without this patch configure would use the first shared library on the linker
path, with this patch it uses the first shared or static library on that path
just like setup.py.
........
r47268 | thomas.wouters | 2006-07-06 12:48:28 +0200 (Thu, 06 Jul 2006) | 4 lines
NEWS entry for r47267: fixing configure's zlib probing.
........
r47269 | fredrik.lundh | 2006-07-06 14:29:24 +0200 (Thu, 06 Jul 2006) | 3 lines
added XMLParser alias for cElementTree compatibility
........
r47271 | nick.coghlan | 2006-07-06 14:53:04 +0200 (Thu, 06 Jul 2006) | 1 line
Revert the __module_name__ changes made in rev 47142. We'll revisit this in Python 2.6
........
r47272 | nick.coghlan | 2006-07-06 15:04:56 +0200 (Thu, 06 Jul 2006) | 1 line
Update the tutorial section on relative imports
........
r47273 | nick.coghlan | 2006-07-06 15:35:27 +0200 (Thu, 06 Jul 2006) | 1 line
Ignore ImportWarning by default
........
r47274 | nick.coghlan | 2006-07-06 15:41:34 +0200 (Thu, 06 Jul 2006) | 1 line
Cover ImportWarning, PendingDeprecationWarning and simplefilter() in the warnings module docs
........
r47275 | nick.coghlan | 2006-07-06 15:47:18 +0200 (Thu, 06 Jul 2006) | 1 line
Add NEWS entries for the ImportWarning change and documentation update
........
r47276 | andrew.kuchling | 2006-07-06 15:57:28 +0200 (Thu, 06 Jul 2006) | 1 line
ImportWarning is now silent by default
........
r47277 | thomas.heller | 2006-07-06 17:06:05 +0200 (Thu, 06 Jul 2006) | 2 lines
Document the correct return type of PyLong_AsUnsignedLongLongMask.
........
r47278 | hyeshik.chang | 2006-07-06 17:21:52 +0200 (Thu, 06 Jul 2006) | 2 lines
Add a testcase for r47086 which fixed a bug in codec_getstreamcodec().
........
r47279 | hyeshik.chang | 2006-07-06 17:39:24 +0200 (Thu, 06 Jul 2006) | 3 lines
Test using all CJK encodings for the testcases which don't require
specific encodings.
........
r47280 | martin.v.loewis | 2006-07-06 21:28:03 +0200 (Thu, 06 Jul 2006) | 2 lines
Properly generate logical file ids. Fixes #1515998.
Also correct typo in Control.mapping.
........
r47287 | neal.norwitz | 2006-07-07 08:03:15 +0200 (Fri, 07 Jul 2006) | 17 lines
Restore rev 47014:
The hppa ubuntu box sometimes hangs forever in these tests. My guess
is that the wait is failing for some reason. Use WNOHANG, so we won't
wait until the buildbot kills the test suite.
I haven't been able to reproduce the failure, so I'm not sure if
this will help or not. Hopefully, this change will cause the test
to fail, rather than hang. That will be better since we will get
the rest of the test results. It may also help us debug the real problem.
*** The reason this originally failed was because there were many
zombie children outstanding before rev 47158 cleaned them up.
There are still hangs in test_subprocess that need to be addressed,
but that will take more work. This should close some holes.
........
r47289 | georg.brandl | 2006-07-07 10:15:12 +0200 (Fri, 07 Jul 2006) | 3 lines
Fix RFC number.
........
r50489 | neal.norwitz | 2006-07-08 07:31:37 +0200 (Sat, 08 Jul 2006) | 1 line
Fix SF bug #1519018: 'as' is now validated properly in import statements
........
r50490 | georg.brandl | 2006-07-08 14:15:27 +0200 (Sat, 08 Jul 2006) | 3 lines
Add an additional test for bug #1519018.
........
r50491 | tim.peters | 2006-07-08 21:55:05 +0200 (Sat, 08 Jul 2006) | 2 lines
Whitespace normalization.
........
r50493 | neil.schemenauer | 2006-07-09 18:16:34 +0200 (Sun, 09 Jul 2006) | 2 lines
Fix AST compiler bug #1501934: incorrect LOAD/STORE_GLOBAL generation.
........
r50495 | neil.schemenauer | 2006-07-09 23:19:29 +0200 (Sun, 09 Jul 2006) | 2 lines
Fix SF bug 1441486: bad unary minus folding in compiler.
........
r50497 | neal.norwitz | 2006-07-10 00:14:42 +0200 (Mon, 10 Jul 2006) | 4 lines
On 64 bit systems, int literals that use less than 64 bits are now ints
rather than longs. This also fixes the test for eval(-sys.maxint - 1).
........
r50500 | neal.norwitz | 2006-07-10 02:04:44 +0200 (Mon, 10 Jul 2006) | 4 lines
Bug #1512814, Fix incorrect lineno's when code at module scope
started after line 256.
........
r50501 | neal.norwitz | 2006-07-10 02:05:34 +0200 (Mon, 10 Jul 2006) | 1 line
Fix doco. Backport candidate.
........
r50503 | neal.norwitz | 2006-07-10 02:23:17 +0200 (Mon, 10 Jul 2006) | 5 lines
Part of SF patch #1484695. This removes dead code. The chksum was
already verified in .frombuf() on the lines above. If there was
a problem an exception is raised, so there was no way this condition
could have been true.
........
r50504 | neal.norwitz | 2006-07-10 03:18:57 +0200 (Mon, 10 Jul 2006) | 3 lines
Patch #1516912: improve Modules support for OpenVMS.
........
r50506 | neal.norwitz | 2006-07-10 04:36:41 +0200 (Mon, 10 Jul 2006) | 7 lines
Patch #1504046: Add documentation for xml.etree.
/F wrote the text docs, Englebert Gruber massaged it to latex and I
did some more massaging to try and improve the consistency and
fix some name mismatches between the declaration and text.
........
r50509 | martin.v.loewis | 2006-07-10 09:23:48 +0200 (Mon, 10 Jul 2006) | 2 lines
Introduce DISTUTILS_USE_SDK as a flag to determine whether the
SDK environment should be used. Fixes #1508010.
........
r50510 | martin.v.loewis | 2006-07-10 09:26:41 +0200 (Mon, 10 Jul 2006) | 1 line
Change error message to indicate that VS2003 is necessary to build extension modules, not the .NET SDK.
........
r50511 | martin.v.loewis | 2006-07-10 09:29:41 +0200 (Mon, 10 Jul 2006) | 1 line
Add svn:ignore.
........
r50512 | anthony.baxter | 2006-07-10 09:41:04 +0200 (Mon, 10 Jul 2006) | 1 line
preparing for 2.5b2
........
r50513 | thomas.heller | 2006-07-10 11:10:28 +0200 (Mon, 10 Jul 2006) | 2 lines
Fix bug #1518190: accept any integer or long value in the
ctypes.c_void_p constructor.
........
r50514 | thomas.heller | 2006-07-10 11:31:06 +0200 (Mon, 10 Jul 2006) | 3 lines
Fixed a segfault when ctypes.wintypes were imported on
non-Windows machines.
........
r50516 | thomas.heller | 2006-07-10 13:11:10 +0200 (Mon, 10 Jul 2006) | 3 lines
Assigning None to pointer type structure fields possible overwrote
wrong fields.
........
r50517 | thomas.heller | 2006-07-10 13:17:37 +0200 (Mon, 10 Jul 2006) | 5 lines
Moved the ctypes news entries from the 'Library' section into the
'Extension Modules' section where they belong, probably.
This destroyes the original order of the news entries, don't know
if that is important or not.
........
r50526 | phillip.eby | 2006-07-10 21:03:29 +0200 (Mon, 10 Jul 2006) | 2 lines
Fix SF#1516184 and add a test to prevent regression.
........
r50528 | phillip.eby | 2006-07-10 21:18:35 +0200 (Mon, 10 Jul 2006) | 2 lines
Fix SF#1457312: bad socket error handling in distutils "upload" command.
........
r50537 | peter.astrand | 2006-07-10 22:39:49 +0200 (Mon, 10 Jul 2006) | 1 line
Make it possible to run test_subprocess.py with Python 2.2, which lacks test_support.reap_children().
........
r50541 | tim.peters | 2006-07-10 23:08:24 +0200 (Mon, 10 Jul 2006) | 5 lines
After approval from Anthony, merge the tim-current_frames
branch into the trunk. This adds a new sys._current_frames()
function, which returns a dict mapping thread id to topmost
thread stack frame.
........
r50542 | tim.peters | 2006-07-10 23:11:49 +0200 (Mon, 10 Jul 2006) | 2 lines
Whitespace normalization.
........
r50553 | martin.v.loewis | 2006-07-11 00:11:28 +0200 (Tue, 11 Jul 2006) | 4 lines
Patch #1519566: Remove unused _tofill member.
Make begin_fill idempotent.
Update demo2 to demonstrate filling of concave shapes.
........
r50567 | anthony.baxter | 2006-07-11 04:04:09 +0200 (Tue, 11 Jul 2006) | 4 lines
#1494314: Fix a regression with high-numbered sockets in 2.4.3. This
means that select() on sockets > FD_SETSIZE (typically 1024) work again.
The patch makes sockets use poll() internally where available.
........
r50568 | tim.peters | 2006-07-11 04:17:48 +0200 (Tue, 11 Jul 2006) | 2 lines
Whitespace normalization.
........
r50575 | thomas.heller | 2006-07-11 18:42:05 +0200 (Tue, 11 Jul 2006) | 1 line
Add missing Py_DECREF.
........
r50576 | thomas.heller | 2006-07-11 18:44:25 +0200 (Tue, 11 Jul 2006) | 1 line
Add missing Py_DECREFs.
........
r50579 | andrew.kuchling | 2006-07-11 19:20:16 +0200 (Tue, 11 Jul 2006) | 1 line
Bump version number; add sys._current_frames
........
r50582 | thomas.heller | 2006-07-11 20:28:35 +0200 (Tue, 11 Jul 2006) | 3 lines
When a foreign function is retrived by calling __getitem__ on a ctypes
library instance, do not set it as attribute.
........
r50583 | thomas.heller | 2006-07-11 20:40:50 +0200 (Tue, 11 Jul 2006) | 2 lines
Change the ctypes version number to 1.0.0.
........
r50597 | neal.norwitz | 2006-07-12 07:26:17 +0200 (Wed, 12 Jul 2006) | 3 lines
Bug #1520864: unpacking singleton tuples in for loop (for x, in) work again.
........
r50598 | neal.norwitz | 2006-07-12 07:26:35 +0200 (Wed, 12 Jul 2006) | 1 line
Fix function name in error msg
........
r50599 | neal.norwitz | 2006-07-12 07:27:46 +0200 (Wed, 12 Jul 2006) | 4 lines
Fix uninitialized memory read reported by Valgrind when running doctest.
This could happen if size == 0.
........
r50600 | neal.norwitz | 2006-07-12 09:28:29 +0200 (Wed, 12 Jul 2006) | 1 line
Actually change the MAGIC #. Create a new section for 2.5c1 and mention the impact of changing the MAGIC #.
........
r50601 | thomas.heller | 2006-07-12 10:43:47 +0200 (Wed, 12 Jul 2006) | 3 lines
Fix #1467450: ctypes now uses RTLD_GLOBAL by default on OSX 10.3 to
load shared libraries.
........
r50604 | thomas.heller | 2006-07-12 16:25:18 +0200 (Wed, 12 Jul 2006) | 3 lines
Fix the wrong description of LibraryLoader.LoadLibrary, and document
the DEFAULT_MODE constant.
........
r50607 | georg.brandl | 2006-07-12 17:31:17 +0200 (Wed, 12 Jul 2006) | 3 lines
Accept long options "--help" and "--version".
........
r50617 | thomas.heller | 2006-07-13 11:53:47 +0200 (Thu, 13 Jul 2006) | 3 lines
A misspelled preprocessor symbol caused ctypes to be always compiled
without thread support. Replaced WITH_THREADS with WITH_THREAD.
........
r50619 | thomas.heller | 2006-07-13 19:01:14 +0200 (Thu, 13 Jul 2006) | 3 lines
Fix #1521375. When running with root priviledges, 'gcc -o /dev/null'
did overwrite /dev/null. Use a temporary file instead of /dev/null.
........
r50620 | thomas.heller | 2006-07-13 19:05:13 +0200 (Thu, 13 Jul 2006) | 2 lines
Fix misleading words.
........
r50622 | andrew.kuchling | 2006-07-13 19:37:26 +0200 (Thu, 13 Jul 2006) | 1 line
Typo fix
........
r50629 | georg.brandl | 2006-07-14 09:12:54 +0200 (Fri, 14 Jul 2006) | 3 lines
Patch #1521874: grammar errors in doanddont.tex.
........
r50630 | neal.norwitz | 2006-07-14 09:20:04 +0200 (Fri, 14 Jul 2006) | 1 line
Try to improve grammar further.
........
r50631 | martin.v.loewis | 2006-07-14 11:58:55 +0200 (Fri, 14 Jul 2006) | 1 line
Extend build_ssl to Win64, using VSExtComp.
........
r50632 | martin.v.loewis | 2006-07-14 14:10:09 +0200 (Fri, 14 Jul 2006) | 1 line
Add debug output to analyse buildbot failure.
........
r50633 | martin.v.loewis | 2006-07-14 14:31:05 +0200 (Fri, 14 Jul 2006) | 1 line
Fix Debug build of _ssl.
........
r50636 | andrew.kuchling | 2006-07-14 15:32:38 +0200 (Fri, 14 Jul 2006) | 1 line
Mention new options
........
r50638 | peter.astrand | 2006-07-14 16:04:45 +0200 (Fri, 14 Jul 2006) | 1 line
Bug #1223937: CalledProcessError.errno -> CalledProcessError.returncode.
........
r50640 | thomas.heller | 2006-07-14 17:01:05 +0200 (Fri, 14 Jul 2006) | 4 lines
Make the prototypes of our private PyUnicode_FromWideChar and
PyUnicode_AsWideChar replacement functions compatible to the official
functions by using Py_ssize_t instead of int.
........
r50643 | thomas.heller | 2006-07-14 19:51:14 +0200 (Fri, 14 Jul 2006) | 3 lines
Patch #1521817: The index range checking on ctypes arrays containing
exactly one element is enabled again.
........
r50647 | thomas.heller | 2006-07-14 20:22:50 +0200 (Fri, 14 Jul 2006) | 2 lines
Updates for the ctypes documentation.
........
r50655 | fredrik.lundh | 2006-07-14 23:45:48 +0200 (Fri, 14 Jul 2006) | 3 lines
typo
........
r50664 | george.yoshida | 2006-07-15 18:03:49 +0200 (Sat, 15 Jul 2006) | 2 lines
Bug #15187702 : ext/win-cookbook.html has a broken link to distutils
........
r50667 | bob.ippolito | 2006-07-15 18:53:15 +0200 (Sat, 15 Jul 2006) | 1 line
Patch #1220874: Update the binhex module for Mach-O.
........
r50671 | fred.drake | 2006-07-16 03:21:20 +0200 (Sun, 16 Jul 2006) | 1 line
clean up some link markup
........
r50673 | neal.norwitz | 2006-07-16 03:50:38 +0200 (Sun, 16 Jul 2006) | 4 lines
Bug #1512814, Fix incorrect lineno's when code within a function
had more than 255 blank lines. Byte codes need to go first, line #s second.
........
r50674 | neal.norwitz | 2006-07-16 04:00:32 +0200 (Sun, 16 Jul 2006) | 5 lines
a & b were dereffed above, so they are known to be valid pointers.
z is known to be NULL, nothing to DECREF.
Reported by Klockwork, #107.
........
r50675 | neal.norwitz | 2006-07-16 04:02:57 +0200 (Sun, 16 Jul 2006) | 5 lines
self is dereffed (and passed as first arg), so it's known to be good.
func is returned from PyArg_ParseTuple and also dereffed.
Reported by Klocwork, #30 (self one at least).
........
r50676 | neal.norwitz | 2006-07-16 04:05:35 +0200 (Sun, 16 Jul 2006) | 4 lines
proto was dereffed above and is known to be good. No need for X.
Reported by Klocwork, #39.
........
r50677 | neal.norwitz | 2006-07-16 04:15:27 +0200 (Sun, 16 Jul 2006) | 5 lines
Fix memory leaks in some conditions.
Reported by Klocwork #152.
........
r50678 | neal.norwitz | 2006-07-16 04:17:36 +0200 (Sun, 16 Jul 2006) | 4 lines
Fix memory leak under some conditions.
Reported by Klocwork, #98.
........
r50679 | neal.norwitz | 2006-07-16 04:22:30 +0200 (Sun, 16 Jul 2006) | 8 lines
Use sizeof(buffer) instead of duplicating the constants to ensure they won't
be wrong.
The real change is to pass (bufsz - 1) to PyOS_ascii_formatd and 1
to strncat. strncat copies n+1 bytes from src (not dest).
Reported by Klocwork #58.
........
r50680 | neal.norwitz | 2006-07-16 04:32:03 +0200 (Sun, 16 Jul 2006) | 5 lines
Handle a NULL name properly.
Reported by Klocwork #67
........
r50681 | neal.norwitz | 2006-07-16 04:35:47 +0200 (Sun, 16 Jul 2006) | 6 lines
PyFunction_SetDefaults() is documented as taking None or a tuple.
A NULL would crash the PyTuple_Check(). Now make NULL return a SystemError.
Reported by Klocwork #73.
........
r50683 | neal.norwitz | 2006-07-17 02:55:45 +0200 (Mon, 17 Jul 2006) | 5 lines
Stop INCREFing name, then checking if it's NULL. name (f_name) should never
be NULL so assert it. Fix one place where we could have passed NULL.
Reported by Klocwork #66.
........
r50684 | neal.norwitz | 2006-07-17 02:57:15 +0200 (Mon, 17 Jul 2006) | 5 lines
otherset is known to be non-NULL based on checks before and DECREF after.
DECREF otherset rather than XDECREF in error conditions too.
Reported by Klockwork #154.
........
r50685 | neal.norwitz | 2006-07-17 02:59:04 +0200 (Mon, 17 Jul 2006) | 7 lines
Reported by Klocwork #151.
v2 can be NULL if exception2 is NULL. I don't think that condition can happen,
but I'm not sure it can't either. Now the code will protect against either
being NULL.
........
r50686 | neal.norwitz | 2006-07-17 03:00:16 +0200 (Mon, 17 Jul 2006) | 1 line
Add NEWS entry for a bunch of fixes due to warnings produced by Klocworks static analysis tool.
........
r50687 | fred.drake | 2006-07-17 07:47:52 +0200 (Mon, 17 Jul 2006) | 3 lines
document xmlcore (still minimal; needs mention in each of the xml.* modules)
SF bug #1504456 (partial)
........
r50688 | georg.brandl | 2006-07-17 15:23:46 +0200 (Mon, 17 Jul 2006) | 3 lines
Remove usage of sets module (patch #1500609).
........
r50689 | georg.brandl | 2006-07-17 15:26:33 +0200 (Mon, 17 Jul 2006) | 3 lines
Add missing NEWS item (#1522771)
........
r50690 | andrew.kuchling | 2006-07-17 18:47:54 +0200 (Mon, 17 Jul 2006) | 1 line
Attribute more features
........
r50692 | kurt.kaiser | 2006-07-17 23:59:27 +0200 (Mon, 17 Jul 2006) | 8 lines
Patch 1479219 - Tal Einat
1. 'as' highlighted as builtin in comment string on import line
2. Comments such as "#False identity" which start with a keyword immediately
after the '#' character aren't colored as comments.
3. u or U beginning unicode string not correctly highlighted
Closes bug 1325071
........
r50693 | barry.warsaw | 2006-07-18 01:07:51 +0200 (Tue, 18 Jul 2006) | 16 lines
decode_rfc2231(): Be more robust against buggy RFC 2231 encodings.
Specifically, instead of raising a ValueError when there is a single tick in
the parameter, simply return that the entire string unquoted, with None for
both the charset and the language. Also, if there are more than 2 ticks in
the parameter, interpret the first three parts as the standard RFC 2231 parts,
then the rest of the parts as the encoded string.
Test cases added.
Original fewer-than-3-parts fix by Tokio Kikuchi.
Resolves SF bug # 1218081. I will back port the fix and tests to Python 2.4
(email 3.0) and Python 2.3 (email 2.5).
Also, bump the version number to email 4.0.1, removing the 'alpha' moniker.
........
r50695 | kurt.kaiser | 2006-07-18 06:03:16 +0200 (Tue, 18 Jul 2006) | 2 lines
Rebinding Tab key was inserting 'tab' instead of 'Tab'. Bug 1179168.
........
r50696 | brett.cannon | 2006-07-18 06:41:36 +0200 (Tue, 18 Jul 2006) | 6 lines
Fix bug #1520914. Starting in 2.4, time.strftime() began to check the bounds
of values in the time tuple passed in. Unfortunately people came to rely on
undocumented behaviour of setting unneeded values to 0, regardless of if it was
within the valid range. Now those values force the value internally to the
minimum value when 0 is passed in.
........
r50697 | facundo.batista | 2006-07-18 14:16:13 +0200 (Tue, 18 Jul 2006) | 1 line
Comments and docs cleanups, and some little fixes, provided by Santiágo Peresón
........
r50704 | martin.v.loewis | 2006-07-18 19:46:31 +0200 (Tue, 18 Jul 2006) | 2 lines
Patch #1524429: Use repr instead of backticks again.
........
r50706 | tim.peters | 2006-07-18 23:55:15 +0200 (Tue, 18 Jul 2006) | 2 lines
Whitespace normalization.
........
r50708 | tim.peters | 2006-07-19 02:03:19 +0200 (Wed, 19 Jul 2006) | 18 lines
SF bug 1524317: configure --without-threads fails to build
Moved the code for _PyThread_CurrentFrames() up, so it's no longer
in a huge "#ifdef WITH_THREAD" block (I didn't realize it /was/ in
one).
Changed test_sys's test_current_frames() so it passes with or without
thread supported compiled in.
Note that test_sys fails when Python is compiled without threads,
but for an unrelated reason (the old test_exit() fails with an
indirect ImportError on the `thread` module). There are also
other unrelated compilation failures without threads, in extension
modules (like ctypes); at least the core compiles again.
Do we really support --without-threads? If so, there are several
problems remaining.
........
r50713 | thomas.heller | 2006-07-19 11:09:32 +0200 (Wed, 19 Jul 2006) | 4 lines
Make sure the _ctypes extension can be compiled when WITH_THREAD is
not defined on Windows, even if that configuration is probably not
supported at all.
........
r50715 | martin.v.loewis | 2006-07-19 19:18:32 +0200 (Wed, 19 Jul 2006) | 4 lines
Revert r50706 (Whitespace normalization) and
r50697: Comments and docs cleanups, and some little fixes
per recommendation from Raymond Hettinger.
........
r50719 | phillip.eby | 2006-07-20 17:54:16 +0200 (Thu, 20 Jul 2006) | 4 lines
Fix SF#1516184 (again) and add a test to prevent regression.
(There was a problem with empty filenames still causing recursion)
........
r50720 | georg.brandl | 2006-07-20 18:28:39 +0200 (Thu, 20 Jul 2006) | 3 lines
Guard for _active being None in __del__ method.
........
r50721 | vinay.sajip | 2006-07-20 18:28:39 +0200 (Thu, 20 Jul 2006) | 1 line
Updated documentation for TimedRotatingFileHandler relating to how rollover files are named. The previous documentation was wrongly the same as for RotatingFileHandler.
........
r50731 | fred.drake | 2006-07-20 22:11:57 +0200 (Thu, 20 Jul 2006) | 1 line
markup fix
........
r50739 | kurt.kaiser | 2006-07-21 00:22:52 +0200 (Fri, 21 Jul 2006) | 7 lines
Avoid occasional failure to detect closing paren properly.
Patch 1407280 Tal Einat
M ParenMatch.py
M NEWS.txt
M CREDITS.txt
........
r50740 | vinay.sajip | 2006-07-21 01:20:12 +0200 (Fri, 21 Jul 2006) | 1 line
Addressed SF#1524081 by using a dictionary to map level names to syslog priority names, rather than a string.lower().
........
r50741 | neal.norwitz | 2006-07-21 07:29:58 +0200 (Fri, 21 Jul 2006) | 1 line
Add some asserts that we got good params passed
........
r50742 | neal.norwitz | 2006-07-21 07:31:02 +0200 (Fri, 21 Jul 2006) | 5 lines
Move the initialization of some pointers earlier. The problem is
that if we call Py_DECREF(frame) like we do if allocating locals fails,
frame_dealloc() will try to use these bogus values and crash.
........
r50743 | neal.norwitz | 2006-07-21 07:32:28 +0200 (Fri, 21 Jul 2006) | 4 lines
Handle allocation failures gracefully. Found with failmalloc.
Many (all?) of these could be backported.
........
r50745 | neal.norwitz | 2006-07-21 09:59:02 +0200 (Fri, 21 Jul 2006) | 1 line
Speel initialise write. Tanks Anthony.
........
r50746 | neal.norwitz | 2006-07-21 09:59:47 +0200 (Fri, 21 Jul 2006) | 2 lines
Handle more memory allocation failures without crashing.
........
r50754 | barry.warsaw | 2006-07-21 16:51:07 +0200 (Fri, 21 Jul 2006) | 23 lines
More RFC 2231 improvements for the email 4.0 package. As Mark Sapiro rightly
points out there are really two types of continued headers defined in this
RFC (i.e. "encoded" parameters with the form "name*0*=" and unencoded
parameters with the form "name*0="), but we were were handling them both the
same way and that isn't correct.
This patch should be much more RFC compliant in that only encoded params are
%-decoded and the charset/language information is only extract if there are
any encoded params in the segments. If there are no encoded params then the
RFC says that there will be no charset/language parts.
Note however that this will change the return value for Message.get_param() in
some cases. For example, whereas before if you had all unencoded param
continuations you would have still gotten a 3-tuple back from this method
(with charset and language == None), you will now get just a string. I don't
believe this is a backward incompatible change though because the
documentation for this method already indicates that either return value is
possible and that you must do an isinstance(val, tuple) check to discriminate
between the two. (Yeah that API kind of sucks but we can't change /that/
without breaking code.)
Test cases, some documentation updates, and a NEWS item accompany this patch.
........
r50759 | georg.brandl | 2006-07-21 19:36:31 +0200 (Fri, 21 Jul 2006) | 3 lines
Fix check for empty list (vs. None).
........
r50771 | brett.cannon | 2006-07-22 00:44:07 +0200 (Sat, 22 Jul 2006) | 2 lines
Remove an XXX marker in a comment.
........
r50773 | neal.norwitz | 2006-07-22 18:20:49 +0200 (Sat, 22 Jul 2006) | 1 line
Fix more memory allocation issues found with failmalloc.
........
r50774 | neal.norwitz | 2006-07-22 19:00:57 +0200 (Sat, 22 Jul 2006) | 1 line
Don't fail if the directory already exists
........
r50775 | greg.ward | 2006-07-23 04:25:53 +0200 (Sun, 23 Jul 2006) | 6 lines
Be a lot smarter about whether this test passes: instead of assuming
that a 2.93 sec audio file will always take 3.1 sec (as it did on the
hardware I had when I first wrote the test), expect that it will take
2.93 sec +/- 10%, and only fail if it's outside of that range.
Compute the expected
........
r50776 | kurt.kaiser | 2006-07-23 06:19:49 +0200 (Sun, 23 Jul 2006) | 2 lines
Tooltips failed on new-syle class __init__ args. Bug 1027566 Loren Guthrie
........
r50777 | neal.norwitz | 2006-07-23 09:50:36 +0200 (Sun, 23 Jul 2006) | 1 line
Handle more mem alloc issues found with failmalloc
........
r50778 | neal.norwitz | 2006-07-23 09:51:58 +0200 (Sun, 23 Jul 2006) | 5 lines
If the for loop isn't entered, entryblock will be NULL. If passed
to stackdepth_walk it will be dereffed.
Not sure if I found with failmalloc or Klockwork #55.
........
r50779 | neal.norwitz | 2006-07-23 09:53:14 +0200 (Sun, 23 Jul 2006) | 4 lines
Move the initialization of size_a down below the check for a being NULL.
Reported by Klocwork #106
........
r50780 | neal.norwitz | 2006-07-23 09:55:55 +0200 (Sun, 23 Jul 2006) | 9 lines
Check the allocation of b_objects and return if there was a failure.
Also fix a few memory leaks in other failure scenarios.
It seems that if b_objects == Py_None, we will have an extra ref to
b_objects. Add XXX comment so hopefully someone documents why the
else isn't necessary or adds it in.
Reported by Klocwork #20
........
r50781 | neal.norwitz | 2006-07-23 09:57:11 +0200 (Sun, 23 Jul 2006) | 2 lines
Fix memory leaks spotted by Klocwork #37.
........
r50782 | neal.norwitz | 2006-07-23 09:59:00 +0200 (Sun, 23 Jul 2006) | 5 lines
nextlink can be NULL if teedataobject_new fails, so use XINCREF.
Ensure that dataobj is never NULL.
Reported by Klocwork #102
........
r50783 | neal.norwitz | 2006-07-23 10:01:43 +0200 (Sun, 23 Jul 2006) | 8 lines
Ensure we don't write beyond errText. I think I got this right, but
it definitely could use some review to ensure I'm not off by one
and there's no possible overflow/wrap-around of bytes_left.
Reported by Klocwork #1.
Fix a problem if there is a failure allocating self->db.
Found with failmalloc.
........
r50784 | ronald.oussoren | 2006-07-23 11:41:09 +0200 (Sun, 23 Jul 2006) | 3 lines
Without this patch CMD-W won't close EditorWindows on MacOS X. This solves
part of bug #1517990.
........
r50785 | ronald.oussoren | 2006-07-23 11:46:11 +0200 (Sun, 23 Jul 2006) | 5 lines
Fix for bug #1517996: Class and Path browsers show Tk menu
This patch replaces the menubar that is used by AquaTk for windows without a
menubar of their own by one that is more appropriate for IDLE.
........
r50786 | andrew.macintyre | 2006-07-23 14:57:02 +0200 (Sun, 23 Jul 2006) | 2 lines
Build updates for OS/2 EMX port
........
r50787 | andrew.macintyre | 2006-07-23 15:00:04 +0200 (Sun, 23 Jul 2006) | 3 lines
bugfix: PyThread_start_new_thread() returns the thread ID, not a flag;
will backport.
........
r50789 | andrew.macintyre | 2006-07-23 15:04:00 +0200 (Sun, 23 Jul 2006) | 2 lines
Get mailbox module working on OS/2 EMX port.
........
r50791 | greg.ward | 2006-07-23 18:05:51 +0200 (Sun, 23 Jul 2006) | 1 line
Resync optparse with Optik 1.5.3: minor tweaks for/to tests.
........
r50794 | martin.v.loewis | 2006-07-24 07:05:22 +0200 (Mon, 24 Jul 2006) | 2 lines
Update list of unsupported systems. Fixes #1510853.
........
r50795 | martin.v.loewis | 2006-07-24 12:26:33 +0200 (Mon, 24 Jul 2006) | 1 line
Patch #1448199: Release GIL around ConnectRegistry.
........
r50796 | martin.v.loewis | 2006-07-24 13:54:53 +0200 (Mon, 24 Jul 2006) | 3 lines
Patch #1232023: Don't include empty path component from registry,
so that the current directory does not get added to sys.path.
Also fixes #1526785.
........
r50797 | martin.v.loewis | 2006-07-24 14:54:17 +0200 (Mon, 24 Jul 2006) | 3 lines
Bug #1524310: Properly report errors from FindNextFile in os.listdir.
Will backport to 2.4.
........
r50800 | georg.brandl | 2006-07-24 15:28:57 +0200 (Mon, 24 Jul 2006) | 7 lines
Patch #1523356: fix determining include dirs in python-config.
Also don't install "python-config" when doing altinstall, but
always install "python-config2.x" and make a link to it like
with the main executable.
........
r50802 | georg.brandl | 2006-07-24 15:46:47 +0200 (Mon, 24 Jul 2006) | 3 lines
Patch #1527744: right order of includes in order to have HAVE_CONIO_H defined properly.
........
r50803 | georg.brandl | 2006-07-24 16:09:56 +0200 (Mon, 24 Jul 2006) | 3 lines
Patch #1515343: Fix printing of deprecated string exceptions with a
value in the traceback module.
........
r50804 | kurt.kaiser | 2006-07-24 19:13:23 +0200 (Mon, 24 Jul 2006) | 7 lines
EditorWindow failed when used stand-alone if sys.ps1 not set.
Bug 1010370 Dave Florek
M EditorWindow.py
M PyShell.py
M NEWS.txt
........
r50805 | kurt.kaiser | 2006-07-24 20:05:51 +0200 (Mon, 24 Jul 2006) | 6 lines
- EditorWindow.test() was failing. Bug 1417598
M EditorWindow.py
M ScriptBinding.py
M NEWS.txt
........
r50808 | georg.brandl | 2006-07-24 22:11:35 +0200 (Mon, 24 Jul 2006) | 3 lines
Repair accidental NameError.
........
r50809 | tim.peters | 2006-07-24 23:02:15 +0200 (Mon, 24 Jul 2006) | 2 lines
Whitespace normalization.
........
r50810 | greg.ward | 2006-07-25 04:11:12 +0200 (Tue, 25 Jul 2006) | 3 lines
Don't use standard assert: want tests to fail even when run with -O.
Delete cruft.
........
r50811 | tim.peters | 2006-07-25 06:07:22 +0200 (Tue, 25 Jul 2006) | 10 lines
current_frames_with_threads(): There's actually no way
to guess /which/ line the spawned thread is in at the time
sys._current_frames() is called: we know it finished
enter_g.set(), but can't know whether the instruction
counter has advanced to the following leave_g.wait().
The latter is overwhelming most likely, but not guaranteed,
and I see that the "x86 Ubuntu dapper (icc) trunk" buildbot
found it on the other line once. Changed the test so it
passes in either case.
........
r50815 | martin.v.loewis | 2006-07-25 11:53:12 +0200 (Tue, 25 Jul 2006) | 2 lines
Bug #1525817: Don't truncate short lines in IDLE's tool tips.
........
r50816 | martin.v.loewis | 2006-07-25 12:05:47 +0200 (Tue, 25 Jul 2006) | 3 lines
Bug #978833: Really close underlying socket in _socketobject.close.
Will backport to 2.4.
........
r50817 | martin.v.loewis | 2006-07-25 12:11:14 +0200 (Tue, 25 Jul 2006) | 1 line
Revert incomplete checkin.
........
r50819 | georg.brandl | 2006-07-25 12:22:34 +0200 (Tue, 25 Jul 2006) | 4 lines
Patch #1525766: correctly pass onerror arg to recursive calls
of pkg.walk_packages. Also improve the docstrings.
........
r50825 | brett.cannon | 2006-07-25 19:32:20 +0200 (Tue, 25 Jul 2006) | 2 lines
Add comment for changes to test_ossaudiodev.
........
r50826 | brett.cannon | 2006-07-25 19:34:36 +0200 (Tue, 25 Jul 2006) | 3 lines
Fix a bug in the messages for an assert failure where not enough arguments to a string
were being converted in the format.
........
r50828 | armin.rigo | 2006-07-25 20:09:57 +0200 (Tue, 25 Jul 2006) | 2 lines
Document why is and is not a good way to fix the gc_inspection crasher.
........
r50829 | armin.rigo | 2006-07-25 20:11:07 +0200 (Tue, 25 Jul 2006) | 5 lines
Added another crasher, which hit me today (I was not intentionally
writing such code, of course, but it took some gdb time to figure out
what my bug was).
........
r50830 | armin.rigo | 2006-07-25 20:38:39 +0200 (Tue, 25 Jul 2006) | 3 lines
Document the crashers that will not go away soon as "won't fix",
and explain why.
........
r50831 | ronald.oussoren | 2006-07-25 21:13:35 +0200 (Tue, 25 Jul 2006) | 3 lines
Install the compatibility symlink to libpython.a on OSX using 'ln -sf' instead
of 'ln -s', this avoid problems when reinstalling python.
........
r50832 | ronald.oussoren | 2006-07-25 21:20:54 +0200 (Tue, 25 Jul 2006) | 7 lines
Fix for bug #1525447 (renaming to MacOSmodule.c would also work, but not
without causing problems for anyone that is on a case-insensitive filesystem).
Setup.py tries to compile the MacOS extension from MacOSmodule.c, while the
actual file is named macosmodule.c. This is no problem on the (default)
case-insensitive filesystem, but doesn't work on case-sensitive filesystems.
........
r50833 | ronald.oussoren | 2006-07-25 22:28:55 +0200 (Tue, 25 Jul 2006) | 7 lines
Fix bug #1517990: IDLE keybindings on OSX
This adds a new key definition for OSX, which is slightly different from the
classic mac definition.
Also add NEWS item for a couple of bugfixes I added recently.
........
r50834 | tim.peters | 2006-07-26 00:30:24 +0200 (Wed, 26 Jul 2006) | 2 lines
Whitespace normalization.
........
r50839 | neal.norwitz | 2006-07-26 06:00:18 +0200 (Wed, 26 Jul 2006) | 1 line
Hmm, only python2.x is installed, not plain python. Did that change recently?
........
r50840 | barry.warsaw | 2006-07-26 07:54:46 +0200 (Wed, 26 Jul 2006) | 6 lines
Forward port some fixes that were in email 2.5 but for some reason didn't make
it into email 4.0. Specifically, in Message.get_content_charset(), handle RFC
2231 headers that contain an encoding not known to Python, or a character in
the data that isn't in the charset encoding. Also forward port the
appropriate unit tests.
........
r50841 | georg.brandl | 2006-07-26 09:23:32 +0200 (Wed, 26 Jul 2006) | 3 lines
NEWS entry for #1525766.
........
r50842 | georg.brandl | 2006-07-26 09:40:17 +0200 (Wed, 26 Jul 2006) | 3 lines
Bug #1459963: properly capitalize HTTP header names.
........
r50843 | georg.brandl | 2006-07-26 10:03:10 +0200 (Wed, 26 Jul 2006) | 6 lines
Part of bug #1523610: fix miscalculation of buffer length.
Also add a guard against NULL in converttuple and add a test case
(that previously would have crashed).
........
r50844 | martin.v.loewis | 2006-07-26 14:12:56 +0200 (Wed, 26 Jul 2006) | 3 lines
Bug #978833: Really close underlying socket in _socketobject.close.
Fix httplib.HTTPConnection.getresponse to not close the
socket if it is still needed for the response.
........
r50845 | andrew.kuchling | 2006-07-26 19:16:52 +0200 (Wed, 26 Jul 2006) | 1 line
[Bug #1471938] Fix build problem on Solaris 8 by conditionalizing the use of mvwgetnstr(); it was conditionalized a few lines below. Fix from Paul Eggert. I also tried out the STRICT_SYSV_CURSES case and am therefore removing the 'untested' comment.
........
r50846 | andrew.kuchling | 2006-07-26 19:18:01 +0200 (Wed, 26 Jul 2006) | 1 line
Correct error message
........
r50847 | andrew.kuchling | 2006-07-26 19:19:39 +0200 (Wed, 26 Jul 2006) | 1 line
Minor grammar fix
........
r50848 | andrew.kuchling | 2006-07-26 19:22:21 +0200 (Wed, 26 Jul 2006) | 1 line
Put news item in right section
........
r50850 | andrew.kuchling | 2006-07-26 20:03:12 +0200 (Wed, 26 Jul 2006) | 1 line
Use sys.exc_info()
........
r50851 | andrew.kuchling | 2006-07-26 20:15:45 +0200 (Wed, 26 Jul 2006) | 1 line
Use sys.exc_info()
........
r50852 | phillip.eby | 2006-07-26 21:48:27 +0200 (Wed, 26 Jul 2006) | 4 lines
Allow the 'onerror' argument to walk_packages() to catch any Exception, not
just ImportError. This allows documentation tools to better skip unimportable
packages.
........
r50854 | tim.peters | 2006-07-27 01:23:15 +0200 (Thu, 27 Jul 2006) | 2 lines
Whitespace normalization.
........
r50855 | tim.peters | 2006-07-27 03:14:53 +0200 (Thu, 27 Jul 2006) | 21 lines
Bug #1521947: possible bug in mystrtol.c with recent gcc.
In general, C doesn't define anything about what happens when
an operation on a signed integral type overflows, and PyOS_strtol()
did several formally undefined things of that nature on signed
longs. Some version of gcc apparently tries to exploit that now,
and PyOS_strtol() could fail to detect overflow then.
Tried to repair all that, although it seems at least as likely to me
that we'll get screwed by bad platform definitions for LONG_MIN
and/or LONG_MAX now. For that reason, I don't recommend backporting
this.
Note that I have no box on which this makes a lick of difference --
can't really test it, except to note that it didn't break anything
on my boxes.
Silent change: PyOS_strtol() used to return the hard-coded 0x7fffffff
in case of overflow. Now it returns LONG_MAX. They're the same only on
32-bit boxes (although C doesn't guarantee that either ...).
........
r50856 | neal.norwitz | 2006-07-27 05:51:58 +0200 (Thu, 27 Jul 2006) | 6 lines
Don't kill a normal instance of python running on windows when checking
to kill a cygwin instance. build\\python.exe was matching a normal windows
instance. Prefix that with a \\ to ensure build is a directory and not
PCbuild. As discussed on python-dev.
........
r50857 | neal.norwitz | 2006-07-27 05:55:39 +0200 (Thu, 27 Jul 2006) | 5 lines
Closure can't be NULL at this point since we know it's a tuple.
Reported by Klocwork # 74.
........
r50858 | neal.norwitz | 2006-07-27 06:04:50 +0200 (Thu, 27 Jul 2006) | 1 line
No functional change. Add comment and assert to describe why there cannot be overflow which was reported by Klocwork. Discussed on python-dev
........
r50859 | martin.v.loewis | 2006-07-27 08:38:16 +0200 (Thu, 27 Jul 2006) | 3 lines
Bump distutils version to 2.5, as several new features
have been introduced since 2.4.
........
r50860 | andrew.kuchling | 2006-07-27 14:18:20 +0200 (Thu, 27 Jul 2006) | 1 line
Reformat docstring; fix typo
........
r50861 | georg.brandl | 2006-07-27 17:05:36 +0200 (Thu, 27 Jul 2006) | 6 lines
Add test_main() methods. These three tests were never run
by regrtest.py.
We really need a simpler testing framework.
........
r50862 | tim.peters | 2006-07-27 17:09:20 +0200 (Thu, 27 Jul 2006) | 2 lines
News for patch #1529686.
........
r50863 | tim.peters | 2006-07-27 17:11:00 +0200 (Thu, 27 Jul 2006) | 2 lines
Whitespace normalization.
........
r50864 | georg.brandl | 2006-07-27 17:38:33 +0200 (Thu, 27 Jul 2006) | 3 lines
Amend news entry.
........
r50865 | georg.brandl | 2006-07-27 18:08:15 +0200 (Thu, 27 Jul 2006) | 3 lines
Make uuid test suite pass on this box by requesting output with LC_ALL=C.
........
r50866 | andrew.kuchling | 2006-07-27 20:37:33 +0200 (Thu, 27 Jul 2006) | 1 line
Add example
........
r50867 | thomas.heller | 2006-07-27 20:39:55 +0200 (Thu, 27 Jul 2006) | 9 lines
Remove code that is no longer used (ctypes.com).
Fix the DllGetClassObject and DllCanUnloadNow so that they forward the
call to the comtypes.server.inprocserver module.
The latter was never documented, never used by published code, and
didn't work anyway, so I think it does not deserve a NEWS entry (but I
might be wrong).
........
r50868 | andrew.kuchling | 2006-07-27 20:41:21 +0200 (Thu, 27 Jul 2006) | 1 line
Typo fix ('publically' is rare, poss. non-standard)
........
r50869 | andrew.kuchling | 2006-07-27 20:42:41 +0200 (Thu, 27 Jul 2006) | 1 line
Add missing word
........
r50870 | andrew.kuchling | 2006-07-27 20:44:10 +0200 (Thu, 27 Jul 2006) | 1 line
Repair typos
........
r50872 | andrew.kuchling | 2006-07-27 20:53:33 +0200 (Thu, 27 Jul 2006) | 1 line
Update URL; add example
........
r50873 | andrew.kuchling | 2006-07-27 21:07:29 +0200 (Thu, 27 Jul 2006) | 1 line
Add punctuation mark; add some examples
........
r50874 | andrew.kuchling | 2006-07-27 21:11:07 +0200 (Thu, 27 Jul 2006) | 1 line
Mention base64 module; rewrite last sentence to be more positive
........
r50875 | andrew.kuchling | 2006-07-27 21:12:49 +0200 (Thu, 27 Jul 2006) | 1 line
If binhex is higher-level than binascii, it should come first in the chapter
........
r50876 | tim.peters | 2006-07-27 22:47:24 +0200 (Thu, 27 Jul 2006) | 28 lines
check_node(): stop spraying mystery output to stderr.
When a node number disagrees, keep track of all sources & the
node numbers they reported, and stick all that in the error message.
Changed all callers to supply a non-empty "source" argument; made
the "source" argument non-optional.
On my box, test_uuid still fails, but with the less confusing output:
AssertionError: different sources disagree on node:
from source 'getnode1', node was 00038a000015
from source 'getnode2', node was 00038a000015
from source 'ipconfig', node was 001111b2b7bf
Only the last one appears to be correct; e.g.,
C:\Code\python\PCbuild>getmac
Physical Address Transport Name
=================== ==========================================================
00-11-11-B2-B7-BF \Device\Tcpip_{190FB163-5AFD-4483-86A1-2FE16AC61FF1}
62-A1-AC-6C-FD-BE \Device\Tcpip_{8F77DF5A-EA3D-4F1D-975E-D472CEE6438A}
E2-1F-01-C6-5D-88 \Device\Tcpip_{CD18F76B-2EF3-409F-9B8A-6481EE70A1E4}
I can't find anything on my box with MAC 00-03-8a-00-00-15, and am
not clear on where that comes from.
........
r50878 | andrew.kuchling | 2006-07-28 00:40:05 +0200 (Fri, 28 Jul 2006) | 1 line
Reword paragraph
........
r50879 | andrew.kuchling | 2006-07-28 00:49:38 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50880 | andrew.kuchling | 2006-07-28 00:49:54 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50881 | barry.warsaw | 2006-07-28 01:43:15 +0200 (Fri, 28 Jul 2006) | 27 lines
Patch #1520294: Support for getset and member descriptors in types.py,
inspect.py, and pydoc.py. Specifically, this allows for querying the type of
an object against these built-in C types and more importantly, for getting
their docstrings printed in the interactive interpreter's help() function.
This patch includes a new built-in module called _types which provides
definitions of getset and member descriptors for use by the types.py module.
These types are exposed as types.GetSetDescriptorType and
types.MemberDescriptorType. Query functions are provided as
inspect.isgetsetdescriptor() and inspect.ismemberdescriptor(). The
implementations of these are robust enough to work with Python implementations
other than CPython, which may not have these fundamental types.
The patch also includes documentation and test suite updates.
I commit these changes now under these guiding principles:
1. Silence is assent. The release manager has not said "no", and of the few
people that cared enough to respond to the thread, the worst vote was "0".
2. It's easier to ask for forgiveness than permission.
3. It's so dang easy to revert stuff in svn, that you could view this as a
forcing function. :)
Windows build patches will follow.
........
r50882 | tim.peters | 2006-07-28 01:44:37 +0200 (Fri, 28 Jul 2006) | 4 lines
Bug #1529297: The rewrite of doctest for Python 2.4 unintentionally
lost that tests are sorted by name before being run. ``DocTestFinder``
has been changed to sort the list of tests it returns.
........
r50883 | tim.peters | 2006-07-28 01:45:48 +0200 (Fri, 28 Jul 2006) | 2 lines
Whitespace normalization.
........
r50884 | tim.peters | 2006-07-28 01:46:36 +0200 (Fri, 28 Jul 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r50885 | barry.warsaw | 2006-07-28 01:50:40 +0200 (Fri, 28 Jul 2006) | 4 lines
Enable the building of the _types module on Windows.
Note that this has only been tested for VS 2003 since that's all I have.
........
r50887 | tim.peters | 2006-07-28 02:23:15 +0200 (Fri, 28 Jul 2006) | 7 lines
defdict_reduce(): Plug leaks.
We didn't notice these before because test_defaultdict didn't
actually do anything before Georg fixed that earlier today.
Neal's next refleak run then showed test_defaultdict leaking
9 references on each run. That's repaired by this checkin.
........
r50888 | tim.peters | 2006-07-28 02:30:00 +0200 (Fri, 28 Jul 2006) | 2 lines
News about the repaired memory leak in defaultdict.
........
r50889 | gregory.p.smith | 2006-07-28 03:35:25 +0200 (Fri, 28 Jul 2006) | 7 lines
- pybsddb Bug #1527939: bsddb module DBEnv dbremove and dbrename
methods now allow their database parameter to be None as the
sleepycat API allows.
Also adds an appropriate test case for DBEnv.dbrename and dbremove.
........
r50895 | neal.norwitz | 2006-07-28 06:22:34 +0200 (Fri, 28 Jul 2006) | 1 line
Ensure the actual number matches the expected count
........
r50896 | tim.peters | 2006-07-28 06:51:59 +0200 (Fri, 28 Jul 2006) | 6 lines
Live with that "the hardware address" is an ill-defined
concept, and that different ways of trying to find "the
hardware address" may return different results. Certainly
true on both of my Windows boxes, and in different ways
(see whining on python-dev).
........
r50897 | neal.norwitz | 2006-07-28 09:21:27 +0200 (Fri, 28 Jul 2006) | 3 lines
Try to find the MAC addr on various flavours of Unix. This seems hopeless.
The reduces the test_uuid failures, but there's still another method failing.
........
r50898 | martin.v.loewis | 2006-07-28 09:45:49 +0200 (Fri, 28 Jul 2006) | 2 lines
Add UUID for upcoming 2.5b3.
........
r50899 | matt.fleming | 2006-07-28 13:27:27 +0200 (Fri, 28 Jul 2006) | 3 lines
Allow socketmodule to compile on NetBSD -current, whose bluetooth API
differs from both Linux and FreeBSD. Accepted by Neal Norwitz.
........
r50900 | andrew.kuchling | 2006-07-28 14:07:12 +0200 (Fri, 28 Jul 2006) | 1 line
[Patch #1529811] Correction to description of r|* mode
........
r50901 | andrew.kuchling | 2006-07-28 14:18:22 +0200 (Fri, 28 Jul 2006) | 1 line
Typo fix
........
r50902 | andrew.kuchling | 2006-07-28 14:32:43 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50903 | andrew.kuchling | 2006-07-28 14:33:19 +0200 (Fri, 28 Jul 2006) | 1 line
Add example
........
r50904 | andrew.kuchling | 2006-07-28 14:45:55 +0200 (Fri, 28 Jul 2006) | 1 line
Don't overwrite built-in name; add some blank lines for readability
........
r50905 | andrew.kuchling | 2006-07-28 14:48:07 +0200 (Fri, 28 Jul 2006) | 1 line
Add example. Should I propagate this example to all the other DBM-ish modules, too?
........
r50912 | georg.brandl | 2006-07-28 20:31:39 +0200 (Fri, 28 Jul 2006) | 3 lines
Patch #1529686: also run test_email_codecs with regrtest.py.
........
r50913 | georg.brandl | 2006-07-28 20:36:01 +0200 (Fri, 28 Jul 2006) | 3 lines
Fix spelling.
........
r50915 | thomas.heller | 2006-07-28 21:42:40 +0200 (Fri, 28 Jul 2006) | 3 lines
Remove a useless XXX comment.
Cosmetic changes to the code so that the #ifdef _UNICODE block
doesn't mess emacs code formatting.
........
r50916 | phillip.eby | 2006-07-28 23:12:07 +0200 (Fri, 28 Jul 2006) | 5 lines
Bug #1529871: The speed enhancement patch #921466 broke Python's compliance
with PEP 302. This was fixed by adding an ``imp.NullImporter`` type that is
used in ``sys.path_importer_cache`` to cache non-directory paths and avoid
excessive filesystem operations during imports.
........
r50917 | phillip.eby | 2006-07-28 23:31:54 +0200 (Fri, 28 Jul 2006) | 2 lines
Fix svn merge spew.
........
r50918 | thomas.heller | 2006-07-28 23:43:20 +0200 (Fri, 28 Jul 2006) | 4 lines
Patch #1529514: More openbsd platforms for ctypes.
Regenerated Modules/_ctypes/libffi/configure with autoconf 2.59.
Approved by Neal.
........
r50922 | georg.brandl | 2006-07-29 10:51:21 +0200 (Sat, 29 Jul 2006) | 2 lines
Bug #835255: The "closure" argument to new.function() is now documented.
........
r50924 | georg.brandl | 2006-07-29 11:33:26 +0200 (Sat, 29 Jul 2006) | 3 lines
Bug #1441397: The compiler module now recognizes module and function
docstrings correctly as it did in Python 2.4.
........
r50925 | georg.brandl | 2006-07-29 12:25:46 +0200 (Sat, 29 Jul 2006) | 4 lines
Revert rev 42617, it was introduced to work around bug #1441397.
test_compiler now passes again.
........
r50926 | fred.drake | 2006-07-29 15:22:49 +0200 (Sat, 29 Jul 2006) | 1 line
update target version number
........
r50927 | andrew.kuchling | 2006-07-29 15:56:48 +0200 (Sat, 29 Jul 2006) | 1 line
Add example
........
r50928 | andrew.kuchling | 2006-07-29 16:04:47 +0200 (Sat, 29 Jul 2006) | 1 line
Update URL
........
r50930 | andrew.kuchling | 2006-07-29 16:08:15 +0200 (Sat, 29 Jul 2006) | 1 line
Reword paragraph to match the order of the subsequent sections
........
r50931 | andrew.kuchling | 2006-07-29 16:21:15 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1529157] Mention raw_input() and input(); while I'm at it, reword the description a bit
........
r50932 | andrew.kuchling | 2006-07-29 16:42:48 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1519571] Document some missing functions: setup(), title(), done()
........
r50933 | andrew.kuchling | 2006-07-29 16:43:55 +0200 (Sat, 29 Jul 2006) | 1 line
Fix docstring punctuation
........
r50934 | andrew.kuchling | 2006-07-29 17:10:32 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1414697] Change docstring of set/frozenset types to specify that the contents are unique. Raymond, please feel free to edit or revert.
........
r50935 | andrew.kuchling | 2006-07-29 17:35:21 +0200 (Sat, 29 Jul 2006) | 1 line
[Bug #1530382] Document SSL.server(), .issuer() methods
........
r50936 | andrew.kuchling | 2006-07-29 17:42:46 +0200 (Sat, 29 Jul 2006) | 1 line
Typo fix
........
r50937 | andrew.kuchling | 2006-07-29 17:43:13 +0200 (Sat, 29 Jul 2006) | 1 line
Tweak wording
........
r50938 | matt.fleming | 2006-07-29 17:55:30 +0200 (Sat, 29 Jul 2006) | 2 lines
Fix typo
........
r50939 | andrew.kuchling | 2006-07-29 17:57:08 +0200 (Sat, 29 Jul 2006) | 6 lines
[Bug #1528258] Mention that the 'data' argument can be None.
The constructor docs referred the reader to the add_data() method's docs,
but they weren't very helpful. I've simply copied an earlier explanation
of 'data' that's more useful.
........
r50940 | andrew.kuchling | 2006-07-29 18:08:40 +0200 (Sat, 29 Jul 2006) | 1 line
Set bug/patch count. Take a bow, everyone!
........
r50941 | fred.drake | 2006-07-29 18:56:15 +0200 (Sat, 29 Jul 2006) | 18 lines
expunge the xmlcore changes:
41667, 41668 - initial switch to xmlcore
47044 - mention of xmlcore in What's New
50687 - mention of xmlcore in the library reference
re-apply xmlcore changes to xml:
41674 - line ending changes (re-applied manually), directory props
41677 - add cElementTree wrapper
41678 - PSF licensing for etree
41812 - whitespace normalization
42724 - fix svn:eol-style settings
43681, 43682 - remove Python version-compatibility cruft from minidom
46773 - fix encoding of \r\n\t in attr values in saxutils
47269 - added XMLParser alias for cElementTree compatibility
additional tests were added in Lib/test/test_sax.py that failed with
the xmlcore changes; these relate to SF bugs #1511497, #1513611
........
r50942 | andrew.kuchling | 2006-07-29 20:14:07 +0200 (Sat, 29 Jul 2006) | 17 lines
Reorganize the docs for 'file' and 'open()' after some discussion with Fred.
We want to encourage users to write open() when opening a file, but
open() was described with a single paragraph and
'file' had lots of explanation of the mode and bufsize arguments.
I've shrunk the description of 'file' to cross-reference to the 'File
objects' section, and to open() for an explanation of the arguments.
open() now has all the paragraphs about the mode string. The bufsize
argument was moved up so that it isn't buried at the end; now there's
1 paragraph on mode, 1 on bufsize, and then 3 more on mode. Various
other edits and rearrangements were made in the process.
It's probably best to read the final text and not to try to make sense
of the diffs.
........
r50943 | fred.drake | 2006-07-29 20:19:19 +0200 (Sat, 29 Jul 2006) | 1 line
restore test un-intentionally removed in the xmlcore purge (revision 50941)
........
r50944 | fred.drake | 2006-07-29 20:33:29 +0200 (Sat, 29 Jul 2006) | 3 lines
make the reference to older versions of the documentation a link
to the right page on python.org
........
r50945 | fred.drake | 2006-07-29 21:09:01 +0200 (Sat, 29 Jul 2006) | 1 line
document the footnote usage pattern
........
r50947 | fred.drake | 2006-07-29 21:14:10 +0200 (Sat, 29 Jul 2006) | 1 line
emphasize and oddball nuance of LaTeX comment syntax
........
r50948 | andrew.kuchling | 2006-07-29 21:24:04 +0200 (Sat, 29 Jul 2006) | 1 line
[Patch #1490989 from Skip Montanaro] Mention debugging builds in the API documentation. I've changed Skip's patch to point to Misc/SpecialBuilds and fiddled with the markup a bit.
........
r50949 | neal.norwitz | 2006-07-29 21:29:35 +0200 (Sat, 29 Jul 2006) | 6 lines
Disable these tests until they are reliable across platforms.
These problems may mask more important, real problems.
One or both methods are known to fail on: Solaris, OpenBSD, Debian, Ubuntu.
They pass on Windows and some Linux boxes.
........
r50950 | andrew.kuchling | 2006-07-29 21:50:37 +0200 (Sat, 29 Jul 2006) | 1 line
[Patch #1068277] Clarify that os.path.exists() can return False depending on permissions. Fred approved committing this patch in December 2004!
........
r50952 | fred.drake | 2006-07-29 22:04:42 +0200 (Sat, 29 Jul 2006) | 6 lines
SF bug #1193966: Weakref types documentation misplaced
The information about supporting weakrefs with types defined in C extensions
is moved to the Extending & Embedding manual. Py_TPFLAGS_HAVE_WEAKREFS is
no longer mentioned since it is part of Py_TPFLAGS_DEFAULT.
........
r50953 | skip.montanaro | 2006-07-29 22:06:05 +0200 (Sat, 29 Jul 2006) | 4 lines
Add a comment to the csv reader documentation that explains why the
treatment of newlines changed in 2.5. Pulled almost verbatim from a comment
by Andrew McNamara in <http://python.org/sf/1465014>.
........
r50954 | neal.norwitz | 2006-07-29 22:20:52 +0200 (Sat, 29 Jul 2006) | 3 lines
If the executable doesn't exist, there's no reason to try to start it.
This prevents garbage about command not found being printed on Solaris.
........
r50955 | fred.drake | 2006-07-29 22:21:25 +0200 (Sat, 29 Jul 2006) | 1 line
fix minor markup error that introduced extra punctuation
........
r50957 | neal.norwitz | 2006-07-29 22:37:08 +0200 (Sat, 29 Jul 2006) | 3 lines
Disable test_getnode too, since this is also unreliable.
........
r50958 | andrew.kuchling | 2006-07-29 23:27:12 +0200 (Sat, 29 Jul 2006) | 1 line
Follow TeX's conventions for hyphens
........
r50959 | andrew.kuchling | 2006-07-29 23:30:21 +0200 (Sat, 29 Jul 2006) | 1 line
Fix case for 'Unix'
........
r50960 | fred.drake | 2006-07-30 01:34:57 +0200 (Sun, 30 Jul 2006) | 1 line
markup cleanups
........
r50961 | andrew.kuchling | 2006-07-30 02:27:34 +0200 (Sun, 30 Jul 2006) | 1 line
Minor typo fixes
........
r50962 | andrew.kuchling | 2006-07-30 02:37:56 +0200 (Sun, 30 Jul 2006) | 1 line
[Bug #793553] Correct description of keyword arguments for SSL authentication
........
r50963 | tim.peters | 2006-07-30 02:58:15 +0200 (Sun, 30 Jul 2006) | 2 lines
Whitespace normalization.
........
r50964 | fred.drake | 2006-07-30 05:03:43 +0200 (Sun, 30 Jul 2006) | 1 line
lots of markup nits, most commonly Unix/unix --> \UNIX
........
r50965 | fred.drake | 2006-07-30 07:41:28 +0200 (Sun, 30 Jul 2006) | 1 line
update information on wxPython, from Robin Dunn
........
r50966 | fred.drake | 2006-07-30 07:49:49 +0200 (Sun, 30 Jul 2006) | 4 lines
remove possibly-outdated comment on what GUI toolkit is most commonly used;
it is hard to know whether this is right, and it does not add valuable reference information
at any rate
........
r50967 | fred.drake | 2006-07-30 07:55:39 +0200 (Sun, 30 Jul 2006) | 3 lines
- remove yet another reference to how commonly Tkinter is (thought to be) used
- fix an internal section reference
........
r50968 | neal.norwitz | 2006-07-30 08:53:31 +0200 (Sun, 30 Jul 2006) | 4 lines
Patch #1531113: Fix augmented assignment with yield expressions.
Also fix a SystemError when trying to assign to yield expressions.
........
r50969 | neal.norwitz | 2006-07-30 08:55:48 +0200 (Sun, 30 Jul 2006) | 5 lines
Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().
This provides the proper warning for struct.pack().
PyErr_Warn() is now deprecated in favor of PyErr_WarnEx().
As mentioned by Tim Peters on python-dev.
........
r50970 | neal.norwitz | 2006-07-30 08:57:04 +0200 (Sun, 30 Jul 2006) | 3 lines
Bug #1515471: string.replace() accepts character buffers again.
Pass the char* and size around rather than PyObject's.
........
r50971 | neal.norwitz | 2006-07-30 08:59:13 +0200 (Sun, 30 Jul 2006) | 1 line
Whitespace normalization
........
r50973 | georg.brandl | 2006-07-30 12:53:32 +0200 (Sun, 30 Jul 2006) | 3 lines
Clarify that __op__ methods must return NotImplemented if they don't support the operation.
........
r50974 | georg.brandl | 2006-07-30 13:07:23 +0200 (Sun, 30 Jul 2006) | 3 lines
Bug #1002398: The documentation for os.path.sameopenfile now correctly
refers to file descriptors, not file objects.
........
r50977 | martin.v.loewis | 2006-07-30 15:00:31 +0200 (Sun, 30 Jul 2006) | 3 lines
Don't copy directory stat times in shutil.copytree on Windows
Fixes #1525866.
........
r50978 | martin.v.loewis | 2006-07-30 15:14:05 +0200 (Sun, 30 Jul 2006) | 3 lines
Base __version__ on sys.version_info, as distutils is
no longer maintained separatedly.
........
r50979 | martin.v.loewis | 2006-07-30 15:27:31 +0200 (Sun, 30 Jul 2006) | 3 lines
Mention Cygwin in distutils error message about a missing VS 2003.
Fixes #1257728.
........
r50982 | martin.v.loewis | 2006-07-30 16:09:47 +0200 (Sun, 30 Jul 2006) | 5 lines
Drop usage of test -e in configure as it is not portable.
Fixes #1439538
Will backport to 2.4
Also regenerate pyconfig.h.in.
........
r50984 | georg.brandl | 2006-07-30 18:20:10 +0200 (Sun, 30 Jul 2006) | 3 lines
Fix makefile changes for python-config.
........
r50985 | george.yoshida | 2006-07-30 18:37:37 +0200 (Sun, 30 Jul 2006) | 2 lines
Rename struct.pack_to to struct.pack_into as changed in revision 46642.
........
r50986 | george.yoshida | 2006-07-30 18:41:30 +0200 (Sun, 30 Jul 2006) | 2 lines
Typo fix
........
r50987 | neal.norwitz | 2006-07-30 21:18:13 +0200 (Sun, 30 Jul 2006) | 1 line
Add some asserts and update comments
........
r50988 | neal.norwitz | 2006-07-30 21:18:38 +0200 (Sun, 30 Jul 2006) | 1 line
Verify that the signal handlers were really called
........
r50989 | neal.norwitz | 2006-07-30 21:20:42 +0200 (Sun, 30 Jul 2006) | 3 lines
Try to prevent hangs on Tru64/Alpha buildbot. I'm not certain this will help
and may need to be reverted if it causes problems.
........
r50990 | georg.brandl | 2006-07-30 22:18:51 +0200 (Sun, 30 Jul 2006) | 2 lines
Bug #1531349: right <-> left glitch in __rop__ description.
........
r50992 | tim.peters | 2006-07-31 03:46:03 +0200 (Mon, 31 Jul 2006) | 2 lines
Whitespace normalization.
........
r50993 | andrew.mcnamara | 2006-07-31 04:27:48 +0200 (Mon, 31 Jul 2006) | 2 lines
Redo the comment about the 2.5 change in quoted-newline handling.
........
r50994 | tim.peters | 2006-07-31 04:40:23 +0200 (Mon, 31 Jul 2006) | 10 lines
ZipFile.close(): Killed one of the struct.pack deprecation
warnings on Win32.
Also added an XXX about the line:
pos3 = self.fp.tell()
`pos3` is never referenced, and I have no idea what the code
intended to do instead.
........
r50996 | tim.peters | 2006-07-31 04:53:03 +0200 (Mon, 31 Jul 2006) | 8 lines
ZipFile.close(): Kill the other struct.pack deprecation
warning on Windows.
Afraid I can't detect a pattern to when the pack formats decide
to use a signed or unsigned format code -- appears nearly
arbitrary to my eyes. So I left all the pack formats alone and
changed the special-case data values instead.
........
r50997 | skip.montanaro | 2006-07-31 05:09:45 +0200 (Mon, 31 Jul 2006) | 1 line
minor tweaks
........
r50998 | skip.montanaro | 2006-07-31 05:11:11 +0200 (Mon, 31 Jul 2006) | 1 line
minor tweaks
........
r50999 | andrew.kuchling | 2006-07-31 14:20:24 +0200 (Mon, 31 Jul 2006) | 1 line
Add refcounts for PyErr_WarnEx
........
r51000 | andrew.kuchling | 2006-07-31 14:39:05 +0200 (Mon, 31 Jul 2006) | 9 lines
Document PyErr_WarnEx. (Bad Neal! No biscuit!)
Is the explanation of the 'stacklevel' parameter clear? Please feel free
to edit it.
I don't have LaTeX installed on this machine, so haven't verified that the
markup is correct. Will check tonight, or maybe the automatic doc build will
tell me.
........
r51001 | andrew.kuchling | 2006-07-31 14:52:26 +0200 (Mon, 31 Jul 2006) | 1 line
Add PyErr_WarnEx()
........
r51002 | andrew.kuchling | 2006-07-31 15:18:27 +0200 (Mon, 31 Jul 2006) | 1 line
Mention csv newline changes
........
r51003 | andrew.kuchling | 2006-07-31 17:22:58 +0200 (Mon, 31 Jul 2006) | 1 line
Typo fix
........
r51004 | andrew.kuchling | 2006-07-31 17:23:43 +0200 (Mon, 31 Jul 2006) | 1 line
Remove reference to notation
........
r51005 | georg.brandl | 2006-07-31 18:00:34 +0200 (Mon, 31 Jul 2006) | 3 lines
Fix function name.
........
r51006 | andrew.kuchling | 2006-07-31 18:10:24 +0200 (Mon, 31 Jul 2006) | 1 line
[Bug #1514540] Instead of putting the standard types in a section, put them in a chapter of their own. This means string methods will now show up in the ToC. (Should the types come before or after the functions+exceptions+constants chapter? I've put them after, for now.)
........
r51007 | andrew.kuchling | 2006-07-31 18:22:05 +0200 (Mon, 31 Jul 2006) | 1 line
[Bug #848556] Remove \d* from second alternative to avoid exponential case when repeating match
........
r51008 | andrew.kuchling | 2006-07-31 18:27:57 +0200 (Mon, 31 Jul 2006) | 1 line
Update list of files; fix a typo
........
r51013 | andrew.kuchling | 2006-08-01 18:24:30 +0200 (Tue, 01 Aug 2006) | 1 line
typo fix
........
r51018 | thomas.heller | 2006-08-01 18:54:43 +0200 (Tue, 01 Aug 2006) | 2 lines
Fix a potential segfault and various potentail refcount leaks
in the cast() function.
........
r51020 | thomas.heller | 2006-08-01 19:46:10 +0200 (Tue, 01 Aug 2006) | 1 line
Minimal useful docstring for CopyComPointer.
........
r51021 | andrew.kuchling | 2006-08-01 20:16:15 +0200 (Tue, 01 Aug 2006) | 8 lines
[Patch #1520905] Attempt to suppress core file created by test_subprocess.py.
Patch by Douglas Greiman.
The test_run_abort() testcase produces a core file on Unix systems,
even though the test is successful. This can be confusing or alarming
to someone who runs 'make test' and then finds that the Python
interpreter apparently crashed.
........
r51023 | georg.brandl | 2006-08-01 20:49:24 +0200 (Tue, 01 Aug 2006) | 3 lines
os.urandom no longer masks unrelated exceptions like SystemExit or
KeyboardInterrupt.
........
r51025 | thomas.heller | 2006-08-01 21:14:15 +0200 (Tue, 01 Aug 2006) | 2 lines
Speed up PyType_stgdict and PyObject_stgdict.
........
r51027 | ronald.oussoren | 2006-08-01 22:30:31 +0200 (Tue, 01 Aug 2006) | 3 lines
Make sure the postinstall action that optionally updates the user's profile
on MacOS X actually works correctly in all cases.
........
r51028 | ronald.oussoren | 2006-08-01 23:00:57 +0200 (Tue, 01 Aug 2006) | 4 lines
This fixes bug #1527397: PythonLauncher runs scripts with the wrong working
directory. It also fixes a bug where PythonLauncher failed to launch scripts
when the scriptname (or the path to the script) contains quotes.
........
r51031 | tim.peters | 2006-08-02 05:27:46 +0200 (Wed, 02 Aug 2006) | 2 lines
Whitespace normalization.
........
r51032 | tim.peters | 2006-08-02 06:12:36 +0200 (Wed, 02 Aug 2006) | 19 lines
Try to squash struct.pack warnings on the "amd64 gentoo trunk"
buildbot (& possibly other 64-bit boxes) during test_gzip.
The native zlib crc32 function returns an unsigned 32-bit integer,
which the Python wrapper implicitly casts to C long. Therefore the
same crc can "look negative" on a 32-bit box but "look positive" on
a 64-bit box. This patch papers over that platform difference when
writing the crc to file.
It may be better to change the Python wrapper, either to make
the result "look positive" on all platforms (which means it may
have to return a Python long at times on a 32-bit box), or to
keep the sign the same across boxes. But that would be a visible
change in what users see, while the current hack changes no
visible behavior (well, apart from stopping the struct deprecation
warning).
Note that the module-level write32() function is no longer used.
........
r51033 | neal.norwitz | 2006-08-02 06:27:11 +0200 (Wed, 02 Aug 2006) | 4 lines
Prevent memory leak on error.
Reported by Klocwork #36
........
r51034 | tim.peters | 2006-08-02 07:20:08 +0200 (Wed, 02 Aug 2006) | 9 lines
_Stream.close(): Try to kill struct.pack() warnings when
writing the crc to file on the "PPC64 Debian trunk" buildbot
when running test_tarfile.
This is again a case where the native zlib crc is an unsigned
32-bit int, but the Python wrapper implicitly casts it to
signed C long, so that "the sign bit looks different" on
different platforms.
........
r51035 | ronald.oussoren | 2006-08-02 08:10:10 +0200 (Wed, 02 Aug 2006) | 2 lines
Updated documentation for the script that builds the OSX installer.
........
r51036 | neal.norwitz | 2006-08-02 08:14:22 +0200 (Wed, 02 Aug 2006) | 2 lines
_PyWeakref_GetWeakrefCount() now returns a Py_ssize_t instead of long.
........
r51037 | neal.norwitz | 2006-08-02 08:15:10 +0200 (Wed, 02 Aug 2006) | 1 line
v is already checked for NULL, so just DECREF it
........
r51038 | neal.norwitz | 2006-08-02 08:19:19 +0200 (Wed, 02 Aug 2006) | 1 line
Let us know when there was a problem and the child had to kill the parent
........
r51039 | neal.norwitz | 2006-08-02 08:46:21 +0200 (Wed, 02 Aug 2006) | 5 lines
Patch #1519025 and bug #926423: If a KeyboardInterrupt occurs during
a socket operation on a socket with a timeout, the exception will be
caught correctly. Previously, the exception was not caught.
........
r51040 | neal.norwitz | 2006-08-02 09:09:32 +0200 (Wed, 02 Aug 2006) | 1 line
Add some explanation about Klocwork and Coverity static analysis
........
r51041 | anthony.baxter | 2006-08-02 09:43:09 +0200 (Wed, 02 Aug 2006) | 1 line
pre-release machinations
........
r51043 | thomas.heller | 2006-08-02 13:35:31 +0200 (Wed, 02 Aug 2006) | 4 lines
A few nore words about what ctypes does.
Document that using the wrong calling convention can also raise
'ValueError: Procedure called with the wrong number of arguments'.
........
r51045 | thomas.heller | 2006-08-02 14:00:13 +0200 (Wed, 02 Aug 2006) | 1 line
Fix a mistake.
........
r51046 | martin.v.loewis | 2006-08-02 15:53:55 +0200 (Wed, 02 Aug 2006) | 3 lines
Correction of patch #1455898: In the mbcs decoder, set final=False
for stream decoder, but final=True for the decode function.
........
r51049 | tim.peters | 2006-08-02 20:19:35 +0200 (Wed, 02 Aug 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r51079 | neal.norwitz | 2006-08-04 06:50:21 +0200 (Fri, 04 Aug 2006) | 3 lines
Bug #1531405, format_exception no longer raises an exception if
str(exception) raised an exception.
........
r51080 | neal.norwitz | 2006-08-04 06:58:47 +0200 (Fri, 04 Aug 2006) | 11 lines
Bug #1191458: tracing over for loops now produces a line event
on each iteration. I'm not positive this is the best way to handle
this. I'm also not sure that there aren't other cases where
the lnotab is generated incorrectly. It would be great if people
that use pdb or tracing could test heavily.
Also:
* Remove dead/duplicated code that wasn't used/necessary
because we already handled the docstring prior to entering the loop.
* add some debugging code into the compiler (#if 0'd out).
........
r51081 | neal.norwitz | 2006-08-04 07:09:28 +0200 (Fri, 04 Aug 2006) | 4 lines
Bug #1333982: string/number constants were inappropriately stored
in the byte code and co_consts even if they were not used, ie
immediately popped off the stack.
........
r51082 | neal.norwitz | 2006-08-04 07:12:19 +0200 (Fri, 04 Aug 2006) | 1 line
There were really two issues
........
r51084 | fred.drake | 2006-08-04 07:17:21 +0200 (Fri, 04 Aug 2006) | 1 line
SF patch #1534048 (bug #1531003): fix typo in error message
........
r51085 | gregory.p.smith | 2006-08-04 07:17:47 +0200 (Fri, 04 Aug 2006) | 3 lines
fix typos
........
r51087 | georg.brandl | 2006-08-04 08:03:53 +0200 (Fri, 04 Aug 2006) | 3 lines
Fix bug caused by first decrefing, then increfing.
........
r51109 | neil.schemenauer | 2006-08-04 18:20:30 +0200 (Fri, 04 Aug 2006) | 5 lines
Fix the 'compiler' package to generate correct code for MAKE_CLOSURE.
In the 2.5 development cycle, MAKE_CLOSURE as changed to take free
variables as a tuple rather than as individual items on the stack.
Closes patch #1534084.
........
r51110 | georg.brandl | 2006-08-04 20:03:37 +0200 (Fri, 04 Aug 2006) | 3 lines
Change fix for segfaulting property(), add a NEWS entry and a test.
........
r51111 | georg.brandl | 2006-08-04 20:07:34 +0200 (Fri, 04 Aug 2006) | 3 lines
Better fix for bug #1531405, not executing str(value) twice.
........
r51112 | thomas.heller | 2006-08-04 20:17:40 +0200 (Fri, 04 Aug 2006) | 1 line
On Windows, make PyErr_Warn an exported function again.
........
r51113 | thomas.heller | 2006-08-04 20:57:34 +0200 (Fri, 04 Aug 2006) | 4 lines
Fix #1530448 - fix ctypes build failure on solaris 10.
The '-mimpure-text' linker flag is required when linking _ctypes.so.
........
r51114 | thomas.heller | 2006-08-04 21:49:31 +0200 (Fri, 04 Aug 2006) | 3 lines
Fix #1534738: win32 debug version of _msi must be _msi_d.pyd, not _msi.pyd.
Fix the name of the pdb file as well.
........
r51115 | andrew.kuchling | 2006-08-04 22:37:43 +0200 (Fri, 04 Aug 2006) | 1 line
Typo fixes
........
r51116 | andrew.kuchling | 2006-08-04 23:10:03 +0200 (Fri, 04 Aug 2006) | 1 line
Fix mangled sentence
........
r51118 | tim.peters | 2006-08-05 00:00:35 +0200 (Sat, 05 Aug 2006) | 2 lines
Whitespace normalization.
........
r51119 | bob.ippolito | 2006-08-05 01:59:21 +0200 (Sat, 05 Aug 2006) | 5 lines
Fix #1530559, struct.pack raises TypeError where it used to convert.
Passing float arguments to struct.pack when integers are expected
now triggers a DeprecationWarning.
........
r51123 | georg.brandl | 2006-08-05 08:10:54 +0200 (Sat, 05 Aug 2006) | 3 lines
Patch #1534922: correct and enhance unittest docs.
........
r51126 | georg.brandl | 2006-08-06 09:06:33 +0200 (Sun, 06 Aug 2006) | 2 lines
Bug #1535182: really test the xreadlines() method of bz2 objects.
........
r51128 | georg.brandl | 2006-08-06 09:26:21 +0200 (Sun, 06 Aug 2006) | 4 lines
Bug #1535081: A leading underscore has been added to the names of
the md5 and sha modules, so add it in Modules/Setup.dist too.
........
r51129 | georg.brandl | 2006-08-06 10:23:54 +0200 (Sun, 06 Aug 2006) | 3 lines
Bug #1535165: fixed a segfault in input() and raw_input() when
sys.stdin is closed.
........
r51131 | georg.brandl | 2006-08-06 11:17:16 +0200 (Sun, 06 Aug 2006) | 2 lines
Don't produce output in test_builtin.
........
r51133 | andrew.macintyre | 2006-08-06 14:37:03 +0200 (Sun, 06 Aug 2006) | 4 lines
test_threading now skips testing alternate thread stack sizes on
platforms that don't support changing thread stack size.
........
r51134 | andrew.kuchling | 2006-08-07 00:07:04 +0200 (Mon, 07 Aug 2006) | 2 lines
[Patch #1464056] Ensure that we use the panelw library when linking with ncursesw.
Once I see how the buildbots react, I'll backport this to 2.4.
........
r51137 | georg.brandl | 2006-08-08 13:52:34 +0200 (Tue, 08 Aug 2006) | 3 lines
webbrowser: Silence stderr output if no gconftool or gnome browser found
........
r51138 | georg.brandl | 2006-08-08 13:56:21 +0200 (Tue, 08 Aug 2006) | 7 lines
Remove "non-mapping" and "non-sequence" from TypeErrors raised by
PyMapping_Size and PySequence_Size.
Because len() tries first sequence, then mapping size, it will always
raise a "non-mapping object has no len" error which is confusing.
........
r51139 | thomas.heller | 2006-08-08 19:37:00 +0200 (Tue, 08 Aug 2006) | 3 lines
memcmp() can return values other than -1, 0, and +1 but tp_compare
must not.
........
r51140 | thomas.heller | 2006-08-08 19:39:20 +0200 (Tue, 08 Aug 2006) | 1 line
Remove accidently committed, duplicated test.
........
r51147 | andrew.kuchling | 2006-08-08 20:50:14 +0200 (Tue, 08 Aug 2006) | 1 line
Reword paragraph to clarify
........
r51148 | andrew.kuchling | 2006-08-08 20:56:08 +0200 (Tue, 08 Aug 2006) | 1 line
Move obmalloc item into C API section
........
r51149 | andrew.kuchling | 2006-08-08 21:00:14 +0200 (Tue, 08 Aug 2006) | 1 line
'Other changes' section now has only one item; move the item elsewhere and remove the section
........
r51150 | andrew.kuchling | 2006-08-08 21:00:34 +0200 (Tue, 08 Aug 2006) | 1 line
Bump version number
........
r51151 | georg.brandl | 2006-08-08 22:11:22 +0200 (Tue, 08 Aug 2006) | 2 lines
Bug #1536828: typo: TypeType should have been StringType.
........
r51153 | georg.brandl | 2006-08-08 22:13:13 +0200 (Tue, 08 Aug 2006) | 2 lines
Bug #1536660: separate two words.
........
r51155 | georg.brandl | 2006-08-08 22:48:10 +0200 (Tue, 08 Aug 2006) | 3 lines
``str`` is now the same object as ``types.StringType``.
........
r51156 | tim.peters | 2006-08-09 02:52:26 +0200 (Wed, 09 Aug 2006) | 2 lines
Whitespace normalization.
........
r51158 | georg.brandl | 2006-08-09 09:03:22 +0200 (Wed, 09 Aug 2006) | 4 lines
Introduce an upper bound on tuple nesting depth in
C argument format strings; fixes rest of #1523610.
........
r51160 | martin.v.loewis | 2006-08-09 09:57:39 +0200 (Wed, 09 Aug 2006) | 4 lines
__hash__ may now return long int; the final hash
value is obtained by invoking hash on the long int.
Fixes #1536021.
........
r51168 | andrew.kuchling | 2006-08-09 15:03:41 +0200 (Wed, 09 Aug 2006) | 1 line
[Bug #1536021] Mention __hash__ change
........
r51169 | andrew.kuchling | 2006-08-09 15:57:05 +0200 (Wed, 09 Aug 2006) | 1 line
[Patch #1534027] Add notes on locale module changes
........
r51170 | andrew.kuchling | 2006-08-09 16:05:35 +0200 (Wed, 09 Aug 2006) | 1 line
Add missing 'self' parameters
........
r51171 | andrew.kuchling | 2006-08-09 16:06:19 +0200 (Wed, 09 Aug 2006) | 1 line
Reindent code
........
r51172 | armin.rigo | 2006-08-09 16:55:26 +0200 (Wed, 09 Aug 2006) | 2 lines
Fix and test for an infinite C recursion.
........
r51173 | ronald.oussoren | 2006-08-09 16:56:33 +0200 (Wed, 09 Aug 2006) | 2 lines
It's unlikely that future versions will require _POSIX_C_SOURCE
........
r51178 | armin.rigo | 2006-08-09 17:37:26 +0200 (Wed, 09 Aug 2006) | 2 lines
Concatenation on a long string breaks (SF #1526585).
........
r51180 | kurt.kaiser | 2006-08-09 18:46:15 +0200 (Wed, 09 Aug 2006) | 8 lines
1. When used w/o subprocess, all exceptions were preceeded by an error
message claiming they were IDLE internal errors (since 1.2a1).
2. Add Ronald Oussoren to CREDITS
M NEWS.txt
M PyShell.py
M CREDITS.txt
........
r51181 | kurt.kaiser | 2006-08-09 19:47:15 +0200 (Wed, 09 Aug 2006) | 4 lines
As a slight enhancement to the previous checkin, improve the
internal error reporting by moving message to IDLE console.
........
r51182 | andrew.kuchling | 2006-08-09 20:23:14 +0200 (Wed, 09 Aug 2006) | 1 line
Typo fix
........
r51183 | kurt.kaiser | 2006-08-09 22:34:46 +0200 (Wed, 09 Aug 2006) | 2 lines
ToggleTab dialog was setting indent to 8 even if cancelled (since 1.2a1).
........
r51184 | martin.v.loewis | 2006-08-10 01:42:18 +0200 (Thu, 10 Aug 2006) | 2 lines
Add some commentary on -mimpure-text.
........
r51185 | tim.peters | 2006-08-10 02:58:49 +0200 (Thu, 10 Aug 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r51186 | kurt.kaiser | 2006-08-10 03:41:17 +0200 (Thu, 10 Aug 2006) | 2 lines
Changing tokenize (39046) to detect dedent broke tabnanny check (since 1.2a1)
........
r51187 | tim.peters | 2006-08-10 05:01:26 +0200 (Thu, 10 Aug 2006) | 13 lines
test_copytree_simple(): This was leaving behind two new temp
directories each time it ran, at least on Windows.
Several changes: explicitly closed all files; wrapped long
lines; stopped suppressing errors when removing a file or
directory fails (removing /shouldn't/ fail!); and changed
what appeared to be incorrect usage of os.removedirs() (that
doesn't remove empty directories at and /under/ the given
path, instead it must be given an empty leaf directory and
then deletes empty directories moving /up/ the path -- could
be that the conceptually simpler shutil.rmtree() was really
actually intended here).
........
2006-08-11 14:57:12 +00:00
|
|
|
}
|
|
|
|
|
|
2019-05-29 13:57:07 -06:00
|
|
|
#ifdef HAVE_MEMFD_CREATE
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.memfd_create
|
|
|
|
|
|
|
|
|
|
name: FSConverter
|
|
|
|
|
flags: unsigned_int(bitwise=True, c_default="MFD_CLOEXEC") = MFD_CLOEXEC
|
|
|
|
|
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
os_memfd_create_impl(PyObject *module, PyObject *name, unsigned int flags)
|
|
|
|
|
/*[clinic end generated code: output=6681ede983bdb9a6 input=a42cfc199bcd56e9]*/
|
|
|
|
|
{
|
|
|
|
|
int fd;
|
|
|
|
|
const char *bytes = PyBytes_AS_STRING(name);
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
fd = memfd_create(bytes, flags);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
if (fd == -1) {
|
|
|
|
|
return PyErr_SetFromErrno(PyExc_OSError);
|
|
|
|
|
}
|
|
|
|
|
return PyLong_FromLong(fd);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2012-02-08 23:28:36 +01:00
|
|
|
/* Terminal size querying */
|
|
|
|
|
|
|
|
|
|
PyDoc_STRVAR(TerminalSize_docstring,
|
|
|
|
|
"A tuple of (columns, lines) for holding terminal window size");
|
|
|
|
|
|
|
|
|
|
static PyStructSequence_Field TerminalSize_fields[] = {
|
|
|
|
|
{"columns", "width of the terminal window in characters"},
|
|
|
|
|
{"lines", "height of the terminal window in characters"},
|
|
|
|
|
{NULL, NULL}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static PyStructSequence_Desc TerminalSize_desc = {
|
|
|
|
|
"os.terminal_size",
|
|
|
|
|
TerminalSize_docstring,
|
|
|
|
|
TerminalSize_fields,
|
|
|
|
|
2,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#if defined(TERMSIZE_USE_CONIO) || defined(TERMSIZE_USE_IOCTL)
|
2020-04-18 19:14:10 +03:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.get_terminal_size
|
2012-02-08 23:28:36 +01:00
|
|
|
|
2020-04-18 19:14:10 +03:00
|
|
|
fd: int(c_default="fileno(stdout)", py_default="<unrepresentable>") = -1
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Return the size of the terminal window as (columns, lines).
|
|
|
|
|
|
|
|
|
|
The optional argument fd (default standard output) specifies
|
|
|
|
|
which file descriptor should be queried.
|
|
|
|
|
|
|
|
|
|
If the file descriptor is not connected to a terminal, an OSError
|
|
|
|
|
is thrown.
|
|
|
|
|
|
|
|
|
|
This function will only be defined if an implementation is
|
|
|
|
|
available for this system.
|
|
|
|
|
|
|
|
|
|
shutil.get_terminal_size is the high-level function which should
|
|
|
|
|
normally be used, os.get_terminal_size is the low-level implementation.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
os_get_terminal_size_impl(PyObject *module, int fd)
|
|
|
|
|
/*[clinic end generated code: output=fbab93acef980508 input=ead5679b82ddb920]*/
|
2012-02-08 23:28:36 +01:00
|
|
|
{
|
|
|
|
|
int columns, lines;
|
|
|
|
|
PyObject *termsize;
|
|
|
|
|
|
|
|
|
|
/* Under some conditions stdout may not be connected and
|
|
|
|
|
* fileno(stdout) may point to an invalid file descriptor. For example
|
|
|
|
|
* GUI apps don't have valid standard streams by default.
|
|
|
|
|
*
|
|
|
|
|
* If this happens, and the optional fd argument is not present,
|
|
|
|
|
* the ioctl below will fail returning EBADF. This is what we want.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifdef TERMSIZE_USE_IOCTL
|
|
|
|
|
{
|
|
|
|
|
struct winsize w;
|
|
|
|
|
if (ioctl(fd, TIOCGWINSZ, &w))
|
|
|
|
|
return PyErr_SetFromErrno(PyExc_OSError);
|
|
|
|
|
columns = w.ws_col;
|
|
|
|
|
lines = w.ws_row;
|
|
|
|
|
}
|
|
|
|
|
#endif /* TERMSIZE_USE_IOCTL */
|
|
|
|
|
|
|
|
|
|
#ifdef TERMSIZE_USE_CONIO
|
|
|
|
|
{
|
|
|
|
|
DWORD nhandle;
|
|
|
|
|
HANDLE handle;
|
|
|
|
|
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
|
|
|
|
switch (fd) {
|
|
|
|
|
case 0: nhandle = STD_INPUT_HANDLE;
|
|
|
|
|
break;
|
|
|
|
|
case 1: nhandle = STD_OUTPUT_HANDLE;
|
|
|
|
|
break;
|
|
|
|
|
case 2: nhandle = STD_ERROR_HANDLE;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
return PyErr_Format(PyExc_ValueError, "bad file descriptor");
|
|
|
|
|
}
|
|
|
|
|
handle = GetStdHandle(nhandle);
|
|
|
|
|
if (handle == NULL)
|
|
|
|
|
return PyErr_Format(PyExc_OSError, "handle cannot be retrieved");
|
|
|
|
|
if (handle == INVALID_HANDLE_VALUE)
|
|
|
|
|
return PyErr_SetFromWindowsErr(0);
|
|
|
|
|
|
|
|
|
|
if (!GetConsoleScreenBufferInfo(handle, &csbi))
|
|
|
|
|
return PyErr_SetFromWindowsErr(0);
|
|
|
|
|
|
|
|
|
|
columns = csbi.srWindow.Right - csbi.srWindow.Left + 1;
|
|
|
|
|
lines = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
|
|
|
|
|
}
|
|
|
|
|
#endif /* TERMSIZE_USE_CONIO */
|
|
|
|
|
|
2020-04-18 19:14:10 +03:00
|
|
|
PyObject *TerminalSizeType = get_posix_state(module)->TerminalSizeType;
|
2019-11-05 07:16:14 -08:00
|
|
|
termsize = PyStructSequence_New((PyTypeObject *)TerminalSizeType);
|
2012-02-08 23:28:36 +01:00
|
|
|
if (termsize == NULL)
|
|
|
|
|
return NULL;
|
|
|
|
|
PyStructSequence_SET_ITEM(termsize, 0, PyLong_FromLong(columns));
|
|
|
|
|
PyStructSequence_SET_ITEM(termsize, 1, PyLong_FromLong(lines));
|
|
|
|
|
if (PyErr_Occurred()) {
|
|
|
|
|
Py_DECREF(termsize);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return termsize;
|
|
|
|
|
}
|
|
|
|
|
#endif /* defined(TERMSIZE_USE_CONIO) || defined(TERMSIZE_USE_IOCTL) */
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.cpu_count
|
|
|
|
|
|
2015-08-13 20:37:08 +01:00
|
|
|
Return the number of CPUs in the system; return None if indeterminable.
|
|
|
|
|
|
|
|
|
|
This number is not equivalent to the number of CPUs the current process can
|
|
|
|
|
use. The number of usable CPUs can be obtained with
|
|
|
|
|
``len(os.sched_getaffinity(0))``
|
2014-08-05 14:04:04 +10:00
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_cpu_count_impl(PyObject *module)
|
2016-07-07 18:20:03 +03:00
|
|
|
/*[clinic end generated code: output=5fc29463c3936a9c input=e7c8f4ba6dbbadd3]*/
|
2013-05-20 14:40:46 +02:00
|
|
|
{
|
2013-05-20 17:31:06 +02:00
|
|
|
int ncpu = 0;
|
2013-05-20 14:40:46 +02:00
|
|
|
#ifdef MS_WINDOWS
|
2019-09-11 16:15:39 +01:00
|
|
|
ncpu = GetActiveProcessorCount(ALL_PROCESSOR_GROUPS);
|
2013-05-20 14:40:46 +02:00
|
|
|
#elif defined(__hpux)
|
|
|
|
|
ncpu = mpctl(MPC_GETNUMSPUS, NULL, NULL);
|
|
|
|
|
#elif defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN)
|
|
|
|
|
ncpu = sysconf(_SC_NPROCESSORS_ONLN);
|
|
|
|
|
#elif defined(__DragonFly__) || \
|
|
|
|
|
defined(__OpenBSD__) || \
|
|
|
|
|
defined(__FreeBSD__) || \
|
2013-05-20 17:31:06 +02:00
|
|
|
defined(__NetBSD__) || \
|
|
|
|
|
defined(__APPLE__)
|
2013-05-20 17:40:32 +02:00
|
|
|
int mib[2];
|
|
|
|
|
size_t len = sizeof(ncpu);
|
|
|
|
|
mib[0] = CTL_HW;
|
|
|
|
|
mib[1] = HW_NCPU;
|
|
|
|
|
if (sysctl(mib, 2, &ncpu, &len, NULL, 0) != 0)
|
|
|
|
|
ncpu = 0;
|
2013-05-20 14:40:46 +02:00
|
|
|
#endif
|
|
|
|
|
if (ncpu >= 1)
|
|
|
|
|
return PyLong_FromLong(ncpu);
|
|
|
|
|
else
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-28 00:53:59 +02:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.get_inheritable -> bool
|
2013-08-28 00:53:59 +02:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
fd: int
|
|
|
|
|
/
|
2013-08-28 00:53:59 +02:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Get the close-on-exe flag of the specified file descriptor.
|
|
|
|
|
[clinic start generated code]*/
|
2013-08-28 00:53:59 +02:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
static int
|
2016-07-07 17:35:15 +03:00
|
|
|
os_get_inheritable_impl(PyObject *module, int fd)
|
|
|
|
|
/*[clinic end generated code: output=0445e20e149aa5b8 input=89ac008dc9ab6b95]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2015-04-12 00:26:27 -04:00
|
|
|
int return_value;
|
|
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
|
|
|
|
return_value = _Py_get_inheritable(fd);
|
|
|
|
|
_Py_END_SUPPRESS_IPH
|
|
|
|
|
return return_value;
|
2014-08-05 14:04:04 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.set_inheritable
|
|
|
|
|
fd: int
|
|
|
|
|
inheritable: int
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Set the inheritable flag of the specified file descriptor.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 17:35:15 +03:00
|
|
|
os_set_inheritable_impl(PyObject *module, int fd, int inheritable)
|
|
|
|
|
/*[clinic end generated code: output=f1b1918a2f3c38c2 input=9ceaead87a1e2402]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
2015-04-12 00:26:27 -04:00
|
|
|
int result;
|
2013-08-28 00:53:59 +02:00
|
|
|
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
|
|
|
|
result = _Py_set_inheritable(fd, inheritable, NULL);
|
|
|
|
|
_Py_END_SUPPRESS_IPH
|
|
|
|
|
if (result < 0)
|
2013-08-28 00:53:59 +02:00
|
|
|
return NULL;
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef MS_WINDOWS
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.get_handle_inheritable -> bool
|
2016-09-06 13:47:26 -07:00
|
|
|
handle: intptr_t
|
2014-08-05 14:04:04 +10:00
|
|
|
/
|
2013-08-28 00:53:59 +02:00
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
Get the close-on-exe flag of the specified file descriptor.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static int
|
2016-09-06 13:47:26 -07:00
|
|
|
os_get_handle_inheritable_impl(PyObject *module, intptr_t handle)
|
2016-09-06 15:54:20 -07:00
|
|
|
/*[clinic end generated code: output=36be5afca6ea84d8 input=cfe99f9c05c70ad1]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
DWORD flags;
|
2013-08-28 00:53:59 +02:00
|
|
|
|
|
|
|
|
if (!GetHandleInformation((HANDLE)handle, &flags)) {
|
|
|
|
|
PyErr_SetFromWindowsErr(0);
|
2014-08-05 14:04:04 +10:00
|
|
|
return -1;
|
2013-08-28 00:53:59 +02:00
|
|
|
}
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
return flags & HANDLE_FLAG_INHERIT;
|
2013-08-28 00:53:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2014-08-05 14:04:04 +10:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.set_handle_inheritable
|
2016-09-06 13:47:26 -07:00
|
|
|
handle: intptr_t
|
2014-08-05 14:04:04 +10:00
|
|
|
inheritable: bool
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|
Set the inheritable flag of the specified handle.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-09-06 13:47:26 -07:00
|
|
|
os_set_handle_inheritable_impl(PyObject *module, intptr_t handle,
|
2015-04-14 18:07:59 -04:00
|
|
|
int inheritable)
|
2016-09-06 15:54:20 -07:00
|
|
|
/*[clinic end generated code: output=021d74fe6c96baa3 input=7a7641390d8364fc]*/
|
2014-08-05 14:04:04 +10:00
|
|
|
{
|
|
|
|
|
DWORD flags = inheritable ? HANDLE_FLAG_INHERIT : 0;
|
2013-08-28 00:53:59 +02:00
|
|
|
if (!SetHandleInformation((HANDLE)handle, HANDLE_FLAG_INHERIT, flags)) {
|
|
|
|
|
PyErr_SetFromWindowsErr(0);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
2014-08-05 14:04:04 +10:00
|
|
|
#endif /* MS_WINDOWS */
|
2012-02-08 23:28:36 +01:00
|
|
|
|
2014-07-29 22:32:47 +02:00
|
|
|
#ifndef MS_WINDOWS
|
2018-09-17 15:38:27 +03:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.get_blocking -> bool
|
|
|
|
|
fd: int
|
|
|
|
|
/
|
2014-07-29 22:32:47 +02:00
|
|
|
|
2018-09-17 15:38:27 +03:00
|
|
|
Get the blocking mode of the file descriptor.
|
|
|
|
|
|
|
|
|
|
Return False if the O_NONBLOCK flag is set, True if the flag is cleared.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
os_get_blocking_impl(PyObject *module, int fd)
|
|
|
|
|
/*[clinic end generated code: output=336a12ad76a61482 input=f4afb59d51560179]*/
|
2014-07-29 22:32:47 +02:00
|
|
|
{
|
|
|
|
|
int blocking;
|
|
|
|
|
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
2014-07-29 22:32:47 +02:00
|
|
|
blocking = _Py_get_blocking(fd);
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_END_SUPPRESS_IPH
|
2018-09-17 15:38:27 +03:00
|
|
|
return blocking;
|
2014-07-29 22:32:47 +02:00
|
|
|
}
|
|
|
|
|
|
2018-09-17 15:38:27 +03:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.set_blocking
|
|
|
|
|
fd: int
|
|
|
|
|
blocking: bool(accept={int})
|
|
|
|
|
/
|
2014-07-29 22:32:47 +02:00
|
|
|
|
2018-09-17 15:38:27 +03:00
|
|
|
Set the blocking mode of the specified file descriptor.
|
2014-07-29 22:32:47 +02:00
|
|
|
|
2018-09-17 15:38:27 +03:00
|
|
|
Set the O_NONBLOCK flag if blocking is False,
|
|
|
|
|
clear the O_NONBLOCK flag otherwise.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
os_set_blocking_impl(PyObject *module, int fd, int blocking)
|
|
|
|
|
/*[clinic end generated code: output=384eb43aa0762a9d input=bf5c8efdc5860ff3]*/
|
|
|
|
|
{
|
|
|
|
|
int result;
|
2014-07-29 22:32:47 +02:00
|
|
|
|
2015-04-12 00:26:27 -04:00
|
|
|
_Py_BEGIN_SUPPRESS_IPH
|
|
|
|
|
result = _Py_set_blocking(fd, blocking);
|
|
|
|
|
_Py_END_SUPPRESS_IPH
|
|
|
|
|
if (result < 0)
|
2014-07-29 22:32:47 +02:00
|
|
|
return NULL;
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
|
|
|
|
#endif /* !MS_WINDOWS */
|
|
|
|
|
|
|
|
|
|
|
2016-11-06 13:45:33 +02:00
|
|
|
/*[clinic input]
|
2019-11-05 07:16:14 -08:00
|
|
|
class os.DirEntry "DirEntry *" "DirEntryType"
|
2016-11-06 13:45:33 +02:00
|
|
|
[clinic start generated code]*/
|
2019-11-05 07:16:14 -08:00
|
|
|
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=3c18c7a448247980]*/
|
2015-03-08 01:58:04 +01:00
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
PyObject_HEAD
|
|
|
|
|
PyObject *name;
|
|
|
|
|
PyObject *path;
|
|
|
|
|
PyObject *stat;
|
|
|
|
|
PyObject *lstat;
|
|
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
struct _Py_stat_struct win32_lstat;
|
2017-03-09 17:34:28 +01:00
|
|
|
uint64_t win32_file_index;
|
2015-03-08 01:58:04 +01:00
|
|
|
int got_file_index;
|
|
|
|
|
#else /* POSIX */
|
2015-03-08 02:59:09 +01:00
|
|
|
#ifdef HAVE_DIRENT_D_TYPE
|
2015-03-08 01:58:04 +01:00
|
|
|
unsigned char d_type;
|
2015-03-08 02:59:09 +01:00
|
|
|
#endif
|
2015-03-08 01:58:04 +01:00
|
|
|
ino_t d_ino;
|
2017-03-30 09:12:31 +03:00
|
|
|
int dir_fd;
|
2015-03-08 01:58:04 +01:00
|
|
|
#endif
|
|
|
|
|
} DirEntry;
|
|
|
|
|
|
2019-11-05 07:16:14 -08:00
|
|
|
static PyObject *
|
|
|
|
|
_disabled_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
|
|
|
|
|
{
|
|
|
|
|
PyErr_Format(PyExc_TypeError,
|
|
|
|
|
"cannot create '%.100s' instances", _PyType_Name(type));
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-08 01:58:04 +01:00
|
|
|
static void
|
|
|
|
|
DirEntry_dealloc(DirEntry *entry)
|
|
|
|
|
{
|
2019-11-05 07:16:14 -08:00
|
|
|
PyTypeObject *tp = Py_TYPE(entry);
|
2015-03-08 01:58:04 +01:00
|
|
|
Py_XDECREF(entry->name);
|
|
|
|
|
Py_XDECREF(entry->path);
|
|
|
|
|
Py_XDECREF(entry->stat);
|
|
|
|
|
Py_XDECREF(entry->lstat);
|
2019-11-05 07:16:14 -08:00
|
|
|
freefunc free_func = PyType_GetSlot(tp, Py_tp_free);
|
|
|
|
|
free_func(entry);
|
|
|
|
|
Py_DECREF(tp);
|
2015-03-08 01:58:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Forward reference */
|
|
|
|
|
static int
|
2020-05-14 18:05:58 +02:00
|
|
|
DirEntry_test_mode(PyTypeObject *defining_class, DirEntry *self,
|
|
|
|
|
int follow_symlinks, unsigned short mode_bits);
|
2015-03-08 01:58:04 +01:00
|
|
|
|
2016-11-06 13:45:33 +02:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.DirEntry.is_symlink -> bool
|
2020-05-14 18:05:58 +02:00
|
|
|
defining_class: defining_class
|
|
|
|
|
/
|
2016-11-06 13:45:33 +02:00
|
|
|
|
|
|
|
|
Return True if the entry is a symbolic link; cached per entry.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
2015-03-08 01:58:04 +01:00
|
|
|
static int
|
2020-05-14 18:05:58 +02:00
|
|
|
os_DirEntry_is_symlink_impl(DirEntry *self, PyTypeObject *defining_class)
|
|
|
|
|
/*[clinic end generated code: output=293096d589b6d47c input=e9acc5ee4d511113]*/
|
2015-03-08 01:58:04 +01:00
|
|
|
{
|
|
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
return (self->win32_lstat.st_mode & S_IFMT) == S_IFLNK;
|
2015-03-08 02:59:09 +01:00
|
|
|
#elif defined(HAVE_DIRENT_D_TYPE)
|
|
|
|
|
/* POSIX */
|
2015-03-08 01:58:04 +01:00
|
|
|
if (self->d_type != DT_UNKNOWN)
|
|
|
|
|
return self->d_type == DT_LNK;
|
|
|
|
|
else
|
2020-05-14 18:05:58 +02:00
|
|
|
return DirEntry_test_mode(defining_class, self, 0, S_IFLNK);
|
2015-03-08 02:59:09 +01:00
|
|
|
#else
|
|
|
|
|
/* POSIX without d_type */
|
2020-05-14 18:05:58 +02:00
|
|
|
return DirEntry_test_mode(defining_class, self, 0, S_IFLNK);
|
2015-03-08 01:58:04 +01:00
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2020-05-14 18:05:58 +02:00
|
|
|
DirEntry_fetch_stat(PyObject *module, DirEntry *self, int follow_symlinks)
|
2015-03-08 01:58:04 +01:00
|
|
|
{
|
|
|
|
|
int result;
|
2016-10-08 20:16:57 +03:00
|
|
|
STRUCT_STAT st;
|
|
|
|
|
PyObject *ub;
|
2015-03-08 01:58:04 +01:00
|
|
|
|
|
|
|
|
#ifdef MS_WINDOWS
|
2017-03-30 09:12:31 +03:00
|
|
|
if (!PyUnicode_FSDecoder(self->path, &ub))
|
|
|
|
|
return NULL;
|
2021-03-16 08:03:37 +02:00
|
|
|
_Py_COMP_DIAG_PUSH
|
|
|
|
|
_Py_COMP_DIAG_IGNORE_DEPR_DECLS
|
2017-03-30 09:12:31 +03:00
|
|
|
const wchar_t *path = PyUnicode_AsUnicode(ub);
|
2021-03-16 08:03:37 +02:00
|
|
|
_Py_COMP_DIAG_POP
|
2015-03-08 01:58:04 +01:00
|
|
|
#else /* POSIX */
|
2017-03-30 09:12:31 +03:00
|
|
|
if (!PyUnicode_FSConverter(self->path, &ub))
|
|
|
|
|
return NULL;
|
|
|
|
|
const char *path = PyBytes_AS_STRING(ub);
|
|
|
|
|
if (self->dir_fd != DEFAULT_DIR_FD) {
|
|
|
|
|
#ifdef HAVE_FSTATAT
|
2020-11-22 11:18:40 +01:00
|
|
|
if (HAVE_FSTATAT_RUNTIME) {
|
2017-03-30 09:12:31 +03:00
|
|
|
result = fstatat(self->dir_fd, path, &st,
|
|
|
|
|
follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW);
|
2020-11-22 11:18:40 +01:00
|
|
|
} else
|
|
|
|
|
|
|
|
|
|
#endif /* HAVE_FSTATAT */
|
|
|
|
|
{
|
|
|
|
|
Py_DECREF(ub);
|
2017-03-30 09:12:31 +03:00
|
|
|
PyErr_SetString(PyExc_NotImplementedError, "can't fetch stat");
|
|
|
|
|
return NULL;
|
2020-11-22 11:18:40 +01:00
|
|
|
}
|
2017-03-30 09:12:31 +03:00
|
|
|
}
|
|
|
|
|
else
|
2016-10-08 20:16:57 +03:00
|
|
|
#endif
|
2017-03-30 09:12:31 +03:00
|
|
|
{
|
2016-10-08 20:16:57 +03:00
|
|
|
if (follow_symlinks)
|
|
|
|
|
result = STAT(path, &st);
|
|
|
|
|
else
|
|
|
|
|
result = LSTAT(path, &st);
|
2017-03-30 09:12:31 +03:00
|
|
|
}
|
|
|
|
|
Py_DECREF(ub);
|
2015-03-08 01:58:04 +01:00
|
|
|
|
|
|
|
|
if (result != 0)
|
2016-10-08 20:16:57 +03:00
|
|
|
return path_object_error(self->path);
|
2015-03-08 01:58:04 +01:00
|
|
|
|
2020-05-14 18:05:58 +02:00
|
|
|
return _pystat_fromstructstat(module, &st);
|
2015-03-08 01:58:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2020-05-14 18:05:58 +02:00
|
|
|
DirEntry_get_lstat(PyTypeObject *defining_class, DirEntry *self)
|
2015-03-08 01:58:04 +01:00
|
|
|
{
|
|
|
|
|
if (!self->lstat) {
|
2020-05-14 18:05:58 +02:00
|
|
|
PyObject *module = PyType_GetModule(defining_class);
|
2015-03-08 01:58:04 +01:00
|
|
|
#ifdef MS_WINDOWS
|
2020-05-14 18:05:58 +02:00
|
|
|
self->lstat = _pystat_fromstructstat(module, &self->win32_lstat);
|
2015-03-08 01:58:04 +01:00
|
|
|
#else /* POSIX */
|
2020-05-14 18:05:58 +02:00
|
|
|
self->lstat = DirEntry_fetch_stat(module, self, 0);
|
2015-03-08 01:58:04 +01:00
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
Py_XINCREF(self->lstat);
|
|
|
|
|
return self->lstat;
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-06 13:45:33 +02:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.DirEntry.stat
|
2020-05-14 18:05:58 +02:00
|
|
|
defining_class: defining_class
|
|
|
|
|
/
|
2016-11-06 13:45:33 +02:00
|
|
|
*
|
|
|
|
|
follow_symlinks: bool = True
|
|
|
|
|
|
|
|
|
|
Return stat_result object for the entry; cached per entry.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
2015-03-08 01:58:04 +01:00
|
|
|
static PyObject *
|
2020-05-14 18:05:58 +02:00
|
|
|
os_DirEntry_stat_impl(DirEntry *self, PyTypeObject *defining_class,
|
|
|
|
|
int follow_symlinks)
|
|
|
|
|
/*[clinic end generated code: output=23f803e19c3e780e input=e816273c4e67ee98]*/
|
2015-03-08 01:58:04 +01:00
|
|
|
{
|
2020-05-14 18:05:58 +02:00
|
|
|
if (!follow_symlinks) {
|
|
|
|
|
return DirEntry_get_lstat(defining_class, self);
|
|
|
|
|
}
|
2015-03-08 01:58:04 +01:00
|
|
|
|
|
|
|
|
if (!self->stat) {
|
2020-05-14 18:05:58 +02:00
|
|
|
int result = os_DirEntry_is_symlink_impl(self, defining_class);
|
|
|
|
|
if (result == -1) {
|
2015-03-08 01:58:04 +01:00
|
|
|
return NULL;
|
2020-05-14 18:05:58 +02:00
|
|
|
}
|
|
|
|
|
if (result) {
|
|
|
|
|
PyObject *module = PyType_GetModule(defining_class);
|
|
|
|
|
self->stat = DirEntry_fetch_stat(module, self, 1);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
self->stat = DirEntry_get_lstat(defining_class, self);
|
|
|
|
|
}
|
2015-03-08 01:58:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Py_XINCREF(self->stat);
|
|
|
|
|
return self->stat;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Set exception and return -1 on error, 0 for False, 1 for True */
|
|
|
|
|
static int
|
2020-05-14 18:05:58 +02:00
|
|
|
DirEntry_test_mode(PyTypeObject *defining_class, DirEntry *self,
|
|
|
|
|
int follow_symlinks, unsigned short mode_bits)
|
2015-03-08 01:58:04 +01:00
|
|
|
{
|
|
|
|
|
PyObject *stat = NULL;
|
|
|
|
|
PyObject *st_mode = NULL;
|
|
|
|
|
long mode;
|
|
|
|
|
int result;
|
2015-03-08 02:59:09 +01:00
|
|
|
#if defined(MS_WINDOWS) || defined(HAVE_DIRENT_D_TYPE)
|
2015-03-08 01:58:04 +01:00
|
|
|
int is_symlink;
|
|
|
|
|
int need_stat;
|
2015-03-08 02:59:09 +01:00
|
|
|
#endif
|
2015-03-08 01:58:04 +01:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
unsigned long dir_bits;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
is_symlink = (self->win32_lstat.st_mode & S_IFMT) == S_IFLNK;
|
|
|
|
|
need_stat = follow_symlinks && is_symlink;
|
2015-03-08 02:59:09 +01:00
|
|
|
#elif defined(HAVE_DIRENT_D_TYPE)
|
2015-03-08 01:58:04 +01:00
|
|
|
is_symlink = self->d_type == DT_LNK;
|
|
|
|
|
need_stat = self->d_type == DT_UNKNOWN || (follow_symlinks && is_symlink);
|
|
|
|
|
#endif
|
|
|
|
|
|
2015-03-08 02:59:09 +01:00
|
|
|
#if defined(MS_WINDOWS) || defined(HAVE_DIRENT_D_TYPE)
|
2015-03-08 01:58:04 +01:00
|
|
|
if (need_stat) {
|
2015-03-08 02:59:09 +01:00
|
|
|
#endif
|
2020-05-14 18:05:58 +02:00
|
|
|
stat = os_DirEntry_stat_impl(self, defining_class, follow_symlinks);
|
2015-03-08 01:58:04 +01:00
|
|
|
if (!stat) {
|
|
|
|
|
if (PyErr_ExceptionMatches(PyExc_FileNotFoundError)) {
|
|
|
|
|
/* If file doesn't exist (anymore), then return False
|
|
|
|
|
(i.e., say it's not a file/directory) */
|
|
|
|
|
PyErr_Clear();
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
2020-05-14 18:05:58 +02:00
|
|
|
_posixstate* state = get_posix_state(PyType_GetModule(defining_class));
|
|
|
|
|
st_mode = PyObject_GetAttr(stat, state->st_mode);
|
2015-03-08 01:58:04 +01:00
|
|
|
if (!st_mode)
|
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
|
|
mode = PyLong_AsLong(st_mode);
|
|
|
|
|
if (mode == -1 && PyErr_Occurred())
|
|
|
|
|
goto error;
|
|
|
|
|
Py_CLEAR(st_mode);
|
|
|
|
|
Py_CLEAR(stat);
|
|
|
|
|
result = (mode & S_IFMT) == mode_bits;
|
2015-03-08 02:59:09 +01:00
|
|
|
#if defined(MS_WINDOWS) || defined(HAVE_DIRENT_D_TYPE)
|
2015-03-08 01:58:04 +01:00
|
|
|
}
|
|
|
|
|
else if (is_symlink) {
|
|
|
|
|
assert(mode_bits != S_IFLNK);
|
|
|
|
|
result = 0;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
assert(mode_bits == S_IFDIR || mode_bits == S_IFREG);
|
|
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
dir_bits = self->win32_lstat.st_file_attributes & FILE_ATTRIBUTE_DIRECTORY;
|
|
|
|
|
if (mode_bits == S_IFDIR)
|
|
|
|
|
result = dir_bits != 0;
|
|
|
|
|
else
|
|
|
|
|
result = dir_bits == 0;
|
|
|
|
|
#else /* POSIX */
|
|
|
|
|
if (mode_bits == S_IFDIR)
|
|
|
|
|
result = self->d_type == DT_DIR;
|
|
|
|
|
else
|
|
|
|
|
result = self->d_type == DT_REG;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
2015-03-08 02:59:09 +01:00
|
|
|
#endif
|
2015-03-08 01:58:04 +01:00
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
Py_XDECREF(st_mode);
|
|
|
|
|
Py_XDECREF(stat);
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-06 13:45:33 +02:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.DirEntry.is_dir -> bool
|
2020-05-14 18:05:58 +02:00
|
|
|
defining_class: defining_class
|
|
|
|
|
/
|
2016-11-06 13:45:33 +02:00
|
|
|
*
|
|
|
|
|
follow_symlinks: bool = True
|
2015-03-08 01:58:04 +01:00
|
|
|
|
2016-11-06 13:45:33 +02:00
|
|
|
Return True if the entry is a directory; cached per entry.
|
|
|
|
|
[clinic start generated code]*/
|
2015-03-08 01:58:04 +01:00
|
|
|
|
2016-11-06 13:45:33 +02:00
|
|
|
static int
|
2020-05-14 18:05:58 +02:00
|
|
|
os_DirEntry_is_dir_impl(DirEntry *self, PyTypeObject *defining_class,
|
|
|
|
|
int follow_symlinks)
|
|
|
|
|
/*[clinic end generated code: output=0cd453b9c0987fdf input=1a4ffd6dec9920cb]*/
|
2015-03-08 01:58:04 +01:00
|
|
|
{
|
2020-05-14 18:05:58 +02:00
|
|
|
return DirEntry_test_mode(defining_class, self, follow_symlinks, S_IFDIR);
|
2016-11-06 13:45:33 +02:00
|
|
|
}
|
2015-03-08 01:58:04 +01:00
|
|
|
|
2016-11-06 13:45:33 +02:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.DirEntry.is_file -> bool
|
2020-05-14 18:05:58 +02:00
|
|
|
defining_class: defining_class
|
|
|
|
|
/
|
2016-11-06 13:45:33 +02:00
|
|
|
*
|
|
|
|
|
follow_symlinks: bool = True
|
2015-03-08 01:58:04 +01:00
|
|
|
|
2016-11-06 13:45:33 +02:00
|
|
|
Return True if the entry is a file; cached per entry.
|
|
|
|
|
[clinic start generated code]*/
|
2015-03-08 01:58:04 +01:00
|
|
|
|
2016-11-06 13:45:33 +02:00
|
|
|
static int
|
2020-05-14 18:05:58 +02:00
|
|
|
os_DirEntry_is_file_impl(DirEntry *self, PyTypeObject *defining_class,
|
|
|
|
|
int follow_symlinks)
|
|
|
|
|
/*[clinic end generated code: output=f7c277ab5ba80908 input=0a64c5a12e802e3b]*/
|
2015-03-08 01:58:04 +01:00
|
|
|
{
|
2020-05-14 18:05:58 +02:00
|
|
|
return DirEntry_test_mode(defining_class, self, follow_symlinks, S_IFREG);
|
2016-11-06 13:45:33 +02:00
|
|
|
}
|
2015-03-08 01:58:04 +01:00
|
|
|
|
2016-11-06 13:45:33 +02:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.DirEntry.inode
|
2015-03-08 01:58:04 +01:00
|
|
|
|
2016-11-06 13:45:33 +02:00
|
|
|
Return inode of the entry; cached per entry.
|
|
|
|
|
[clinic start generated code]*/
|
2015-03-08 01:58:04 +01:00
|
|
|
|
|
|
|
|
static PyObject *
|
2016-11-06 13:45:33 +02:00
|
|
|
os_DirEntry_inode_impl(DirEntry *self)
|
|
|
|
|
/*[clinic end generated code: output=156bb3a72162440e input=3ee7b872ae8649f0]*/
|
2015-03-08 01:58:04 +01:00
|
|
|
{
|
|
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
if (!self->got_file_index) {
|
2016-10-08 20:16:57 +03:00
|
|
|
PyObject *unicode;
|
2016-05-07 16:45:18 +03:00
|
|
|
const wchar_t *path;
|
2016-10-08 20:16:57 +03:00
|
|
|
STRUCT_STAT stat;
|
|
|
|
|
int result;
|
2015-03-08 01:58:04 +01:00
|
|
|
|
2016-10-08 20:16:57 +03:00
|
|
|
if (!PyUnicode_FSDecoder(self->path, &unicode))
|
2015-03-08 01:58:04 +01:00
|
|
|
return NULL;
|
2021-03-16 08:03:37 +02:00
|
|
|
_Py_COMP_DIAG_PUSH
|
|
|
|
|
_Py_COMP_DIAG_IGNORE_DEPR_DECLS
|
2016-10-08 20:16:57 +03:00
|
|
|
path = PyUnicode_AsUnicode(unicode);
|
2021-03-16 08:03:37 +02:00
|
|
|
_Py_COMP_DIAG_POP
|
2016-10-08 20:16:57 +03:00
|
|
|
result = LSTAT(path, &stat);
|
|
|
|
|
Py_DECREF(unicode);
|
2015-03-08 01:58:04 +01:00
|
|
|
|
2016-10-08 20:16:57 +03:00
|
|
|
if (result != 0)
|
|
|
|
|
return path_object_error(self->path);
|
2015-03-08 01:58:04 +01:00
|
|
|
|
|
|
|
|
self->win32_file_index = stat.st_ino;
|
|
|
|
|
self->got_file_index = 1;
|
|
|
|
|
}
|
2017-03-09 17:34:28 +01:00
|
|
|
Py_BUILD_ASSERT(sizeof(unsigned long long) >= sizeof(self->win32_file_index));
|
|
|
|
|
return PyLong_FromUnsignedLongLong(self->win32_file_index);
|
2015-03-08 01:58:04 +01:00
|
|
|
#else /* POSIX */
|
2017-05-22 11:15:08 +02:00
|
|
|
Py_BUILD_ASSERT(sizeof(unsigned long long) >= sizeof(self->d_ino));
|
|
|
|
|
return PyLong_FromUnsignedLongLong(self->d_ino);
|
2015-03-08 01:58:04 +01:00
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
DirEntry_repr(DirEntry *self)
|
|
|
|
|
{
|
|
|
|
|
return PyUnicode_FromFormat("<DirEntry %R>", self->name);
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-06 13:45:33 +02:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.DirEntry.__fspath__
|
|
|
|
|
|
|
|
|
|
Returns the path for the entry.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
2016-06-10 14:37:21 -07:00
|
|
|
static PyObject *
|
2016-11-06 13:45:33 +02:00
|
|
|
os_DirEntry___fspath___impl(DirEntry *self)
|
|
|
|
|
/*[clinic end generated code: output=6dd7f7ef752e6f4f input=3c49d0cf38df4fac]*/
|
2016-06-10 14:37:21 -07:00
|
|
|
{
|
|
|
|
|
Py_INCREF(self->path);
|
|
|
|
|
return self->path;
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-08 01:58:04 +01:00
|
|
|
static PyMemberDef DirEntry_members[] = {
|
|
|
|
|
{"name", T_OBJECT_EX, offsetof(DirEntry, name), READONLY,
|
|
|
|
|
"the entry's base filename, relative to scandir() \"path\" argument"},
|
|
|
|
|
{"path", T_OBJECT_EX, offsetof(DirEntry, path), READONLY,
|
|
|
|
|
"the entry's full path name; equivalent to os.path.join(scandir_path, entry.name)"},
|
|
|
|
|
{NULL}
|
|
|
|
|
};
|
|
|
|
|
|
2016-11-06 13:45:33 +02:00
|
|
|
#include "clinic/posixmodule.c.h"
|
|
|
|
|
|
2015-03-08 01:58:04 +01:00
|
|
|
static PyMethodDef DirEntry_methods[] = {
|
2016-11-06 13:45:33 +02:00
|
|
|
OS_DIRENTRY_IS_DIR_METHODDEF
|
|
|
|
|
OS_DIRENTRY_IS_FILE_METHODDEF
|
|
|
|
|
OS_DIRENTRY_IS_SYMLINK_METHODDEF
|
|
|
|
|
OS_DIRENTRY_STAT_METHODDEF
|
|
|
|
|
OS_DIRENTRY_INODE_METHODDEF
|
|
|
|
|
OS_DIRENTRY___FSPATH___METHODDEF
|
2020-04-08 00:37:19 +03:00
|
|
|
{"__class_getitem__", (PyCFunction)Py_GenericAlias,
|
|
|
|
|
METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},
|
2015-03-08 01:58:04 +01:00
|
|
|
{NULL}
|
|
|
|
|
};
|
|
|
|
|
|
2019-11-05 07:16:14 -08:00
|
|
|
static PyType_Slot DirEntryType_slots[] = {
|
|
|
|
|
{Py_tp_new, _disabled_new},
|
|
|
|
|
{Py_tp_dealloc, DirEntry_dealloc},
|
|
|
|
|
{Py_tp_repr, DirEntry_repr},
|
|
|
|
|
{Py_tp_methods, DirEntry_methods},
|
|
|
|
|
{Py_tp_members, DirEntry_members},
|
|
|
|
|
{0, 0},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static PyType_Spec DirEntryType_spec = {
|
|
|
|
|
MODNAME ".DirEntry",
|
|
|
|
|
sizeof(DirEntry),
|
|
|
|
|
0,
|
|
|
|
|
Py_TPFLAGS_DEFAULT,
|
|
|
|
|
DirEntryType_slots
|
2015-03-08 01:58:04 +01:00
|
|
|
};
|
|
|
|
|
|
2019-11-05 07:16:14 -08:00
|
|
|
|
2015-03-08 01:58:04 +01:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
|
|
|
|
|
static wchar_t *
|
2016-05-07 16:45:18 +03:00
|
|
|
join_path_filenameW(const wchar_t *path_wide, const wchar_t *filename)
|
2015-03-08 01:58:04 +01:00
|
|
|
{
|
|
|
|
|
Py_ssize_t path_len;
|
|
|
|
|
Py_ssize_t size;
|
|
|
|
|
wchar_t *result;
|
|
|
|
|
wchar_t ch;
|
|
|
|
|
|
|
|
|
|
if (!path_wide) { /* Default arg: "." */
|
|
|
|
|
path_wide = L".";
|
|
|
|
|
path_len = 1;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
path_len = wcslen(path_wide);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* The +1's are for the path separator and the NUL */
|
|
|
|
|
size = path_len + 1 + wcslen(filename) + 1;
|
|
|
|
|
result = PyMem_New(wchar_t, size);
|
|
|
|
|
if (!result) {
|
|
|
|
|
PyErr_NoMemory();
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
wcscpy(result, path_wide);
|
|
|
|
|
if (path_len > 0) {
|
|
|
|
|
ch = result[path_len - 1];
|
|
|
|
|
if (ch != SEP && ch != ALTSEP && ch != L':')
|
|
|
|
|
result[path_len++] = SEP;
|
|
|
|
|
wcscpy(result + path_len, filename);
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2020-05-10 11:05:29 +02:00
|
|
|
DirEntry_from_find_data(PyObject *module, path_t *path, WIN32_FIND_DATAW *dataW)
|
2015-03-08 01:58:04 +01:00
|
|
|
{
|
|
|
|
|
DirEntry *entry;
|
|
|
|
|
BY_HANDLE_FILE_INFORMATION file_info;
|
|
|
|
|
ULONG reparse_tag;
|
|
|
|
|
wchar_t *joined_path;
|
|
|
|
|
|
2020-05-10 11:05:29 +02:00
|
|
|
PyObject *DirEntryType = get_posix_state(module)->DirEntryType;
|
2019-11-05 07:16:14 -08:00
|
|
|
entry = PyObject_New(DirEntry, (PyTypeObject *)DirEntryType);
|
2015-03-08 01:58:04 +01:00
|
|
|
if (!entry)
|
|
|
|
|
return NULL;
|
|
|
|
|
entry->name = NULL;
|
|
|
|
|
entry->path = NULL;
|
|
|
|
|
entry->stat = NULL;
|
|
|
|
|
entry->lstat = NULL;
|
|
|
|
|
entry->got_file_index = 0;
|
|
|
|
|
|
|
|
|
|
entry->name = PyUnicode_FromWideChar(dataW->cFileName, -1);
|
|
|
|
|
if (!entry->name)
|
|
|
|
|
goto error;
|
2016-09-08 10:35:16 -07:00
|
|
|
if (path->narrow) {
|
|
|
|
|
Py_SETREF(entry->name, PyUnicode_EncodeFSDefault(entry->name));
|
|
|
|
|
if (!entry->name)
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
2015-03-08 01:58:04 +01:00
|
|
|
|
|
|
|
|
joined_path = join_path_filenameW(path->wide, dataW->cFileName);
|
|
|
|
|
if (!joined_path)
|
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
|
|
entry->path = PyUnicode_FromWideChar(joined_path, -1);
|
|
|
|
|
PyMem_Free(joined_path);
|
|
|
|
|
if (!entry->path)
|
|
|
|
|
goto error;
|
2016-09-08 10:35:16 -07:00
|
|
|
if (path->narrow) {
|
|
|
|
|
Py_SETREF(entry->path, PyUnicode_EncodeFSDefault(entry->path));
|
|
|
|
|
if (!entry->path)
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
2015-03-08 01:58:04 +01:00
|
|
|
|
2016-09-08 10:35:16 -07:00
|
|
|
find_data_to_file_info(dataW, &file_info, &reparse_tag);
|
2015-03-08 01:58:04 +01:00
|
|
|
_Py_attribute_data_to_stat(&file_info, reparse_tag, &entry->win32_lstat);
|
|
|
|
|
|
|
|
|
|
return (PyObject *)entry;
|
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
Py_DECREF(entry);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#else /* POSIX */
|
|
|
|
|
|
|
|
|
|
static char *
|
2015-12-25 20:01:53 +02:00
|
|
|
join_path_filename(const char *path_narrow, const char* filename, Py_ssize_t filename_len)
|
2015-03-08 01:58:04 +01:00
|
|
|
{
|
|
|
|
|
Py_ssize_t path_len;
|
|
|
|
|
Py_ssize_t size;
|
|
|
|
|
char *result;
|
|
|
|
|
|
|
|
|
|
if (!path_narrow) { /* Default arg: "." */
|
|
|
|
|
path_narrow = ".";
|
|
|
|
|
path_len = 1;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
path_len = strlen(path_narrow);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (filename_len == -1)
|
|
|
|
|
filename_len = strlen(filename);
|
|
|
|
|
|
|
|
|
|
/* The +1's are for the path separator and the NUL */
|
|
|
|
|
size = path_len + 1 + filename_len + 1;
|
|
|
|
|
result = PyMem_New(char, size);
|
|
|
|
|
if (!result) {
|
|
|
|
|
PyErr_NoMemory();
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
strcpy(result, path_narrow);
|
|
|
|
|
if (path_len > 0 && result[path_len - 1] != '/')
|
|
|
|
|
result[path_len++] = '/';
|
|
|
|
|
strcpy(result + path_len, filename);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2020-05-10 11:05:29 +02:00
|
|
|
DirEntry_from_posix_info(PyObject *module, path_t *path, const char *name,
|
|
|
|
|
Py_ssize_t name_len, ino_t d_ino
|
2015-03-08 02:59:09 +01:00
|
|
|
#ifdef HAVE_DIRENT_D_TYPE
|
|
|
|
|
, unsigned char d_type
|
|
|
|
|
#endif
|
|
|
|
|
)
|
2015-03-08 01:58:04 +01:00
|
|
|
{
|
|
|
|
|
DirEntry *entry;
|
|
|
|
|
char *joined_path;
|
|
|
|
|
|
2020-05-10 11:05:29 +02:00
|
|
|
PyObject *DirEntryType = get_posix_state(module)->DirEntryType;
|
2019-11-05 07:16:14 -08:00
|
|
|
entry = PyObject_New(DirEntry, (PyTypeObject *)DirEntryType);
|
2015-03-08 01:58:04 +01:00
|
|
|
if (!entry)
|
|
|
|
|
return NULL;
|
|
|
|
|
entry->name = NULL;
|
|
|
|
|
entry->path = NULL;
|
|
|
|
|
entry->stat = NULL;
|
|
|
|
|
entry->lstat = NULL;
|
|
|
|
|
|
2017-03-30 09:12:31 +03:00
|
|
|
if (path->fd != -1) {
|
|
|
|
|
entry->dir_fd = path->fd;
|
|
|
|
|
joined_path = NULL;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
entry->dir_fd = DEFAULT_DIR_FD;
|
|
|
|
|
joined_path = join_path_filename(path->narrow, name, name_len);
|
|
|
|
|
if (!joined_path)
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
2015-03-08 01:58:04 +01:00
|
|
|
|
2017-07-11 06:36:46 +03:00
|
|
|
if (!path->narrow || !PyObject_CheckBuffer(path->object)) {
|
2015-03-08 01:58:04 +01:00
|
|
|
entry->name = PyUnicode_DecodeFSDefaultAndSize(name, name_len);
|
2017-03-30 09:12:31 +03:00
|
|
|
if (joined_path)
|
|
|
|
|
entry->path = PyUnicode_DecodeFSDefault(joined_path);
|
2015-03-08 01:58:04 +01:00
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
entry->name = PyBytes_FromStringAndSize(name, name_len);
|
2017-03-30 09:12:31 +03:00
|
|
|
if (joined_path)
|
|
|
|
|
entry->path = PyBytes_FromString(joined_path);
|
2015-03-08 01:58:04 +01:00
|
|
|
}
|
|
|
|
|
PyMem_Free(joined_path);
|
2017-03-30 09:12:31 +03:00
|
|
|
if (!entry->name)
|
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
|
|
if (path->fd != -1) {
|
|
|
|
|
entry->path = entry->name;
|
|
|
|
|
Py_INCREF(entry->path);
|
|
|
|
|
}
|
|
|
|
|
else if (!entry->path)
|
2015-03-08 01:58:04 +01:00
|
|
|
goto error;
|
|
|
|
|
|
2015-03-08 02:59:09 +01:00
|
|
|
#ifdef HAVE_DIRENT_D_TYPE
|
2015-03-08 01:58:04 +01:00
|
|
|
entry->d_type = d_type;
|
2015-03-08 02:59:09 +01:00
|
|
|
#endif
|
2015-03-08 01:58:04 +01:00
|
|
|
entry->d_ino = d_ino;
|
|
|
|
|
|
|
|
|
|
return (PyObject *)entry;
|
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
Py_XDECREF(entry);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
PyObject_HEAD
|
|
|
|
|
path_t path;
|
|
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
HANDLE handle;
|
|
|
|
|
WIN32_FIND_DATAW file_data;
|
|
|
|
|
int first_time;
|
|
|
|
|
#else /* POSIX */
|
|
|
|
|
DIR *dirp;
|
|
|
|
|
#endif
|
2017-03-30 09:12:31 +03:00
|
|
|
#ifdef HAVE_FDOPENDIR
|
|
|
|
|
int fd;
|
|
|
|
|
#endif
|
2015-03-08 01:58:04 +01:00
|
|
|
} ScandirIterator;
|
|
|
|
|
|
|
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
|
2016-02-11 13:21:30 +02:00
|
|
|
static int
|
|
|
|
|
ScandirIterator_is_closed(ScandirIterator *iterator)
|
|
|
|
|
{
|
|
|
|
|
return iterator->handle == INVALID_HANDLE_VALUE;
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-08 01:58:04 +01:00
|
|
|
static void
|
2016-02-11 13:21:30 +02:00
|
|
|
ScandirIterator_closedir(ScandirIterator *iterator)
|
2015-03-08 01:58:04 +01:00
|
|
|
{
|
Issue #26494: Fixed crash on iterating exhausting iterators.
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
2016-03-30 20:40:02 +03:00
|
|
|
HANDLE handle = iterator->handle;
|
|
|
|
|
|
|
|
|
|
if (handle == INVALID_HANDLE_VALUE)
|
2015-03-08 01:58:04 +01:00
|
|
|
return;
|
|
|
|
|
|
Issue #26494: Fixed crash on iterating exhausting iterators.
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
2016-03-30 20:40:02 +03:00
|
|
|
iterator->handle = INVALID_HANDLE_VALUE;
|
2015-03-08 01:58:04 +01:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
Issue #26494: Fixed crash on iterating exhausting iterators.
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
2016-03-30 20:40:02 +03:00
|
|
|
FindClose(handle);
|
2015-03-08 01:58:04 +01:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
ScandirIterator_iternext(ScandirIterator *iterator)
|
|
|
|
|
{
|
|
|
|
|
WIN32_FIND_DATAW *file_data = &iterator->file_data;
|
|
|
|
|
BOOL success;
|
2016-02-08 17:56:36 +02:00
|
|
|
PyObject *entry;
|
2015-03-08 01:58:04 +01:00
|
|
|
|
2016-02-11 13:21:30 +02:00
|
|
|
/* Happens if the iterator is iterated twice, or closed explicitly */
|
2016-02-08 17:56:36 +02:00
|
|
|
if (iterator->handle == INVALID_HANDLE_VALUE)
|
2015-03-08 01:58:04 +01:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
while (1) {
|
|
|
|
|
if (!iterator->first_time) {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
success = FindNextFileW(iterator->handle, file_data);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
if (!success) {
|
2016-02-08 17:56:36 +02:00
|
|
|
/* Error or no more files */
|
2015-03-08 01:58:04 +01:00
|
|
|
if (GetLastError() != ERROR_NO_MORE_FILES)
|
2016-02-08 17:56:36 +02:00
|
|
|
path_error(&iterator->path);
|
2015-03-08 01:58:04 +01:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
iterator->first_time = 0;
|
|
|
|
|
|
|
|
|
|
/* Skip over . and .. */
|
|
|
|
|
if (wcscmp(file_data->cFileName, L".") != 0 &&
|
2020-05-10 11:05:29 +02:00
|
|
|
wcscmp(file_data->cFileName, L"..") != 0)
|
|
|
|
|
{
|
|
|
|
|
PyObject *module = PyType_GetModule(Py_TYPE(iterator));
|
|
|
|
|
entry = DirEntry_from_find_data(module, &iterator->path, file_data);
|
2016-02-08 17:56:36 +02:00
|
|
|
if (!entry)
|
|
|
|
|
break;
|
|
|
|
|
return entry;
|
|
|
|
|
}
|
2015-03-08 01:58:04 +01:00
|
|
|
|
|
|
|
|
/* Loop till we get a non-dot directory or finish iterating */
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-08 17:56:36 +02:00
|
|
|
/* Error or no more files */
|
2016-02-11 13:21:30 +02:00
|
|
|
ScandirIterator_closedir(iterator);
|
2015-03-08 01:58:04 +01:00
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#else /* POSIX */
|
|
|
|
|
|
2016-02-11 13:21:30 +02:00
|
|
|
static int
|
|
|
|
|
ScandirIterator_is_closed(ScandirIterator *iterator)
|
|
|
|
|
{
|
|
|
|
|
return !iterator->dirp;
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-08 01:58:04 +01:00
|
|
|
static void
|
2016-02-11 13:21:30 +02:00
|
|
|
ScandirIterator_closedir(ScandirIterator *iterator)
|
2015-03-08 01:58:04 +01:00
|
|
|
{
|
Issue #26494: Fixed crash on iterating exhausting iterators.
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
2016-03-30 20:40:02 +03:00
|
|
|
DIR *dirp = iterator->dirp;
|
|
|
|
|
|
|
|
|
|
if (!dirp)
|
2015-03-08 01:58:04 +01:00
|
|
|
return;
|
|
|
|
|
|
Issue #26494: Fixed crash on iterating exhausting iterators.
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
2016-03-30 20:40:02 +03:00
|
|
|
iterator->dirp = NULL;
|
2015-03-08 01:58:04 +01:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
2017-03-30 09:12:31 +03:00
|
|
|
#ifdef HAVE_FDOPENDIR
|
|
|
|
|
if (iterator->path.fd != -1)
|
|
|
|
|
rewinddir(dirp);
|
|
|
|
|
#endif
|
Issue #26494: Fixed crash on iterating exhausting iterators.
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
2016-03-30 20:40:02 +03:00
|
|
|
closedir(dirp);
|
2015-03-08 01:58:04 +01:00
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
ScandirIterator_iternext(ScandirIterator *iterator)
|
|
|
|
|
{
|
|
|
|
|
struct dirent *direntp;
|
|
|
|
|
Py_ssize_t name_len;
|
|
|
|
|
int is_dot;
|
2016-02-08 17:56:36 +02:00
|
|
|
PyObject *entry;
|
2015-03-08 01:58:04 +01:00
|
|
|
|
2016-02-11 13:21:30 +02:00
|
|
|
/* Happens if the iterator is iterated twice, or closed explicitly */
|
2016-02-08 17:56:36 +02:00
|
|
|
if (!iterator->dirp)
|
2015-03-08 01:58:04 +01:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
while (1) {
|
|
|
|
|
errno = 0;
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
direntp = readdir(iterator->dirp);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
|
|
|
|
|
if (!direntp) {
|
2016-02-08 17:56:36 +02:00
|
|
|
/* Error or no more files */
|
2015-03-08 01:58:04 +01:00
|
|
|
if (errno != 0)
|
2016-02-08 17:56:36 +02:00
|
|
|
path_error(&iterator->path);
|
2015-03-08 01:58:04 +01:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Skip over . and .. */
|
|
|
|
|
name_len = NAMLEN(direntp);
|
|
|
|
|
is_dot = direntp->d_name[0] == '.' &&
|
|
|
|
|
(name_len == 1 || (direntp->d_name[1] == '.' && name_len == 2));
|
|
|
|
|
if (!is_dot) {
|
2020-05-10 11:05:29 +02:00
|
|
|
PyObject *module = PyType_GetModule(Py_TYPE(iterator));
|
|
|
|
|
entry = DirEntry_from_posix_info(module,
|
|
|
|
|
&iterator->path, direntp->d_name,
|
|
|
|
|
name_len, direntp->d_ino
|
2015-03-08 02:59:09 +01:00
|
|
|
#ifdef HAVE_DIRENT_D_TYPE
|
2020-05-10 11:05:29 +02:00
|
|
|
, direntp->d_type
|
2015-03-08 02:59:09 +01:00
|
|
|
#endif
|
|
|
|
|
);
|
2016-02-08 17:56:36 +02:00
|
|
|
if (!entry)
|
|
|
|
|
break;
|
|
|
|
|
return entry;
|
2015-03-08 01:58:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Loop till we get a non-dot directory or finish iterating */
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-08 17:56:36 +02:00
|
|
|
/* Error or no more files */
|
2016-02-11 13:21:30 +02:00
|
|
|
ScandirIterator_closedir(iterator);
|
2015-03-08 01:58:04 +01:00
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
2016-02-11 13:21:30 +02:00
|
|
|
static PyObject *
|
|
|
|
|
ScandirIterator_close(ScandirIterator *self, PyObject *args)
|
|
|
|
|
{
|
|
|
|
|
ScandirIterator_closedir(self);
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
ScandirIterator_enter(PyObject *self, PyObject *args)
|
|
|
|
|
{
|
|
|
|
|
Py_INCREF(self);
|
|
|
|
|
return self;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
ScandirIterator_exit(ScandirIterator *self, PyObject *args)
|
|
|
|
|
{
|
|
|
|
|
ScandirIterator_closedir(self);
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-08 01:58:04 +01:00
|
|
|
static void
|
2016-03-23 00:43:54 +01:00
|
|
|
ScandirIterator_finalize(ScandirIterator *iterator)
|
2015-03-08 01:58:04 +01:00
|
|
|
{
|
2016-03-23 00:43:54 +01:00
|
|
|
PyObject *error_type, *error_value, *error_traceback;
|
|
|
|
|
|
|
|
|
|
/* Save the current exception, if any. */
|
|
|
|
|
PyErr_Fetch(&error_type, &error_value, &error_traceback);
|
|
|
|
|
|
2016-02-11 13:21:30 +02:00
|
|
|
if (!ScandirIterator_is_closed(iterator)) {
|
2016-03-23 00:43:54 +01:00
|
|
|
ScandirIterator_closedir(iterator);
|
|
|
|
|
|
|
|
|
|
if (PyErr_ResourceWarning((PyObject *)iterator, 1,
|
|
|
|
|
"unclosed scandir iterator %R", iterator)) {
|
2016-02-11 13:21:30 +02:00
|
|
|
/* Spurious errors can appear at shutdown */
|
2016-03-23 00:43:54 +01:00
|
|
|
if (PyErr_ExceptionMatches(PyExc_Warning)) {
|
2016-02-11 13:21:30 +02:00
|
|
|
PyErr_WriteUnraisable((PyObject *) iterator);
|
2016-03-23 00:43:54 +01:00
|
|
|
}
|
2016-02-11 13:21:30 +02:00
|
|
|
}
|
|
|
|
|
}
|
2016-03-23 00:43:54 +01:00
|
|
|
|
2015-03-08 01:58:04 +01:00
|
|
|
path_cleanup(&iterator->path);
|
2016-03-23 00:43:54 +01:00
|
|
|
|
|
|
|
|
/* Restore the saved exception. */
|
|
|
|
|
PyErr_Restore(error_type, error_value, error_traceback);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
ScandirIterator_dealloc(ScandirIterator *iterator)
|
|
|
|
|
{
|
2019-11-05 07:16:14 -08:00
|
|
|
PyTypeObject *tp = Py_TYPE(iterator);
|
2016-03-23 00:43:54 +01:00
|
|
|
if (PyObject_CallFinalizerFromDealloc((PyObject *)iterator) < 0)
|
|
|
|
|
return;
|
|
|
|
|
|
2019-11-05 07:16:14 -08:00
|
|
|
freefunc free_func = PyType_GetSlot(tp, Py_tp_free);
|
|
|
|
|
free_func(iterator);
|
|
|
|
|
Py_DECREF(tp);
|
2015-03-08 01:58:04 +01:00
|
|
|
}
|
|
|
|
|
|
2016-02-11 13:21:30 +02:00
|
|
|
static PyMethodDef ScandirIterator_methods[] = {
|
|
|
|
|
{"__enter__", (PyCFunction)ScandirIterator_enter, METH_NOARGS},
|
|
|
|
|
{"__exit__", (PyCFunction)ScandirIterator_exit, METH_VARARGS},
|
|
|
|
|
{"close", (PyCFunction)ScandirIterator_close, METH_NOARGS},
|
|
|
|
|
{NULL}
|
|
|
|
|
};
|
|
|
|
|
|
2019-11-05 07:16:14 -08:00
|
|
|
static PyType_Slot ScandirIteratorType_slots[] = {
|
|
|
|
|
{Py_tp_new, _disabled_new},
|
|
|
|
|
{Py_tp_dealloc, ScandirIterator_dealloc},
|
|
|
|
|
{Py_tp_finalize, ScandirIterator_finalize},
|
|
|
|
|
{Py_tp_iter, PyObject_SelfIter},
|
|
|
|
|
{Py_tp_iternext, ScandirIterator_iternext},
|
|
|
|
|
{Py_tp_methods, ScandirIterator_methods},
|
|
|
|
|
{0, 0},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static PyType_Spec ScandirIteratorType_spec = {
|
|
|
|
|
MODNAME ".ScandirIterator",
|
|
|
|
|
sizeof(ScandirIterator),
|
|
|
|
|
0,
|
2020-05-14 18:05:58 +02:00
|
|
|
// bpo-40549: Py_TPFLAGS_BASETYPE should not be used, since
|
|
|
|
|
// PyType_GetModule(Py_TYPE(self)) doesn't work on a subclass instance.
|
2019-11-05 07:16:14 -08:00
|
|
|
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_FINALIZE,
|
|
|
|
|
ScandirIteratorType_slots
|
2015-03-08 01:58:04 +01:00
|
|
|
};
|
|
|
|
|
|
2016-11-06 13:45:33 +02:00
|
|
|
/*[clinic input]
|
|
|
|
|
os.scandir
|
|
|
|
|
|
2017-03-30 09:12:31 +03:00
|
|
|
path : path_t(nullable=True, allow_fd='PATH_HAVE_FDOPENDIR') = None
|
2016-11-06 13:45:33 +02:00
|
|
|
|
|
|
|
|
Return an iterator of DirEntry objects for given path.
|
|
|
|
|
|
2018-11-02 15:20:19 +00:00
|
|
|
path can be specified as either str, bytes, or a path-like object. If path
|
2016-11-06 13:45:33 +02:00
|
|
|
is bytes, the names of yielded DirEntry objects will also be bytes; in
|
|
|
|
|
all other circumstances they will be str.
|
|
|
|
|
|
|
|
|
|
If path is None, uses the path='.'.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
2015-03-08 01:58:04 +01:00
|
|
|
static PyObject *
|
2016-11-06 13:45:33 +02:00
|
|
|
os_scandir_impl(PyObject *module, path_t *path)
|
2018-11-02 15:20:19 +00:00
|
|
|
/*[clinic end generated code: output=6eb2668b675ca89e input=6bdd312708fc3bb0]*/
|
2015-03-08 01:58:04 +01:00
|
|
|
{
|
|
|
|
|
ScandirIterator *iterator;
|
|
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
wchar_t *path_strW;
|
|
|
|
|
#else
|
2016-11-06 13:45:33 +02:00
|
|
|
const char *path_str;
|
2017-03-30 09:12:31 +03:00
|
|
|
#ifdef HAVE_FDOPENDIR
|
|
|
|
|
int fd = -1;
|
|
|
|
|
#endif
|
2015-03-08 01:58:04 +01:00
|
|
|
#endif
|
|
|
|
|
|
2019-06-24 08:42:54 -07:00
|
|
|
if (PySys_Audit("os.scandir", "O",
|
|
|
|
|
path->object ? path->object : Py_None) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-16 21:15:01 +08:00
|
|
|
PyObject *ScandirIteratorType = get_posix_state(module)->ScandirIteratorType;
|
2019-11-05 07:16:14 -08:00
|
|
|
iterator = PyObject_New(ScandirIterator, (PyTypeObject *)ScandirIteratorType);
|
2015-03-08 01:58:04 +01:00
|
|
|
if (!iterator)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
iterator->handle = INVALID_HANDLE_VALUE;
|
|
|
|
|
#else
|
|
|
|
|
iterator->dirp = NULL;
|
|
|
|
|
#endif
|
|
|
|
|
|
2016-11-06 13:45:33 +02:00
|
|
|
memcpy(&iterator->path, path, sizeof(path_t));
|
2017-02-09 20:05:51 +02:00
|
|
|
/* Move the ownership to iterator->path */
|
|
|
|
|
path->object = NULL;
|
|
|
|
|
path->cleanup = NULL;
|
2015-03-08 01:58:04 +01:00
|
|
|
|
|
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
iterator->first_time = 1;
|
|
|
|
|
|
|
|
|
|
path_strW = join_path_filenameW(iterator->path.wide, L"*.*");
|
|
|
|
|
if (!path_strW)
|
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
iterator->handle = FindFirstFileW(path_strW, &iterator->file_data);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
|
|
|
|
|
PyMem_Free(path_strW);
|
|
|
|
|
|
|
|
|
|
if (iterator->handle == INVALID_HANDLE_VALUE) {
|
|
|
|
|
path_error(&iterator->path);
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
#else /* POSIX */
|
2017-03-30 09:12:31 +03:00
|
|
|
errno = 0;
|
|
|
|
|
#ifdef HAVE_FDOPENDIR
|
2020-11-22 11:18:40 +01:00
|
|
|
if (iterator->path.fd != -1) {
|
|
|
|
|
if (HAVE_FDOPENDIR_RUNTIME) {
|
2017-03-30 09:12:31 +03:00
|
|
|
/* closedir() closes the FD, so we duplicate it */
|
|
|
|
|
fd = _Py_dup(path->fd);
|
|
|
|
|
if (fd == -1)
|
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
iterator->dirp = fdopendir(fd);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
2020-11-22 11:18:40 +01:00
|
|
|
} else {
|
|
|
|
|
PyErr_SetString(PyExc_TypeError,
|
|
|
|
|
"scandir: path should be string, bytes, os.PathLike or None, not int");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2017-03-30 09:12:31 +03:00
|
|
|
}
|
2015-03-08 01:58:04 +01:00
|
|
|
else
|
2017-03-30 09:12:31 +03:00
|
|
|
#endif
|
|
|
|
|
{
|
|
|
|
|
if (iterator->path.narrow)
|
|
|
|
|
path_str = iterator->path.narrow;
|
|
|
|
|
else
|
|
|
|
|
path_str = ".";
|
2015-03-08 01:58:04 +01:00
|
|
|
|
2017-03-30 09:12:31 +03:00
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
iterator->dirp = opendir(path_str);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
}
|
2015-03-08 01:58:04 +01:00
|
|
|
|
|
|
|
|
if (!iterator->dirp) {
|
|
|
|
|
path_error(&iterator->path);
|
2017-03-30 09:12:31 +03:00
|
|
|
#ifdef HAVE_FDOPENDIR
|
|
|
|
|
if (fd != -1) {
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
close(fd);
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2015-03-08 01:58:04 +01:00
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
return (PyObject *)iterator;
|
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
Py_DECREF(iterator);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-04 12:06:26 -07:00
|
|
|
/*
|
|
|
|
|
Return the file system path representation of the object.
|
|
|
|
|
|
|
|
|
|
If the object is str or bytes, then allow it to pass through with
|
|
|
|
|
an incremented refcount. If the object defines __fspath__(), then
|
|
|
|
|
return the result of that method. All other types raise a TypeError.
|
|
|
|
|
*/
|
|
|
|
|
PyObject *
|
|
|
|
|
PyOS_FSPath(PyObject *path)
|
|
|
|
|
{
|
2016-08-26 14:44:48 -07:00
|
|
|
/* For error message reasons, this function is manually inlined in
|
|
|
|
|
path_converter(). */
|
2016-06-04 12:06:26 -07:00
|
|
|
PyObject *func = NULL;
|
|
|
|
|
PyObject *path_repr = NULL;
|
|
|
|
|
|
|
|
|
|
if (PyUnicode_Check(path) || PyBytes_Check(path)) {
|
|
|
|
|
Py_INCREF(path);
|
|
|
|
|
return path;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func = _PyObject_LookupSpecial(path, &PyId___fspath__);
|
|
|
|
|
if (NULL == func) {
|
|
|
|
|
return PyErr_Format(PyExc_TypeError,
|
|
|
|
|
"expected str, bytes or os.PathLike object, "
|
2016-06-24 12:03:43 -07:00
|
|
|
"not %.200s",
|
2019-11-05 07:16:14 -08:00
|
|
|
_PyType_Name(Py_TYPE(path)));
|
2016-06-04 12:06:26 -07:00
|
|
|
}
|
|
|
|
|
|
2016-12-06 18:46:19 +01:00
|
|
|
path_repr = _PyObject_CallNoArg(func);
|
2016-06-04 12:06:26 -07:00
|
|
|
Py_DECREF(func);
|
2016-07-15 10:41:49 -07:00
|
|
|
if (NULL == path_repr) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-24 12:03:43 -07:00
|
|
|
if (!(PyUnicode_Check(path_repr) || PyBytes_Check(path_repr))) {
|
|
|
|
|
PyErr_Format(PyExc_TypeError,
|
|
|
|
|
"expected %.200s.__fspath__() to return str or bytes, "
|
2019-11-05 07:16:14 -08:00
|
|
|
"not %.200s", _PyType_Name(Py_TYPE(path)),
|
|
|
|
|
_PyType_Name(Py_TYPE(path_repr)));
|
2016-06-24 12:03:43 -07:00
|
|
|
Py_DECREF(path_repr);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-04 12:06:26 -07:00
|
|
|
return path_repr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.fspath
|
|
|
|
|
|
|
|
|
|
path: object
|
|
|
|
|
|
|
|
|
|
Return the file system path representation of the object.
|
|
|
|
|
|
2016-06-09 14:32:08 -07:00
|
|
|
If the object is str or bytes, then allow it to pass through as-is. If the
|
|
|
|
|
object defines __fspath__(), then return the result of that method. All other
|
|
|
|
|
types raise a TypeError.
|
2016-06-04 12:06:26 -07:00
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2016-07-07 18:20:03 +03:00
|
|
|
os_fspath_impl(PyObject *module, PyObject *path)
|
|
|
|
|
/*[clinic end generated code: output=c3c3b78ecff2914f input=e357165f7b22490f]*/
|
2016-06-04 12:06:26 -07:00
|
|
|
{
|
|
|
|
|
return PyOS_FSPath(path);
|
|
|
|
|
}
|
2015-03-08 01:58:04 +01:00
|
|
|
|
2016-09-06 16:18:52 -07:00
|
|
|
#ifdef HAVE_GETRANDOM_SYSCALL
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.getrandom
|
|
|
|
|
|
|
|
|
|
size: Py_ssize_t
|
|
|
|
|
flags: int=0
|
|
|
|
|
|
|
|
|
|
Obtain a series of random bytes.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
os_getrandom_impl(PyObject *module, Py_ssize_t size, int flags)
|
|
|
|
|
/*[clinic end generated code: output=b3a618196a61409c input=59bafac39c594947]*/
|
|
|
|
|
{
|
|
|
|
|
PyObject *bytes;
|
2016-09-20 23:00:59 +02:00
|
|
|
Py_ssize_t n;
|
2016-09-06 16:18:52 -07:00
|
|
|
|
|
|
|
|
if (size < 0) {
|
|
|
|
|
errno = EINVAL;
|
|
|
|
|
return posix_error();
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-20 23:00:59 +02:00
|
|
|
bytes = PyBytes_FromStringAndSize(NULL, size);
|
|
|
|
|
if (bytes == NULL) {
|
2016-09-06 16:18:52 -07:00
|
|
|
PyErr_NoMemory();
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while (1) {
|
2016-09-20 23:00:59 +02:00
|
|
|
n = syscall(SYS_getrandom,
|
|
|
|
|
PyBytes_AS_STRING(bytes),
|
|
|
|
|
PyBytes_GET_SIZE(bytes),
|
|
|
|
|
flags);
|
2016-09-06 16:18:52 -07:00
|
|
|
if (n < 0 && errno == EINTR) {
|
|
|
|
|
if (PyErr_CheckSignals() < 0) {
|
2016-09-20 23:00:59 +02:00
|
|
|
goto error;
|
2016-09-06 16:18:52 -07:00
|
|
|
}
|
2016-09-20 23:00:59 +02:00
|
|
|
|
|
|
|
|
/* getrandom() was interrupted by a signal: retry */
|
2016-09-06 16:18:52 -07:00
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (n < 0) {
|
|
|
|
|
PyErr_SetFromErrno(PyExc_OSError);
|
2016-09-20 23:00:59 +02:00
|
|
|
goto error;
|
2016-09-06 16:18:52 -07:00
|
|
|
}
|
|
|
|
|
|
2016-09-20 23:00:59 +02:00
|
|
|
if (n != size) {
|
|
|
|
|
_PyBytes_Resize(&bytes, n);
|
|
|
|
|
}
|
2016-09-06 16:18:52 -07:00
|
|
|
|
|
|
|
|
return bytes;
|
2016-09-20 23:00:59 +02:00
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
Py_DECREF(bytes);
|
|
|
|
|
return NULL;
|
2016-09-06 16:18:52 -07:00
|
|
|
}
|
|
|
|
|
#endif /* HAVE_GETRANDOM_SYSCALL */
|
|
|
|
|
|
2019-03-29 16:37:16 -07:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
/* bpo-36085: Helper functions for managing DLL search directories
|
|
|
|
|
* on win32
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
typedef DLL_DIRECTORY_COOKIE (WINAPI *PAddDllDirectory)(PCWSTR newDirectory);
|
|
|
|
|
typedef BOOL (WINAPI *PRemoveDllDirectory)(DLL_DIRECTORY_COOKIE cookie);
|
|
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os._add_dll_directory
|
|
|
|
|
|
|
|
|
|
path: path_t
|
|
|
|
|
|
|
|
|
|
Add a path to the DLL search path.
|
|
|
|
|
|
|
|
|
|
This search path is used when resolving dependencies for imported
|
|
|
|
|
extension modules (the module itself is resolved through sys.path),
|
|
|
|
|
and also by ctypes.
|
|
|
|
|
|
|
|
|
|
Returns an opaque value that may be passed to os.remove_dll_directory
|
|
|
|
|
to remove this directory from the search path.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
os__add_dll_directory_impl(PyObject *module, path_t *path)
|
|
|
|
|
/*[clinic end generated code: output=80b025daebb5d683 input=1de3e6c13a5808c8]*/
|
|
|
|
|
{
|
|
|
|
|
HMODULE hKernel32;
|
|
|
|
|
PAddDllDirectory AddDllDirectory;
|
|
|
|
|
DLL_DIRECTORY_COOKIE cookie = 0;
|
|
|
|
|
DWORD err = 0;
|
|
|
|
|
|
2020-02-12 23:47:42 -08:00
|
|
|
if (PySys_Audit("os.add_dll_directory", "(O)", path->object) < 0) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-29 16:37:16 -07:00
|
|
|
/* For Windows 7, we have to load this. As this will be a fairly
|
|
|
|
|
infrequent operation, just do it each time. Kernel32 is always
|
|
|
|
|
loaded. */
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
if (!(hKernel32 = GetModuleHandleW(L"kernel32")) ||
|
|
|
|
|
!(AddDllDirectory = (PAddDllDirectory)GetProcAddress(
|
|
|
|
|
hKernel32, "AddDllDirectory")) ||
|
|
|
|
|
!(cookie = (*AddDllDirectory)(path->wide))) {
|
|
|
|
|
err = GetLastError();
|
|
|
|
|
}
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
|
|
|
|
|
if (err) {
|
|
|
|
|
return win32_error_object_err("add_dll_directory",
|
|
|
|
|
path->object, err);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return PyCapsule_New(cookie, "DLL directory cookie", NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os._remove_dll_directory
|
|
|
|
|
|
|
|
|
|
cookie: object
|
|
|
|
|
|
|
|
|
|
Removes a path from the DLL search path.
|
|
|
|
|
|
|
|
|
|
The parameter is an opaque value that was returned from
|
|
|
|
|
os.add_dll_directory. You can only remove directories that you added
|
|
|
|
|
yourself.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
os__remove_dll_directory_impl(PyObject *module, PyObject *cookie)
|
|
|
|
|
/*[clinic end generated code: output=594350433ae535bc input=c1d16a7e7d9dc5dc]*/
|
|
|
|
|
{
|
|
|
|
|
HMODULE hKernel32;
|
|
|
|
|
PRemoveDllDirectory RemoveDllDirectory;
|
|
|
|
|
DLL_DIRECTORY_COOKIE cookieValue;
|
|
|
|
|
DWORD err = 0;
|
|
|
|
|
|
|
|
|
|
if (!PyCapsule_IsValid(cookie, "DLL directory cookie")) {
|
|
|
|
|
PyErr_SetString(PyExc_TypeError,
|
|
|
|
|
"Provided cookie was not returned from os.add_dll_directory");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cookieValue = (DLL_DIRECTORY_COOKIE)PyCapsule_GetPointer(
|
|
|
|
|
cookie, "DLL directory cookie");
|
|
|
|
|
|
|
|
|
|
/* For Windows 7, we have to load this. As this will be a fairly
|
|
|
|
|
infrequent operation, just do it each time. Kernel32 is always
|
|
|
|
|
loaded. */
|
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
if (!(hKernel32 = GetModuleHandleW(L"kernel32")) ||
|
|
|
|
|
!(RemoveDllDirectory = (PRemoveDllDirectory)GetProcAddress(
|
|
|
|
|
hKernel32, "RemoveDllDirectory")) ||
|
|
|
|
|
!(*RemoveDllDirectory)(cookieValue)) {
|
|
|
|
|
err = GetLastError();
|
|
|
|
|
}
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
|
|
|
|
|
|
if (err) {
|
|
|
|
|
return win32_error_object_err("remove_dll_directory",
|
|
|
|
|
NULL, err);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (PyCapsule_SetName(cookie, NULL)) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
2013-10-19 00:09:25 -07:00
|
|
|
|
2020-04-01 18:49:29 +02:00
|
|
|
|
|
|
|
|
/* Only check if WIFEXITED is available: expect that it comes
|
|
|
|
|
with WEXITSTATUS, WIFSIGNALED, etc.
|
|
|
|
|
|
|
|
|
|
os.waitstatus_to_exitcode() is implemented in C and not in Python, so
|
|
|
|
|
subprocess can safely call it during late Python finalization without
|
|
|
|
|
risking that used os attributes were set to None by _PyImport_Cleanup(). */
|
|
|
|
|
#if defined(WIFEXITED) || defined(MS_WINDOWS)
|
|
|
|
|
/*[clinic input]
|
|
|
|
|
os.waitstatus_to_exitcode
|
|
|
|
|
|
2020-04-22 16:30:35 +02:00
|
|
|
status as status_obj: object
|
2020-04-01 18:49:29 +02:00
|
|
|
|
|
|
|
|
Convert a wait status to an exit code.
|
|
|
|
|
|
|
|
|
|
On Unix:
|
|
|
|
|
|
|
|
|
|
* If WIFEXITED(status) is true, return WEXITSTATUS(status).
|
|
|
|
|
* If WIFSIGNALED(status) is true, return -WTERMSIG(status).
|
|
|
|
|
* Otherwise, raise a ValueError.
|
|
|
|
|
|
|
|
|
|
On Windows, return status shifted right by 8 bits.
|
|
|
|
|
|
|
|
|
|
On Unix, if the process is being traced or if waitpid() was called with
|
|
|
|
|
WUNTRACED option, the caller must first check if WIFSTOPPED(status) is true.
|
|
|
|
|
This function must not be called if WIFSTOPPED(status) is true.
|
|
|
|
|
[clinic start generated code]*/
|
|
|
|
|
|
|
|
|
|
static PyObject *
|
2020-04-22 16:30:35 +02:00
|
|
|
os_waitstatus_to_exitcode_impl(PyObject *module, PyObject *status_obj)
|
|
|
|
|
/*[clinic end generated code: output=db50b1b0ba3c7153 input=7fe2d7fdaea3db42]*/
|
2020-04-01 18:49:29 +02:00
|
|
|
{
|
2020-04-22 16:30:35 +02:00
|
|
|
if (PyFloat_Check(status_obj)) {
|
|
|
|
|
PyErr_SetString(PyExc_TypeError,
|
|
|
|
|
"integer argument expected, got float" );
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2020-04-01 18:49:29 +02:00
|
|
|
#ifndef MS_WINDOWS
|
2020-04-22 16:30:35 +02:00
|
|
|
int status = _PyLong_AsInt(status_obj);
|
|
|
|
|
if (status == -1 && PyErr_Occurred()) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-01 18:49:29 +02:00
|
|
|
WAIT_TYPE wait_status;
|
|
|
|
|
WAIT_STATUS_INT(wait_status) = status;
|
|
|
|
|
int exitcode;
|
|
|
|
|
if (WIFEXITED(wait_status)) {
|
|
|
|
|
exitcode = WEXITSTATUS(wait_status);
|
|
|
|
|
/* Sanity check to provide warranty on the function behavior.
|
|
|
|
|
It should not occur in practice */
|
|
|
|
|
if (exitcode < 0) {
|
|
|
|
|
PyErr_Format(PyExc_ValueError, "invalid WEXITSTATUS: %i", exitcode);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (WIFSIGNALED(wait_status)) {
|
|
|
|
|
int signum = WTERMSIG(wait_status);
|
|
|
|
|
/* Sanity check to provide warranty on the function behavior.
|
|
|
|
|
It should not occurs in practice */
|
|
|
|
|
if (signum <= 0) {
|
|
|
|
|
PyErr_Format(PyExc_ValueError, "invalid WTERMSIG: %i", signum);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
exitcode = -signum;
|
|
|
|
|
} else if (WIFSTOPPED(wait_status)) {
|
|
|
|
|
/* Status only received if the process is being traced
|
|
|
|
|
or if waitpid() was called with WUNTRACED option. */
|
|
|
|
|
int signum = WSTOPSIG(wait_status);
|
|
|
|
|
PyErr_Format(PyExc_ValueError,
|
|
|
|
|
"process stopped by delivery of signal %i",
|
|
|
|
|
signum);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
PyErr_Format(PyExc_ValueError, "invalid wait status: %i", status);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return PyLong_FromLong(exitcode);
|
|
|
|
|
#else
|
|
|
|
|
/* Windows implementation: see os.waitpid() implementation
|
|
|
|
|
which uses _cwait(). */
|
2020-04-22 16:30:35 +02:00
|
|
|
unsigned long long status = PyLong_AsUnsignedLongLong(status_obj);
|
|
|
|
|
if (status == (unsigned long long)-1 && PyErr_Occurred()) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
unsigned long long exitcode = (status >> 8);
|
|
|
|
|
/* ExitProcess() accepts an UINT type:
|
|
|
|
|
reject exit code which doesn't fit in an UINT */
|
|
|
|
|
if (exitcode > UINT_MAX) {
|
|
|
|
|
PyErr_Format(PyExc_ValueError, "invalid exit code: %llu", exitcode);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return PyLong_FromUnsignedLong((unsigned long)exitcode);
|
2020-04-01 18:49:29 +02:00
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
1996-12-10 23:23:01 +00:00
|
|
|
static PyMethodDef posix_methods[] = {
|
2013-10-19 00:09:25 -07:00
|
|
|
|
|
|
|
|
OS_STAT_METHODDEF
|
|
|
|
|
OS_ACCESS_METHODDEF
|
|
|
|
|
OS_TTYNAME_METHODDEF
|
2014-08-05 14:04:04 +10:00
|
|
|
OS_CHDIR_METHODDEF
|
|
|
|
|
OS_CHFLAGS_METHODDEF
|
|
|
|
|
OS_CHMOD_METHODDEF
|
|
|
|
|
OS_FCHMOD_METHODDEF
|
|
|
|
|
OS_LCHMOD_METHODDEF
|
|
|
|
|
OS_CHOWN_METHODDEF
|
|
|
|
|
OS_FCHOWN_METHODDEF
|
|
|
|
|
OS_LCHOWN_METHODDEF
|
|
|
|
|
OS_LCHFLAGS_METHODDEF
|
|
|
|
|
OS_CHROOT_METHODDEF
|
|
|
|
|
OS_CTERMID_METHODDEF
|
|
|
|
|
OS_GETCWD_METHODDEF
|
|
|
|
|
OS_GETCWDB_METHODDEF
|
|
|
|
|
OS_LINK_METHODDEF
|
|
|
|
|
OS_LISTDIR_METHODDEF
|
|
|
|
|
OS_LSTAT_METHODDEF
|
|
|
|
|
OS_MKDIR_METHODDEF
|
|
|
|
|
OS_NICE_METHODDEF
|
|
|
|
|
OS_GETPRIORITY_METHODDEF
|
|
|
|
|
OS_SETPRIORITY_METHODDEF
|
2018-01-29 01:56:10 +00:00
|
|
|
OS_POSIX_SPAWN_METHODDEF
|
2019-01-16 16:29:26 +03:00
|
|
|
OS_POSIX_SPAWNP_METHODDEF
|
2018-09-17 15:38:27 +03:00
|
|
|
OS_READLINK_METHODDEF
|
2019-05-31 19:39:47 +01:00
|
|
|
OS_COPY_FILE_RANGE_METHODDEF
|
2014-08-05 14:04:04 +10:00
|
|
|
OS_RENAME_METHODDEF
|
|
|
|
|
OS_REPLACE_METHODDEF
|
|
|
|
|
OS_RMDIR_METHODDEF
|
|
|
|
|
OS_SYMLINK_METHODDEF
|
|
|
|
|
OS_SYSTEM_METHODDEF
|
|
|
|
|
OS_UMASK_METHODDEF
|
|
|
|
|
OS_UNAME_METHODDEF
|
|
|
|
|
OS_UNLINK_METHODDEF
|
|
|
|
|
OS_REMOVE_METHODDEF
|
|
|
|
|
OS_UTIME_METHODDEF
|
|
|
|
|
OS_TIMES_METHODDEF
|
|
|
|
|
OS__EXIT_METHODDEF
|
2018-06-12 23:04:50 +02:00
|
|
|
OS__FCOPYFILE_METHODDEF
|
2014-08-05 14:04:04 +10:00
|
|
|
OS_EXECV_METHODDEF
|
|
|
|
|
OS_EXECVE_METHODDEF
|
|
|
|
|
OS_SPAWNV_METHODDEF
|
|
|
|
|
OS_SPAWNVE_METHODDEF
|
|
|
|
|
OS_FORK1_METHODDEF
|
|
|
|
|
OS_FORK_METHODDEF
|
2017-05-27 17:50:54 +02:00
|
|
|
OS_REGISTER_AT_FORK_METHODDEF
|
2014-08-05 14:04:04 +10:00
|
|
|
OS_SCHED_GET_PRIORITY_MAX_METHODDEF
|
|
|
|
|
OS_SCHED_GET_PRIORITY_MIN_METHODDEF
|
|
|
|
|
OS_SCHED_GETPARAM_METHODDEF
|
|
|
|
|
OS_SCHED_GETSCHEDULER_METHODDEF
|
|
|
|
|
OS_SCHED_RR_GET_INTERVAL_METHODDEF
|
|
|
|
|
OS_SCHED_SETPARAM_METHODDEF
|
|
|
|
|
OS_SCHED_SETSCHEDULER_METHODDEF
|
|
|
|
|
OS_SCHED_YIELD_METHODDEF
|
|
|
|
|
OS_SCHED_SETAFFINITY_METHODDEF
|
|
|
|
|
OS_SCHED_GETAFFINITY_METHODDEF
|
|
|
|
|
OS_OPENPTY_METHODDEF
|
|
|
|
|
OS_FORKPTY_METHODDEF
|
|
|
|
|
OS_GETEGID_METHODDEF
|
|
|
|
|
OS_GETEUID_METHODDEF
|
|
|
|
|
OS_GETGID_METHODDEF
|
2020-04-18 19:14:10 +03:00
|
|
|
OS_GETGROUPLIST_METHODDEF
|
2014-08-05 14:04:04 +10:00
|
|
|
OS_GETGROUPS_METHODDEF
|
|
|
|
|
OS_GETPID_METHODDEF
|
|
|
|
|
OS_GETPGRP_METHODDEF
|
|
|
|
|
OS_GETPPID_METHODDEF
|
|
|
|
|
OS_GETUID_METHODDEF
|
|
|
|
|
OS_GETLOGIN_METHODDEF
|
|
|
|
|
OS_KILL_METHODDEF
|
|
|
|
|
OS_KILLPG_METHODDEF
|
|
|
|
|
OS_PLOCK_METHODDEF
|
2016-09-08 10:35:16 -07:00
|
|
|
OS_STARTFILE_METHODDEF
|
2014-08-05 14:04:04 +10:00
|
|
|
OS_SETUID_METHODDEF
|
|
|
|
|
OS_SETEUID_METHODDEF
|
|
|
|
|
OS_SETREUID_METHODDEF
|
|
|
|
|
OS_SETGID_METHODDEF
|
|
|
|
|
OS_SETEGID_METHODDEF
|
|
|
|
|
OS_SETREGID_METHODDEF
|
|
|
|
|
OS_SETGROUPS_METHODDEF
|
2020-04-18 19:14:10 +03:00
|
|
|
OS_INITGROUPS_METHODDEF
|
2014-08-05 14:04:04 +10:00
|
|
|
OS_GETPGID_METHODDEF
|
|
|
|
|
OS_SETPGRP_METHODDEF
|
|
|
|
|
OS_WAIT_METHODDEF
|
|
|
|
|
OS_WAIT3_METHODDEF
|
|
|
|
|
OS_WAIT4_METHODDEF
|
|
|
|
|
OS_WAITID_METHODDEF
|
|
|
|
|
OS_WAITPID_METHODDEF
|
2019-11-05 19:21:29 -08:00
|
|
|
OS_PIDFD_OPEN_METHODDEF
|
2014-08-05 14:04:04 +10:00
|
|
|
OS_GETSID_METHODDEF
|
|
|
|
|
OS_SETSID_METHODDEF
|
|
|
|
|
OS_SETPGID_METHODDEF
|
|
|
|
|
OS_TCGETPGRP_METHODDEF
|
|
|
|
|
OS_TCSETPGRP_METHODDEF
|
|
|
|
|
OS_OPEN_METHODDEF
|
|
|
|
|
OS_CLOSE_METHODDEF
|
|
|
|
|
OS_CLOSERANGE_METHODDEF
|
|
|
|
|
OS_DEVICE_ENCODING_METHODDEF
|
|
|
|
|
OS_DUP_METHODDEF
|
|
|
|
|
OS_DUP2_METHODDEF
|
|
|
|
|
OS_LOCKF_METHODDEF
|
|
|
|
|
OS_LSEEK_METHODDEF
|
|
|
|
|
OS_READ_METHODDEF
|
|
|
|
|
OS_READV_METHODDEF
|
|
|
|
|
OS_PREAD_METHODDEF
|
2018-01-27 16:16:37 +00:00
|
|
|
OS_PREADV_METHODDEF
|
2014-08-05 14:04:04 +10:00
|
|
|
OS_WRITE_METHODDEF
|
|
|
|
|
OS_WRITEV_METHODDEF
|
|
|
|
|
OS_PWRITE_METHODDEF
|
2018-01-27 16:16:37 +00:00
|
|
|
OS_PWRITEV_METHODDEF
|
2020-04-18 19:14:10 +03:00
|
|
|
OS_SENDFILE_METHODDEF
|
2014-08-05 14:04:04 +10:00
|
|
|
OS_FSTAT_METHODDEF
|
|
|
|
|
OS_ISATTY_METHODDEF
|
|
|
|
|
OS_PIPE_METHODDEF
|
|
|
|
|
OS_PIPE2_METHODDEF
|
|
|
|
|
OS_MKFIFO_METHODDEF
|
|
|
|
|
OS_MKNOD_METHODDEF
|
|
|
|
|
OS_MAJOR_METHODDEF
|
|
|
|
|
OS_MINOR_METHODDEF
|
|
|
|
|
OS_MAKEDEV_METHODDEF
|
|
|
|
|
OS_FTRUNCATE_METHODDEF
|
|
|
|
|
OS_TRUNCATE_METHODDEF
|
|
|
|
|
OS_POSIX_FALLOCATE_METHODDEF
|
|
|
|
|
OS_POSIX_FADVISE_METHODDEF
|
|
|
|
|
OS_PUTENV_METHODDEF
|
|
|
|
|
OS_UNSETENV_METHODDEF
|
|
|
|
|
OS_STRERROR_METHODDEF
|
|
|
|
|
OS_FCHDIR_METHODDEF
|
|
|
|
|
OS_FSYNC_METHODDEF
|
|
|
|
|
OS_SYNC_METHODDEF
|
|
|
|
|
OS_FDATASYNC_METHODDEF
|
|
|
|
|
OS_WCOREDUMP_METHODDEF
|
|
|
|
|
OS_WIFCONTINUED_METHODDEF
|
|
|
|
|
OS_WIFSTOPPED_METHODDEF
|
|
|
|
|
OS_WIFSIGNALED_METHODDEF
|
|
|
|
|
OS_WIFEXITED_METHODDEF
|
|
|
|
|
OS_WEXITSTATUS_METHODDEF
|
|
|
|
|
OS_WTERMSIG_METHODDEF
|
|
|
|
|
OS_WSTOPSIG_METHODDEF
|
|
|
|
|
OS_FSTATVFS_METHODDEF
|
|
|
|
|
OS_STATVFS_METHODDEF
|
|
|
|
|
OS_CONFSTR_METHODDEF
|
|
|
|
|
OS_SYSCONF_METHODDEF
|
|
|
|
|
OS_FPATHCONF_METHODDEF
|
|
|
|
|
OS_PATHCONF_METHODDEF
|
|
|
|
|
OS_ABORT_METHODDEF
|
2015-05-13 00:52:39 +03:00
|
|
|
OS__GETFULLPATHNAME_METHODDEF
|
2014-08-05 14:04:04 +10:00
|
|
|
OS__GETDISKUSAGE_METHODDEF
|
|
|
|
|
OS__GETFINALPATHNAME_METHODDEF
|
|
|
|
|
OS__GETVOLUMEPATHNAME_METHODDEF
|
2021-04-07 12:35:36 +01:00
|
|
|
OS__PATH_SPLITROOT_METHODDEF
|
2014-08-05 14:04:04 +10:00
|
|
|
OS_GETLOADAVG_METHODDEF
|
|
|
|
|
OS_URANDOM_METHODDEF
|
|
|
|
|
OS_SETRESUID_METHODDEF
|
|
|
|
|
OS_SETRESGID_METHODDEF
|
|
|
|
|
OS_GETRESUID_METHODDEF
|
|
|
|
|
OS_GETRESGID_METHODDEF
|
|
|
|
|
|
|
|
|
|
OS_GETXATTR_METHODDEF
|
|
|
|
|
OS_SETXATTR_METHODDEF
|
|
|
|
|
OS_REMOVEXATTR_METHODDEF
|
|
|
|
|
OS_LISTXATTR_METHODDEF
|
2009-11-27 14:09:49 +00:00
|
|
|
|
2020-04-18 19:14:10 +03:00
|
|
|
OS_GET_TERMINAL_SIZE_METHODDEF
|
2014-08-05 14:04:04 +10:00
|
|
|
OS_CPU_COUNT_METHODDEF
|
|
|
|
|
OS_GET_INHERITABLE_METHODDEF
|
|
|
|
|
OS_SET_INHERITABLE_METHODDEF
|
|
|
|
|
OS_GET_HANDLE_INHERITABLE_METHODDEF
|
|
|
|
|
OS_SET_HANDLE_INHERITABLE_METHODDEF
|
2018-09-17 15:38:27 +03:00
|
|
|
OS_GET_BLOCKING_METHODDEF
|
|
|
|
|
OS_SET_BLOCKING_METHODDEF
|
2016-11-06 13:45:33 +02:00
|
|
|
OS_SCANDIR_METHODDEF
|
2016-06-04 12:06:26 -07:00
|
|
|
OS_FSPATH_METHODDEF
|
2016-09-06 16:18:52 -07:00
|
|
|
OS_GETRANDOM_METHODDEF
|
2019-05-29 13:57:07 -06:00
|
|
|
OS_MEMFD_CREATE_METHODDEF
|
2019-03-29 16:37:16 -07:00
|
|
|
OS__ADD_DLL_DIRECTORY_METHODDEF
|
|
|
|
|
OS__REMOVE_DLL_DIRECTORY_METHODDEF
|
2020-04-01 18:49:29 +02:00
|
|
|
OS_WAITSTATUS_TO_EXITCODE_METHODDEF
|
2010-05-06 00:08:46 +00:00
|
|
|
{NULL, NULL} /* Sentinel */
|
1990-10-14 12:07:46 +00:00
|
|
|
};
|
|
|
|
|
|
1996-12-19 23:50:02 +00:00
|
|
|
static int
|
2013-05-20 19:13:19 +02:00
|
|
|
all_ins(PyObject *m)
|
1996-12-19 23:50:02 +00:00
|
|
|
{
|
1999-01-06 18:42:14 +00:00
|
|
|
#ifdef F_OK
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, F_OK)) return -1;
|
2002-01-30 05:46:57 +00:00
|
|
|
#endif
|
1999-01-06 18:42:14 +00:00
|
|
|
#ifdef R_OK
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, R_OK)) return -1;
|
2002-01-30 05:46:57 +00:00
|
|
|
#endif
|
1999-01-06 18:42:14 +00:00
|
|
|
#ifdef W_OK
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, W_OK)) return -1;
|
2002-01-30 05:46:57 +00:00
|
|
|
#endif
|
1999-01-06 18:42:14 +00:00
|
|
|
#ifdef X_OK
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, X_OK)) return -1;
|
2002-01-30 05:46:57 +00:00
|
|
|
#endif
|
1999-12-13 16:37:25 +00:00
|
|
|
#ifdef NGROUPS_MAX
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, NGROUPS_MAX)) return -1;
|
1999-12-13 16:37:25 +00:00
|
|
|
#endif
|
1999-12-09 21:13:07 +00:00
|
|
|
#ifdef TMP_MAX
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, TMP_MAX)) return -1;
|
1999-12-09 21:13:07 +00:00
|
|
|
#endif
|
2002-04-23 15:58:02 +00:00
|
|
|
#ifdef WCONTINUED
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, WCONTINUED)) return -1;
|
2002-04-23 15:58:02 +00:00
|
|
|
#endif
|
1996-12-19 23:50:02 +00:00
|
|
|
#ifdef WNOHANG
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, WNOHANG)) return -1;
|
2002-01-30 05:46:57 +00:00
|
|
|
#endif
|
2002-04-23 15:58:02 +00:00
|
|
|
#ifdef WUNTRACED
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, WUNTRACED)) return -1;
|
2002-04-23 15:58:02 +00:00
|
|
|
#endif
|
1996-12-19 23:50:02 +00:00
|
|
|
#ifdef O_RDONLY
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_RDONLY)) return -1;
|
1996-12-19 23:50:02 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef O_WRONLY
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_WRONLY)) return -1;
|
1996-12-19 23:50:02 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef O_RDWR
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_RDWR)) return -1;
|
1996-12-19 23:50:02 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef O_NDELAY
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_NDELAY)) return -1;
|
1996-12-19 23:50:02 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef O_NONBLOCK
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_NONBLOCK)) return -1;
|
1996-12-19 23:50:02 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef O_APPEND
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_APPEND)) return -1;
|
1996-12-19 23:50:02 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef O_DSYNC
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_DSYNC)) return -1;
|
1996-12-19 23:50:02 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef O_RSYNC
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_RSYNC)) return -1;
|
1996-12-19 23:50:02 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef O_SYNC
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_SYNC)) return -1;
|
1996-12-19 23:50:02 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef O_NOCTTY
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_NOCTTY)) return -1;
|
1996-12-19 23:50:02 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef O_CREAT
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_CREAT)) return -1;
|
1996-12-19 23:50:02 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef O_EXCL
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_EXCL)) return -1;
|
1996-12-19 23:50:02 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef O_TRUNC
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_TRUNC)) return -1;
|
1997-08-08 21:48:51 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef O_BINARY
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_BINARY)) return -1;
|
1997-08-08 21:48:51 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef O_TEXT
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_TEXT)) return -1;
|
1996-12-19 23:50:02 +00:00
|
|
|
#endif
|
2012-04-24 20:59:17 +02:00
|
|
|
#ifdef O_XATTR
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_XATTR)) return -1;
|
2012-04-24 20:59:17 +02:00
|
|
|
#endif
|
2001-10-18 22:05:36 +00:00
|
|
|
#ifdef O_LARGEFILE
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_LARGEFILE)) return -1;
|
2001-10-18 22:05:36 +00:00
|
|
|
#endif
|
2016-06-13 16:33:04 +02:00
|
|
|
#ifndef __GNU__
|
2005-05-16 02:42:22 +00:00
|
|
|
#ifdef O_SHLOCK
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_SHLOCK)) return -1;
|
2005-05-16 02:42:22 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef O_EXLOCK
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_EXLOCK)) return -1;
|
2005-05-16 02:42:22 +00:00
|
|
|
#endif
|
2016-06-13 16:33:04 +02:00
|
|
|
#endif
|
2012-04-24 20:44:40 +02:00
|
|
|
#ifdef O_EXEC
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_EXEC)) return -1;
|
2012-04-24 20:44:40 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef O_SEARCH
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_SEARCH)) return -1;
|
2012-04-24 20:44:40 +02:00
|
|
|
#endif
|
2013-03-13 10:27:41 -05:00
|
|
|
#ifdef O_PATH
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_PATH)) return -1;
|
2013-03-13 10:27:41 -05:00
|
|
|
#endif
|
2012-04-24 20:44:40 +02:00
|
|
|
#ifdef O_TTY_INIT
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_TTY_INIT)) return -1;
|
2012-04-24 20:44:40 +02:00
|
|
|
#endif
|
2013-08-16 14:35:09 +02:00
|
|
|
#ifdef O_TMPFILE
|
|
|
|
|
if (PyModule_AddIntMacro(m, O_TMPFILE)) return -1;
|
|
|
|
|
#endif
|
2011-02-25 20:57:54 +00:00
|
|
|
#ifdef PRIO_PROCESS
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, PRIO_PROCESS)) return -1;
|
2011-02-25 20:57:54 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef PRIO_PGRP
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, PRIO_PGRP)) return -1;
|
2011-02-25 20:57:54 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef PRIO_USER
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, PRIO_USER)) return -1;
|
2011-02-25 20:57:54 +00:00
|
|
|
#endif
|
2011-05-22 20:42:32 +02:00
|
|
|
#ifdef O_CLOEXEC
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_CLOEXEC)) return -1;
|
2011-05-22 20:42:32 +02:00
|
|
|
#endif
|
2012-04-24 20:59:17 +02:00
|
|
|
#ifdef O_ACCMODE
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_ACCMODE)) return -1;
|
2012-04-24 20:59:17 +02:00
|
|
|
#endif
|
2011-02-25 20:57:54 +00:00
|
|
|
|
2001-10-18 22:05:36 +00:00
|
|
|
|
2012-06-22 18:32:07 +02:00
|
|
|
#ifdef SEEK_HOLE
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, SEEK_HOLE)) return -1;
|
2012-06-22 18:32:07 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef SEEK_DATA
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, SEEK_DATA)) return -1;
|
2012-06-22 18:32:07 +02:00
|
|
|
#endif
|
|
|
|
|
|
2002-01-30 05:46:57 +00:00
|
|
|
/* MS Windows */
|
|
|
|
|
#ifdef O_NOINHERIT
|
2010-05-06 00:08:46 +00:00
|
|
|
/* Don't inherit in child processes. */
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_NOINHERIT)) return -1;
|
2002-01-30 05:46:57 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef _O_SHORT_LIVED
|
2010-05-06 00:08:46 +00:00
|
|
|
/* Optimize for short life (keep in memory). */
|
|
|
|
|
/* MS forgot to define this one with a non-underscore form too. */
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntConstant(m, "O_SHORT_LIVED", _O_SHORT_LIVED)) return -1;
|
2002-01-30 05:46:57 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef O_TEMPORARY
|
2010-05-06 00:08:46 +00:00
|
|
|
/* Automatically delete when last handle is closed. */
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_TEMPORARY)) return -1;
|
2002-01-30 05:46:57 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef O_RANDOM
|
2010-05-06 00:08:46 +00:00
|
|
|
/* Optimize for random access. */
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_RANDOM)) return -1;
|
2002-01-30 05:46:57 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef O_SEQUENTIAL
|
2010-05-06 00:08:46 +00:00
|
|
|
/* Optimize for sequential access. */
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_SEQUENTIAL)) return -1;
|
2002-01-30 05:46:57 +00:00
|
|
|
#endif
|
|
|
|
|
|
2001-10-18 22:05:36 +00:00
|
|
|
/* GNU extensions. */
|
Merged revisions 63361-63373,63375,63377-63380 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r63361 | alexandre.vassalotti | 2008-05-16 03:14:08 -0400 (Fri, 16 May 2008) | 2 lines
Rename the test file of reprlib.
........
r63364 | georg.brandl | 2008-05-16 05:34:48 -0400 (Fri, 16 May 2008) | 2 lines
Make generator repr consistent with function and code object repr.
........
r63365 | georg.brandl | 2008-05-16 05:47:29 -0400 (Fri, 16 May 2008) | 2 lines
#2869: remove parameter from signature.
........
r63366 | christian.heimes | 2008-05-16 06:23:31 -0400 (Fri, 16 May 2008) | 1 line
Fixed #2870: cmathmodule.c compile error
........
r63367 | christian.heimes | 2008-05-16 07:28:56 -0400 (Fri, 16 May 2008) | 1 line
Following Amaury's advice
........
r63368 | georg.brandl | 2008-05-16 09:10:15 -0400 (Fri, 16 May 2008) | 2 lines
#2890: support os.O_ASYNC and fcntl.FASYNC.
........
r63369 | georg.brandl | 2008-05-16 09:18:50 -0400 (Fri, 16 May 2008) | 2 lines
#2845: fix copy2's docs.
........
r63370 | georg.brandl | 2008-05-16 09:24:29 -0400 (Fri, 16 May 2008) | 2 lines
Don't allow keyword arguments to reversed().
........
r63373 | georg.brandl | 2008-05-16 09:41:26 -0400 (Fri, 16 May 2008) | 2 lines
Document O_ASYNC addition.
........
r63380 | georg.brandl | 2008-05-16 13:33:13 -0400 (Fri, 16 May 2008) | 2 lines
Fix reprlib docs.
........
2008-05-16 18:15:12 +00:00
|
|
|
#ifdef O_ASYNC
|
2010-05-06 00:08:46 +00:00
|
|
|
/* Send a SIGIO signal whenever input or output
|
|
|
|
|
becomes available on file descriptor */
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_ASYNC)) return -1;
|
Merged revisions 63361-63373,63375,63377-63380 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r63361 | alexandre.vassalotti | 2008-05-16 03:14:08 -0400 (Fri, 16 May 2008) | 2 lines
Rename the test file of reprlib.
........
r63364 | georg.brandl | 2008-05-16 05:34:48 -0400 (Fri, 16 May 2008) | 2 lines
Make generator repr consistent with function and code object repr.
........
r63365 | georg.brandl | 2008-05-16 05:47:29 -0400 (Fri, 16 May 2008) | 2 lines
#2869: remove parameter from signature.
........
r63366 | christian.heimes | 2008-05-16 06:23:31 -0400 (Fri, 16 May 2008) | 1 line
Fixed #2870: cmathmodule.c compile error
........
r63367 | christian.heimes | 2008-05-16 07:28:56 -0400 (Fri, 16 May 2008) | 1 line
Following Amaury's advice
........
r63368 | georg.brandl | 2008-05-16 09:10:15 -0400 (Fri, 16 May 2008) | 2 lines
#2890: support os.O_ASYNC and fcntl.FASYNC.
........
r63369 | georg.brandl | 2008-05-16 09:18:50 -0400 (Fri, 16 May 2008) | 2 lines
#2845: fix copy2's docs.
........
r63370 | georg.brandl | 2008-05-16 09:24:29 -0400 (Fri, 16 May 2008) | 2 lines
Don't allow keyword arguments to reversed().
........
r63373 | georg.brandl | 2008-05-16 09:41:26 -0400 (Fri, 16 May 2008) | 2 lines
Document O_ASYNC addition.
........
r63380 | georg.brandl | 2008-05-16 13:33:13 -0400 (Fri, 16 May 2008) | 2 lines
Fix reprlib docs.
........
2008-05-16 18:15:12 +00:00
|
|
|
#endif
|
2001-10-18 22:05:36 +00:00
|
|
|
#ifdef O_DIRECT
|
2010-05-06 00:08:46 +00:00
|
|
|
/* Direct disk access. */
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_DIRECT)) return -1;
|
2001-10-18 22:05:36 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef O_DIRECTORY
|
2010-05-06 00:08:46 +00:00
|
|
|
/* Must be a directory. */
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_DIRECTORY)) return -1;
|
2001-10-18 22:05:36 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef O_NOFOLLOW
|
2010-05-06 00:08:46 +00:00
|
|
|
/* Do not follow links. */
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_NOFOLLOW)) return -1;
|
2012-04-24 20:59:17 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef O_NOLINKS
|
|
|
|
|
/* Fails if link count of the named file is greater than 1 */
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_NOLINKS)) return -1;
|
2001-10-18 22:05:36 +00:00
|
|
|
#endif
|
Merged revisions 59107-59186 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
(Note: some conflicts in the PCbuild9 directory reverted. Sorry Christian!)
........
r59120 | christian.heimes | 2007-11-22 03:21:16 -0800 (Thu, 22 Nov 2007) | 3 lines
Backport of the PCbuild9 directory from the py3k branch.
I've finished the last task for the PCbuild9 directory today. I don't think there is much left to do. Now you can all play around with the shiny new VS 2008 and try the PGO builds. I was able to get a speed improvement of about 10% on py3k.
Have fun! :)
........
r59126 | brett.cannon | 2007-11-22 16:06:51 -0800 (Thu, 22 Nov 2007) | 2 lines
Fix a bug in the test for using __loader__.get_data().
........
r59131 | christian.heimes | 2007-11-22 23:05:03 -0800 (Thu, 22 Nov 2007) | 1 line
Backport of PCbuild9 fixes from py3k r59130
........
r59132 | christian.heimes | 2007-11-23 01:10:36 -0800 (Fri, 23 Nov 2007) | 2 lines
Applied patch #1754273 and #1754271 from Thomas Glee
The patches are adding deprecation warnings for back ticks and <>
........
r59133 | christian.heimes | 2007-11-23 04:12:02 -0800 (Fri, 23 Nov 2007) | 2 lines
Fixed problems in the last commit. Filenames and line numbers weren't reported correctly.
Backquotes still don't report the correct file. The AST nodes only contain the line number but not the file name.
........
r59134 | christian.heimes | 2007-11-23 04:16:35 -0800 (Fri, 23 Nov 2007) | 1 line
How did the comment get there?
........
r59135 | christian.heimes | 2007-11-23 05:25:31 -0800 (Fri, 23 Nov 2007) | 1 line
And yet another fix for the patch. Paul Moore has send me a note that I've missed a declaration. The additional code has moved the declaration in the middle of the block.
........
r59136 | andrew.kuchling | 2007-11-23 05:37:39 -0800 (Fri, 23 Nov 2007) | 1 line
Add item
........
r59137 | skip.montanaro | 2007-11-23 09:08:35 -0800 (Fri, 23 Nov 2007) | 2 lines
Make trace and doctest play nice together (issue 1429818). Will backport.
........
r59139 | skip.montanaro | 2007-11-23 09:12:47 -0800 (Fri, 23 Nov 2007) | 1 line
issue 1429818
........
r59144 | facundo.batista | 2007-11-23 09:59:00 -0800 (Fri, 23 Nov 2007) | 10 lines
Major change in the internal structure of the Decimal
number: now it does not store the mantissa as a tuple
of numbers, but as a string.
This avoids a lot of conversions, and achieves a
speedup of 40%. The API remains intact.
Thanks Mark Dickinson.
........
r59146 | facundo.batista | 2007-11-23 10:14:50 -0800 (Fri, 23 Nov 2007) | 3 lines
Test cases from Cowlishaw, v2.57. All are pased cleanly.
........
r59156 | christian.heimes | 2007-11-23 17:36:02 -0800 (Fri, 23 Nov 2007) | 2 lines
Added filename to compiling struct based on Martin's suggestion.
I'm wonder why I was trying to add the filename to the node all the time. The compiling struct is more obvious.
........
r59158 | christian.heimes | 2007-11-23 17:53:59 -0800 (Fri, 23 Nov 2007) | 2 lines
Backport of fixes from py3k branch
svn merge -r59131:HEAD ../../py3k/PCbuild9/ .
........
r59159 | skip.montanaro | 2007-11-23 20:29:08 -0800 (Fri, 23 Nov 2007) | 1 line
revert change that breaks test_doctest (which I forgot to run - sorry)
........
r59162 | skip.montanaro | 2007-11-23 20:31:15 -0800 (Fri, 23 Nov 2007) | 1 line
revert
........
r59164 | georg.brandl | 2007-11-24 03:31:46 -0800 (Sat, 24 Nov 2007) | 3 lines
#1344: document that you need to open std{in,out,err} with PIPE if you want
communicate() to work as described.
........
r59165 | georg.brandl | 2007-11-24 03:39:13 -0800 (Sat, 24 Nov 2007) | 2 lines
#1467: fix documentation for TestResult.add{Error,Failure}.
........
r59166 | georg.brandl | 2007-11-24 03:42:14 -0800 (Sat, 24 Nov 2007) | 2 lines
#1355: remove mention of PyXML from xml.dom docs.
........
r59169 | amaury.forgeotdarc | 2007-11-24 05:20:22 -0800 (Sat, 24 Nov 2007) | 2 lines
Warning "<> not supported in 3.x" should be enabled only when the -3 option is set.
........
r59170 | amaury.forgeotdarc | 2007-11-24 05:44:17 -0800 (Sat, 24 Nov 2007) | 3 lines
Issue #1445: Fix a SystemError when accessing the ``cell_contents``
attribute of an empty cell object. Now a ValueError is raised.
........
r59172 | georg.brandl | 2007-11-24 05:56:09 -0800 (Sat, 24 Nov 2007) | 3 lines
#1735632: add O_NOATIME constant to os module.
Also document a few other O_ constants that were missing from documentation.
........
r59173 | skip.montanaro | 2007-11-24 06:30:47 -0800 (Sat, 24 Nov 2007) | 1 line
back in these go - thanks to Titus Brown for the fix
........
r59176 | martin.v.loewis | 2007-11-24 10:33:40 -0800 (Sat, 24 Nov 2007) | 2 lines
Bug #1494: Document that appendChild removes first.
........
r59186 | guido.van.rossum | 2007-11-26 14:16:49 -0800 (Mon, 26 Nov 2007) | 2 lines
A thread-less variant of brownian.py, submitted by Michele Simoniato.
........
2007-11-26 23:23:18 +00:00
|
|
|
#ifdef O_NOATIME
|
2010-05-06 00:08:46 +00:00
|
|
|
/* Do not update the access time. */
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, O_NOATIME)) return -1;
|
Merged revisions 59107-59186 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
(Note: some conflicts in the PCbuild9 directory reverted. Sorry Christian!)
........
r59120 | christian.heimes | 2007-11-22 03:21:16 -0800 (Thu, 22 Nov 2007) | 3 lines
Backport of the PCbuild9 directory from the py3k branch.
I've finished the last task for the PCbuild9 directory today. I don't think there is much left to do. Now you can all play around with the shiny new VS 2008 and try the PGO builds. I was able to get a speed improvement of about 10% on py3k.
Have fun! :)
........
r59126 | brett.cannon | 2007-11-22 16:06:51 -0800 (Thu, 22 Nov 2007) | 2 lines
Fix a bug in the test for using __loader__.get_data().
........
r59131 | christian.heimes | 2007-11-22 23:05:03 -0800 (Thu, 22 Nov 2007) | 1 line
Backport of PCbuild9 fixes from py3k r59130
........
r59132 | christian.heimes | 2007-11-23 01:10:36 -0800 (Fri, 23 Nov 2007) | 2 lines
Applied patch #1754273 and #1754271 from Thomas Glee
The patches are adding deprecation warnings for back ticks and <>
........
r59133 | christian.heimes | 2007-11-23 04:12:02 -0800 (Fri, 23 Nov 2007) | 2 lines
Fixed problems in the last commit. Filenames and line numbers weren't reported correctly.
Backquotes still don't report the correct file. The AST nodes only contain the line number but not the file name.
........
r59134 | christian.heimes | 2007-11-23 04:16:35 -0800 (Fri, 23 Nov 2007) | 1 line
How did the comment get there?
........
r59135 | christian.heimes | 2007-11-23 05:25:31 -0800 (Fri, 23 Nov 2007) | 1 line
And yet another fix for the patch. Paul Moore has send me a note that I've missed a declaration. The additional code has moved the declaration in the middle of the block.
........
r59136 | andrew.kuchling | 2007-11-23 05:37:39 -0800 (Fri, 23 Nov 2007) | 1 line
Add item
........
r59137 | skip.montanaro | 2007-11-23 09:08:35 -0800 (Fri, 23 Nov 2007) | 2 lines
Make trace and doctest play nice together (issue 1429818). Will backport.
........
r59139 | skip.montanaro | 2007-11-23 09:12:47 -0800 (Fri, 23 Nov 2007) | 1 line
issue 1429818
........
r59144 | facundo.batista | 2007-11-23 09:59:00 -0800 (Fri, 23 Nov 2007) | 10 lines
Major change in the internal structure of the Decimal
number: now it does not store the mantissa as a tuple
of numbers, but as a string.
This avoids a lot of conversions, and achieves a
speedup of 40%. The API remains intact.
Thanks Mark Dickinson.
........
r59146 | facundo.batista | 2007-11-23 10:14:50 -0800 (Fri, 23 Nov 2007) | 3 lines
Test cases from Cowlishaw, v2.57. All are pased cleanly.
........
r59156 | christian.heimes | 2007-11-23 17:36:02 -0800 (Fri, 23 Nov 2007) | 2 lines
Added filename to compiling struct based on Martin's suggestion.
I'm wonder why I was trying to add the filename to the node all the time. The compiling struct is more obvious.
........
r59158 | christian.heimes | 2007-11-23 17:53:59 -0800 (Fri, 23 Nov 2007) | 2 lines
Backport of fixes from py3k branch
svn merge -r59131:HEAD ../../py3k/PCbuild9/ .
........
r59159 | skip.montanaro | 2007-11-23 20:29:08 -0800 (Fri, 23 Nov 2007) | 1 line
revert change that breaks test_doctest (which I forgot to run - sorry)
........
r59162 | skip.montanaro | 2007-11-23 20:31:15 -0800 (Fri, 23 Nov 2007) | 1 line
revert
........
r59164 | georg.brandl | 2007-11-24 03:31:46 -0800 (Sat, 24 Nov 2007) | 3 lines
#1344: document that you need to open std{in,out,err} with PIPE if you want
communicate() to work as described.
........
r59165 | georg.brandl | 2007-11-24 03:39:13 -0800 (Sat, 24 Nov 2007) | 2 lines
#1467: fix documentation for TestResult.add{Error,Failure}.
........
r59166 | georg.brandl | 2007-11-24 03:42:14 -0800 (Sat, 24 Nov 2007) | 2 lines
#1355: remove mention of PyXML from xml.dom docs.
........
r59169 | amaury.forgeotdarc | 2007-11-24 05:20:22 -0800 (Sat, 24 Nov 2007) | 2 lines
Warning "<> not supported in 3.x" should be enabled only when the -3 option is set.
........
r59170 | amaury.forgeotdarc | 2007-11-24 05:44:17 -0800 (Sat, 24 Nov 2007) | 3 lines
Issue #1445: Fix a SystemError when accessing the ``cell_contents``
attribute of an empty cell object. Now a ValueError is raised.
........
r59172 | georg.brandl | 2007-11-24 05:56:09 -0800 (Sat, 24 Nov 2007) | 3 lines
#1735632: add O_NOATIME constant to os module.
Also document a few other O_ constants that were missing from documentation.
........
r59173 | skip.montanaro | 2007-11-24 06:30:47 -0800 (Sat, 24 Nov 2007) | 1 line
back in these go - thanks to Titus Brown for the fix
........
r59176 | martin.v.loewis | 2007-11-24 10:33:40 -0800 (Sat, 24 Nov 2007) | 2 lines
Bug #1494: Document that appendChild removes first.
........
r59186 | guido.van.rossum | 2007-11-26 14:16:49 -0800 (Mon, 26 Nov 2007) | 2 lines
A thread-less variant of brownian.py, submitted by Michele Simoniato.
........
2007-11-26 23:23:18 +00:00
|
|
|
#endif
|
1997-12-05 22:19:34 +00:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
/* These come from sysexits.h */
|
2003-01-07 20:57:09 +00:00
|
|
|
#ifdef EX_OK
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, EX_OK)) return -1;
|
2003-01-10 15:29:16 +00:00
|
|
|
#endif /* EX_OK */
|
2003-01-07 20:57:09 +00:00
|
|
|
#ifdef EX_USAGE
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, EX_USAGE)) return -1;
|
2003-01-10 15:29:16 +00:00
|
|
|
#endif /* EX_USAGE */
|
2003-01-07 20:57:09 +00:00
|
|
|
#ifdef EX_DATAERR
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, EX_DATAERR)) return -1;
|
2003-01-10 15:29:16 +00:00
|
|
|
#endif /* EX_DATAERR */
|
2003-01-07 20:57:09 +00:00
|
|
|
#ifdef EX_NOINPUT
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, EX_NOINPUT)) return -1;
|
2003-01-10 15:29:16 +00:00
|
|
|
#endif /* EX_NOINPUT */
|
2003-01-07 20:57:09 +00:00
|
|
|
#ifdef EX_NOUSER
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, EX_NOUSER)) return -1;
|
2003-01-10 15:29:16 +00:00
|
|
|
#endif /* EX_NOUSER */
|
2003-01-07 20:57:09 +00:00
|
|
|
#ifdef EX_NOHOST
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, EX_NOHOST)) return -1;
|
2003-01-10 15:29:16 +00:00
|
|
|
#endif /* EX_NOHOST */
|
2003-01-07 20:57:09 +00:00
|
|
|
#ifdef EX_UNAVAILABLE
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, EX_UNAVAILABLE)) return -1;
|
2003-01-10 15:29:16 +00:00
|
|
|
#endif /* EX_UNAVAILABLE */
|
2003-01-07 20:57:09 +00:00
|
|
|
#ifdef EX_SOFTWARE
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, EX_SOFTWARE)) return -1;
|
2003-01-10 15:29:16 +00:00
|
|
|
#endif /* EX_SOFTWARE */
|
2003-01-07 20:57:09 +00:00
|
|
|
#ifdef EX_OSERR
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, EX_OSERR)) return -1;
|
2003-01-10 15:29:16 +00:00
|
|
|
#endif /* EX_OSERR */
|
2003-01-07 20:57:09 +00:00
|
|
|
#ifdef EX_OSFILE
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, EX_OSFILE)) return -1;
|
2003-01-10 15:29:16 +00:00
|
|
|
#endif /* EX_OSFILE */
|
2003-01-07 20:57:09 +00:00
|
|
|
#ifdef EX_CANTCREAT
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, EX_CANTCREAT)) return -1;
|
2003-01-10 15:29:16 +00:00
|
|
|
#endif /* EX_CANTCREAT */
|
2003-01-07 20:57:09 +00:00
|
|
|
#ifdef EX_IOERR
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, EX_IOERR)) return -1;
|
2003-01-10 15:29:16 +00:00
|
|
|
#endif /* EX_IOERR */
|
2003-01-07 20:57:09 +00:00
|
|
|
#ifdef EX_TEMPFAIL
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, EX_TEMPFAIL)) return -1;
|
2003-01-10 15:29:16 +00:00
|
|
|
#endif /* EX_TEMPFAIL */
|
2003-01-07 20:57:09 +00:00
|
|
|
#ifdef EX_PROTOCOL
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, EX_PROTOCOL)) return -1;
|
2003-01-10 15:29:16 +00:00
|
|
|
#endif /* EX_PROTOCOL */
|
2003-01-07 20:57:09 +00:00
|
|
|
#ifdef EX_NOPERM
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, EX_NOPERM)) return -1;
|
2003-01-10 15:29:16 +00:00
|
|
|
#endif /* EX_NOPERM */
|
2003-01-07 20:57:09 +00:00
|
|
|
#ifdef EX_CONFIG
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, EX_CONFIG)) return -1;
|
2003-01-10 15:29:16 +00:00
|
|
|
#endif /* EX_CONFIG */
|
2003-01-07 20:57:09 +00:00
|
|
|
#ifdef EX_NOTFOUND
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, EX_NOTFOUND)) return -1;
|
2003-01-10 15:29:16 +00:00
|
|
|
#endif /* EX_NOTFOUND */
|
2003-01-07 20:57:09 +00:00
|
|
|
|
2010-09-10 18:11:45 +00:00
|
|
|
/* statvfs */
|
2010-08-18 22:30:34 +00:00
|
|
|
#ifdef ST_RDONLY
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, ST_RDONLY)) return -1;
|
2010-08-18 22:30:34 +00:00
|
|
|
#endif /* ST_RDONLY */
|
|
|
|
|
#ifdef ST_NOSUID
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, ST_NOSUID)) return -1;
|
2010-08-18 22:30:34 +00:00
|
|
|
#endif /* ST_NOSUID */
|
|
|
|
|
|
2013-12-08 15:23:07 +01:00
|
|
|
/* GNU extensions */
|
|
|
|
|
#ifdef ST_NODEV
|
|
|
|
|
if (PyModule_AddIntMacro(m, ST_NODEV)) return -1;
|
|
|
|
|
#endif /* ST_NODEV */
|
|
|
|
|
#ifdef ST_NOEXEC
|
|
|
|
|
if (PyModule_AddIntMacro(m, ST_NOEXEC)) return -1;
|
|
|
|
|
#endif /* ST_NOEXEC */
|
|
|
|
|
#ifdef ST_SYNCHRONOUS
|
|
|
|
|
if (PyModule_AddIntMacro(m, ST_SYNCHRONOUS)) return -1;
|
|
|
|
|
#endif /* ST_SYNCHRONOUS */
|
|
|
|
|
#ifdef ST_MANDLOCK
|
|
|
|
|
if (PyModule_AddIntMacro(m, ST_MANDLOCK)) return -1;
|
|
|
|
|
#endif /* ST_MANDLOCK */
|
|
|
|
|
#ifdef ST_WRITE
|
|
|
|
|
if (PyModule_AddIntMacro(m, ST_WRITE)) return -1;
|
|
|
|
|
#endif /* ST_WRITE */
|
|
|
|
|
#ifdef ST_APPEND
|
|
|
|
|
if (PyModule_AddIntMacro(m, ST_APPEND)) return -1;
|
|
|
|
|
#endif /* ST_APPEND */
|
|
|
|
|
#ifdef ST_NOATIME
|
|
|
|
|
if (PyModule_AddIntMacro(m, ST_NOATIME)) return -1;
|
|
|
|
|
#endif /* ST_NOATIME */
|
|
|
|
|
#ifdef ST_NODIRATIME
|
|
|
|
|
if (PyModule_AddIntMacro(m, ST_NODIRATIME)) return -1;
|
|
|
|
|
#endif /* ST_NODIRATIME */
|
|
|
|
|
#ifdef ST_RELATIME
|
|
|
|
|
if (PyModule_AddIntMacro(m, ST_RELATIME)) return -1;
|
|
|
|
|
#endif /* ST_RELATIME */
|
|
|
|
|
|
2011-02-25 14:39:16 +00:00
|
|
|
/* FreeBSD sendfile() constants */
|
|
|
|
|
#ifdef SF_NODISKIO
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, SF_NODISKIO)) return -1;
|
2011-02-25 14:39:16 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef SF_MNOWAIT
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, SF_MNOWAIT)) return -1;
|
2011-02-25 14:39:16 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef SF_SYNC
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, SF_SYNC)) return -1;
|
2011-02-25 14:39:16 +00:00
|
|
|
#endif
|
|
|
|
|
|
2011-03-17 20:20:30 +02:00
|
|
|
/* constants for posix_fadvise */
|
|
|
|
|
#ifdef POSIX_FADV_NORMAL
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, POSIX_FADV_NORMAL)) return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef POSIX_FADV_SEQUENTIAL
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, POSIX_FADV_SEQUENTIAL)) return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef POSIX_FADV_RANDOM
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, POSIX_FADV_RANDOM)) return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef POSIX_FADV_NOREUSE
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, POSIX_FADV_NOREUSE)) return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef POSIX_FADV_WILLNEED
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, POSIX_FADV_WILLNEED)) return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef POSIX_FADV_DONTNEED
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, POSIX_FADV_DONTNEED)) return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* constants for waitid */
|
|
|
|
|
#if defined(HAVE_SYS_WAIT_H) && defined(HAVE_WAITID)
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, P_PID)) return -1;
|
|
|
|
|
if (PyModule_AddIntMacro(m, P_PGID)) return -1;
|
|
|
|
|
if (PyModule_AddIntMacro(m, P_ALL)) return -1;
|
2019-11-05 21:58:31 -08:00
|
|
|
#ifdef P_PIDFD
|
|
|
|
|
if (PyModule_AddIntMacro(m, P_PIDFD)) return -1;
|
|
|
|
|
#endif
|
2011-03-17 20:20:30 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef WEXITED
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, WEXITED)) return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef WNOWAIT
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, WNOWAIT)) return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef WSTOPPED
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, WSTOPPED)) return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef CLD_EXITED
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, CLD_EXITED)) return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
#endif
|
2019-10-21 16:01:05 +09:00
|
|
|
#ifdef CLD_KILLED
|
|
|
|
|
if (PyModule_AddIntMacro(m, CLD_KILLED)) return -1;
|
|
|
|
|
#endif
|
2011-03-17 20:20:30 +02:00
|
|
|
#ifdef CLD_DUMPED
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, CLD_DUMPED)) return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef CLD_TRAPPED
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, CLD_TRAPPED)) return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
#endif
|
2019-10-21 16:01:05 +09:00
|
|
|
#ifdef CLD_STOPPED
|
|
|
|
|
if (PyModule_AddIntMacro(m, CLD_STOPPED)) return -1;
|
|
|
|
|
#endif
|
2011-03-17 20:20:30 +02:00
|
|
|
#ifdef CLD_CONTINUED
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, CLD_CONTINUED)) return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* constants for lockf */
|
|
|
|
|
#ifdef F_LOCK
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, F_LOCK)) return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef F_TLOCK
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, F_TLOCK)) return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef F_ULOCK
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, F_ULOCK)) return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef F_TEST
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, F_TEST)) return -1;
|
2011-03-17 20:20:30 +02:00
|
|
|
#endif
|
|
|
|
|
|
2018-01-27 16:16:37 +00:00
|
|
|
#ifdef RWF_DSYNC
|
|
|
|
|
if (PyModule_AddIntConstant(m, "RWF_DSYNC", RWF_DSYNC)) return -1;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef RWF_HIPRI
|
|
|
|
|
if (PyModule_AddIntConstant(m, "RWF_HIPRI", RWF_HIPRI)) return -1;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef RWF_SYNC
|
|
|
|
|
if (PyModule_AddIntConstant(m, "RWF_SYNC", RWF_SYNC)) return -1;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef RWF_NOWAIT
|
|
|
|
|
if (PyModule_AddIntConstant(m, "RWF_NOWAIT", RWF_NOWAIT)) return -1;
|
|
|
|
|
#endif
|
|
|
|
|
|
2018-01-29 01:56:10 +00:00
|
|
|
/* constants for posix_spawn */
|
|
|
|
|
#ifdef HAVE_POSIX_SPAWN
|
|
|
|
|
if (PyModule_AddIntConstant(m, "POSIX_SPAWN_OPEN", POSIX_SPAWN_OPEN)) return -1;
|
|
|
|
|
if (PyModule_AddIntConstant(m, "POSIX_SPAWN_CLOSE", POSIX_SPAWN_CLOSE)) return -1;
|
|
|
|
|
if (PyModule_AddIntConstant(m, "POSIX_SPAWN_DUP2", POSIX_SPAWN_DUP2)) return -1;
|
|
|
|
|
#endif
|
|
|
|
|
|
2019-05-21 18:46:37 +08:00
|
|
|
#if defined(HAVE_SPAWNV) || defined (HAVE_RTPSPAWN)
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntConstant(m, "P_WAIT", _P_WAIT)) return -1;
|
|
|
|
|
if (PyModule_AddIntConstant(m, "P_NOWAIT", _P_NOWAIT)) return -1;
|
|
|
|
|
if (PyModule_AddIntConstant(m, "P_NOWAITO", _P_NOWAITO)) return -1;
|
2019-05-21 18:46:37 +08:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_SPAWNV
|
|
|
|
|
if (PyModule_AddIntConstant(m, "P_OVERLAY", _OLD_P_OVERLAY)) return -1;
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntConstant(m, "P_DETACH", _P_DETACH)) return -1;
|
1999-02-01 23:54:31 +00:00
|
|
|
#endif
|
|
|
|
|
|
2011-08-02 17:30:04 -05:00
|
|
|
#ifdef HAVE_SCHED_H
|
2016-07-30 23:21:50 -07:00
|
|
|
#ifdef SCHED_OTHER
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, SCHED_OTHER)) return -1;
|
2016-07-30 23:21:50 -07:00
|
|
|
#endif
|
|
|
|
|
#ifdef SCHED_FIFO
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, SCHED_FIFO)) return -1;
|
2016-07-30 23:21:50 -07:00
|
|
|
#endif
|
|
|
|
|
#ifdef SCHED_RR
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, SCHED_RR)) return -1;
|
2016-07-30 23:21:50 -07:00
|
|
|
#endif
|
2011-08-02 17:30:04 -05:00
|
|
|
#ifdef SCHED_SPORADIC
|
2017-06-13 22:30:43 +08:00
|
|
|
if (PyModule_AddIntMacro(m, SCHED_SPORADIC)) return -1;
|
2011-08-02 17:30:04 -05:00
|
|
|
#endif
|
|
|
|
|
#ifdef SCHED_BATCH
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, SCHED_BATCH)) return -1;
|
2011-08-02 17:30:04 -05:00
|
|
|
#endif
|
|
|
|
|
#ifdef SCHED_IDLE
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, SCHED_IDLE)) return -1;
|
2011-08-02 17:30:04 -05:00
|
|
|
#endif
|
|
|
|
|
#ifdef SCHED_RESET_ON_FORK
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, SCHED_RESET_ON_FORK)) return -1;
|
2011-08-02 17:30:04 -05:00
|
|
|
#endif
|
2011-09-09 23:55:42 +02:00
|
|
|
#ifdef SCHED_SYS
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, SCHED_SYS)) return -1;
|
2011-09-09 23:55:42 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef SCHED_IA
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, SCHED_IA)) return -1;
|
2011-09-09 23:55:42 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef SCHED_FSS
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, SCHED_FSS)) return -1;
|
2011-09-09 23:55:42 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef SCHED_FX
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntConstant(m, "SCHED_FX", SCHED_FSS)) return -1;
|
2011-09-09 23:55:42 +02:00
|
|
|
#endif
|
2011-08-02 17:30:04 -05:00
|
|
|
#endif
|
|
|
|
|
|
2011-09-14 11:45:52 -04:00
|
|
|
#ifdef USE_XATTRS
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, XATTR_CREATE)) return -1;
|
|
|
|
|
if (PyModule_AddIntMacro(m, XATTR_REPLACE)) return -1;
|
|
|
|
|
if (PyModule_AddIntMacro(m, XATTR_SIZE_MAX)) return -1;
|
2011-08-31 22:15:17 -04:00
|
|
|
#endif
|
|
|
|
|
|
2016-05-04 09:44:44 +03:00
|
|
|
#if HAVE_DECL_RTLD_LAZY
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, RTLD_LAZY)) return -1;
|
2011-10-25 13:34:04 +02:00
|
|
|
#endif
|
2016-05-04 09:44:44 +03:00
|
|
|
#if HAVE_DECL_RTLD_NOW
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, RTLD_NOW)) return -1;
|
2011-10-25 13:34:04 +02:00
|
|
|
#endif
|
2016-05-04 09:44:44 +03:00
|
|
|
#if HAVE_DECL_RTLD_GLOBAL
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, RTLD_GLOBAL)) return -1;
|
2011-10-25 13:34:04 +02:00
|
|
|
#endif
|
2016-05-04 09:44:44 +03:00
|
|
|
#if HAVE_DECL_RTLD_LOCAL
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, RTLD_LOCAL)) return -1;
|
2011-10-25 13:34:04 +02:00
|
|
|
#endif
|
2016-05-04 09:44:44 +03:00
|
|
|
#if HAVE_DECL_RTLD_NODELETE
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, RTLD_NODELETE)) return -1;
|
2011-10-25 13:34:04 +02:00
|
|
|
#endif
|
2016-05-04 09:44:44 +03:00
|
|
|
#if HAVE_DECL_RTLD_NOLOAD
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, RTLD_NOLOAD)) return -1;
|
2011-10-25 13:34:04 +02:00
|
|
|
#endif
|
2016-05-04 09:44:44 +03:00
|
|
|
#if HAVE_DECL_RTLD_DEEPBIND
|
2013-05-20 19:13:19 +02:00
|
|
|
if (PyModule_AddIntMacro(m, RTLD_DEEPBIND)) return -1;
|
2011-10-25 13:34:04 +02:00
|
|
|
#endif
|
2017-12-19 13:58:49 +01:00
|
|
|
#if HAVE_DECL_RTLD_MEMBER
|
|
|
|
|
if (PyModule_AddIntMacro(m, RTLD_MEMBER)) return -1;
|
|
|
|
|
#endif
|
2011-10-25 13:34:04 +02:00
|
|
|
|
2016-09-06 16:18:52 -07:00
|
|
|
#ifdef HAVE_GETRANDOM_SYSCALL
|
|
|
|
|
if (PyModule_AddIntMacro(m, GRND_RANDOM)) return -1;
|
|
|
|
|
if (PyModule_AddIntMacro(m, GRND_NONBLOCK)) return -1;
|
|
|
|
|
#endif
|
2019-05-29 13:57:07 -06:00
|
|
|
#ifdef HAVE_MEMFD_CREATE
|
|
|
|
|
if (PyModule_AddIntMacro(m, MFD_CLOEXEC)) return -1;
|
|
|
|
|
if (PyModule_AddIntMacro(m, MFD_ALLOW_SEALING)) return -1;
|
|
|
|
|
#ifdef MFD_HUGETLB
|
|
|
|
|
if (PyModule_AddIntMacro(m, MFD_HUGETLB)) return -1;
|
2019-05-29 14:43:50 -06:00
|
|
|
#endif
|
|
|
|
|
#ifdef MFD_HUGE_SHIFT
|
2019-05-29 13:57:07 -06:00
|
|
|
if (PyModule_AddIntMacro(m, MFD_HUGE_SHIFT)) return -1;
|
2019-05-29 14:43:50 -06:00
|
|
|
#endif
|
|
|
|
|
#ifdef MFD_HUGE_MASK
|
2019-05-29 13:57:07 -06:00
|
|
|
if (PyModule_AddIntMacro(m, MFD_HUGE_MASK)) return -1;
|
2019-05-29 14:43:50 -06:00
|
|
|
#endif
|
|
|
|
|
#ifdef MFD_HUGE_64KB
|
2019-05-29 13:57:07 -06:00
|
|
|
if (PyModule_AddIntMacro(m, MFD_HUGE_64KB)) return -1;
|
2019-05-29 14:43:50 -06:00
|
|
|
#endif
|
|
|
|
|
#ifdef MFD_HUGE_512KB
|
2019-05-29 13:57:07 -06:00
|
|
|
if (PyModule_AddIntMacro(m, MFD_HUGE_512KB)) return -1;
|
2019-05-29 14:43:50 -06:00
|
|
|
#endif
|
|
|
|
|
#ifdef MFD_HUGE_1MB
|
2019-05-29 13:57:07 -06:00
|
|
|
if (PyModule_AddIntMacro(m, MFD_HUGE_1MB)) return -1;
|
2019-05-29 14:43:50 -06:00
|
|
|
#endif
|
|
|
|
|
#ifdef MFD_HUGE_2MB
|
2019-05-29 13:57:07 -06:00
|
|
|
if (PyModule_AddIntMacro(m, MFD_HUGE_2MB)) return -1;
|
2019-05-29 14:43:50 -06:00
|
|
|
#endif
|
|
|
|
|
#ifdef MFD_HUGE_8MB
|
2019-05-29 13:57:07 -06:00
|
|
|
if (PyModule_AddIntMacro(m, MFD_HUGE_8MB)) return -1;
|
2019-05-29 14:43:50 -06:00
|
|
|
#endif
|
|
|
|
|
#ifdef MFD_HUGE_16MB
|
2019-05-29 13:57:07 -06:00
|
|
|
if (PyModule_AddIntMacro(m, MFD_HUGE_16MB)) return -1;
|
2019-05-29 14:43:50 -06:00
|
|
|
#endif
|
|
|
|
|
#ifdef MFD_HUGE_32MB
|
2019-05-29 13:57:07 -06:00
|
|
|
if (PyModule_AddIntMacro(m, MFD_HUGE_32MB)) return -1;
|
2019-05-29 14:43:50 -06:00
|
|
|
#endif
|
|
|
|
|
#ifdef MFD_HUGE_256MB
|
2019-05-29 13:57:07 -06:00
|
|
|
if (PyModule_AddIntMacro(m, MFD_HUGE_256MB)) return -1;
|
2019-05-29 14:43:50 -06:00
|
|
|
#endif
|
|
|
|
|
#ifdef MFD_HUGE_512MB
|
2019-05-29 13:57:07 -06:00
|
|
|
if (PyModule_AddIntMacro(m, MFD_HUGE_512MB)) return -1;
|
2019-05-29 14:43:50 -06:00
|
|
|
#endif
|
|
|
|
|
#ifdef MFD_HUGE_1GB
|
2019-05-29 13:57:07 -06:00
|
|
|
if (PyModule_AddIntMacro(m, MFD_HUGE_1GB)) return -1;
|
2019-05-29 14:43:50 -06:00
|
|
|
#endif
|
|
|
|
|
#ifdef MFD_HUGE_2GB
|
2019-05-29 13:57:07 -06:00
|
|
|
if (PyModule_AddIntMacro(m, MFD_HUGE_2GB)) return -1;
|
2019-05-29 14:43:50 -06:00
|
|
|
#endif
|
|
|
|
|
#ifdef MFD_HUGE_16GB
|
2019-05-29 13:57:07 -06:00
|
|
|
if (PyModule_AddIntMacro(m, MFD_HUGE_16GB)) return -1;
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
2016-09-06 16:18:52 -07:00
|
|
|
|
2018-06-12 23:04:50 +02:00
|
|
|
#if defined(__APPLE__)
|
|
|
|
|
if (PyModule_AddIntConstant(m, "_COPYFILE_DATA", COPYFILE_DATA)) return -1;
|
|
|
|
|
#endif
|
|
|
|
|
|
2019-03-29 16:37:16 -07:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
|
if (PyModule_AddIntConstant(m, "_LOAD_LIBRARY_SEARCH_DEFAULT_DIRS", LOAD_LIBRARY_SEARCH_DEFAULT_DIRS)) return -1;
|
|
|
|
|
if (PyModule_AddIntConstant(m, "_LOAD_LIBRARY_SEARCH_APPLICATION_DIR", LOAD_LIBRARY_SEARCH_APPLICATION_DIR)) return -1;
|
|
|
|
|
if (PyModule_AddIntConstant(m, "_LOAD_LIBRARY_SEARCH_SYSTEM32", LOAD_LIBRARY_SEARCH_SYSTEM32)) return -1;
|
|
|
|
|
if (PyModule_AddIntConstant(m, "_LOAD_LIBRARY_SEARCH_USER_DIRS", LOAD_LIBRARY_SEARCH_USER_DIRS)) return -1;
|
|
|
|
|
if (PyModule_AddIntConstant(m, "_LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR", LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR)) return -1;
|
|
|
|
|
#endif
|
|
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
return 0;
|
1996-12-19 23:50:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2020-11-22 11:18:40 +01:00
|
|
|
|
|
|
|
|
#define PROBE(name, test) \
|
|
|
|
|
static int name(void) \
|
|
|
|
|
{ \
|
|
|
|
|
if (test) { \
|
|
|
|
|
return 1; \
|
|
|
|
|
} else { \
|
|
|
|
|
return 0; \
|
|
|
|
|
} \
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FSTATAT
|
|
|
|
|
PROBE(probe_fstatat, HAVE_FSTATAT_RUNTIME)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FACCESSAT
|
|
|
|
|
PROBE(probe_faccessat, HAVE_FACCESSAT_RUNTIME)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FCHMODAT
|
|
|
|
|
PROBE(probe_fchmodat, HAVE_FCHMODAT_RUNTIME)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FCHOWNAT
|
|
|
|
|
PROBE(probe_fchownat, HAVE_FCHOWNAT_RUNTIME)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_LINKAT
|
|
|
|
|
PROBE(probe_linkat, HAVE_LINKAT_RUNTIME)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FDOPENDIR
|
|
|
|
|
PROBE(probe_fdopendir, HAVE_FDOPENDIR_RUNTIME)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_MKDIRAT
|
|
|
|
|
PROBE(probe_mkdirat, HAVE_MKDIRAT_RUNTIME)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_RENAMEAT
|
|
|
|
|
PROBE(probe_renameat, HAVE_RENAMEAT_RUNTIME)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_UNLINKAT
|
|
|
|
|
PROBE(probe_unlinkat, HAVE_UNLINKAT_RUNTIME)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_OPENAT
|
|
|
|
|
PROBE(probe_openat, HAVE_OPENAT_RUNTIME)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_READLINKAT
|
|
|
|
|
PROBE(probe_readlinkat, HAVE_READLINKAT_RUNTIME)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SYMLINKAT
|
|
|
|
|
PROBE(probe_symlinkat, HAVE_SYMLINKAT_RUNTIME)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FUTIMENS
|
|
|
|
|
PROBE(probe_futimens, HAVE_FUTIMENS_RUNTIME)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_UTIMENSAT
|
|
|
|
|
PROBE(probe_utimensat, HAVE_UTIMENSAT_RUNTIME)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const struct have_function {
|
|
|
|
|
const char * const label;
|
|
|
|
|
int (*probe)(void);
|
|
|
|
|
} have_functions[] = {
|
2012-06-22 16:30:09 -07:00
|
|
|
|
|
|
|
|
#ifdef HAVE_FACCESSAT
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_FACCESSAT", probe_faccessat },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FCHDIR
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_FCHDIR", NULL },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FCHMOD
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_FCHMOD", NULL },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FCHMODAT
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_FCHMODAT", probe_fchmodat },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FCHOWN
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_FCHOWN", NULL },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
2013-08-12 13:49:30 -04:00
|
|
|
#ifdef HAVE_FCHOWNAT
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_FCHOWNAT", probe_fchownat },
|
2013-08-12 13:49:30 -04:00
|
|
|
#endif
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef HAVE_FEXECVE
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_FEXECVE", NULL },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FDOPENDIR
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_FDOPENDIR", probe_fdopendir },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
2012-06-24 12:55:33 +02:00
|
|
|
#ifdef HAVE_FPATHCONF
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_FPATHCONF", NULL },
|
2012-06-24 12:55:33 +02:00
|
|
|
#endif
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef HAVE_FSTATAT
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_FSTATAT", probe_fstatat },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FSTATVFS
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_FSTATVFS", NULL },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
2015-03-20 19:50:46 -07:00
|
|
|
#if defined HAVE_FTRUNCATE || defined MS_WINDOWS
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_FTRUNCATE", NULL },
|
2012-06-24 12:55:33 +02:00
|
|
|
#endif
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef HAVE_FUTIMENS
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_FUTIMENS", probe_futimens },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FUTIMES
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_FUTIMES", NULL },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FUTIMESAT
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_FUTIMESAT", NULL },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_LINKAT
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_LINKAT", probe_linkat },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_LCHFLAGS
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_LCHFLAGS", NULL },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_LCHMOD
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_LCHMOD", NULL },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_LCHOWN
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_LCHOWN", NULL },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_LSTAT
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_LSTAT", NULL },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_LUTIMES
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_LUTIMES", NULL },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
2019-05-29 13:57:07 -06:00
|
|
|
#ifdef HAVE_MEMFD_CREATE
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_MEMFD_CREATE", NULL },
|
2019-05-29 13:57:07 -06:00
|
|
|
#endif
|
|
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
#ifdef HAVE_MKDIRAT
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_MKDIRAT", probe_mkdirat },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_MKFIFOAT
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_MKFIFOAT", NULL },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_MKNODAT
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_MKNODAT", NULL },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_OPENAT
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_OPENAT", probe_openat },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_READLINKAT
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_READLINKAT", probe_readlinkat },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_RENAMEAT
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_RENAMEAT", probe_renameat },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SYMLINKAT
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_SYMLINKAT", probe_symlinkat },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_UNLINKAT
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_UNLINKAT", probe_unlinkat },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_UTIMENSAT
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "HAVE_UTIMENSAT", probe_utimensat },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef MS_WINDOWS
|
2020-11-22 11:18:40 +01:00
|
|
|
{ "MS_WINDOWS", NULL },
|
2012-06-22 16:30:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
2020-11-22 11:18:40 +01:00
|
|
|
{ NULL, NULL }
|
2012-06-22 16:30:09 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2020-05-10 11:05:29 +02:00
|
|
|
static int
|
|
|
|
|
posixmodule_exec(PyObject *m)
|
1990-10-14 12:07:46 +00:00
|
|
|
{
|
2020-05-14 18:05:58 +02:00
|
|
|
_posixstate *state = get_posix_state(m);
|
2002-01-30 05:46:57 +00:00
|
|
|
|
2020-11-22 11:18:40 +01:00
|
|
|
#if defined(HAVE_PWRITEV)
|
|
|
|
|
if (HAVE_PWRITEV_RUNTIME) {} else {
|
|
|
|
|
PyObject* dct = PyModule_GetDict(m);
|
|
|
|
|
|
|
|
|
|
if (dct == NULL) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (PyDict_DelItemString(dct, "pwritev") == -1) {
|
|
|
|
|
PyErr_Clear();
|
|
|
|
|
}
|
|
|
|
|
if (PyDict_DelItemString(dct, "preadv") == -1) {
|
|
|
|
|
PyErr_Clear();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
/* Initialize environ dictionary */
|
2020-05-14 18:05:58 +02:00
|
|
|
PyObject *v = convertenviron();
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_XINCREF(v);
|
|
|
|
|
if (v == NULL || PyModule_AddObject(m, "environ", v) != 0)
|
2020-05-10 11:05:29 +02:00
|
|
|
return -1;
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_DECREF(v);
|
1999-12-13 16:37:25 +00:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
if (all_ins(m))
|
2020-05-10 11:05:29 +02:00
|
|
|
return -1;
|
1996-12-19 23:50:02 +00:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
if (setup_confname_tables(m))
|
2020-05-10 11:05:29 +02:00
|
|
|
return -1;
|
1999-12-15 18:31:10 +00:00
|
|
|
|
2010-05-06 00:08:46 +00:00
|
|
|
Py_INCREF(PyExc_OSError);
|
|
|
|
|
PyModule_AddObject(m, "error", PyExc_OSError);
|
1999-08-26 17:23:54 +00:00
|
|
|
|
2011-03-17 20:20:30 +02:00
|
|
|
#if defined(HAVE_WAITID) && !defined(__APPLE__)
|
2019-11-05 07:16:14 -08:00
|
|
|
waitid_result_desc.name = MODNAME ".waitid_result";
|
|
|
|
|
PyObject *WaitidResultType = (PyObject *)PyStructSequence_NewType(&waitid_result_desc);
|
|
|
|
|
if (WaitidResultType == NULL) {
|
2020-05-10 11:05:29 +02:00
|
|
|
return -1;
|
2019-11-05 07:16:14 -08:00
|
|
|
}
|
|
|
|
|
Py_INCREF(WaitidResultType);
|
|
|
|
|
PyModule_AddObject(m, "waitid_result", WaitidResultType);
|
2020-05-14 18:05:58 +02:00
|
|
|
state->WaitidResultType = WaitidResultType;
|
2011-03-17 20:20:30 +02:00
|
|
|
#endif
|
|
|
|
|
|
2019-11-05 07:16:14 -08:00
|
|
|
stat_result_desc.name = "os.stat_result"; /* see issue #19209 */
|
|
|
|
|
stat_result_desc.fields[7].name = PyStructSequence_UnnamedField;
|
|
|
|
|
stat_result_desc.fields[8].name = PyStructSequence_UnnamedField;
|
|
|
|
|
stat_result_desc.fields[9].name = PyStructSequence_UnnamedField;
|
|
|
|
|
PyObject *StatResultType = (PyObject *)PyStructSequence_NewType(&stat_result_desc);
|
|
|
|
|
if (StatResultType == NULL) {
|
2020-05-10 11:05:29 +02:00
|
|
|
return -1;
|
2019-11-05 07:16:14 -08:00
|
|
|
}
|
|
|
|
|
Py_INCREF(StatResultType);
|
|
|
|
|
PyModule_AddObject(m, "stat_result", StatResultType);
|
2020-05-14 18:05:58 +02:00
|
|
|
state->StatResultType = StatResultType;
|
2019-11-05 07:16:14 -08:00
|
|
|
structseq_new = ((PyTypeObject *)StatResultType)->tp_new;
|
|
|
|
|
((PyTypeObject *)StatResultType)->tp_new = statresult_new;
|
2006-04-21 10:40:58 +00:00
|
|
|
|
2019-11-05 07:16:14 -08:00
|
|
|
statvfs_result_desc.name = "os.statvfs_result"; /* see issue #19209 */
|
|
|
|
|
PyObject *StatVFSResultType = (PyObject *)PyStructSequence_NewType(&statvfs_result_desc);
|
|
|
|
|
if (StatVFSResultType == NULL) {
|
2020-05-10 11:05:29 +02:00
|
|
|
return -1;
|
2019-11-05 07:16:14 -08:00
|
|
|
}
|
|
|
|
|
Py_INCREF(StatVFSResultType);
|
|
|
|
|
PyModule_AddObject(m, "statvfs_result", StatVFSResultType);
|
2020-05-14 18:05:58 +02:00
|
|
|
state->StatVFSResultType = StatVFSResultType;
|
2008-12-29 18:21:47 +00:00
|
|
|
#ifdef NEED_TICKS_PER_SECOND
|
|
|
|
|
# if defined(HAVE_SYSCONF) && defined(_SC_CLK_TCK)
|
2019-11-05 07:16:14 -08:00
|
|
|
ticks_per_second = sysconf(_SC_CLK_TCK);
|
2008-12-29 18:21:47 +00:00
|
|
|
# elif defined(HZ)
|
2019-11-05 07:16:14 -08:00
|
|
|
ticks_per_second = HZ;
|
2008-12-29 18:21:47 +00:00
|
|
|
# else
|
2019-11-05 07:16:14 -08:00
|
|
|
ticks_per_second = 60; /* magic fallback value; may be bogus */
|
2008-12-29 18:21:47 +00:00
|
|
|
# endif
|
2011-08-02 17:30:04 -05:00
|
|
|
#endif
|
|
|
|
|
|
2018-10-01 22:19:56 -07:00
|
|
|
#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM)
|
2019-11-05 07:16:14 -08:00
|
|
|
sched_param_desc.name = MODNAME ".sched_param";
|
|
|
|
|
PyObject *SchedParamType = (PyObject *)PyStructSequence_NewType(&sched_param_desc);
|
|
|
|
|
if (SchedParamType == NULL) {
|
2020-05-10 11:05:29 +02:00
|
|
|
return -1;
|
2019-11-05 07:16:14 -08:00
|
|
|
}
|
|
|
|
|
Py_INCREF(SchedParamType);
|
|
|
|
|
PyModule_AddObject(m, "sched_param", SchedParamType);
|
2020-05-14 18:05:58 +02:00
|
|
|
state->SchedParamType = SchedParamType;
|
2019-11-05 07:16:14 -08:00
|
|
|
((PyTypeObject *)SchedParamType)->tp_new = os_sched_param;
|
2008-12-29 18:21:47 +00:00
|
|
|
#endif
|
2012-02-08 23:28:36 +01:00
|
|
|
|
2019-11-05 07:16:14 -08:00
|
|
|
/* initialize TerminalSize_info */
|
|
|
|
|
PyObject *TerminalSizeType = (PyObject *)PyStructSequence_NewType(&TerminalSize_desc);
|
|
|
|
|
if (TerminalSizeType == NULL) {
|
2020-05-10 11:05:29 +02:00
|
|
|
return -1;
|
2019-11-05 07:16:14 -08:00
|
|
|
}
|
|
|
|
|
Py_INCREF(TerminalSizeType);
|
|
|
|
|
PyModule_AddObject(m, "terminal_size", TerminalSizeType);
|
2020-05-14 18:05:58 +02:00
|
|
|
state->TerminalSizeType = TerminalSizeType;
|
2015-03-08 01:58:04 +01:00
|
|
|
|
2019-11-05 07:16:14 -08:00
|
|
|
/* initialize scandir types */
|
2020-05-10 11:05:29 +02:00
|
|
|
PyObject *ScandirIteratorType = PyType_FromModuleAndSpec(m, &ScandirIteratorType_spec, NULL);
|
2019-11-05 07:16:14 -08:00
|
|
|
if (ScandirIteratorType == NULL) {
|
2020-05-10 11:05:29 +02:00
|
|
|
return -1;
|
2010-05-06 00:08:46 +00:00
|
|
|
}
|
2020-05-14 18:05:58 +02:00
|
|
|
state->ScandirIteratorType = ScandirIteratorType;
|
2011-08-02 18:40:46 -05:00
|
|
|
|
2020-05-10 11:05:29 +02:00
|
|
|
PyObject *DirEntryType = PyType_FromModuleAndSpec(m, &DirEntryType_spec, NULL);
|
2019-11-05 07:16:14 -08:00
|
|
|
if (DirEntryType == NULL) {
|
2020-05-10 11:05:29 +02:00
|
|
|
return -1;
|
2019-11-05 07:16:14 -08:00
|
|
|
}
|
|
|
|
|
Py_INCREF(DirEntryType);
|
|
|
|
|
PyModule_AddObject(m, "DirEntry", DirEntryType);
|
2020-05-14 18:05:58 +02:00
|
|
|
state->DirEntryType = DirEntryType;
|
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Inherits test_gzip/test_tarfile failures on 64-bit platforms from the trunk,
but I don't want the merge to hang around too long (even though the regular
p3yk-contributors are/have been busy with other things.)
Merged revisions 45621-46490 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r45621 | george.yoshida | 2006-04-21 18:34:17 +0200 (Fri, 21 Apr 2006) | 2 lines
Correct the grammar
........
r45622 | tim.peters | 2006-04-21 18:34:54 +0200 (Fri, 21 Apr 2006) | 2 lines
Whitespace normalization.
........
r45624 | thomas.heller | 2006-04-21 18:48:56 +0200 (Fri, 21 Apr 2006) | 1 line
Merge in changes from ctypes 0.9.9.6 upstream version.
........
r45625 | thomas.heller | 2006-04-21 18:51:04 +0200 (Fri, 21 Apr 2006) | 1 line
Merge in changes from ctypes 0.9.9.6 upstream version.
........
r45630 | thomas.heller | 2006-04-21 20:29:17 +0200 (Fri, 21 Apr 2006) | 8 lines
Documentation for ctypes.
I think that 'generic operating system services' is the best category.
Note that the Doc/lib/libctypes.latex file is generated from reST sources.
You are welcome to make typo fixes, and I'll try to keep the reST sources
in sync, but markup changes would be lost - they should be fixed in the tool
that creates the latex file.
The conversion script is external/ctypes/docs/manual/mkpydoc.py.
........
r45631 | tim.peters | 2006-04-21 23:18:10 +0200 (Fri, 21 Apr 2006) | 24 lines
SF bug #1473760 TempFile can hang on Windows.
Python 2.4 changed ntpath.abspath to do an import
inside the function. As a result, due to Python's
import lock, anything calling abspath on Windows
(directly, or indirectly like tempfile.TemporaryFile)
hung when it was called from a thread spawned as a
side effect of importing a module.
This is a depressingly frequent problem, and
deserves a more general fix. I'm settling for
a micro-fix here because this specific one accounts
for a report of Zope Corp's ZEO hanging on Windows,
and it was an odd way to change abspath to begin
with (ntpath needs a different implementation
depending on whether we're actually running on
Windows, and the _obvious_ way to arrange for that
is not to bury a possibly-failing import _inside_
the function).
Note that if/when other micro-fixes of this kind
get made, the new Lib/test/threaded_import_hangers.py
is a convenient place to add tests for them.
........
r45634 | phillip.eby | 2006-04-21 23:53:37 +0200 (Fri, 21 Apr 2006) | 2 lines
Guido wrote contextlib, not me, but thanks anyway. ;)
........
r45636 | andrew.kuchling | 2006-04-22 03:51:41 +0200 (Sat, 22 Apr 2006) | 1 line
Typo fixes
........
r45638 | andrew.kuchling | 2006-04-22 03:58:40 +0200 (Sat, 22 Apr 2006) | 1 line
Fix comment typo
........
r45639 | andrew.kuchling | 2006-04-22 04:06:03 +0200 (Sat, 22 Apr 2006) | 8 lines
Make copy of test_mailbox.py. We'll still want to check the backward
compatibility classes in the new mailbox.py that I'll be committing in
a few minutes.
One change has been made: the tests use len(mbox) instead of len(mbox.boxes).
The 'boxes' attribute was never documented and contains some internal state
that seems unlikely to have been useful.
........
r45640 | andrew.kuchling | 2006-04-22 04:32:43 +0200 (Sat, 22 Apr 2006) | 16 lines
Add Gregory K. Johnson's revised version of mailbox.py (funded by
the 2005 Summer of Code).
The revision adds a number of new mailbox classes that support adding
and removing messages; these classes also support mailbox locking and
default to using email.Message instead of rfc822.Message.
The old mailbox classes are largely left alone for backward compatibility.
The exception is the Maildir class, which was present in the old module
and now inherits from the new classes. The Maildir class's interface
is pretty simple, though, so I think it'll be compatible with existing
code.
(The change to the NEWS file also adds a missing word to a different
news item, which unfortunately required rewrapping the line.)
........
r45641 | tim.peters | 2006-04-22 07:52:59 +0200 (Sat, 22 Apr 2006) | 2 lines
Whitespace normalization.
........
r45642 | neal.norwitz | 2006-04-22 08:07:46 +0200 (Sat, 22 Apr 2006) | 1 line
Add libctypes as a dep
........
r45643 | martin.v.loewis | 2006-04-22 13:15:41 +0200 (Sat, 22 Apr 2006) | 1 line
Fix more ssize_t problems.
........
r45644 | martin.v.loewis | 2006-04-22 13:40:03 +0200 (Sat, 22 Apr 2006) | 1 line
Fix more ssize_t issues.
........
r45645 | george.yoshida | 2006-04-22 17:10:49 +0200 (Sat, 22 Apr 2006) | 2 lines
Typo fixes
........
r45647 | martin.v.loewis | 2006-04-22 17:19:54 +0200 (Sat, 22 Apr 2006) | 1 line
Port to Python 2.5. Drop .DEF file. Change output file names to .pyd.
........
r45648 | george.yoshida | 2006-04-22 17:27:14 +0200 (Sat, 22 Apr 2006) | 3 lines
- add versionadded tag
- make arbitrary arguments come last
........
r45649 | hyeshik.chang | 2006-04-22 17:48:15 +0200 (Sat, 22 Apr 2006) | 3 lines
Remove $CJKCodecs$ RCS tags. The CJKCodecs isn't maintained outside
anymore.
........
r45654 | greg.ward | 2006-04-23 05:47:58 +0200 (Sun, 23 Apr 2006) | 2 lines
Update optparse to Optik 1.5.1.
........
r45658 | george.yoshida | 2006-04-23 11:27:10 +0200 (Sun, 23 Apr 2006) | 2 lines
wrap SyntaxError with \exception{}
........
r45660 | ronald.oussoren | 2006-04-23 13:59:25 +0200 (Sun, 23 Apr 2006) | 6 lines
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.
........
r45661 | ronald.oussoren | 2006-04-23 14:36:23 +0200 (Sun, 23 Apr 2006) | 5 lines
Patch 1471761 - test for broken poll at runtime
This patch checks if poll is broken when the select module is loaded instead
of doing so at configure-time. This functionality is only active on Mac OS X.
........
r45662 | nick.coghlan | 2006-04-23 17:13:32 +0200 (Sun, 23 Apr 2006) | 1 line
Add a Context Types section to parallel the Iterator Types section (uses the same terminology as the 2.5a1 implementation)
........
r45663 | nick.coghlan | 2006-04-23 17:14:37 +0200 (Sun, 23 Apr 2006) | 1 line
Update contextlib documentation to use the same terminology as the module implementation
........
r45664 | gerhard.haering | 2006-04-23 17:24:26 +0200 (Sun, 23 Apr 2006) | 2 lines
Updated the sqlite3 module to the external pysqlite 2.2.2 version.
........
r45666 | nick.coghlan | 2006-04-23 17:39:16 +0200 (Sun, 23 Apr 2006) | 1 line
Update with statement documentation to use same terminology as 2.5a1 implementation
........
r45667 | nick.coghlan | 2006-04-23 18:05:04 +0200 (Sun, 23 Apr 2006) | 1 line
Add a (very) brief mention of the with statement to the end of chapter 8
........
r45668 | nick.coghlan | 2006-04-23 18:35:19 +0200 (Sun, 23 Apr 2006) | 1 line
Take 2 on mentioning the with statement, this time without inadvertently killing the Unicode examples
........
r45669 | nick.coghlan | 2006-04-23 19:04:07 +0200 (Sun, 23 Apr 2006) | 1 line
Backdated NEWS entry to record the implementation of PEP 338 for alpha 1
........
r45670 | tim.peters | 2006-04-23 20:13:45 +0200 (Sun, 23 Apr 2006) | 2 lines
Whitespace normalization.
........
r45671 | skip.montanaro | 2006-04-23 21:14:27 +0200 (Sun, 23 Apr 2006) | 1 line
first cut at trace module doc
........
r45672 | skip.montanaro | 2006-04-23 21:26:33 +0200 (Sun, 23 Apr 2006) | 1 line
minor tweak
........
r45673 | skip.montanaro | 2006-04-23 21:30:50 +0200 (Sun, 23 Apr 2006) | 1 line
it's always helpful if the example works...
........
r45674 | skip.montanaro | 2006-04-23 21:32:14 +0200 (Sun, 23 Apr 2006) | 1 line
correct example
........
r45675 | andrew.kuchling | 2006-04-23 23:01:04 +0200 (Sun, 23 Apr 2006) | 1 line
Edits to the PEP 343 section
........
r45676 | andrew.kuchling | 2006-04-23 23:51:10 +0200 (Sun, 23 Apr 2006) | 1 line
Add two items
........
r45677 | tim.peters | 2006-04-24 04:03:16 +0200 (Mon, 24 Apr 2006) | 5 lines
Bug #1337990: clarified that `doctest` does not support examples
requiring both expected output and an exception.
I'll backport to 2.4 next.
........
r45679 | nick.coghlan | 2006-04-24 05:04:43 +0200 (Mon, 24 Apr 2006) | 1 line
Note changes made to PEP 343 related documentation
........
r45681 | nick.coghlan | 2006-04-24 06:17:02 +0200 (Mon, 24 Apr 2006) | 1 line
Change PEP 343 related documentation to use the term context specifier instead of context object
........
r45682 | nick.coghlan | 2006-04-24 06:32:47 +0200 (Mon, 24 Apr 2006) | 1 line
Add unit tests for the -m and -c command line switches
........
r45683 | nick.coghlan | 2006-04-24 06:37:15 +0200 (Mon, 24 Apr 2006) | 1 line
Fix contextlib.nested to cope with exit methods raising and handling exceptions
........
r45685 | nick.coghlan | 2006-04-24 06:59:28 +0200 (Mon, 24 Apr 2006) | 1 line
Fix broken contextlib test from last checkin (I'd've sworn I tested that before checking it in. . .)
........
r45686 | nick.coghlan | 2006-04-24 07:24:26 +0200 (Mon, 24 Apr 2006) | 1 line
Back out new command line tests (broke buildbot)
........
r45687 | nick.coghlan | 2006-04-24 07:52:15 +0200 (Mon, 24 Apr 2006) | 1 line
More reliable version of new command line tests that just checks the exit codes
........
r45688 | thomas.wouters | 2006-04-24 13:37:13 +0200 (Mon, 24 Apr 2006) | 4 lines
Stop test_tcl's testLoadTk from leaking the Tk commands 'loadtk' registers.
........
r45690 | andrew.kuchling | 2006-04-24 16:30:47 +0200 (Mon, 24 Apr 2006) | 2 lines
Edits, using the new term
'context specifier' in a few places
........
r45697 | phillip.eby | 2006-04-24 22:53:13 +0200 (Mon, 24 Apr 2006) | 2 lines
Revert addition of setuptools
........
r45698 | tim.peters | 2006-04-25 00:45:13 +0200 (Tue, 25 Apr 2006) | 2 lines
Whitespace normalization.
........
r45700 | trent.mick | 2006-04-25 02:34:50 +0200 (Tue, 25 Apr 2006) | 4 lines
Put break at correct level so *all* root HKEYs acutally get checked for
an installed VC6. Otherwise only the first such tree gets checked and this
warning doesn't get displayed.
........
r45701 | tim.peters | 2006-04-25 05:31:36 +0200 (Tue, 25 Apr 2006) | 3 lines
Patch #1475231: add a new SKIP doctest option, thanks to
Edward Loper.
........
r45702 | neal.norwitz | 2006-04-25 07:04:35 +0200 (Tue, 25 Apr 2006) | 1 line
versionadded for SKIP
........
r45703 | neal.norwitz | 2006-04-25 07:05:03 +0200 (Tue, 25 Apr 2006) | 1 line
Restore Walters name
........
r45704 | neal.norwitz | 2006-04-25 07:49:42 +0200 (Tue, 25 Apr 2006) | 1 line
Revert previous change, SKIP had a versionadded elsewhere
........
r45706 | nick.coghlan | 2006-04-25 12:56:51 +0200 (Tue, 25 Apr 2006) | 31 lines
Move the PEP 343 documentation and implementation closer to the
terminology in the alpha 1 documentation.
- "context manager" reverts to its alpha 1 definition
- the term "context specifier" goes away entirely
- contextlib.GeneratorContextManager is renamed GeneratorContext
There are still a number of changes relative to alpha 1:
- the expression in the with statement is explicitly called the
"context expression" in the language reference
- the terms 'with statement context', 'context object' or 'with
statement context' are used in several places instead of a bare
'context'. The aim of this is to avoid ambiguity in relation to the
runtime context set up when the block is executed, and the context
objects that already exist in various application domains (such as
decimal.Context)
- contextlib.contextmanager is renamed to contextfactory
This best reflects the nature of the function resulting from the
use of that decorator
- decimal.ContextManager is renamed to WithStatementContext
Simple dropping the 'Manager' part wasn't possible due to the
fact that decimal.Context already exists and means something
different. WithStatementContext is ugly but workable.
A technically unrelated change snuck into this commit:
contextlib.closing now avoids the overhead of creating a
generator, since it's trivial to implement that particular
context manager directly.
........
r45707 | nick.coghlan | 2006-04-25 13:05:56 +0200 (Tue, 25 Apr 2006) | 1 line
Fix latex typo
........
r45708 | thomas.wouters | 2006-04-25 14:28:56 +0200 (Tue, 25 Apr 2006) | 4 lines
Fix markup glitch in unittest docs. Will backport.
........
r45710 | andrew.kuchling | 2006-04-25 14:31:38 +0200 (Tue, 25 Apr 2006) | 1 line
Add two items; easy_install is now off the table, though pkgutil still is
........
r45711 | andrew.kuchling | 2006-04-25 14:47:25 +0200 (Tue, 25 Apr 2006) | 1 line
Rework context terminology
........
r45712 | thomas.wouters | 2006-04-25 15:53:23 +0200 (Tue, 25 Apr 2006) | 9 lines
SF bug/patch #1433877: string parameter to ioctl not null terminated
The new char-array used in ioctl calls wasn't explicitly NUL-terminated;
quite probably the cause for the test_pty failures on Solaris that we
circumvented earlier. (I wasn't able to reproduce it with this patch, but it
has been somewhat elusive to start with.)
........
r45713 | george.yoshida | 2006-04-25 16:09:58 +0200 (Tue, 25 Apr 2006) | 2 lines
minor tweak
........
r45714 | thomas.wouters | 2006-04-25 17:08:10 +0200 (Tue, 25 Apr 2006) | 7 lines
Fix SF bug #1476111: SystemError in socket sendto. The AF_INET6 and
AF_PACKET cases in getsockaddrarg were missing their own checks for
tuple-ness of the address argument, which means a confusing SystemError was
raised by PyArg_ParseTuple instead.
........
r45715 | thomas.wouters | 2006-04-25 17:29:46 +0200 (Tue, 25 Apr 2006) | 10 lines
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.
........
r45717 | thomas.heller | 2006-04-25 20:26:08 +0200 (Tue, 25 Apr 2006) | 3 lines
Fix compiler warnings on Darwin.
Patch by Brett Canon, see
https://sourceforge.net/tracker/?func=detail&atid=532156&aid=1475959&group_id=71702
........
r45718 | guido.van.rossum | 2006-04-25 22:12:45 +0200 (Tue, 25 Apr 2006) | 4 lines
Implement MvL's improvement on __context__ in Condition;
this can just call __context__ on the underlying lock.
(The same change for Semaphore does *not* work!)
........
r45721 | tim.peters | 2006-04-26 03:15:53 +0200 (Wed, 26 Apr 2006) | 13 lines
Rev 45706 renamed stuff in contextlib.py, but didn't rename
uses of it in test_with.py. As a result, test_with has been skipped
(due to failing imports) on all buildbot boxes since. Alas, that's
not a test failure -- you have to pay attention to the
1 skip unexpected on PLATFORM:
test_with
kinds of output at the ends of test runs to notice that this got
broken.
It's likely that more renaming in test_with.py would be desirable.
........
r45722 | fred.drake | 2006-04-26 07:15:41 +0200 (Wed, 26 Apr 2006) | 1 line
markup fixes, cleanup
........
r45723 | fred.drake | 2006-04-26 07:19:39 +0200 (Wed, 26 Apr 2006) | 1 line
minor adjustment suggested by Peter Gephardt
........
r45724 | neal.norwitz | 2006-04-26 07:34:03 +0200 (Wed, 26 Apr 2006) | 10 lines
Patch from Aldo Cortesi (OpenBSD buildbot owner).
After the patch (45590) to add extra debug stats to the gc module, Python
was crashing on OpenBSD due to:
Fatal Python error: Interpreter not initialized (version mismatch?)
This seems to occur due to calling collect() when initialized (in pythonrun.c)
is set to 0. Now, the import will occur in the init function which
shouldn't suffer this problem.
........
r45725 | neal.norwitz | 2006-04-26 08:26:12 +0200 (Wed, 26 Apr 2006) | 3 lines
Fix this test on Solaris. There can be embedded \r, so don't just replace
the one at the end.
........
r45727 | nick.coghlan | 2006-04-26 13:50:04 +0200 (Wed, 26 Apr 2006) | 1 line
Fix an error in the last contextlib.closing example
........
r45728 | andrew.kuchling | 2006-04-26 14:21:06 +0200 (Wed, 26 Apr 2006) | 1 line
[Bug #1475080] Fix example
........
r45729 | andrew.kuchling | 2006-04-26 14:23:39 +0200 (Wed, 26 Apr 2006) | 1 line
Add labels to all sections
........
r45730 | thomas.wouters | 2006-04-26 17:53:30 +0200 (Wed, 26 Apr 2006) | 7 lines
The result of SF patch #1471578: big-memory tests for strings, lists and
tuples. Lots to be added, still, but this will give big-memory people
something to play with in 2.5 alpha 2, and hopefully get more people to
write these tests.
........
r45731 | tim.peters | 2006-04-26 19:11:16 +0200 (Wed, 26 Apr 2006) | 2 lines
Whitespace normalization.
........
r45732 | martin.v.loewis | 2006-04-26 19:19:44 +0200 (Wed, 26 Apr 2006) | 1 line
Use GS- and bufferoverlowU.lib where appropriate, for AMD64.
........
r45733 | thomas.wouters | 2006-04-26 20:46:01 +0200 (Wed, 26 Apr 2006) | 5 lines
Add tests for += and *= on strings, and fix the memory-use estimate for the
list.extend tests (they were estimating half the actual use.)
........
r45734 | thomas.wouters | 2006-04-26 21:14:46 +0200 (Wed, 26 Apr 2006) | 5 lines
Some more test-size-estimate fixes: test_append and test_insert trigger a
list resize, which overallocates.
........
r45735 | hyeshik.chang | 2006-04-26 21:20:26 +0200 (Wed, 26 Apr 2006) | 3 lines
Fix build on MIPS for libffi. I haven't tested this yet because I
don't have an access on MIPS machines. Will be tested by buildbot. :)
........
r45737 | fred.drake | 2006-04-27 01:40:32 +0200 (Thu, 27 Apr 2006) | 1 line
one more place to use the current Python version
........
r45738 | fred.drake | 2006-04-27 02:02:24 +0200 (Thu, 27 Apr 2006) | 3 lines
- update version numbers in file names again, until we have a better way
- elaborate instructions for Cygwin support (closes SF #839709)
........
r45739 | fred.drake | 2006-04-27 02:20:14 +0200 (Thu, 27 Apr 2006) | 1 line
add missing word
........
r45740 | anthony.baxter | 2006-04-27 04:11:24 +0200 (Thu, 27 Apr 2006) | 2 lines
2.5a2
........
r45741 | anthony.baxter | 2006-04-27 04:13:13 +0200 (Thu, 27 Apr 2006) | 1 line
2.5a2
........
r45749 | andrew.kuchling | 2006-04-27 14:22:37 +0200 (Thu, 27 Apr 2006) | 1 line
Now that 2.5a2 is out, revert to the current date
........
r45750 | andrew.kuchling | 2006-04-27 14:23:07 +0200 (Thu, 27 Apr 2006) | 1 line
Bump document version
........
r45751 | andrew.kuchling | 2006-04-27 14:34:39 +0200 (Thu, 27 Apr 2006) | 6 lines
[Bug #1477102] Add necessary import to example
This may be a useful style question for the docs -- should examples show
the necessary imports, or should it be assumed that the reader will
figure it out? In the What's New, I'm not consistent but usually opt
for omitting the imports.
........
r45753 | andrew.kuchling | 2006-04-27 14:38:35 +0200 (Thu, 27 Apr 2006) | 1 line
[Bug #1477140] Import Error base class
........
r45754 | andrew.kuchling | 2006-04-27 14:42:54 +0200 (Thu, 27 Apr 2006) | 1 line
Mention the xmlrpclib.Error base class, which is used in one of the examples
........
r45756 | george.yoshida | 2006-04-27 15:41:07 +0200 (Thu, 27 Apr 2006) | 2 lines
markup fix
........
r45757 | thomas.wouters | 2006-04-27 15:46:59 +0200 (Thu, 27 Apr 2006) | 4 lines
Some more size-estimate fixes, for large-list-tests.
........
r45758 | thomas.heller | 2006-04-27 17:50:42 +0200 (Thu, 27 Apr 2006) | 3 lines
Rerun the libffi configuration if any of the files used for that
are newer then fficonfig.py.
........
r45766 | thomas.wouters | 2006-04-28 00:37:50 +0200 (Fri, 28 Apr 2006) | 6 lines
Some style fixes and size-calculation fixes. Also do the small-memory run
using a prime number, rather than a convenient power-of-2-and-multiple-of-5,
so incorrect testing algorithms fail more easily.
........
r45767 | thomas.wouters | 2006-04-28 00:38:32 +0200 (Fri, 28 Apr 2006) | 6 lines
Do the small-memory run of big-meormy tests using a prime number, rather
than a convenient power-of-2-and-multiple-of-5, so incorrect testing
algorithms fail more easily.
........
r45768 | david.goodger | 2006-04-28 00:53:05 +0200 (Fri, 28 Apr 2006) | 1 line
Added SVN access for Steven Bethard and Talin, for PEP updating.
........
r45770 | thomas.wouters | 2006-04-28 01:13:20 +0200 (Fri, 28 Apr 2006) | 16 lines
- Add new Warning class, ImportWarning
- Warn-raise ImportWarning when importing would have picked up a directory
as package, if only it'd had an __init__.py. This swaps two tests (for
case-ness and __init__-ness), but case-test is not really more expensive,
and it's not in a speed-critical section.
- Test for the new warning by importing a common non-package directory on
sys.path: site-packages
- In regrtest.py, silence warnings generated by the build-environment
because Modules/ (which is added to sys.path for Setup-created modules)
has 'zlib' and '_ctypes' directories without __init__.py's.
........
r45771 | thomas.wouters | 2006-04-28 01:41:27 +0200 (Fri, 28 Apr 2006) | 6 lines
Add more ignores of ImportWarnings; these are all just potential triggers
(since they won't trigger if zlib is already sucessfully imported); they
were found by grepping .py files, instead of looking at warning output :)
........
r45773 | neal.norwitz | 2006-04-28 06:32:20 +0200 (Fri, 28 Apr 2006) | 1 line
Add some whitespace to be more consistent.
........
r45774 | neal.norwitz | 2006-04-28 06:34:43 +0200 (Fri, 28 Apr 2006) | 5 lines
Try to really fix the slow buildbots this time.
Printing to stdout, doesn't mean the data was actually written.
It depends on the buffering, so we need to flush. This will hopefully
really fix the buildbots getting killed due to no output on the slow bots.
........
r45775 | neal.norwitz | 2006-04-28 07:28:05 +0200 (Fri, 28 Apr 2006) | 1 line
Fix some warnings on Mac OS X 10.4
........
r45776 | neal.norwitz | 2006-04-28 07:28:30 +0200 (Fri, 28 Apr 2006) | 1 line
Fix a warning on alpha
........
r45777 | neal.norwitz | 2006-04-28 07:28:54 +0200 (Fri, 28 Apr 2006) | 1 line
Fix a warning on ppc (debian)
........
r45778 | george.yoshida | 2006-04-28 18:09:45 +0200 (Fri, 28 Apr 2006) | 2 lines
fix markup glitch
........
r45780 | georg.brandl | 2006-04-28 18:31:17 +0200 (Fri, 28 Apr 2006) | 3 lines
Add SeaMonkey to the list of Mozilla browsers.
........
r45781 | georg.brandl | 2006-04-28 18:36:55 +0200 (Fri, 28 Apr 2006) | 2 lines
Bug #1475009: clarify ntpath.join behavior with absolute components
........
r45783 | george.yoshida | 2006-04-28 18:40:14 +0200 (Fri, 28 Apr 2006) | 2 lines
correct a dead link
........
r45785 | georg.brandl | 2006-04-28 18:54:25 +0200 (Fri, 28 Apr 2006) | 4 lines
Bug #1472949: stringify IOErrors in shutil.copytree when appending
them to the Error errors list.
........
r45786 | georg.brandl | 2006-04-28 18:58:52 +0200 (Fri, 28 Apr 2006) | 3 lines
Bug #1478326: don't allow '/' in distutils.util.get_platform machine names
since this value is used to name the build directory.
........
r45788 | thomas.heller | 2006-04-28 19:02:18 +0200 (Fri, 28 Apr 2006) | 1 line
Remove a duplicated test (the same test is in test_incomplete.py).
........
r45792 | georg.brandl | 2006-04-28 21:09:24 +0200 (Fri, 28 Apr 2006) | 3 lines
Bug #1478429: make datetime.datetime.fromtimestamp accept every float,
possibly "rounding up" to the next whole second.
........
r45796 | george.yoshida | 2006-04-29 04:43:30 +0200 (Sat, 29 Apr 2006) | 2 lines
grammar fix
........
r45800 | ronald.oussoren | 2006-04-29 13:31:35 +0200 (Sat, 29 Apr 2006) | 2 lines
Patch 1471883: --enable-universalsdk on Mac OS X
........
r45801 | andrew.kuchling | 2006-04-29 13:53:15 +0200 (Sat, 29 Apr 2006) | 1 line
Add item
........
r45802 | andrew.kuchling | 2006-04-29 14:10:28 +0200 (Sat, 29 Apr 2006) | 1 line
Make case of 'ZIP' consistent
........
r45803 | andrew.kuchling | 2006-04-29 14:10:43 +0200 (Sat, 29 Apr 2006) | 1 line
Add item
........
r45808 | martin.v.loewis | 2006-04-29 14:37:25 +0200 (Sat, 29 Apr 2006) | 3 lines
Further changes for #1471883: Edit Misc/NEWS, and
add expat_config.h.
........
r45809 | brett.cannon | 2006-04-29 23:29:50 +0200 (Sat, 29 Apr 2006) | 2 lines
Fix docstring for contextfactory; mentioned old contextmanager name.
........
r45810 | gerhard.haering | 2006-04-30 01:12:41 +0200 (Sun, 30 Apr 2006) | 3 lines
This is the start of documentation for the sqlite3 module. Please feel free to
find a better place for the link to it than alongside bsddb & friends.
........
r45811 | andrew.kuchling | 2006-04-30 03:07:09 +0200 (Sun, 30 Apr 2006) | 1 line
Add two items
........
r45814 | george.yoshida | 2006-04-30 05:49:56 +0200 (Sun, 30 Apr 2006) | 2 lines
Use \versionchanged instead of \versionadded for new parameter support.
........
r45815 | georg.brandl | 2006-04-30 09:06:11 +0200 (Sun, 30 Apr 2006) | 2 lines
Patch #1470846: fix urllib2 ProxyBasicAuthHandler.
........
r45817 | georg.brandl | 2006-04-30 10:57:35 +0200 (Sun, 30 Apr 2006) | 3 lines
In stdlib, use hashlib instead of deprecated md5 and sha modules.
........
r45819 | georg.brandl | 2006-04-30 11:23:59 +0200 (Sun, 30 Apr 2006) | 3 lines
Patch #1470976: don't NLST files when retrieving over FTP.
........
r45821 | georg.brandl | 2006-04-30 13:13:56 +0200 (Sun, 30 Apr 2006) | 6 lines
Bug #1473625: stop cPickle making float dumps locale dependent in protocol 0.
On the way, add a decorator to test_support to facilitate running single
test functions in different locales with automatic cleanup.
........
r45822 | phillip.eby | 2006-04-30 17:59:26 +0200 (Sun, 30 Apr 2006) | 2 lines
Fix infinite regress when inspecting <string> or <stdin> frames.
........
r45824 | georg.brandl | 2006-04-30 19:42:26 +0200 (Sun, 30 Apr 2006) | 3 lines
Fix another problem in inspect: if the module for an object cannot be found, don't try to give its __dict__ to linecache.
........
r45825 | georg.brandl | 2006-04-30 20:14:54 +0200 (Sun, 30 Apr 2006) | 3 lines
Patch #1472854: make the rlcompleter.Completer class usable on non-
UNIX platforms.
........
r45826 | georg.brandl | 2006-04-30 21:34:19 +0200 (Sun, 30 Apr 2006) | 3 lines
Patch #1479438: add \keyword markup for "with".
........
r45827 | andrew.kuchling | 2006-04-30 23:19:31 +0200 (Sun, 30 Apr 2006) | 1 line
Add urllib2 HOWTO from Michael Foord
........
r45828 | andrew.kuchling | 2006-04-30 23:19:49 +0200 (Sun, 30 Apr 2006) | 1 line
Add item
........
r45830 | barry.warsaw | 2006-05-01 05:03:02 +0200 (Mon, 01 May 2006) | 11 lines
Port forward from 2.4 branch:
Patch #1464708 from William McVey: fixed handling of nested comments in mail
addresses. E.g.
"Foo ((Foo Bar)) <foo@example.com>"
Fixes for both rfc822.py and email package. This patch needs to be back
ported to Python 2.3 for email 2.5.
........
r45832 | fred.drake | 2006-05-01 08:25:58 +0200 (Mon, 01 May 2006) | 4 lines
- minor clarification in section title
- markup adjustments
(there is clearly much to be done in this section)
........
r45833 | martin.v.loewis | 2006-05-01 08:28:01 +0200 (Mon, 01 May 2006) | 2 lines
Work around deadlock risk. Will backport.
........
r45836 | andrew.kuchling | 2006-05-01 14:45:02 +0200 (Mon, 01 May 2006) | 1 line
Some ElementTree fixes: import from xml, not xmlcore; fix case of module name; mention list() instead of getchildren()
........
r45837 | gerhard.haering | 2006-05-01 17:14:48 +0200 (Mon, 01 May 2006) | 3 lines
Further integration of the documentation for the sqlite3 module. There's still
quite some content to move over from the pysqlite manual, but it's a start now.
........
r45838 | martin.v.loewis | 2006-05-01 17:56:03 +0200 (Mon, 01 May 2006) | 2 lines
Rename uisample to text, drop all non-text tables.
........
r45839 | martin.v.loewis | 2006-05-01 18:12:44 +0200 (Mon, 01 May 2006) | 2 lines
Add msilib documentation.
........
r45840 | martin.v.loewis | 2006-05-01 18:14:16 +0200 (Mon, 01 May 2006) | 4 lines
Rename parameters to match the documentation (which
in turn matches Microsoft's documentation).
Drop unused parameter in CAB.append.
........
r45841 | fred.drake | 2006-05-01 18:28:54 +0200 (Mon, 01 May 2006) | 1 line
add dependency
........
r45842 | andrew.kuchling | 2006-05-01 18:30:25 +0200 (Mon, 01 May 2006) | 1 line
Markup fixes; add some XXX comments noting problems
........
r45843 | andrew.kuchling | 2006-05-01 18:32:49 +0200 (Mon, 01 May 2006) | 1 line
Add item
........
r45844 | andrew.kuchling | 2006-05-01 19:06:54 +0200 (Mon, 01 May 2006) | 1 line
Markup fixes
........
r45850 | neal.norwitz | 2006-05-02 06:43:14 +0200 (Tue, 02 May 2006) | 3 lines
SF #1479181: split open() and file() from being aliases for each other.
........
r45852 | neal.norwitz | 2006-05-02 08:23:22 +0200 (Tue, 02 May 2006) | 1 line
Try to fix breakage caused by patch #1479181, r45850
........
r45853 | fred.drake | 2006-05-02 08:53:59 +0200 (Tue, 02 May 2006) | 3 lines
SF #1479988: add methods to allow access to weakrefs for the
weakref.WeakKeyDictionary and weakref.WeakValueDictionary
........
r45854 | neal.norwitz | 2006-05-02 09:27:47 +0200 (Tue, 02 May 2006) | 5 lines
Fix breakage from patch 1471883 (r45800 & r45808) on OSF/1.
The problem was that pyconfig.h was being included before some system headers
which caused redefinitions and other breakage. This moves system headers
after expat_config.h which includes pyconfig.h.
........
r45855 | vinay.sajip | 2006-05-02 10:35:36 +0200 (Tue, 02 May 2006) | 1 line
Replaced my dumb way of calculating seconds to midnight with Tim Peters' much more sensible suggestion. What was I thinking ?!?
........
r45856 | andrew.kuchling | 2006-05-02 13:30:03 +0200 (Tue, 02 May 2006) | 1 line
Provide encoding as keyword argument; soften warning paragraph about encodings
........
r45858 | guido.van.rossum | 2006-05-02 19:36:09 +0200 (Tue, 02 May 2006) | 2 lines
Fix the formatting of KeyboardInterrupt -- a bad issubclass() call.
........
r45862 | guido.van.rossum | 2006-05-02 21:47:52 +0200 (Tue, 02 May 2006) | 7 lines
Get rid of __context__, per the latest changes to PEP 343 and python-dev
discussion.
There are two places of documentation that still mention __context__:
Doc/lib/libstdtypes.tex -- I wasn't quite sure how to rewrite that without
spending a whole lot of time thinking about it; and whatsnew, which Andrew
usually likes to change himself.
........
r45863 | armin.rigo | 2006-05-02 21:52:32 +0200 (Tue, 02 May 2006) | 4 lines
Documentation bug: PySet_Pop() returns a new reference (because the
caller becomes the owner of that reference).
........
r45864 | guido.van.rossum | 2006-05-02 22:47:36 +0200 (Tue, 02 May 2006) | 4 lines
Hopefully this will fix the spurious failures of test_mailbox.py that I'm
experiencing. (This code and mailbox.py itself are full of calls to file()
that should be calls to open() -- but I'm not fixing those.)
........
r45865 | andrew.kuchling | 2006-05-02 23:44:33 +0200 (Tue, 02 May 2006) | 1 line
Use open() instead of file()
........
r45866 | andrew.kuchling | 2006-05-03 00:47:49 +0200 (Wed, 03 May 2006) | 1 line
Update context manager section for removal of __context__
........
r45867 | fred.drake | 2006-05-03 03:46:52 +0200 (Wed, 03 May 2006) | 1 line
remove unnecessary assignment
........
r45868 | fred.drake | 2006-05-03 03:48:24 +0200 (Wed, 03 May 2006) | 4 lines
tell LaTeX2HTML to:
- use UTF-8 output
- not mess with the >>> prompt!
........
r45869 | fred.drake | 2006-05-03 04:04:40 +0200 (Wed, 03 May 2006) | 3 lines
avoid ugly markup based on the unfortunate conversions of ">>" and "<<" to
guillemets; no need for magic here
........
r45870 | fred.drake | 2006-05-03 04:12:47 +0200 (Wed, 03 May 2006) | 1 line
at least comment on why curly-quotes are not enabled
........
r45871 | fred.drake | 2006-05-03 04:27:40 +0200 (Wed, 03 May 2006) | 1 line
one more place to avoid extra markup
........
r45872 | fred.drake | 2006-05-03 04:29:09 +0200 (Wed, 03 May 2006) | 1 line
one more place to avoid extra markup (how many will there be?)
........
r45873 | fred.drake | 2006-05-03 04:29:39 +0200 (Wed, 03 May 2006) | 1 line
fix up whitespace in prompt strings
........
r45876 | tim.peters | 2006-05-03 06:46:14 +0200 (Wed, 03 May 2006) | 2 lines
Whitespace normalization.
........
r45877 | martin.v.loewis | 2006-05-03 06:52:04 +0200 (Wed, 03 May 2006) | 2 lines
Correct some formulations, fix XXX comments.
........
r45879 | georg.brandl | 2006-05-03 07:05:02 +0200 (Wed, 03 May 2006) | 2 lines
Patch #1480067: don't redirect HTTP digest auth in urllib2
........
r45881 | georg.brandl | 2006-05-03 07:15:10 +0200 (Wed, 03 May 2006) | 3 lines
Move network tests from test_urllib2 to test_urllib2net.
........
r45887 | nick.coghlan | 2006-05-03 15:02:47 +0200 (Wed, 03 May 2006) | 1 line
Finish bringing SVN into line with latest version of PEP 343 by getting rid of all remaining references to context objects that I could find. Without a __context__() method context objects no longer exist. Also get test_with working again, and adopt a suggestion from Neal for decimal.Context.get_manager()
........
r45888 | nick.coghlan | 2006-05-03 15:17:49 +0200 (Wed, 03 May 2006) | 1 line
Get rid of a couple more context object references, fix some markup and clarify what happens when a generator context function swallows an exception.
........
r45889 | georg.brandl | 2006-05-03 19:46:13 +0200 (Wed, 03 May 2006) | 3 lines
Add seamonkey to list of Windows browsers too.
........
r45890 | georg.brandl | 2006-05-03 20:03:22 +0200 (Wed, 03 May 2006) | 3 lines
RFE #1472176: In httplib, don't encode the netloc and hostname with "idna" if not necessary.
........
r45891 | georg.brandl | 2006-05-03 20:12:33 +0200 (Wed, 03 May 2006) | 2 lines
Bug #1472191: convert breakpoint indices to ints before comparing them to ints
........
r45893 | georg.brandl | 2006-05-03 20:18:32 +0200 (Wed, 03 May 2006) | 3 lines
Bug #1385040: don't allow "def foo(a=1, b): pass" in the compiler package.
........
r45894 | thomas.heller | 2006-05-03 20:35:39 +0200 (Wed, 03 May 2006) | 1 line
Don't fail the tests when libglut.so or libgle.so cannot be loaded.
........
r45895 | georg.brandl | 2006-05-04 07:08:10 +0200 (Thu, 04 May 2006) | 2 lines
Bug #1481530: allow "from os.path import ..." with imputil
........
r45897 | martin.v.loewis | 2006-05-04 07:51:03 +0200 (Thu, 04 May 2006) | 2 lines
Patch #1475845: Raise IndentationError for unexpected indent.
........
r45898 | martin.v.loewis | 2006-05-04 12:08:42 +0200 (Thu, 04 May 2006) | 1 line
Implement os.{chdir,rename,rmdir,remove} using Win32 directly.
........
r45899 | martin.v.loewis | 2006-05-04 14:04:27 +0200 (Thu, 04 May 2006) | 2 lines
Drop now-unnecessary arguments to posix_2str.
........
r45900 | martin.v.loewis | 2006-05-04 16:27:52 +0200 (Thu, 04 May 2006) | 1 line
Update checks to consider Windows error numbers.
........
r45913 | thomas.heller | 2006-05-05 20:42:14 +0200 (Fri, 05 May 2006) | 2 lines
Export the 'free' standard C function for use in the test suite.
........
r45914 | thomas.heller | 2006-05-05 20:43:24 +0200 (Fri, 05 May 2006) | 3 lines
Fix memory leaks in the ctypes test suite, reported by valgrind, by
free()ing the memory we allocate.
........
r45915 | thomas.heller | 2006-05-05 20:46:27 +0200 (Fri, 05 May 2006) | 1 line
oops - the function is exported as 'my_free', not 'free'.
........
r45916 | thomas.heller | 2006-05-05 21:14:24 +0200 (Fri, 05 May 2006) | 2 lines
Clean up.
........
r45920 | george.yoshida | 2006-05-06 15:09:45 +0200 (Sat, 06 May 2006) | 2 lines
describe optional arguments for DocFileSuite
........
r45924 | george.yoshida | 2006-05-06 16:16:51 +0200 (Sat, 06 May 2006) | 2 lines
Use \versionchanged for the feature change
........
r45925 | martin.v.loewis | 2006-05-06 18:32:54 +0200 (Sat, 06 May 2006) | 1 line
Port access, chmod, parts of getcwdu, mkdir, and utime to direct Win32 API.
........
r45926 | martin.v.loewis | 2006-05-06 22:04:08 +0200 (Sat, 06 May 2006) | 2 lines
Handle ERROR_ALREADY_EXISTS.
........
r45931 | andrew.kuchling | 2006-05-07 19:12:12 +0200 (Sun, 07 May 2006) | 1 line
[Patch #1479977] Revised version of urllib2 HOWTO, edited by John J. Lee
........
r45932 | andrew.kuchling | 2006-05-07 19:14:53 +0200 (Sun, 07 May 2006) | 1 line
Minor language edit
........
r45934 | georg.brandl | 2006-05-07 22:44:34 +0200 (Sun, 07 May 2006) | 3 lines
Patch #1483395: add new TLDs to cookielib
........
r45936 | martin.v.loewis | 2006-05-08 07:25:56 +0200 (Mon, 08 May 2006) | 2 lines
Add missing PyMem_Free.
........
r45938 | georg.brandl | 2006-05-08 19:28:47 +0200 (Mon, 08 May 2006) | 3 lines
Add test for rev. 45934.
........
r45939 | georg.brandl | 2006-05-08 19:36:08 +0200 (Mon, 08 May 2006) | 3 lines
Patch #1479302: Make urllib2 digest auth and basic auth play together.
........
r45940 | georg.brandl | 2006-05-08 19:48:01 +0200 (Mon, 08 May 2006) | 3 lines
Patch #1478993: take advantage of BaseException/Exception split in cookielib
........
r45941 | neal.norwitz | 2006-05-09 07:38:56 +0200 (Tue, 09 May 2006) | 5 lines
Micro optimization. In the first case, we know that frame->f_exc_type
is NULL, so there's no reason to do anything with it. In the second case,
we know frame->f_exc_type is not NULL, so we can just do an INCREF.
........
r45943 | thomas.heller | 2006-05-09 22:20:15 +0200 (Tue, 09 May 2006) | 2 lines
Disable a test that is unreliable.
........
r45944 | tim.peters | 2006-05-10 04:43:01 +0200 (Wed, 10 May 2006) | 4 lines
Variant of patch #1478292. doctest.register_optionflag(name)
shouldn't create a new flag when `name` is already the name of
an option flag.
........
r45947 | neal.norwitz | 2006-05-10 08:57:58 +0200 (Wed, 10 May 2006) | 14 lines
Fix problems found by Coverity.
longobject.c: also fix an ssize_t problem
<a> could have been NULL, so hoist the size calc to not use <a>.
_ssl.c: under fail: self is DECREF'd, but it would have been NULL.
_elementtree.c: delete self if there was an error.
_csv.c: I'm not sure if lineterminator could have been anything other than
a string. However, other string method calls are checked, so check this
one too.
........
r45948 | thomas.wouters | 2006-05-10 17:04:11 +0200 (Wed, 10 May 2006) | 4 lines
Ignore reflog.txt, too.
........
r45949 | georg.brandl | 2006-05-10 17:59:06 +0200 (Wed, 10 May 2006) | 3 lines
Bug #1482988: indicate more prominently that the Stats class is in the pstats module.
........
r45950 | georg.brandl | 2006-05-10 18:09:03 +0200 (Wed, 10 May 2006) | 2 lines
Bug #1485447: subprocess: document that the "cwd" parameter isn't used to find the executable. Misc. other markup fixes.
........
r45952 | georg.brandl | 2006-05-10 18:11:44 +0200 (Wed, 10 May 2006) | 2 lines
Bug #1484978: curses.panel: clarify that Panel objects are destroyed on garbage collection.
........
r45954 | georg.brandl | 2006-05-10 18:26:03 +0200 (Wed, 10 May 2006) | 4 lines
Patch #1484695: Update the tarfile module to version 0.8. This fixes
a couple of issues, notably handling of long file names using the
GNU LONGNAME extension.
........
r45955 | georg.brandl | 2006-05-10 19:13:20 +0200 (Wed, 10 May 2006) | 4 lines
Patch #721464: pdb.Pdb instances can now be given explicit stdin and
stdout arguments, making it possible to redirect input and output
for remote debugging.
........
r45956 | andrew.kuchling | 2006-05-10 19:19:04 +0200 (Wed, 10 May 2006) | 1 line
Clarify description of exception handling
........
r45957 | georg.brandl | 2006-05-10 22:09:23 +0200 (Wed, 10 May 2006) | 2 lines
Fix two small errors in argument lists.
........
r45960 | brett.cannon | 2006-05-11 07:11:33 +0200 (Thu, 11 May 2006) | 5 lines
Detect if %zd is supported by printf() during configure and sets
PY_FORMAT_SIZE_T appropriately. Removes warnings on
OS X under gcc 4.0.1 when PY_FORMAT_SIZE_T is set to "" instead of "z" as is
needed.
........
r45963 | neal.norwitz | 2006-05-11 09:51:59 +0200 (Thu, 11 May 2006) | 1 line
Don't mask a no memory error with a less meaningful one as discussed on python-checkins
........
r45964 | martin.v.loewis | 2006-05-11 15:28:43 +0200 (Thu, 11 May 2006) | 3 lines
Change WindowsError to carry the Win32 error code in winerror,
and the DOS error code in errno. Revert changes where
WindowsError catch blocks unnecessarily special-case OSError.
........
r45965 | george.yoshida | 2006-05-11 17:53:27 +0200 (Thu, 11 May 2006) | 2 lines
Grammar fix
........
r45967 | andrew.kuchling | 2006-05-11 18:32:24 +0200 (Thu, 11 May 2006) | 1 line
typo fix
........
r45968 | tim.peters | 2006-05-11 18:37:42 +0200 (Thu, 11 May 2006) | 5 lines
BaseThreadedTestCase.setup(): stop special-casing WindowsError.
Rev 45964 fiddled with WindowsError, and broke test_bsddb3 on all
the Windows buildbot slaves as a result. This should repair it.
........
r45969 | georg.brandl | 2006-05-11 21:57:09 +0200 (Thu, 11 May 2006) | 2 lines
Typo fix.
........
r45970 | tim.peters | 2006-05-12 03:57:59 +0200 (Fri, 12 May 2006) | 5 lines
SF patch #1473132: Improve docs for tp_clear and tp_traverse,
by Collin Winter.
Bugfix candidate (but I'm not going to bother).
........
r45974 | martin.v.loewis | 2006-05-12 14:27:28 +0200 (Fri, 12 May 2006) | 4 lines
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.
........
r45975 | martin.v.loewis | 2006-05-12 15:57:36 +0200 (Fri, 12 May 2006) | 1 line
Move icon files into DLLs dir. Fixes #1477968.
........
r45976 | george.yoshida | 2006-05-12 18:40:11 +0200 (Fri, 12 May 2006) | 2 lines
At first there were 6 steps, but one was removed after that.
........
r45977 | martin.v.loewis | 2006-05-12 19:22:04 +0200 (Fri, 12 May 2006) | 1 line
Fix alignment error on Itanium.
........
r45978 | george.yoshida | 2006-05-12 19:25:26 +0200 (Fri, 12 May 2006) | 3 lines
Duplicated description about the illegal continue usage can be found in nearly the same place.
They are same, so keep the original one and remove the later-added one.
........
r45980 | thomas.heller | 2006-05-12 20:16:03 +0200 (Fri, 12 May 2006) | 2 lines
Add missing svn properties.
........
r45981 | thomas.heller | 2006-05-12 20:47:35 +0200 (Fri, 12 May 2006) | 1 line
set svn properties
........
r45982 | thomas.heller | 2006-05-12 21:31:46 +0200 (Fri, 12 May 2006) | 1 line
add svn:eol-style native svn:keywords Id
........
r45987 | gerhard.haering | 2006-05-13 01:49:49 +0200 (Sat, 13 May 2006) | 3 lines
Integrated the rest of the pysqlite reference manual into the Python
documentation. Ready to be reviewed and improved upon.
........
r45988 | george.yoshida | 2006-05-13 08:53:31 +0200 (Sat, 13 May 2006) | 2 lines
Add \exception markup
........
r45990 | martin.v.loewis | 2006-05-13 15:34:04 +0200 (Sat, 13 May 2006) | 2 lines
Revert 43315: Printing of %zd must be signed.
........
r45992 | tim.peters | 2006-05-14 01:28:20 +0200 (Sun, 14 May 2006) | 11 lines
Teach PyString_FromFormat, PyErr_Format, and PyString_FromFormatV
about "%u", "%lu" and "%zu" formats.
Since PyString_FromFormat and PyErr_Format have exactly the same rules
(both inherited from PyString_FromFormatV), it would be good if someone
with more LaTeX Fu changed one of them to just point to the other.
Their docs were way out of synch before this patch, and I just did a
mass copy+paste to repair that.
Not a backport candidate (this is a new feature).
........
r45993 | tim.peters | 2006-05-14 01:31:05 +0200 (Sun, 14 May 2006) | 2 lines
Typo repair.
........
r45994 | tim.peters | 2006-05-14 01:33:19 +0200 (Sun, 14 May 2006) | 2 lines
Remove lie in new comment.
........
r45995 | ronald.oussoren | 2006-05-14 21:56:34 +0200 (Sun, 14 May 2006) | 11 lines
Rework the build system for osx applications:
* Don't use xcodebuild for building PythonLauncher, but use a normal unix
makefile. This makes it a lot easier to use the same build flags as for the
rest of python (e.g. make a universal version of python launcher)
* Convert the mac makefile-s to makefile.in-s and use configure to set makefile
variables instead of forwarding them as command-line arguments
* Add a C version of pythonw, that we you can use '#!/usr/local/bin/pythonw'
* Build IDLE.app using bundlebuilder instead of BuildApplet, that will allow
easier modification of the bundle contents later on.
........
r45996 | ronald.oussoren | 2006-05-14 22:35:41 +0200 (Sun, 14 May 2006) | 6 lines
A first cut at replacing the icons on MacOS X. This replaces all icons by icons
based on the new python.org logo. These are also the first icons that are
"proper" OSX icons.
These icons were created by Jacob Rus.
........
r45997 | ronald.oussoren | 2006-05-14 23:07:41 +0200 (Sun, 14 May 2006) | 3 lines
I missed one small detail in my rewrite of the osx build files: the path
to the Python.app template.
........
r45998 | martin.v.loewis | 2006-05-15 07:51:36 +0200 (Mon, 15 May 2006) | 2 lines
Fix memory leak.
........
r45999 | neal.norwitz | 2006-05-15 08:48:14 +0200 (Mon, 15 May 2006) | 1 line
Move items implemented after a2 into the new a3 section
........
r46000 | neal.norwitz | 2006-05-15 09:04:36 +0200 (Mon, 15 May 2006) | 5 lines
- Bug #1487966: Fix SystemError with conditional expression in assignment
Most of the test_syntax changes are just updating the numbers.
........
r46001 | neal.norwitz | 2006-05-15 09:17:23 +0200 (Mon, 15 May 2006) | 1 line
Patch #1488312, Fix memory alignment problem on SPARC in unicode. Will backport
........
r46003 | martin.v.loewis | 2006-05-15 11:22:27 +0200 (Mon, 15 May 2006) | 3 lines
Remove bogus DECREF of self.
Change __str__() functions to METH_O.
Change WindowsError__str__ to use PyTuple_Pack.
........
r46005 | georg.brandl | 2006-05-15 21:30:35 +0200 (Mon, 15 May 2006) | 3 lines
[ 1488881 ] tarfile.py: support for file-objects and bz2 (cp. #1488634)
........
r46007 | tim.peters | 2006-05-15 22:44:10 +0200 (Mon, 15 May 2006) | 9 lines
ReadDetectFileobjTest: repair Windows disasters by opening
the file object in binary mode.
The Windows buildbot slaves shouldn't swap themselves to death
anymore. However, test_tarfile may still fail because of a
temp directory left behind from a previous failing run.
Windows buildbot owners may need to remove that directory
by hand.
........
r46009 | tim.peters | 2006-05-15 23:32:25 +0200 (Mon, 15 May 2006) | 3 lines
test_directory(): Remove the leftover temp directory that's making
the Windows buildbots fail test_tarfile.
........
r46010 | martin.v.loewis | 2006-05-16 09:05:37 +0200 (Tue, 16 May 2006) | 4 lines
- 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
........
r46012 | georg.brandl | 2006-05-16 09:38:27 +0200 (Tue, 16 May 2006) | 3 lines
Patch #1435422: zlib's compress and decompress objects now have a
copy() method.
........
r46015 | andrew.kuchling | 2006-05-16 18:11:54 +0200 (Tue, 16 May 2006) | 1 line
Add item
........
r46016 | andrew.kuchling | 2006-05-16 18:27:31 +0200 (Tue, 16 May 2006) | 3 lines
PEP 243 has been withdrawn, so don't refer to it any more.
The PyPI upload material has been moved into the section on PEP314.
........
r46017 | george.yoshida | 2006-05-16 19:42:16 +0200 (Tue, 16 May 2006) | 2 lines
Update for 'ImportWarning'
........
r46018 | george.yoshida | 2006-05-16 20:07:00 +0200 (Tue, 16 May 2006) | 4 lines
Mention that Exception is now a subclass of BaseException.
Remove a sentence that says that BaseException inherits from BaseException.
(I guess this is just a copy & paste mistake.)
........
r46019 | george.yoshida | 2006-05-16 20:26:10 +0200 (Tue, 16 May 2006) | 2 lines
Document ImportWarning
........
r46020 | tim.peters | 2006-05-17 01:22:20 +0200 (Wed, 17 May 2006) | 2 lines
Whitespace normalization.
........
r46021 | tim.peters | 2006-05-17 01:24:08 +0200 (Wed, 17 May 2006) | 2 lines
Text files missing the SVN eol-style property.
........
r46022 | tim.peters | 2006-05-17 03:30:11 +0200 (Wed, 17 May 2006) | 2 lines
PyZlib_copy(), PyZlib_uncopy(): Repair leaks on the normal-case path.
........
r46023 | georg.brandl | 2006-05-17 16:06:07 +0200 (Wed, 17 May 2006) | 3 lines
Remove misleading comment about type-class unification.
........
r46024 | georg.brandl | 2006-05-17 16:11:36 +0200 (Wed, 17 May 2006) | 3 lines
Apply patch #1489784 from Michael Foord.
........
r46025 | georg.brandl | 2006-05-17 16:18:20 +0200 (Wed, 17 May 2006) | 3 lines
Fix typo in os.utime docstring (patch #1490189)
........
r46026 | georg.brandl | 2006-05-17 16:26:50 +0200 (Wed, 17 May 2006) | 3 lines
Patch #1490224: set time.altzone correctly on Cygwin.
........
r46027 | georg.brandl | 2006-05-17 16:45:06 +0200 (Wed, 17 May 2006) | 4 lines
Add global debug flag to cookielib to avoid heavy dependency on the logging module.
Resolves #1484758.
........
r46028 | georg.brandl | 2006-05-17 16:56:04 +0200 (Wed, 17 May 2006) | 3 lines
Patch #1486962: Several bugs in the turtle Tk demo module were fixed
and several features added, such as speed and geometry control.
........
r46029 | georg.brandl | 2006-05-17 17:17:00 +0200 (Wed, 17 May 2006) | 4 lines
Delay-import some large modules to speed up urllib2 import.
(fixes #1484793).
........
r46030 | georg.brandl | 2006-05-17 17:51:16 +0200 (Wed, 17 May 2006) | 3 lines
Patch #1180296: improve locale string formatting functions
........
r46032 | tim.peters | 2006-05-18 04:06:40 +0200 (Thu, 18 May 2006) | 2 lines
Whitespace normalization.
........
r46033 | georg.brandl | 2006-05-18 08:11:19 +0200 (Thu, 18 May 2006) | 3 lines
Amendments to patch #1484695.
........
r46034 | georg.brandl | 2006-05-18 08:18:06 +0200 (Thu, 18 May 2006) | 3 lines
Remove unused import.
........
r46035 | georg.brandl | 2006-05-18 08:33:27 +0200 (Thu, 18 May 2006) | 3 lines
Fix test_locale for platforms without a default thousands separator.
........
r46036 | neal.norwitz | 2006-05-18 08:51:46 +0200 (Thu, 18 May 2006) | 1 line
Little cleanup
........
r46037 | georg.brandl | 2006-05-18 09:01:27 +0200 (Thu, 18 May 2006) | 4 lines
Bug #1462152: file() now checks more thoroughly for invalid mode
strings and removes a possible "U" before passing the mode to the
C library function.
........
r46038 | georg.brandl | 2006-05-18 09:20:05 +0200 (Thu, 18 May 2006) | 3 lines
Bug #1490688: properly document %e, %f, %g format subtleties.
........
r46039 | vinay.sajip | 2006-05-18 09:28:58 +0200 (Thu, 18 May 2006) | 1 line
Changed status from "beta" to "production"; since logging has been part of the stdlib since 2.3, it should be safe to make this assertion ;-)
........
r46040 | ronald.oussoren | 2006-05-18 11:04:15 +0200 (Thu, 18 May 2006) | 2 lines
Fix some minor issues with the generated application bundles on MacOSX
........
r46041 | andrew.kuchling | 2006-05-19 02:03:55 +0200 (Fri, 19 May 2006) | 1 line
Typo fix; add clarifying word
........
r46044 | neal.norwitz | 2006-05-19 08:31:23 +0200 (Fri, 19 May 2006) | 3 lines
Fix #132 from Coverity, retval could have been derefed
if a continue inside a try failed.
........
r46045 | neal.norwitz | 2006-05-19 08:43:50 +0200 (Fri, 19 May 2006) | 2 lines
Fix #1474677, non-keyword argument following keyword.
........
r46046 | neal.norwitz | 2006-05-19 09:00:58 +0200 (Fri, 19 May 2006) | 4 lines
Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
I suppose this could be backported if anyone cares.
........
r46047 | neal.norwitz | 2006-05-19 09:05:01 +0200 (Fri, 19 May 2006) | 7 lines
Oops, I forgot to include this file in the last commit (46046):
Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
I suppose this could be backported if anyone cares.
........
r46050 | ronald.oussoren | 2006-05-19 20:17:31 +0200 (Fri, 19 May 2006) | 6 lines
* Change working directory to the users home
directory, that makes the file open/save
dialogs more useable.
* Don't use argv emulator, its not needed
for idle.
........
r46052 | tim.peters | 2006-05-19 21:16:34 +0200 (Fri, 19 May 2006) | 2 lines
Whitespace normalization.
........
r46054 | ronald.oussoren | 2006-05-20 08:17:01 +0200 (Sat, 20 May 2006) | 9 lines
Fix bug #1000914 (again).
This patches a file that is generated by bgen, however the code is now the
same as a current copy of bgen would generate. Without this patch most types
in the Carbon.CF module are unusable.
I haven't managed to coax bgen into generating a complete copy of _CFmodule.c
yet :-(, hence the manual patching.
........
r46055 | george.yoshida | 2006-05-20 17:36:19 +0200 (Sat, 20 May 2006) | 3 lines
- markup fix
- add clarifying words
........
r46057 | george.yoshida | 2006-05-20 18:29:14 +0200 (Sat, 20 May 2006) | 3 lines
- Add 'as' and 'with' as new keywords in 2.5.
- Regenerate keyword lists with reswords.py.
........
r46058 | george.yoshida | 2006-05-20 20:07:26 +0200 (Sat, 20 May 2006) | 2 lines
Apply patch #1492147 from Mike Foord.
........
r46059 | andrew.kuchling | 2006-05-20 21:25:16 +0200 (Sat, 20 May 2006) | 1 line
Minor edits
........
r46061 | george.yoshida | 2006-05-21 06:22:59 +0200 (Sun, 21 May 2006) | 2 lines
Fix the TeX compile error.
........
r46062 | george.yoshida | 2006-05-21 06:40:32 +0200 (Sun, 21 May 2006) | 2 lines
Apply patch #1492255 from Mike Foord.
........
r46063 | martin.v.loewis | 2006-05-22 10:48:14 +0200 (Mon, 22 May 2006) | 1 line
Patch 1490384: New Icons for the PC build.
........
r46064 | martin.v.loewis | 2006-05-22 11:15:18 +0200 (Mon, 22 May 2006) | 1 line
Patch #1492356: Port to Windows CE (patch set 1).
........
r46065 | tim.peters | 2006-05-22 13:29:41 +0200 (Mon, 22 May 2006) | 4 lines
Define SIZEOF_{DOUBLE,FLOAT} on Windows. Else
Michael Hudson's nice gimmicks for IEEE special
values (infinities, NaNs) don't work.
........
r46070 | bob.ippolito | 2006-05-22 16:31:24 +0200 (Mon, 22 May 2006) | 2 lines
GzipFile.readline performance improvement (~30-40%), patch #1281707
........
r46071 | bob.ippolito | 2006-05-22 17:22:46 +0200 (Mon, 22 May 2006) | 1 line
Revert gzip readline performance patch #1281707 until a more generic performance improvement can be found
........
r46073 | fredrik.lundh | 2006-05-22 17:35:12 +0200 (Mon, 22 May 2006) | 4 lines
docstring tweaks: count counts non-overlapping substrings, not
total number of occurences
........
r46075 | bob.ippolito | 2006-05-22 17:59:12 +0200 (Mon, 22 May 2006) | 1 line
Apply revised patch for GzipFile.readline performance #1281707
........
r46076 | fredrik.lundh | 2006-05-22 18:29:30 +0200 (Mon, 22 May 2006) | 3 lines
needforspeed: speed up unicode repeat, unicode string copy
........
r46079 | fredrik.lundh | 2006-05-22 19:12:58 +0200 (Mon, 22 May 2006) | 4 lines
needforspeed: use memcpy for "long" strings; use a better algorithm
for long repeats.
........
r46084 | tim.peters | 2006-05-22 21:17:04 +0200 (Mon, 22 May 2006) | 7 lines
PyUnicode_Join(): Recent code changes introduced new
compiler warnings on Windows (signed vs unsigned mismatch
in comparisons). Cleaned that up by switching more locals
to Py_ssize_t. Simplified overflow checking (it can _be_
simpler because while these things are declared as
Py_ssize_t, then should in fact never be negative).
........
r46085 | tim.peters | 2006-05-23 07:47:16 +0200 (Tue, 23 May 2006) | 3 lines
unicode_repeat(): Change type of local to Py_ssize_t,
since that's what it should be.
........
r46094 | fredrik.lundh | 2006-05-23 12:10:57 +0200 (Tue, 23 May 2006) | 3 lines
needforspeed: check first *and* last character before doing a full memcmp
........
r46095 | fredrik.lundh | 2006-05-23 12:12:21 +0200 (Tue, 23 May 2006) | 4 lines
needforspeed: fixed unicode "in" operator to use same implementation
approach as find/index
........
r46096 | richard.jones | 2006-05-23 12:37:38 +0200 (Tue, 23 May 2006) | 7 lines
Merge from rjones-funccall branch.
Applied patch zombie-frames-2.diff from sf patch 876206 with updates for
Python 2.5 and also modified to retain the free_list to avoid the 67%
slow-down in pybench recursion test. 5% speed up in function call pybench.
........
r46098 | ronald.oussoren | 2006-05-23 13:04:24 +0200 (Tue, 23 May 2006) | 2 lines
Avoid creating a mess when installing a framework for the second time.
........
r46101 | georg.brandl | 2006-05-23 13:17:21 +0200 (Tue, 23 May 2006) | 3 lines
PyErr_NewException now accepts a tuple of base classes as its
"base" parameter.
........
r46103 | ronald.oussoren | 2006-05-23 13:47:16 +0200 (Tue, 23 May 2006) | 3 lines
Disable linking extensions with -lpython2.5 for darwin. This should fix bug
#1487105.
........
r46104 | ronald.oussoren | 2006-05-23 14:01:11 +0200 (Tue, 23 May 2006) | 6 lines
Patch #1488098.
This patchs makes it possible to create a universal build on OSX 10.4 and use
the result to build extensions on 10.3. It also makes it possible to override
the '-arch' and '-isysroot' compiler arguments for specific extensions.
........
r46108 | andrew.kuchling | 2006-05-23 14:44:36 +0200 (Tue, 23 May 2006) | 1 line
Add some items; mention the sprint
........
r46109 | andrew.kuchling | 2006-05-23 14:47:01 +0200 (Tue, 23 May 2006) | 1 line
Mention string improvements
........
r46110 | andrew.kuchling | 2006-05-23 14:49:35 +0200 (Tue, 23 May 2006) | 4 lines
Use 'speed' instead of 'performance', because I agree with the argument
at http://zestyping.livejournal.com/193260.html that 'erformance' really means
something more general.
........
r46113 | ronald.oussoren | 2006-05-23 17:09:57 +0200 (Tue, 23 May 2006) | 2 lines
An improved script for building the binary distribution on MacOSX.
........
r46128 | richard.jones | 2006-05-23 20:28:17 +0200 (Tue, 23 May 2006) | 3 lines
Applied patch 1337051 by Neal Norwitz, saving 4 ints on frame objects.
........
r46129 | richard.jones | 2006-05-23 20:32:11 +0200 (Tue, 23 May 2006) | 1 line
fix broken merge
........
r46130 | bob.ippolito | 2006-05-23 20:41:17 +0200 (Tue, 23 May 2006) | 1 line
Update Misc/NEWS for gzip patch #1281707
........
r46131 | bob.ippolito | 2006-05-23 20:43:47 +0200 (Tue, 23 May 2006) | 1 line
Update Misc/NEWS for gzip patch #1281707
........
r46132 | fredrik.lundh | 2006-05-23 20:44:25 +0200 (Tue, 23 May 2006) | 7 lines
needforspeed: use append+reverse for rsplit, use "bloom filters" to
speed up splitlines and strip with charsets; etc. rsplit is now as
fast as split in all our tests (reverse takes no time at all), and
splitlines() is nearly as fast as a plain split("\n") in our tests.
and we're not done yet... ;-)
........
r46133 | tim.peters | 2006-05-23 20:45:30 +0200 (Tue, 23 May 2006) | 38 lines
Bug #1334662 / patch #1335972: int(string, base) wrong answers.
In rare cases of strings specifying true values near sys.maxint,
and oddball bases (not decimal or a power of 2), int(string, base)
could deliver insane answers. This repairs all such problems, and
also speeds string->int significantly. On my box, here are %
speedups for decimal strings of various lengths:
length speedup
------ -------
1 12.4%
2 15.7%
3 20.6%
4 28.1%
5 33.2%
6 37.5%
7 41.9%
8 46.3%
9 51.2%
10 19.5%
11 19.9%
12 23.9%
13 23.7%
14 23.3%
15 24.9%
16 25.3%
17 28.3%
18 27.9%
19 35.7%
Note that the difference between 9 and 10 is the difference between
short and long Python ints on a 32-bit box. The patch doesn't
actually do anything to speed conversion to long: the speedup is
due to detecting "unsigned long" overflow more quickly.
This is a bugfix candidate, but it's a non-trivial patch and it
would be painful to separate the "bug fix" from the "speed up" parts.
........
r46134 | bob.ippolito | 2006-05-23 20:46:41 +0200 (Tue, 23 May 2006) | 1 line
Patch #1493701: performance enhancements for struct module.
........
r46136 | andrew.kuchling | 2006-05-23 21:00:45 +0200 (Tue, 23 May 2006) | 1 line
Remove duplicate item
........
r46141 | bob.ippolito | 2006-05-23 21:09:51 +0200 (Tue, 23 May 2006) | 1 line
revert #1493701
........
r46142 | bob.ippolito | 2006-05-23 21:11:34 +0200 (Tue, 23 May 2006) | 1 line
patch #1493701: performance enhancements for struct module
........
r46144 | bob.ippolito | 2006-05-23 21:12:41 +0200 (Tue, 23 May 2006) | 1 line
patch #1493701: performance enhancements for struct module
........
r46148 | bob.ippolito | 2006-05-23 21:25:52 +0200 (Tue, 23 May 2006) | 1 line
fix linking issue, warnings, in struct
........
r46149 | andrew.kuchling | 2006-05-23 21:29:38 +0200 (Tue, 23 May 2006) | 1 line
Add two items
........
r46150 | bob.ippolito | 2006-05-23 21:31:23 +0200 (Tue, 23 May 2006) | 1 line
forward declaration for PyStructType
........
r46151 | bob.ippolito | 2006-05-23 21:32:25 +0200 (Tue, 23 May 2006) | 1 line
fix typo in _struct
........
r46152 | andrew.kuchling | 2006-05-23 21:32:35 +0200 (Tue, 23 May 2006) | 1 line
Add item
........
r46153 | tim.peters | 2006-05-23 21:34:37 +0200 (Tue, 23 May 2006) | 3 lines
Get the Windows build working again (recover from
`struct` module changes).
........
r46155 | fredrik.lundh | 2006-05-23 21:47:35 +0200 (Tue, 23 May 2006) | 3 lines
return 0 on misses, not -1.
........
r46156 | tim.peters | 2006-05-23 23:51:35 +0200 (Tue, 23 May 2006) | 4 lines
test_struct grew weird behavior under regrtest.py -R,
due to a module-level cache. Clearing the cache should
make it stop showing up in refleak reports.
........
r46157 | tim.peters | 2006-05-23 23:54:23 +0200 (Tue, 23 May 2006) | 2 lines
Whitespace normalization.
........
r46158 | tim.peters | 2006-05-23 23:55:53 +0200 (Tue, 23 May 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46161 | fredrik.lundh | 2006-05-24 12:20:36 +0200 (Wed, 24 May 2006) | 3 lines
use Py_ssize_t for string indexes (thanks, neal!)
........
r46173 | fredrik.lundh | 2006-05-24 16:28:11 +0200 (Wed, 24 May 2006) | 14 lines
needforspeed: use "fastsearch" for count and findstring helpers. this
results in a 2.5x speedup on the stringbench count tests, and a 20x (!)
speedup on the stringbench search/find/contains test, compared to 2.5a2.
for more on the algorithm, see:
http://effbot.org/zone/stringlib.htm
if you get weird results, you can disable the new algoritm by undefining
USE_FAST in Objects/unicodeobject.c.
enjoy /F
........
r46182 | fredrik.lundh | 2006-05-24 17:11:01 +0200 (Wed, 24 May 2006) | 3 lines
needforspeedindeed: use fastsearch also for __contains__
........
r46184 | bob.ippolito | 2006-05-24 17:32:06 +0200 (Wed, 24 May 2006) | 1 line
refactor unpack, add unpack_from
........
r46189 | fredrik.lundh | 2006-05-24 18:35:18 +0200 (Wed, 24 May 2006) | 4 lines
needforspeed: refactored the replace code slightly; special-case
constant-length changes; use fastsearch to locate the first match.
........
r46198 | andrew.dalke | 2006-05-24 20:55:37 +0200 (Wed, 24 May 2006) | 10 lines
Added a slew of test for string replace, based various corner cases from
the Need For Speed sprint coding. Includes commented out overflow tests
which will be uncommented once the code is fixed.
This test will break the 8-bit string tests because
"".replace("", "A") == "" when it should == "A"
We have a fix for it, which should be added tomorrow.
........
r46200 | tim.peters | 2006-05-24 22:27:18 +0200 (Wed, 24 May 2006) | 2 lines
We can't leave the checked-in tests broken.
........
r46201 | tim.peters | 2006-05-24 22:29:44 +0200 (Wed, 24 May 2006) | 2 lines
Whitespace normalization.
........
r46202 | tim.peters | 2006-05-24 23:00:45 +0200 (Wed, 24 May 2006) | 4 lines
Disable the damn empty-string replace test -- it can't
be make to pass now for unicode if it passes for str, or
vice versa.
........
r46203 | tim.peters | 2006-05-24 23:10:40 +0200 (Wed, 24 May 2006) | 58 lines
Heavily fiddled variant of patch #1442927: PyLong_FromString optimization.
``long(str, base)`` is now up to 6x faster for non-power-of-2 bases. The
largest speedup is for inputs with about 1000 decimal digits. Conversion
from non-power-of-2 bases remains quadratic-time in the number of input
digits (it was and remains linear-time for bases 2, 4, 8, 16 and 32).
Speedups at various lengths for decimal inputs, comparing 2.4.3 with
current trunk. Note that it's actually a bit slower for 1-digit strings:
len speedup
---- -------
1 -4.5%
2 4.6%
3 8.3%
4 12.7%
5 16.9%
6 28.6%
7 35.5%
8 44.3%
9 46.6%
10 55.3%
11 65.7%
12 77.7%
13 73.4%
14 75.3%
15 85.2%
16 103.0%
17 95.1%
18 112.8%
19 117.9%
20 128.3%
30 174.5%
40 209.3%
50 236.3%
60 254.3%
70 262.9%
80 295.8%
90 297.3%
100 324.5%
200 374.6%
300 403.1%
400 391.1%
500 388.7%
600 440.6%
700 468.7%
800 498.0%
900 507.2%
1000 501.2%
2000 450.2%
3000 463.2%
4000 452.5%
5000 440.6%
6000 439.6%
7000 424.8%
8000 418.1%
9000 417.7%
........
r46204 | andrew.kuchling | 2006-05-25 02:23:03 +0200 (Thu, 25 May 2006) | 1 line
Minor edits; add an item
........
r46205 | fred.drake | 2006-05-25 04:42:25 +0200 (Thu, 25 May 2006) | 3 lines
fix broken links in PDF
(SF patch #1281291, contributed by Rory Yorke)
........
r46208 | walter.doerwald | 2006-05-25 10:53:28 +0200 (Thu, 25 May 2006) | 2 lines
Replace tab inside comment with space.
........
r46209 | thomas.wouters | 2006-05-25 13:25:51 +0200 (Thu, 25 May 2006) | 4 lines
Fix #1488915, Multiple dots in relative import statement raise SyntaxError.
........
r46210 | thomas.wouters | 2006-05-25 13:26:25 +0200 (Thu, 25 May 2006) | 5 lines
Update graminit.c for the fix for #1488915, Multiple dots in relative import
statement raise SyntaxError, and add testcase.
........
r46211 | andrew.kuchling | 2006-05-25 14:27:59 +0200 (Thu, 25 May 2006) | 1 line
Add entry; and fix a typo
........
r46214 | fredrik.lundh | 2006-05-25 17:22:03 +0200 (Thu, 25 May 2006) | 7 lines
needforspeed: speed up upper and lower for 8-bit string objects.
(the unicode versions of these are still 2x faster on windows,
though...)
based on work by Andrew Dalke, with tweaks by yours truly.
........
r46216 | fredrik.lundh | 2006-05-25 17:49:45 +0200 (Thu, 25 May 2006) | 5 lines
needforspeed: make new upper/lower work properly for single-character
strings too... (thanks to georg brandl for spotting the exact problem
faster than anyone else)
........
r46217 | kristjan.jonsson | 2006-05-25 17:53:30 +0200 (Thu, 25 May 2006) | 1 line
Added a new macro, Py_IS_FINITE(X). On windows there is an intrinsic for this and it is more efficient than to use !Py_IS_INFINITE(X) && !Py_IS_NAN(X). No change on other platforms
........
r46219 | fredrik.lundh | 2006-05-25 18:10:12 +0200 (Thu, 25 May 2006) | 4 lines
needforspeed: _toupper/_tolower is a SUSv2 thing; fall back on ISO C
versions if they're not defined.
........
r46220 | andrew.kuchling | 2006-05-25 18:23:15 +0200 (Thu, 25 May 2006) | 1 line
Fix comment typos
........
r46221 | andrew.dalke | 2006-05-25 18:30:52 +0200 (Thu, 25 May 2006) | 2 lines
Added tests for implementation error we came up with in the need for speed sprint.
........
r46222 | andrew.kuchling | 2006-05-25 18:34:54 +0200 (Thu, 25 May 2006) | 1 line
Fix another typo
........
r46223 | kristjan.jonsson | 2006-05-25 18:39:27 +0200 (Thu, 25 May 2006) | 1 line
Fix incorrect documentation for the Py_IS_FINITE(X) macro.
........
r46224 | fredrik.lundh | 2006-05-25 18:46:54 +0200 (Thu, 25 May 2006) | 3 lines
needforspeed: check for overflow in replace (from Andrew Dalke)
........
r46226 | fredrik.lundh | 2006-05-25 19:08:14 +0200 (Thu, 25 May 2006) | 5 lines
needforspeed: new replace implementation by Andrew Dalke. replace is
now about 3x faster on my machine, for the replace tests from string-
bench.
........
r46227 | tim.peters | 2006-05-25 19:34:03 +0200 (Thu, 25 May 2006) | 5 lines
A new table to help string->integer conversion was added yesterday to
both mystrtoul.c and longobject.c. Share the table instead. Also
cut its size by 64 entries (they had been used for an inscrutable
trick originally, but the code no longer tries to use that trick).
........
r46229 | andrew.dalke | 2006-05-25 19:53:00 +0200 (Thu, 25 May 2006) | 11 lines
Fixed problem identified by Georg. The special-case in-place code for replace
made a copy of the string using PyString_FromStringAndSize(s, n) and modify
the copied string in-place. However, 1 (and 0) character strings are shared
from a cache. This cause "A".replace("A", "a") to change the cached version
of "A" -- used by everyone.
Now may the copy with NULL as the string and do the memcpy manually. I've
added regression tests to check if this happens in the future. Perhaps
there should be a PyString_Copy for this case?
........
r46230 | fredrik.lundh | 2006-05-25 19:55:31 +0200 (Thu, 25 May 2006) | 4 lines
needforspeed: use "fastsearch" for count. this results in a 3x speedup
for the related stringbench tests.
........
r46231 | andrew.dalke | 2006-05-25 20:03:25 +0200 (Thu, 25 May 2006) | 4 lines
Code had returned an ssize_t, upcast to long, then converted with PyInt_FromLong.
Now using PyInt_FromSsize_t.
........
r46233 | andrew.kuchling | 2006-05-25 20:11:16 +0200 (Thu, 25 May 2006) | 1 line
Comment typo
........
r46234 | andrew.dalke | 2006-05-25 20:18:39 +0200 (Thu, 25 May 2006) | 4 lines
Added overflow test for adding two (very) large strings where the
new string is over max Py_ssize_t. I have no way to test it on my
box or any box I have access to. At least it doesn't break anything.
........
r46235 | bob.ippolito | 2006-05-25 20:20:23 +0200 (Thu, 25 May 2006) | 1 line
Faster path for PyLong_FromLongLong, using PyLong_FromLong algorithm
........
r46238 | georg.brandl | 2006-05-25 20:44:09 +0200 (Thu, 25 May 2006) | 3 lines
Guard the _active.remove() call to avoid errors when there is no _active list.
........
r46239 | fredrik.lundh | 2006-05-25 20:44:29 +0200 (Thu, 25 May 2006) | 4 lines
needforspeed: use fastsearch also for find/index and contains. the
related tests are now about 10x faster.
........
r46240 | bob.ippolito | 2006-05-25 20:44:50 +0200 (Thu, 25 May 2006) | 1 line
Struct now unpacks to PY_LONG_LONG directly when possible, also include #ifdef'ed out code that will return int instead of long when in bounds (not active since it's an API and doc change)
........
r46241 | jack.diederich | 2006-05-25 20:47:15 +0200 (Thu, 25 May 2006) | 1 line
* eliminate warning by reverting tmp_s type to 'const char*'
........
r46242 | bob.ippolito | 2006-05-25 21:03:19 +0200 (Thu, 25 May 2006) | 1 line
Fix Cygwin compiler issue
........
r46243 | bob.ippolito | 2006-05-25 21:15:27 +0200 (Thu, 25 May 2006) | 1 line
fix a struct regression where long would be returned for short unsigned integers
........
r46244 | georg.brandl | 2006-05-25 21:15:31 +0200 (Thu, 25 May 2006) | 4 lines
Replace PyObject_CallFunction calls with only object args
with PyObject_CallFunctionObjArgs, which is 30% faster.
........
r46245 | fredrik.lundh | 2006-05-25 21:19:05 +0200 (Thu, 25 May 2006) | 3 lines
needforspeed: use insert+reverse instead of append
........
r46246 | bob.ippolito | 2006-05-25 21:33:38 +0200 (Thu, 25 May 2006) | 1 line
Use LONG_MIN and LONG_MAX to check Python integer bounds instead of the incorrect INT_MIN and INT_MAX
........
r46248 | bob.ippolito | 2006-05-25 21:56:56 +0200 (Thu, 25 May 2006) | 1 line
Use faster struct pack/unpack functions for the endian table that matches the host's
........
r46249 | bob.ippolito | 2006-05-25 21:59:56 +0200 (Thu, 25 May 2006) | 1 line
enable darwin/x86 support for libffi and hence ctypes (doesn't yet support --enable-universalsdk)
........
r46252 | georg.brandl | 2006-05-25 22:28:10 +0200 (Thu, 25 May 2006) | 4 lines
Someone seems to just have copy-pasted the docs of
tp_compare to tp_richcompare ;)
........
r46253 | brett.cannon | 2006-05-25 22:44:08 +0200 (Thu, 25 May 2006) | 2 lines
Swap out bare malloc()/free() use for PyMem_MALLOC()/PyMem_FREE() .
........
r46254 | bob.ippolito | 2006-05-25 22:52:38 +0200 (Thu, 25 May 2006) | 1 line
squelch gcc4 darwin/x86 compiler warnings
........
r46255 | bob.ippolito | 2006-05-25 23:09:45 +0200 (Thu, 25 May 2006) | 1 line
fix test_float regression and 64-bit size mismatch issue
........
r46256 | georg.brandl | 2006-05-25 23:11:56 +0200 (Thu, 25 May 2006) | 3 lines
Add a x-ref to newer calling APIs.
........
r46257 | ronald.oussoren | 2006-05-25 23:30:54 +0200 (Thu, 25 May 2006) | 2 lines
Fix minor typo in prep_cif.c
........
r46259 | brett.cannon | 2006-05-25 23:33:11 +0200 (Thu, 25 May 2006) | 4 lines
Change test_values so that it compares the lowercasing of group names since getgrall() can return all lowercase names while getgrgid() returns proper casing.
Discovered on Ubuntu 5.04 (custom).
........
r46261 | tim.peters | 2006-05-25 23:50:17 +0200 (Thu, 25 May 2006) | 7 lines
Some Win64 pre-release in 2000 didn't support
QueryPerformanceCounter(), but we believe Win64 does
support it now. So use in time.clock().
It would be peachy if someone with a Win64 box tried
this ;-)
........
r46262 | tim.peters | 2006-05-25 23:52:19 +0200 (Thu, 25 May 2006) | 2 lines
Whitespace normalization.
........
r46263 | bob.ippolito | 2006-05-25 23:58:05 +0200 (Thu, 25 May 2006) | 1 line
Add missing files from x86 darwin ctypes patch
........
r46264 | brett.cannon | 2006-05-26 00:00:14 +0200 (Fri, 26 May 2006) | 2 lines
Move over to use of METH_O and METH_NOARGS.
........
r46265 | tim.peters | 2006-05-26 00:25:25 +0200 (Fri, 26 May 2006) | 3 lines
Repair idiot typo, and complete the job of trying to
use the Windows time.clock() implementation on Win64.
........
r46266 | tim.peters | 2006-05-26 00:28:46 +0200 (Fri, 26 May 2006) | 9 lines
Patch #1494387: SVN longobject.c compiler warnings
The SIGCHECK macro defined here has always been bizarre, but
it apparently causes compiler warnings on "Sun Studio 11".
I believe the warnings are bogus, but it doesn't hurt to make
the macro definition saner.
Bugfix candidate (but I'm not going to bother).
........
r46268 | fredrik.lundh | 2006-05-26 01:27:53 +0200 (Fri, 26 May 2006) | 8 lines
needforspeed: partition for 8-bit strings. for some simple tests,
this is on par with a corresponding find, and nearly twice as fast
as split(sep, 1)
full tests, a unicode version, and documentation will follow to-
morrow.
........
r46271 | andrew.kuchling | 2006-05-26 03:46:22 +0200 (Fri, 26 May 2006) | 1 line
Add Soc student
........
r46272 | ronald.oussoren | 2006-05-26 10:41:25 +0200 (Fri, 26 May 2006) | 3 lines
Without this patch OSX users couldn't add new help sources because the code
tried to update one item in a tuple.
........
r46273 | fredrik.lundh | 2006-05-26 10:54:28 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: partition implementation, part two.
feel free to improve the documentation and the docstrings.
........
r46274 | georg.brandl | 2006-05-26 11:05:54 +0200 (Fri, 26 May 2006) | 3 lines
Clarify docs for str.partition().
........
r46278 | fredrik.lundh | 2006-05-26 11:46:59 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: use METH_O for argument handling, which made partition some
~15% faster for the current tests (which is noticable faster than a corre-
sponding find call). thanks to neal-who-never-sleeps for the tip.
........
r46280 | fredrik.lundh | 2006-05-26 12:27:17 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: use Py_ssize_t for the fastsearch counter and skip
length (thanks, neal!). and yes, I've verified that this doesn't
slow things down ;-)
........
r46285 | andrew.dalke | 2006-05-26 13:11:38 +0200 (Fri, 26 May 2006) | 2 lines
Added a few more test cases for whitespace split. These strings have leading whitespace.
........
r46286 | jack.diederich | 2006-05-26 13:15:17 +0200 (Fri, 26 May 2006) | 1 line
use Py_ssize_t in places that may need it
........
r46287 | andrew.dalke | 2006-05-26 13:15:22 +0200 (Fri, 26 May 2006) | 2 lines
Added split whitespace checks for characters other than space.
........
r46288 | ronald.oussoren | 2006-05-26 13:17:55 +0200 (Fri, 26 May 2006) | 2 lines
Fix buglet in postinstall script, it would generate an invalid .cshrc file.
........
r46290 | georg.brandl | 2006-05-26 13:26:11 +0200 (Fri, 26 May 2006) | 3 lines
Add "partition" to UserString.
........
r46291 | fredrik.lundh | 2006-05-26 13:29:39 +0200 (Fri, 26 May 2006) | 5 lines
needforspeed: added Py_LOCAL macro, based on the LOCAL macro used
for SRE and others. applied Py_LOCAL to relevant portion of ceval,
which gives a 1-2% speedup on my machine. ymmv.
........
r46292 | jack.diederich | 2006-05-26 13:37:20 +0200 (Fri, 26 May 2006) | 1 line
when generating python code prefer to generate valid python code
........
r46293 | fredrik.lundh | 2006-05-26 13:38:15 +0200 (Fri, 26 May 2006) | 3 lines
use Py_LOCAL also for string and unicode objects
........
r46294 | ronald.oussoren | 2006-05-26 13:38:39 +0200 (Fri, 26 May 2006) | 12 lines
- Search the sqlite specific search directories
after the normal include directories when looking
for the version of sqlite to use.
- On OSX:
* Extract additional include and link directories
from the CFLAGS and LDFLAGS, if the user has
bothered to specify them we might as wel use them.
* Add '-Wl,-search_paths_first' to the extra_link_args
for readline and sqlite. This makes it possible to
use a static library to override the system provided
dynamic library.
........
r46295 | ronald.oussoren | 2006-05-26 13:43:26 +0200 (Fri, 26 May 2006) | 6 lines
Integrate installing a framework in the 'make install'
target. Until now users had to use 'make frameworkinstall'
to install python when it is configured with '--enable-framework'.
This tends to confuse users that don't hunt for readme files
hidden in platform specific directories :-)
........
r46297 | fredrik.lundh | 2006-05-26 13:54:04 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: added PY_LOCAL_AGGRESSIVE macro to enable "aggressive"
LOCAL inlining; also added some missing whitespace
........
r46298 | andrew.kuchling | 2006-05-26 14:01:44 +0200 (Fri, 26 May 2006) | 1 line
Typo fixes
........
r46299 | fredrik.lundh | 2006-05-26 14:01:49 +0200 (Fri, 26 May 2006) | 4 lines
Py_LOCAL shouldn't be used for data; it works for some .NET 2003 compilers,
but Trent's copy thinks that it's an anachronism...
........
r46300 | martin.blais | 2006-05-26 14:03:27 +0200 (Fri, 26 May 2006) | 12 lines
Support for buffer protocol for socket and struct.
* Added socket.recv_buf() and socket.recvfrom_buf() methods, that use the buffer
protocol (send and sendto already did).
* Added struct.pack_to(), that is the corresponding buffer compatible method to
unpack_from().
* Fixed minor typos in arraymodule.
........
r46302 | ronald.oussoren | 2006-05-26 14:23:20 +0200 (Fri, 26 May 2006) | 6 lines
- Remove previous version of the binary distribution script for OSX
- Some small bugfixes for the IDLE.app wrapper
- Tweaks to build-installer to ensure that python gets build in the right way,
including sqlite3.
- Updated readme files
........
r46305 | tim.peters | 2006-05-26 14:26:21 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46307 | andrew.dalke | 2006-05-26 14:28:15 +0200 (Fri, 26 May 2006) | 7 lines
I like tests.
The new split functions use a preallocated list. Added tests which exceed
the preallocation size, to exercise list appends/resizes.
Also added more edge case tests.
........
r46308 | andrew.dalke | 2006-05-26 14:31:00 +0200 (Fri, 26 May 2006) | 2 lines
Test cases for off-by-one errors in string split with multicharacter pattern.
........
r46309 | tim.peters | 2006-05-26 14:31:20 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46313 | andrew.kuchling | 2006-05-26 14:39:48 +0200 (Fri, 26 May 2006) | 1 line
Add str.partition()
........
r46314 | bob.ippolito | 2006-05-26 14:52:53 +0200 (Fri, 26 May 2006) | 1 line
quick hack to fix busted binhex test
........
r46316 | andrew.dalke | 2006-05-26 15:05:55 +0200 (Fri, 26 May 2006) | 2 lines
Added more rstrip tests, including for prealloc'ed arrays
........
r46320 | bob.ippolito | 2006-05-26 15:15:44 +0200 (Fri, 26 May 2006) | 1 line
fix #1229380 No struct.pack exception for some out of range integers
........
r46325 | tim.peters | 2006-05-26 15:39:17 +0200 (Fri, 26 May 2006) | 2 lines
Use open() to open files (was using file()).
........
r46327 | andrew.dalke | 2006-05-26 16:00:45 +0200 (Fri, 26 May 2006) | 37 lines
Changes to string.split/rsplit on whitespace to preallocate space in the
results list.
Originally it allocated 0 items and used the list growth during append. Now
it preallocates 12 items so the first few appends don't need list reallocs.
("Here are some words ."*2).split(None, 1) is 7% faster
("Here are some words ."*2).split() is is 15% faster
(Your milage may vary, see dealership for details.)
File parsing like this
for line in f:
count += len(line.split())
is also about 15% faster. There is a slowdown of about 3% for large
strings because of the additional overhead of checking if the append is
to a preallocated region of the list or not. This will be the rare case.
It could be improved with special case code but we decided it was not
useful enough.
There is a cost of 12*sizeof(PyObject *) bytes per list. For the normal
case of file parsing this is not a problem because of the lists have
a short lifetime. We have not come up with cases where this is a problem
in real life.
I chose 12 because human text averages about 11 words per line in books,
one of my data sets averages 6.2 words with a final peak at 11 words per
line, and I work with a tab delimited data set with 8 tabs per line (or
9 words per line). 12 encompasses all of these.
Also changed the last rstrip code to append then reverse, rather than
doing insert(0). The strip() and rstrip() times are now comparable.
........
r46328 | tim.peters | 2006-05-26 16:02:05 +0200 (Fri, 26 May 2006) | 5 lines
Explicitly close files. I'm trying to stop the frequent spurious test_tarfile
failures on Windows buildbots, but it's hard to know how since the regrtest
failure output is useless here, and it never fails when a buildbot slave runs
test_tarfile the second time in verbose mode.
........
r46329 | andrew.kuchling | 2006-05-26 16:03:41 +0200 (Fri, 26 May 2006) | 1 line
Add buffer support for struct, socket
........
r46330 | andrew.kuchling | 2006-05-26 16:04:19 +0200 (Fri, 26 May 2006) | 1 line
Typo fix
........
r46331 | bob.ippolito | 2006-05-26 16:07:23 +0200 (Fri, 26 May 2006) | 1 line
Fix distutils so that libffi will cross-compile between darwin/x86 and darwin/ppc
........
r46333 | bob.ippolito | 2006-05-26 16:23:21 +0200 (Fri, 26 May 2006) | 1 line
Fix _struct typo that broke some 64-bit platforms
........
r46335 | bob.ippolito | 2006-05-26 16:29:35 +0200 (Fri, 26 May 2006) | 1 line
Enable PY_USE_INT_WHEN_POSSIBLE in struct
........
r46343 | andrew.dalke | 2006-05-26 17:21:01 +0200 (Fri, 26 May 2006) | 2 lines
Eeked out another 3% or so performance in split whitespace by cleaning up the algorithm.
........
r46352 | andrew.dalke | 2006-05-26 18:22:52 +0200 (Fri, 26 May 2006) | 3 lines
Test for more edge strip cases; leading and trailing separator gets removed
even with strip(..., 0)
........
r46354 | bob.ippolito | 2006-05-26 18:23:28 +0200 (Fri, 26 May 2006) | 1 line
fix signed/unsigned mismatch in struct
........
r46355 | steve.holden | 2006-05-26 18:27:59 +0200 (Fri, 26 May 2006) | 5 lines
Add -t option to allow easy test selection.
Action verbose option correctly.
Tweak operation counts. Add empty and new instances tests.
Enable comparisons across different warp factors. Change version.
........
r46356 | fredrik.lundh | 2006-05-26 18:32:42 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: use Py_LOCAL on a few more locals in stringobject.c
........
r46357 | thomas.heller | 2006-05-26 18:42:44 +0200 (Fri, 26 May 2006) | 4 lines
For now, I gave up with automatic conversion of reST to Python-latex,
so I'm writing this in latex now.
Skeleton for the ctypes reference.
........
r46358 | tim.peters | 2006-05-26 18:49:28 +0200 (Fri, 26 May 2006) | 3 lines
Repair Windows compiler warnings about mixing
signed and unsigned integral types in comparisons.
........
r46359 | tim.peters | 2006-05-26 18:52:04 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46360 | tim.peters | 2006-05-26 18:53:04 +0200 (Fri, 26 May 2006) | 2 lines
Add missing svn:eol-style property to text files.
........
r46362 | fredrik.lundh | 2006-05-26 19:04:58 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: stringlib refactoring (in progress)
........
r46363 | thomas.heller | 2006-05-26 19:18:33 +0200 (Fri, 26 May 2006) | 1 line
Write some docs.
........
r46364 | fredrik.lundh | 2006-05-26 19:22:38 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: stringlib refactoring (in progress)
........
r46366 | fredrik.lundh | 2006-05-26 19:26:39 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: cleanup
........
r46367 | fredrik.lundh | 2006-05-26 19:31:41 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: remove remaining USE_FAST macros; if fastsearch was
broken, someone would have noticed by now ;-)
........
r46368 | steve.holden | 2006-05-26 19:41:32 +0200 (Fri, 26 May 2006) | 5 lines
Use minimum calibration time rather than avergae to avoid
the illusion of negative run times. Halt with an error if
run times go below 10 ms, indicating that results will be
unreliable.
........
r46370 | thomas.heller | 2006-05-26 19:47:40 +0200 (Fri, 26 May 2006) | 2 lines
Reordered, and wrote more docs.
........
r46372 | georg.brandl | 2006-05-26 20:03:31 +0200 (Fri, 26 May 2006) | 9 lines
Need for speed: Patch #921466 : sys.path_importer_cache is now used to cache valid and
invalid file paths for the built-in import machinery which leads to
fewer open calls on startup.
Also fix issue with PEP 302 style import hooks which lead to more open()
calls than necessary.
........
r46373 | fredrik.lundh | 2006-05-26 20:05:34 +0200 (Fri, 26 May 2006) | 3 lines
removed unnecessary include
........
r46377 | fredrik.lundh | 2006-05-26 20:15:38 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: added rpartition implementation
........
r46380 | fredrik.lundh | 2006-05-26 20:24:15 +0200 (Fri, 26 May 2006) | 5 lines
needspeed: rpartition documentation, tests, and a bug fixes.
feel free to add more tests and improve the documentation.
........
r46381 | steve.holden | 2006-05-26 20:26:21 +0200 (Fri, 26 May 2006) | 4 lines
Revert tests to MAL's original round sizes to retiain comparability
from long ago and far away. Stop calling this pybench 1.4 because it
isn't. Remove the empty test, which was a bad idea.
........
r46387 | andrew.kuchling | 2006-05-26 20:41:18 +0200 (Fri, 26 May 2006) | 1 line
Add rpartition() and path caching
........
r46388 | andrew.dalke | 2006-05-26 21:02:09 +0200 (Fri, 26 May 2006) | 10 lines
substring split now uses /F's fast string matching algorithm.
(If compiled without FAST search support, changed the pre-memcmp test
to check the last character as well as the first. This gave a 25%
speedup for my test case.)
Rewrote the split algorithms so they stop when maxsplit gets to 0.
Previously they did a string match first then checked if the maxsplit
was reached. The new way prevents a needless string search.
........
r46391 | brett.cannon | 2006-05-26 21:04:47 +0200 (Fri, 26 May 2006) | 2 lines
Change C spacing to 4 spaces by default to match PEP 7 for new C files.
........
r46392 | georg.brandl | 2006-05-26 21:04:47 +0200 (Fri, 26 May 2006) | 3 lines
Exception isn't the root of all exception classes anymore.
........
r46397 | fredrik.lundh | 2006-05-26 21:23:21 +0200 (Fri, 26 May 2006) | 3 lines
added rpartition method to UserString class
........
r46398 | fredrik.lundh | 2006-05-26 21:24:53 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: stringlib refactoring, continued. added count and
find helpers; updated unicodeobject to use stringlib_count
........
r46400 | fredrik.lundh | 2006-05-26 21:29:05 +0200 (Fri, 26 May 2006) | 4 lines
needforspeed: stringlib refactoring: use stringlib/find for unicode
find
........
r46403 | fredrik.lundh | 2006-05-26 21:33:03 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: use a macro to fix slice indexes
........
r46404 | thomas.heller | 2006-05-26 21:43:45 +0200 (Fri, 26 May 2006) | 1 line
Write more docs.
........
r46406 | fredrik.lundh | 2006-05-26 21:48:07 +0200 (Fri, 26 May 2006) | 3 lines
needforspeed: stringlib refactoring: use stringlib/find for string find
........
r46407 | andrew.kuchling | 2006-05-26 21:51:10 +0200 (Fri, 26 May 2006) | 1 line
Comment typo
........
r46409 | georg.brandl | 2006-05-26 22:04:44 +0200 (Fri, 26 May 2006) | 3 lines
Replace Py_BuildValue("OO") by PyTuple_Pack.
........
r46411 | georg.brandl | 2006-05-26 22:14:47 +0200 (Fri, 26 May 2006) | 2 lines
Patch #1492218: document None being a constant.
........
r46415 | georg.brandl | 2006-05-26 22:22:50 +0200 (Fri, 26 May 2006) | 3 lines
Simplify calling.
........
r46416 | andrew.dalke | 2006-05-26 22:25:22 +0200 (Fri, 26 May 2006) | 4 lines
Added limits to the replace code so it does not count all of the matching
patterns in a string, only the number needed by the max limit.
........
r46417 | bob.ippolito | 2006-05-26 22:25:23 +0200 (Fri, 26 May 2006) | 1 line
enable all of the struct tests, use ssize_t, fix some whitespace
........
r46418 | tim.peters | 2006-05-26 22:56:56 +0200 (Fri, 26 May 2006) | 2 lines
Record Iceland sprint attendees.
........
r46421 | tim.peters | 2006-05-26 23:51:13 +0200 (Fri, 26 May 2006) | 2 lines
Whitespace normalization.
........
r46422 | steve.holden | 2006-05-27 00:17:54 +0200 (Sat, 27 May 2006) | 2 lines
Add Richard Tew to developers
........
r46423 | steve.holden | 2006-05-27 00:33:20 +0200 (Sat, 27 May 2006) | 2 lines
Update help text and documentaition.
........
r46424 | steve.holden | 2006-05-27 00:39:27 +0200 (Sat, 27 May 2006) | 2 lines
Blasted typos ...
........
r46425 | andrew.dalke | 2006-05-27 00:49:03 +0200 (Sat, 27 May 2006) | 2 lines
Added description of why splitlines doesn't use the prealloc strategy
........
r46426 | tim.peters | 2006-05-27 01:14:37 +0200 (Sat, 27 May 2006) | 19 lines
Patch 1145039.
set_exc_info(), reset_exc_info(): By exploiting the
likely (who knows?) invariant that when an exception's
`type` is NULL, its `value` and `traceback` are also NULL,
save some cycles in heavily-executed code.
This is a "a kronar saved is a kronar earned" patch: the
speedup isn't reliably measurable, but it obviously does
reduce the operation count in the normal (no exception
raised) path through PyEval_EvalFrameEx().
The tim-exc_sanity branch tries to push this harder, but
is still blowing up (at least in part due to pre-existing
subtle bugs that appear to have no other visible
consequences!).
Not a bugfix candidate.
........
r46429 | steve.holden | 2006-05-27 02:51:52 +0200 (Sat, 27 May 2006) | 2 lines
Reinstate new-style object tests.
........
r46430 | neal.norwitz | 2006-05-27 07:18:57 +0200 (Sat, 27 May 2006) | 1 line
Fix compiler warning (and whitespace) on Mac OS 10.4. (A lot of this code looked duplicated, I wonder if a utility function could help reduce the duplication here.)
........
r46431 | neal.norwitz | 2006-05-27 07:21:30 +0200 (Sat, 27 May 2006) | 4 lines
Fix Coverity warnings.
- Check the correct variable (str_obj, not str) for NULL
- sep_len was already verified it wasn't 0
........
r46432 | martin.v.loewis | 2006-05-27 10:36:52 +0200 (Sat, 27 May 2006) | 2 lines
Patch 1494554: Update numeric properties to Unicode 4.1.
........
r46433 | martin.v.loewis | 2006-05-27 10:54:29 +0200 (Sat, 27 May 2006) | 2 lines
Explain why 'consumed' is initialized.
........
r46436 | fredrik.lundh | 2006-05-27 12:05:10 +0200 (Sat, 27 May 2006) | 3 lines
needforspeed: more stringlib refactoring
........
r46438 | fredrik.lundh | 2006-05-27 12:39:48 +0200 (Sat, 27 May 2006) | 5 lines
needforspeed: backed out the Py_LOCAL-isation of ceval; the massive in-
lining killed performance on certain Intel boxes, and the "aggressive"
macro itself gives most of the benefits on others.
........
r46439 | andrew.dalke | 2006-05-27 13:04:36 +0200 (Sat, 27 May 2006) | 2 lines
fixed typo
........
r46440 | martin.v.loewis | 2006-05-27 13:07:49 +0200 (Sat, 27 May 2006) | 2 lines
Revert bogus change committed in 46432 to this file.
........
r46444 | andrew.kuchling | 2006-05-27 13:26:33 +0200 (Sat, 27 May 2006) | 1 line
Add Py_LOCAL macros
........
r46450 | bob.ippolito | 2006-05-27 13:47:12 +0200 (Sat, 27 May 2006) | 1 line
Remove the range checking and int usage #defines from _struct and strip out the now-dead code
........
r46454 | bob.ippolito | 2006-05-27 14:11:36 +0200 (Sat, 27 May 2006) | 1 line
Fix up struct docstrings, add struct.pack_to function for symmetry
........
r46456 | richard.jones | 2006-05-27 14:29:24 +0200 (Sat, 27 May 2006) | 2 lines
Conversion of exceptions over from faked-up classes to new-style C types.
........
r46457 | georg.brandl | 2006-05-27 14:30:25 +0200 (Sat, 27 May 2006) | 3 lines
Add news item for new-style exception class branch merge.
........
r46458 | tim.peters | 2006-05-27 14:36:53 +0200 (Sat, 27 May 2006) | 3 lines
More random thrashing trying to understand spurious
Windows failures. Who's keeping a bz2 file open?
........
r46460 | andrew.kuchling | 2006-05-27 15:44:37 +0200 (Sat, 27 May 2006) | 1 line
Mention new-style exceptions
........
r46461 | richard.jones | 2006-05-27 15:50:42 +0200 (Sat, 27 May 2006) | 1 line
credit where credit is due
........
r46462 | georg.brandl | 2006-05-27 16:02:03 +0200 (Sat, 27 May 2006) | 3 lines
Always close BZ2Proxy object. Remove unnecessary struct usage.
........
r46463 | tim.peters | 2006-05-27 16:13:13 +0200 (Sat, 27 May 2006) | 2 lines
The cheery optimism of old age.
........
r46464 | andrew.dalke | 2006-05-27 16:16:40 +0200 (Sat, 27 May 2006) | 2 lines
cleanup - removed trailing whitespace
........
r46465 | georg.brandl | 2006-05-27 16:41:55 +0200 (Sat, 27 May 2006) | 3 lines
Remove spurious semicolons after macro invocations.
........
r46468 | fredrik.lundh | 2006-05-27 16:58:20 +0200 (Sat, 27 May 2006) | 4 lines
needforspeed: replace improvements, changed to Py_LOCAL_INLINE
where appropriate
........
r46469 | fredrik.lundh | 2006-05-27 17:20:22 +0200 (Sat, 27 May 2006) | 4 lines
needforspeed: stringlib refactoring: changed find_obj to find_slice,
to enable use from stringobject
........
r46470 | fredrik.lundh | 2006-05-27 17:26:19 +0200 (Sat, 27 May 2006) | 3 lines
needforspeed: stringlib refactoring: use find_slice for stringobject
........
r46472 | kristjan.jonsson | 2006-05-27 17:41:31 +0200 (Sat, 27 May 2006) | 1 line
Add a PCBuild8 build directory for building with Visual Studio .NET 2005. Contains a special project to perform profile guided optimizations on the pythoncore.dll, by instrumenting and running pybench.py
........
r46473 | jack.diederich | 2006-05-27 17:44:34 +0200 (Sat, 27 May 2006) | 3 lines
needforspeed: use PyObject_MALLOC instead of system malloc for small
allocations. Use PyMem_MALLOC for larger (1k+) chunks. 1%-2% speedup.
........
r46474 | bob.ippolito | 2006-05-27 17:53:49 +0200 (Sat, 27 May 2006) | 1 line
fix struct regression on 64-bit platforms
........
r46475 | richard.jones | 2006-05-27 18:07:28 +0200 (Sat, 27 May 2006) | 1 line
doc string additions and tweaks
........
r46477 | richard.jones | 2006-05-27 18:15:11 +0200 (Sat, 27 May 2006) | 1 line
move semicolons
........
r46478 | george.yoshida | 2006-05-27 18:32:44 +0200 (Sat, 27 May 2006) | 2 lines
minor markup nits
........
r46488 | george.yoshida | 2006-05-27 18:51:43 +0200 (Sat, 27 May 2006) | 3 lines
End of Ch.3 is now about "with statement".
Avoid obsolescence by directly referring to the section.
........
r46489 | george.yoshida | 2006-05-27 19:09:17 +0200 (Sat, 27 May 2006) | 2 lines
fix typo
........
2006-05-27 19:21:47 +00:00
|
|
|
|
2012-06-24 04:33:36 -07:00
|
|
|
times_result_desc.name = MODNAME ".times_result";
|
2019-11-05 07:16:14 -08:00
|
|
|
PyObject *TimesResultType = (PyObject *)PyStructSequence_NewType(×_result_desc);
|
2018-11-13 04:09:31 -08:00
|
|
|
if (TimesResultType == NULL) {
|
2020-05-10 11:05:29 +02:00
|
|
|
return -1;
|
2018-11-13 04:09:31 -08:00
|
|
|
}
|
2019-11-05 07:16:14 -08:00
|
|
|
Py_INCREF(TimesResultType);
|
|
|
|
|
PyModule_AddObject(m, "times_result", TimesResultType);
|
2020-05-14 18:05:58 +02:00
|
|
|
state->TimesResultType = TimesResultType;
|
2012-06-24 04:33:36 -07:00
|
|
|
|
2019-11-05 07:16:14 -08:00
|
|
|
PyTypeObject *UnameResultType = PyStructSequence_NewType(&uname_result_desc);
|
2018-11-13 04:09:31 -08:00
|
|
|
if (UnameResultType == NULL) {
|
2020-05-10 11:05:29 +02:00
|
|
|
return -1;
|
2018-11-13 04:09:31 -08:00
|
|
|
}
|
2019-11-05 07:16:14 -08:00
|
|
|
Py_INCREF(UnameResultType);
|
2018-11-13 04:09:31 -08:00
|
|
|
PyModule_AddObject(m, "uname_result", (PyObject *)UnameResultType);
|
2020-05-14 18:05:58 +02:00
|
|
|
state->UnameResultType = (PyObject *)UnameResultType;
|
2012-06-24 04:33:36 -07:00
|
|
|
|
2020-05-14 18:05:58 +02:00
|
|
|
if ((state->billion = PyLong_FromLong(1000000000)) == NULL)
|
2020-05-10 11:05:29 +02:00
|
|
|
return -1;
|
2019-11-05 07:16:14 -08:00
|
|
|
#if defined(HAVE_WAIT3) || defined(HAVE_WAIT4)
|
2020-05-14 18:05:58 +02:00
|
|
|
state->struct_rusage = PyUnicode_InternFromString("struct_rusage");
|
|
|
|
|
if (state->struct_rusage == NULL)
|
2020-05-10 11:05:29 +02:00
|
|
|
return -1;
|
2019-11-05 07:16:14 -08:00
|
|
|
#endif
|
2020-05-14 18:05:58 +02:00
|
|
|
state->st_mode = PyUnicode_InternFromString("st_mode");
|
|
|
|
|
if (state->st_mode == NULL)
|
2020-05-10 11:05:29 +02:00
|
|
|
return -1;
|
2012-04-19 15:07:49 -07:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
/* suppress "function not used" warnings */
|
|
|
|
|
{
|
|
|
|
|
int ignored;
|
|
|
|
|
fd_specified("", -1);
|
|
|
|
|
follow_symlinks_specified("", 1);
|
|
|
|
|
dir_fd_and_follow_symlinks_invalid("chmod", DEFAULT_DIR_FD, 1);
|
|
|
|
|
dir_fd_converter(Py_None, &ignored);
|
|
|
|
|
dir_fd_unavailable(Py_None, &ignored);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* provide list of locally available functions
|
|
|
|
|
* so os.py can populate support_* lists
|
|
|
|
|
*/
|
2020-05-14 18:05:58 +02:00
|
|
|
PyObject *list = PyList_New(0);
|
|
|
|
|
if (!list) {
|
2020-05-10 11:05:29 +02:00
|
|
|
return -1;
|
2020-05-14 18:05:58 +02:00
|
|
|
}
|
2020-11-22 11:18:40 +01:00
|
|
|
for (const struct have_function *trace = have_functions; trace->label; trace++) {
|
|
|
|
|
PyObject *unicode;
|
|
|
|
|
if (trace->probe && !trace->probe()) continue;
|
|
|
|
|
unicode = PyUnicode_DecodeASCII(trace->label, strlen(trace->label), NULL);
|
2012-06-22 16:30:09 -07:00
|
|
|
if (!unicode)
|
2020-05-10 11:05:29 +02:00
|
|
|
return -1;
|
2012-06-22 16:30:09 -07:00
|
|
|
if (PyList_Append(list, unicode))
|
2020-05-10 11:05:29 +02:00
|
|
|
return -1;
|
2012-06-22 16:30:09 -07:00
|
|
|
Py_DECREF(unicode);
|
|
|
|
|
}
|
2020-11-22 11:18:40 +01:00
|
|
|
|
2012-06-22 16:30:09 -07:00
|
|
|
PyModule_AddObject(m, "_have_functions", list);
|
2016-08-15 14:40:38 -04:00
|
|
|
|
2020-05-10 11:05:29 +02:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static PyModuleDef_Slot posixmodile_slots[] = {
|
|
|
|
|
{Py_mod_exec, posixmodule_exec},
|
|
|
|
|
{0, NULL}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static struct PyModuleDef posixmodule = {
|
|
|
|
|
PyModuleDef_HEAD_INIT,
|
|
|
|
|
.m_name = MODNAME,
|
|
|
|
|
.m_doc = posix__doc__,
|
|
|
|
|
.m_size = sizeof(_posixstate),
|
|
|
|
|
.m_methods = posix_methods,
|
|
|
|
|
.m_slots = posixmodile_slots,
|
|
|
|
|
.m_traverse = _posix_traverse,
|
|
|
|
|
.m_clear = _posix_clear,
|
|
|
|
|
.m_free = _posix_free,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
PyMODINIT_FUNC
|
|
|
|
|
INITFUNC(void)
|
|
|
|
|
{
|
|
|
|
|
return PyModuleDef_Init(&posixmodule);
|
1990-10-14 12:07:46 +00:00
|
|
|
}
|
2006-04-21 10:40:58 +00:00
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|