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
d0ebc75e
Kaydet (Commit)
d0ebc75e
authored
Ock 15, 2011
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix mmap and test_mmap under Windows too (followup to r88022)
üst
3988ed8e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
test_mmap.py
Lib/test/test_mmap.py
+6
-5
mmapmodule.c
Modules/mmapmodule.c
+1
-0
No files found.
Lib/test/test_mmap.py
Dosyayı görüntüle @
d0ebc75e
...
...
@@ -325,13 +325,14 @@ class MmapTests(unittest.TestCase):
# map length with an offset doesn't cause a segfault.
if
not
hasattr
(
os
,
"stat"
):
self
.
skipTest
(
"needs os.stat"
)
with
open
(
TESTFN
,
"wb+"
)
as
f
:
f
.
write
(
49152
*
b
'm'
)
# Arbitrary character
# NOTE: allocation granularity is currently 65536 under Win64,
# and therefore the minimum offset alignment.
with
open
(
TESTFN
,
"wb"
)
as
f
:
f
.
write
((
65536
*
2
)
*
b
'm'
)
# Arbitrary character
with
open
(
TESTFN
,
"rb"
)
as
f
:
mf
=
mmap
.
mmap
(
f
.
fileno
(),
0
,
offset
=
40960
,
access
=
mmap
.
ACCESS_READ
)
self
.
assertRaises
(
IndexError
,
mf
.
__getitem__
,
45000
)
mf
.
close
()
with
mmap
.
mmap
(
f
.
fileno
(),
0
,
offset
=
65536
,
access
=
mmap
.
ACCESS_READ
)
as
mf
:
self
.
assertRaises
(
IndexError
,
mf
.
__getitem__
,
80000
)
def
test_move
(
self
):
# make move works everywhere (64-bit format problem earlier)
...
...
Modules/mmapmodule.c
Dosyayı görüntüle @
d0ebc75e
...
...
@@ -1300,6 +1300,7 @@ new_mmap_object(PyTypeObject *type, PyObject *args, PyObject *kwdict)
else
m_obj
->
size
=
low
;
#endif
m_obj
->
size
-=
offset
;
}
else
{
m_obj
->
size
=
map_size
;
}
...
...
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