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
5edbaf29
Kaydet (Commit)
5edbaf29
authored
Eyl 01, 2011
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #12802: the Windows error ERROR_DIRECTORY (numbered 267) is now
mapped to POSIX errno ENOTDIR (previously EINVAL).
üst
c2d9a022
a7622858
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
6 deletions
+27
-6
test_exceptions.py
Lib/test/test_exceptions.py
+8
-0
NEWS
Misc/NEWS
+3
-0
errmap.h
PC/errmap.h
+1
-0
generrmap.c
PC/generrmap.c
+15
-6
No files found.
Lib/test/test_exceptions.py
Dosyayı görüntüle @
5edbaf29
...
@@ -5,6 +5,7 @@ import sys
...
@@ -5,6 +5,7 @@ import sys
import
unittest
import
unittest
import
pickle
import
pickle
import
weakref
import
weakref
import
errno
from
test.support
import
(
TESTFN
,
unlink
,
run_unittest
,
captured_output
,
from
test.support
import
(
TESTFN
,
unlink
,
run_unittest
,
captured_output
,
gc_collect
,
cpython_only
,
no_tracing
)
gc_collect
,
cpython_only
,
no_tracing
)
...
@@ -852,6 +853,13 @@ class ExceptionTests(unittest.TestCase):
...
@@ -852,6 +853,13 @@ class ExceptionTests(unittest.TestCase):
self
.
fail
(
"RuntimeError not raised"
)
self
.
fail
(
"RuntimeError not raised"
)
self
.
assertEqual
(
wr
(),
None
)
self
.
assertEqual
(
wr
(),
None
)
def
test_errno_ENOTDIR
(
self
):
# Issue #12802: "not a directory" errors are ENOTDIR even on Windows
with
self
.
assertRaises
(
OSError
)
as
cm
:
os
.
listdir
(
__file__
)
self
.
assertEqual
(
cm
.
exception
.
errno
,
errno
.
ENOTDIR
,
cm
.
exception
)
def
test_main
():
def
test_main
():
run_unittest
(
ExceptionTests
)
run_unittest
(
ExceptionTests
)
...
...
Misc/NEWS
Dosyayı görüntüle @
5edbaf29
...
@@ -10,6 +10,9 @@ What's New in Python 3.3 Alpha 1?
...
@@ -10,6 +10,9 @@ What's New in Python 3.3 Alpha 1?
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue #12802: the Windows error ERROR_DIRECTORY (numbered 267) is now
mapped to POSIX errno ENOTDIR (previously EINVAL).
- Issue #9200: The str.is* methods now work with strings that contain non-BMP
- Issue #9200: The str.is* methods now work with strings that contain non-BMP
characters even in narrow Unicode builds.
characters even in narrow Unicode builds.
...
...
PC/errmap.h
Dosyayı görüntüle @
5edbaf29
...
@@ -72,6 +72,7 @@ int winerror_to_errno(int winerror)
...
@@ -72,6 +72,7 @@ int winerror_to_errno(int winerror)
case
202
:
return
8
;
case
202
:
return
8
;
case
206
:
return
2
;
case
206
:
return
2
;
case
215
:
return
11
;
case
215
:
return
11
;
case
267
:
return
20
;
case
1816
:
return
12
;
case
1816
:
return
12
;
default:
return
EINVAL
;
default:
return
EINVAL
;
}
}
...
...
PC/generrmap.c
Dosyayı görüntüle @
5edbaf29
#include <windows.h>
#include <fcntl.h>
#include <io.h>
#include <stdio.h>
#include <stdio.h>
#include <errno.h>
#include <errno.h>
...
@@ -6,15 +9,21 @@
...
@@ -6,15 +9,21 @@
int
main
()
int
main
()
{
{
int
i
;
int
i
;
_setmode
(
fileno
(
stdout
),
O_BINARY
);
printf
(
"/* Generated file. Do not edit. */
\n
"
);
printf
(
"/* Generated file. Do not edit. */
\n
"
);
printf
(
"int winerror_to_errno(int winerror)
\n
"
);
printf
(
"int winerror_to_errno(int winerror)
\n
"
);
printf
(
"{
\n
\t
switch(winerror) {
\n
"
);
printf
(
"{
\n
switch(winerror) {
\n
"
);
for
(
i
=
1
;
i
<
65000
;
i
++
)
{
for
(
i
=
1
;
i
<
65000
;
i
++
)
{
_dosmaperr
(
i
);
_dosmaperr
(
i
);
if
(
errno
==
EINVAL
)
if
(
errno
==
EINVAL
)
{
continue
;
/* Issue #12802 */
printf
(
"
\t\t
case %d: return %d;
\n
"
,
i
,
errno
);
if
(
i
==
ERROR_DIRECTORY
)
errno
=
ENOTDIR
;
else
continue
;
}
printf
(
" case %d: return %d;
\n
"
,
i
,
errno
);
}
}
printf
(
"
\t\t
default: return EINVAL;
\n
"
);
printf
(
"
default: return EINVAL;
\n
"
);
printf
(
"
\t
}
\n
}
\n
"
);
printf
(
"
}
\n
}
\n
"
);
}
}
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