# DP: Do not add /usr/lib/pythonXY.zip on sys.path. Index: python2.6-2.6.5+20100521/Modules/getpath.c =================================================================== --- python2.6-2.6.5+20100521.orig/Modules/getpath.c 2010-05-21 15:52:49.187710173 +0200 +++ python2.6-2.6.5+20100521/Modules/getpath.c 2010-05-21 15:52:49.191736733 +0200 @@ -376,7 +376,9 @@ char *path = getenv("PATH"); char *prog = Py_GetProgramName(); char argv0_path[MAXPATHLEN+1]; +#ifdef WITH_ZIP_PATH char zip_path[MAXPATHLEN+1]; +#endif int pfound, efound; /* 1 if found; -1 if found build directory */ char *buf; size_t bufsz; @@ -516,6 +518,7 @@ else reduce(prefix); +#ifdef WITH_ZIP_PATH strncpy(zip_path, prefix, MAXPATHLEN); zip_path[MAXPATHLEN] = '\0'; if (pfound > 0) { /* Use the reduced prefix returned by Py_GetPrefix() */ @@ -528,6 +531,7 @@ bufsz = strlen(zip_path); /* Replace "00" with version */ zip_path[bufsz - 6] = VERSION[0]; zip_path[bufsz - 5] = VERSION[2]; +#endif if (!(efound = search_for_exec_prefix(argv0_path, home))) { if (!Py_FrozenFlag) @@ -567,7 +571,9 @@ defpath = delim + 1; } +#ifdef WITH_ZIP_PATH bufsz += strlen(zip_path) + 1; +#endif bufsz += strlen(exec_prefix) + 1; /* This is the only malloc call in this file */ @@ -588,9 +594,11 @@ else buf[0] = '\0'; +#ifdef WITH_ZIP_PATH /* Next is the default zip path */ strcat(buf, zip_path); strcat(buf, delimiter); +#endif /* Next goes merge of compile-time $PYTHONPATH with * dynamically located prefix.