Changeset 444
- Timestamp:
- Mon Apr 28 12:38:47 2008
- Files:
-
- branches/python2.5/buildtests/runtests.py (modified) (diff)
- branches/python2.5/mf.py (modified) (diff)
- branches/python2.5/source/common/launch.c (modified) (diff)
- branches/python2.5/doc/CHANGES.txt (modified) (diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
branches/python2.5/buildtests/runtests.py
r433 r444 63 63 build_python.write(sys.executable) 64 64 build_python.close() 65 alltests = glob.glob('test*[0-9].py') 66 if not sources: 67 tests = alltests 68 else: 69 tests = [] 70 for part in sources: 71 tests += [t for t in alltests if part in t and t not in tests] 65 72 tests.sort(key=lambda x: (len(x), x)) # test1 < test10 66 73 path = os.environ["PATH"] … … 86 93 print "#################### TEST %s FAILED #################################" % src 87 94 print counter 95 88 96 if __name__ == '__main__': 89 97 normal_tests = glob.glob('test*[0-9].py') -
branches/python2.5/mf.py
r393 r444 25 25 # but str(sys.path[n]) should yield the original string. 26 26 27 STRINGTYPE = type('') 27 try: 28 STRINGTYPE = basestring 29 except NameError: 30 STRINGTYPE = type("") 28 31 29 32 if not os.environ.has_key('PYTHONCASEOK') and sys.version_info >= (2, 1): … … 235 238 mod = None 236 239 for thing in self.path: 237 if type(thing) is STRINGTYPE:240 if isinstance(thing, STRINGTYPE): 237 240 owner = self.shadowpath.get(thing, -1) 238 241 if owner == -1: -
branches/python2.5/source/common/launch.c
r436 r444 161 161 162 162 163 int testTempPath(char *buff) 163 #ifdef WIN32 164 165 int getTempPath(char *buff) 164 166 { 165 char base[16]; 166 int n; 167 int i; 168 char *ret; 169 char prefix[16]; 170 171 GetTempPath(MAX_PATH, buff); 172 sprintf(prefix, "_MEI%d", getpid()); 173 174 // Windows does not have a race-free function to create a temporary 175 // directory. Thus, we rely on _tempnam, and simply try several times 176 // to avoid stupid race conditions. 177 for (i=0;i<5;i++) { 178 ret = _tempnam(buff, prefix); 179 if (mkdir(ret) == 0) { 180 strcpy(buff, ret); 181 strcat(buff, "\\"); 182 free(ret); 183 return 1; 184 } 185 free(ret); 186 } 187 return 0; 188 } 167 189 168 n = strlen(buff);169 if ( buff[n-1] == '/' || buff[n-1] == '\\' )170 sprintf(base, "_MEI%d", getpid());171 else172 sprintf(base, "%s_MEI%d", SEP, getpid());173 strcat(buff, base);174 #ifdef WIN32175 if (mkdir(buff) == 0) {176 190 #else 177 if (mkdir(buff, 0700) == 0) { 178 #endif 179 strcat(buff, SEP); 180 return 1; 181 } 182 return 0; 191 192 int testTempPath(char *buff) 193 { 194 strcat(buff, "/_MEIXXXXXX"); 195 if (mkdtemp(buff)) 196 { 197 strcat(buff, "/"); 198 return 1; 199 } 200 return 0; 183 201 } 184 202 185 voidgetTempPath(char *buff)203 int getTempPath(char *buff) 185 203 { 186 #ifdef WIN32187 GetTempPath(MAX_PATH, buff);188 testTempPath(buff);189 #else190 204 static const char *envname[] = { 191 205 "TMPDIR", "TEMP", "TMP", 0 … … 202 216 strcpy(buff, p); 203 217 if (testTempPath(buff)) 204 return; 218 return 1; 204 218 } 205 219 } … … 208 222 strcpy(buff, dirname[i]); 209 223 if (testTempPath(buff)) 210 return; 224 return 1; 210 224 } 211 buff[0] = '\0'; 212 #endif 225 return 0; 213 226 } 227 228 #endif 229 214 230 /* 215 231 * Set up paths required by rest of this module … … 790 806 strcpy(fnm, path); 791 807 strcat(fnm, name); 792 if (stat(fnm, &sbuf) == -1) { 793 VS("%s\n", fnm); 794 return fopen(fnm, "wb"); 795 } 796 return NULL; 808 if (stat(fnm, &sbuf) == 0) { 809 OTHERERROR("WARNING: file already exists but should not: %s\n", fnm); 810 } 811 return fopen(fnm, "wb"); 797 812 } 798 813 /* … … 810 825 811 826 if (!f_workpath) { 812 getTempPath(f_temppath); 827 if (!getTempPath(f_temppath)) 828 { 829 FATALERROR("INTERNAL ERROR: cannot create temporary directory!\n"); 830 return -1; 831 } 813 832 #ifdef WIN32 814 833 strcpy(f_temppathraw, f_temppath); … … 819 838 f_workpath = f_temppath; 820 839 } 840 821 841 out = openTarget(f_workpath, ptoc->name); 822 842 823 843 if (out == NULL) { 824 844 FATALERROR("%s could not be extracted!\n", ptoc->name); 845 return -1; 825 846 } 826 847 else { … … 1056 1077 if ( finfo.attrib & _A_SUBDIR ) 1057 1078 clear(fnm); 1058 else 1059 remove(fnm); 1079 else if (remove(fnm)) { 1080 /* HACK: Possible concurrency issue... spin a little while */ 1081 Sleep(100); 1082 remove(fnm); 1083 } 1060 1084 } 1061 1085 void clear(const char *dir) -
branches/python2.5/doc/CHANGES.txt
r424 r444 19 19 + Fix support for .py files with DOS line endings under Linux (fixes 20 20 PyOpenGL). 21 + Fix support for PIL when imported without top-level package ("import 21 + Fix support for PIL when imported without top-level package ("import 21 21 Image"). 22 22 + Fix PyXML import hook under NT (thanks to Lorenzo Mancini) 23 23 * Improve correctness of the binary cache of UPX'd/strip'd files. This 24 24 fixes problems when switching between multiple versions of the 25 same third-party library (like e.g. wxPython allows to do). 25 same third-party library (like e.g. wxPython allows to do). 25 25 + Fix a stupid bug with modules importing optparse (under Linux) (thanks 26 26 to Louai Al-Khanji). 27 + Under Python 2.4+, if an exception is raised while importing a module 27 + Under Python 2.4+, if an exception is raised while importing a module 27 27 inside a package, the module is now removed from the parent's 28 28 namespace (to match the behaviour of Python itself). … … 33 33 causing this exception to be generated: "PYZ entry 'encodings' (0j) 34 34 is not a valid code object". 35 + Fix problem when having unicode strings among path elements. 35 36 36 37 PyInstaller 1.3
