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
d4b93e21
Kaydet (Commit)
d4b93e21
authored
Agu 14, 2017
tarafından
Коренберг Марк
Kaydeden (comit)
larryhastings
Agu 14, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-31106: Fix handling of erros in posix_fallocate() and posix_fadvise() (#3000) (#3000)
üst
48d9823a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
10 deletions
+39
-10
test_posix.py
Lib/test/test_posix.py
+19
-0
posixmodule.c
Modules/posixmodule.c
+20
-10
No files found.
Lib/test/test_posix.py
Dosyayı görüntüle @
d4b93e21
...
@@ -298,6 +298,16 @@ class PosixTester(unittest.TestCase):
...
@@ -298,6 +298,16 @@ class PosixTester(unittest.TestCase):
finally
:
finally
:
os
.
close
(
fd
)
os
.
close
(
fd
)
# issue31106 - posix_fallocate() does not set error in errno.
@unittest.skipUnless
(
hasattr
(
posix
,
'posix_fallocate'
),
"test needs posix.posix_fallocate()"
)
def
test_posix_fallocate_errno
(
self
):
try
:
posix
.
posix_fallocate
(
-
42
,
0
,
10
)
except
OSError
as
inst
:
if
inst
.
errno
!=
errno
.
EBADF
:
raise
@unittest.skipUnless
(
hasattr
(
posix
,
'posix_fadvise'
),
@unittest.skipUnless
(
hasattr
(
posix
,
'posix_fadvise'
),
"test needs posix.posix_fadvise()"
)
"test needs posix.posix_fadvise()"
)
def
test_posix_fadvise
(
self
):
def
test_posix_fadvise
(
self
):
...
@@ -307,6 +317,15 @@ class PosixTester(unittest.TestCase):
...
@@ -307,6 +317,15 @@ class PosixTester(unittest.TestCase):
finally
:
finally
:
os
.
close
(
fd
)
os
.
close
(
fd
)
@unittest.skipUnless
(
hasattr
(
posix
,
'posix_fadvise'
),
"test needs posix.posix_fadvise()"
)
def
test_posix_fadvise_errno
(
self
):
try
:
posix
.
posix_fadvise
(
-
42
,
0
,
0
,
posix
.
POSIX_FADV_WILLNEED
)
except
OSError
as
inst
:
if
inst
.
errno
!=
errno
.
EBADF
:
raise
@unittest.skipUnless
(
os
.
utime
in
os
.
supports_fd
,
"test needs fd support in os.utime"
)
@unittest.skipUnless
(
os
.
utime
in
os
.
supports_fd
,
"test needs fd support in os.utime"
)
def
test_utime_with_fd
(
self
):
def
test_utime_with_fd
(
self
):
now
=
time
.
time
()
now
=
time
.
time
()
...
...
Modules/posixmodule.c
Dosyayı görüntüle @
d4b93e21
...
@@ -8917,11 +8917,16 @@ os_posix_fallocate_impl(PyObject *module, int fd, Py_off_t offset,
...
@@ -8917,11 +8917,16 @@ os_posix_fallocate_impl(PyObject *module, int fd, Py_off_t offset,
Py_BEGIN_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS
result
=
posix_fallocate
(
fd
,
offset
,
length
);
result
=
posix_fallocate
(
fd
,
offset
,
length
);
Py_END_ALLOW_THREADS
Py_END_ALLOW_THREADS
}
while
(
result
!=
0
&&
errno
==
EINTR
&&
}
while
(
result
==
EINTR
&&
!
(
async_err
=
PyErr_CheckSignals
()));
!
(
async_err
=
PyErr_CheckSignals
()));
if
(
result
!=
0
)
if
(
result
==
0
)
return
(
!
async_err
)
?
posix_error
()
:
NULL
;
Py_RETURN_NONE
;
Py_RETURN_NONE
;
if
(
async_err
)
return
NULL
;
errno
=
result
;
return
posix_error
();
}
}
#endif
/* HAVE_POSIX_FALLOCATE) && !POSIX_FADVISE_AIX_BUG */
#endif
/* HAVE_POSIX_FALLOCATE) && !POSIX_FADVISE_AIX_BUG */
...
@@ -8959,11 +8964,16 @@ os_posix_fadvise_impl(PyObject *module, int fd, Py_off_t offset,
...
@@ -8959,11 +8964,16 @@ os_posix_fadvise_impl(PyObject *module, int fd, Py_off_t offset,
Py_BEGIN_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS
result
=
posix_fadvise
(
fd
,
offset
,
length
,
advice
);
result
=
posix_fadvise
(
fd
,
offset
,
length
,
advice
);
Py_END_ALLOW_THREADS
Py_END_ALLOW_THREADS
}
while
(
result
!=
0
&&
errno
==
EINTR
&&
}
while
(
result
==
EINTR
&&
!
(
async_err
=
PyErr_CheckSignals
()));
!
(
async_err
=
PyErr_CheckSignals
()));
if
(
result
!=
0
)
if
(
result
==
0
)
return
(
!
async_err
)
?
posix_error
()
:
NULL
;
Py_RETURN_NONE
;
Py_RETURN_NONE
;
if
(
async_err
)
return
NULL
;
errno
=
result
;
return
posix_error
();
}
}
#endif
/* HAVE_POSIX_FADVISE && !POSIX_FADVISE_AIX_BUG */
#endif
/* HAVE_POSIX_FADVISE && !POSIX_FADVISE_AIX_BUG */
...
...
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