An interpreted, interactive, object-oriented programming language
CentOS Sources
2017-08-01 71084d584ff953f5463757ec6536406320560b4d
commit | author | age
6e8c2f 1 diff -up Python-2.7.3/Modules/getpath.c.fix-for-usr-move Python-2.7.3/Modules/getpath.c
CB 2 --- Python-2.7.3/Modules/getpath.c.fix-for-usr-move    2013-03-06 14:25:32.801828698 -0500
3 +++ Python-2.7.3/Modules/getpath.c    2013-03-06 15:59:30.872443168 -0500
4 @@ -510,6 +510,24 @@ calculate_path(void)
5         MAXPATHLEN bytes long.
6      */
7  
8 +    /*
9 +      Workaround for rhbz#817554, where an empty argv0_path erroneously
10 +      locates "prefix" as "/lib[64]/python2.7" due to it finding
11 +      "/lib[64]/python2.7/os.py" via the /lib -> /usr/lib symlink for
12 +      https://fedoraproject.org/wiki/Features/UsrMove
13 +    */
14 +    if (argv0_path[0] == '\0' && 0 == strcmp(prog, "cmpi_swig")) {
15 +        /*
16 +          We have an empty argv0_path, presumably because prog aka
17 +          Py_GetProgramName() was not found on $PATH.
18 +
19 +          Set argv0_path to "/usr/" so that search_for_prefix() and
20 +          search_for_exec_prefix() don't erroneously pick up
21 +          on /lib/ via the UsrMove symlink:
22 +        */
23 +        strcpy(argv0_path, "/usr/");
24 +    }
25 +
26      if (!(pfound = search_for_prefix(argv0_path, home))) {
27          if (!Py_FrozenFlag)
28              fprintf(stderr,