python/python-2.7.4-canonicalize2.patch
Jan Matejek 58c938cba7 Accepting request 176926 from home:saschpe:branches:devel:languages:python:Factory
- Update to version 2.7.5:
  + Issue #15535: Fixed regression in the pickling of named tuples by
    removing the __dict__ property introduced in 2.7.4.
  + Issue #17857: Prevent build failures with pre-3.5.0 versions of sqlite3,
    such as was shipped with Centos 5 and Mac OS X 10.4.
  + Issue #17703: Fix a regression where an illegal use of Py_DECREF() after
    interpreter finalization can cause a crash.
  + Issue #16447: Fixed potential segmentation fault when setting __name__ on a
    class.
  + Issue #17610: Don't rely on non-standard behavior of the C qsort() function. 12 
  See http://hg.python.org/cpython/file/ab05e7dd2788/Misc/NEWS for more
- Drop upstreamed patches:
  + python-2.7rc2-configure.patch
  + python-2.7.3-multiprocessing-join.patch
  + ctypes-libffi-aarch64.patch
  + python-2.7.3-fix-dbm-64bit-bigendian.patch
  + python-test_structmembers.patch
- Rebased other patches

- Update to version 2.7.5:
  + Issue #15535: Fixed regression in the pickling of named tuples by
    removing the __dict__ property introduced in 2.7.4.
  + Issue #17857: Prevent build failures with pre-3.5.0 versions of sqlite3,
    such as was shipped with Centos 5 and Mac OS X 10.4.
  + Issue #17703: Fix a regression where an illegal use of Py_DECREF() after
    interpreter finalization can cause a crash.
  + Issue #16447: Fixed potential segmentation fault when setting __name__ on a
    class.
  + Issue #17610: Don't rely on non-standard behavior of the C qsort() function. 12 
  See http://hg.python.org/cpython/file/ab05e7dd2788/Misc/NEWS for more

OBS-URL: https://build.opensuse.org/request/show/176926
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python?expand=0&rev=141
2013-06-03 10:24:54 +00:00

80 lines
2.6 KiB
Diff

--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1620,7 +1620,20 @@
char *p = NULL;
Py_ssize_t n = 0;
PyObject *a;
-#ifdef HAVE_READLINK
+#ifdef HAVE_CANONICALIZE_FILE_NAME
+ int errnum;
+
+ if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0) {
+ argv0 = canonicalize_file_name(argv0);
+ if (argv0 == NULL) argv0 = strdup(argv[0]);
+ }
+#elif defined(HAVE_REALPATH)
+ if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0) {
+ if (realpath(argv0, fullpath)) {
+ argv0 = fullpath;
+ }
+ }
+#elif defined(HAVE_READLINK)
char link[MAXPATHLEN+1];
char argv0copy[2*MAXPATHLEN+1];
int nr = 0;
@@ -1647,7 +1660,8 @@
}
}
}
-#endif /* HAVE_READLINK */
+#endif /* resolve method selection */
+
#if SEP == '\\' /* Special case for MS filename syntax */
if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0) {
char *q;
@@ -1676,11 +1690,6 @@
}
#else /* All other filename syntaxes */
if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0) {
-#if defined(HAVE_REALPATH)
- if (realpath(argv0, fullpath)) {
- argv0 = fullpath;
- }
-#endif
p = strrchr(argv0, SEP);
}
if (p != NULL) {
@@ -1698,6 +1707,9 @@
a = PyString_FromStringAndSize(argv0, n);
if (a == NULL)
Py_FatalError("no mem for sys.path insertion");
+#ifdef HAVE_CANONICALIZE_FILE_NAME
+ if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0) free(argv0);
+#endif /* HAVE_CANONICALIZE_FILE_NAME */
if (PyList_Insert(path, 0, a) < 0)
Py_FatalError("sys.path.insert(0) failed");
Py_DECREF(a);
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -106,6 +106,9 @@
/* Define to 1 if you have the 'chflags' function. */
#undef HAVE_CHFLAGS
+/* Define to 1 if you have the `canonicalize_file_name' function. */
+#undef HAVE_CANONICALIZE_FILE_NAME
+
/* Define to 1 if you have the `chown' function. */
#undef HAVE_CHOWN
--- a/configure.ac
+++ b/configure.ac
@@ -2913,7 +2913,7 @@
getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \
initgroups kill killpg lchmod lchown lstat mkfifo mknod mktime \
mremap nice pathconf pause plock poll pthread_init \
- putenv readlink realpath \
+ putenv readlink realpath canonicalize_file_name \
select sem_open sem_timedwait sem_getvalue sem_unlink setegid seteuid \
setgid \
setlocale setregid setreuid setsid setpgid setpgrp setuid setvbuf snprintf \