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
51ffac6d
Kaydet (Commit)
51ffac6d
authored
Haz 11, 2004
tarafından
Skip Montanaro
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
dump HAVE_FOPENRF stuff - obsolete
üst
a5616d22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
26 deletions
+19
-26
fileobject.c
Objects/fileobject.c
+19
-26
No files found.
Objects/fileobject.c
Dosyayı görüntüle @
51ffac6d
...
...
@@ -151,37 +151,30 @@ open_the_file(PyFileObject *f, char *name, char *mode)
return
NULL
;
}
errno
=
0
;
#ifdef HAVE_FOPENRF
if
(
*
mode
==
'*'
)
{
FILE
*
fopenRF
();
f
->
f_fp
=
fopenRF
(
name
,
mode
+
1
);
}
else
#endif
{
if
(
strcmp
(
mode
,
"U"
)
==
0
||
strcmp
(
mode
,
"rU"
)
==
0
)
mode
=
"rb"
;
if
(
strcmp
(
mode
,
"U"
)
==
0
||
strcmp
(
mode
,
"rU"
)
==
0
)
mode
=
"rb"
;
#ifdef MS_WINDOWS
if
(
PyUnicode_Check
(
f
->
f_name
))
{
PyObject
*
wmode
;
wmode
=
PyUnicode_DecodeASCII
(
mode
,
strlen
(
mode
),
NULL
);
if
(
f
->
f_name
&&
wmode
)
{
Py_BEGIN_ALLOW_THREADS
/* PyUnicode_AS_UNICODE OK without thread
lock as it is a simple dereference. */
f
->
f_fp
=
_wfopen
(
PyUnicode_AS_UNICODE
(
f
->
f_name
),
PyUnicode_AS_UNICODE
(
wmode
));
Py_END_ALLOW_THREADS
}
Py_XDECREF
(
wmode
);
}
#endif
if
(
NULL
==
f
->
f_fp
&&
NULL
!=
name
)
{
if
(
PyUnicode_Check
(
f
->
f_name
))
{
PyObject
*
wmode
;
wmode
=
PyUnicode_DecodeASCII
(
mode
,
strlen
(
mode
),
NULL
);
if
(
f
->
f_name
&&
wmode
)
{
Py_BEGIN_ALLOW_THREADS
f
->
f_fp
=
fopen
(
name
,
mode
);
/* PyUnicode_AS_UNICODE OK without thread
lock as it is a simple dereference. */
f
->
f_fp
=
_wfopen
(
PyUnicode_AS_UNICODE
(
f
->
f_name
),
PyUnicode_AS_UNICODE
(
wmode
));
Py_END_ALLOW_THREADS
}
Py_XDECREF
(
wmode
);
}
#endif
if
(
NULL
==
f
->
f_fp
&&
NULL
!=
name
)
{
Py_BEGIN_ALLOW_THREADS
f
->
f_fp
=
fopen
(
name
,
mode
);
Py_END_ALLOW_THREADS
}
if
(
f
->
f_fp
==
NULL
)
{
#ifdef _MSC_VER
/* MSVC 6 (Microsoft) leaves errno at 0 for bad mode strings,
...
...
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