]> granicus.if.org Git - python/commitdiff
Demonstrate and fix [ 783882 ] os.lstat crashes with Unicode filename.
authorMark Hammond <mhammond@skippinet.com.au>
Wed, 6 Aug 2003 02:46:58 +0000 (02:46 +0000)
committerMark Hammond <mhammond@skippinet.com.au>
Wed, 6 Aug 2003 02:46:58 +0000 (02:46 +0000)
Will also check in on the 2.3 branch.

Lib/test/test_unicode_file.py
Modules/posixmodule.c

index 23fe1f4d03b21dbae415f12e88a9b43286336aee..b8b1848f9c65f8741e725729dd2e1137ace73455 100644 (file)
@@ -25,6 +25,8 @@ f.close()
 # Test stat and chmod
 if os.stat(TESTFN_ENCODED) != os.stat(TESTFN_UNICODE):
     print "os.stat() did not agree on the 2 filenames"
+if os.lstat(TESTFN_ENCODED) != os.lstat(TESTFN_UNICODE):
+    print "os.lstat() did not agree on the 2 filenames"
 os.chmod(TESTFN_ENCODED, 0777)
 os.chmod(TESTFN_UNICODE, 0777)
 
index 43af76647a682fab0059ab35ff210338c789cbe7..b8bda3b5e455179e4467f7ea93e37e690c0ad905 100644 (file)
@@ -4607,7 +4607,7 @@ posix_lstat(PyObject *self, PyObject *args)
        return posix_do_stat(self, args, "et:lstat", lstat, NULL, NULL);
 #else /* !HAVE_LSTAT */
 #ifdef MS_WINDOWS
-       return posix_do_stat(self, args, "et:lstat", STAT, "u:lstat", _wstati64);
+       return posix_do_stat(self, args, "et:lstat", STAT, "U:lstat", _wstati64);
 #else
        return posix_do_stat(self, args, "et:lstat", STAT, NULL, NULL);
 #endif