Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
ee587eaa
Kaydet (Commit)
ee587eaa
authored
Kas 16, 2011
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Catch PyUnicode_AS_UNICODE() errors in fileutils.c
üst
1f795171
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
fileutils.c
Python/fileutils.c
+11
-2
No files found.
Python/fileutils.c
Dosyayı görüntüle @
ee587eaa
...
@@ -244,8 +244,12 @@ _Py_stat(PyObject *path, struct stat *statbuf)
...
@@ -244,8 +244,12 @@ _Py_stat(PyObject *path, struct stat *statbuf)
#ifdef MS_WINDOWS
#ifdef MS_WINDOWS
int
err
;
int
err
;
struct
_stat
wstatbuf
;
struct
_stat
wstatbuf
;
wchar_t
*
wpath
;
err
=
_wstat
(
PyUnicode_AS_UNICODE
(
path
),
&
wstatbuf
);
wpath
=
PyUnicode_AsUnicode
(
path
);
if
(
wpath
==
NULL
)
return
-
1
;
err
=
_wstat
(
wpath
,
&
wstatbuf
);
if
(
!
err
)
if
(
!
err
)
statbuf
->
st_mode
=
wstatbuf
.
st_mode
;
statbuf
->
st_mode
=
wstatbuf
.
st_mode
;
return
err
;
return
err
;
...
@@ -297,14 +301,19 @@ FILE*
...
@@ -297,14 +301,19 @@ FILE*
_Py_fopen
(
PyObject
*
path
,
const
char
*
mode
)
_Py_fopen
(
PyObject
*
path
,
const
char
*
mode
)
{
{
#ifdef MS_WINDOWS
#ifdef MS_WINDOWS
wchar_t
*
wpath
;
wchar_t
wmode
[
10
];
wchar_t
wmode
[
10
];
int
usize
;
int
usize
;
wpath
=
PyUnicode_AsUnicode
(
path
);
if
(
wpath
==
NULL
)
return
NULL
;
usize
=
MultiByteToWideChar
(
CP_ACP
,
0
,
mode
,
-
1
,
wmode
,
sizeof
(
wmode
));
usize
=
MultiByteToWideChar
(
CP_ACP
,
0
,
mode
,
-
1
,
wmode
,
sizeof
(
wmode
));
if
(
usize
==
0
)
if
(
usize
==
0
)
return
NULL
;
return
NULL
;
return
_wfopen
(
PyUnicode_AS_UNICODE
(
path
)
,
wmode
);
return
_wfopen
(
wpath
,
wmode
);
#else
#else
FILE
*
f
;
FILE
*
f
;
PyObject
*
bytes
=
PyUnicode_EncodeFSDefault
(
path
);
PyObject
*
bytes
=
PyUnicode_EncodeFSDefault
(
path
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment