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
7af65568
Kaydet (Commit)
7af65568
authored
Ara 29, 2008
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#4764 in io.open, set IOError.filename when trying to open a directory on POSIX platforms
üst
fe231b07
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
test_fileio.py
Lib/test/test_fileio.py
+1
-0
NEWS
Misc/NEWS
+3
-0
_fileio.c
Modules/_fileio.c
+4
-4
No files found.
Lib/test/test_fileio.py
Dosyayı görüntüle @
7af65568
...
...
@@ -109,6 +109,7 @@ class AutoFileTests(unittest.TestCase):
_fileio
.
_FileIO
(
'.'
,
'r'
)
except
IOError
as
e
:
self
.
assertNotEqual
(
e
.
errno
,
0
)
self
.
assertEqual
(
e
.
filename
,
"."
)
else
:
self
.
fail
(
"Should have raised IOError"
)
...
...
Misc/NEWS
Dosyayı görüntüle @
7af65568
...
...
@@ -12,6 +12,9 @@ What's New in Python 2.7 alpha 1
Core and Builtins
-----------------
- Issue #4764: With io.open, IOError.filename is set when trying to open a
directory on POSIX systems.
- Issue #4764: IOError.filename is set when trying to open a directory on POSIX
systems.
...
...
Modules/_fileio.c
Dosyayı görüntüle @
7af65568
...
...
@@ -98,7 +98,7 @@ fileio_new(PyTypeObject *type, PyObject *args, PyObject *kews)
directories, so we need a check. */
static
int
dircheck
(
PyFileIOObject
*
self
)
dircheck
(
PyFileIOObject
*
self
,
char
*
name
)
{
#if defined(HAVE_FSTAT) && defined(S_IFDIR) && defined(EISDIR)
struct
stat
buf
;
...
...
@@ -109,8 +109,8 @@ dircheck(PyFileIOObject* self)
PyObject
*
exc
;
internal_close
(
self
);
exc
=
PyObject_CallFunction
(
PyExc_IOError
,
"(is)"
,
EISDIR
,
msg
);
exc
=
PyObject_CallFunction
(
PyExc_IOError
,
"(is
s
)"
,
EISDIR
,
msg
,
name
);
PyErr_SetObject
(
PyExc_IOError
,
exc
);
Py_XDECREF
(
exc
);
return
-
1
;
...
...
@@ -271,7 +271,7 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
#endif
goto
error
;
}
if
(
dircheck
(
self
)
<
0
)
if
(
dircheck
(
self
,
name
)
<
0
)
goto
error
;
}
...
...
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