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
015dd821
Kaydet (Commit)
015dd821
authored
May 04, 2003
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Somewhere along the way, the softspace attr of file objects became read-
only. Repaired, and added new tests to test_file.py.
üst
d7231285
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
test_file.py
Lib/test/test_file.py
+20
-0
NEWS
Misc/NEWS
+3
-0
fileobject.c
Objects/fileobject.c
+2
-1
No files found.
Lib/test/test_file.py
Dosyayı görüntüle @
015dd821
...
@@ -5,6 +5,26 @@ from array import array
...
@@ -5,6 +5,26 @@ from array import array
from
test.test_support
import
verify
,
TESTFN
,
TestFailed
from
test.test_support
import
verify
,
TESTFN
,
TestFailed
from
UserList
import
UserList
from
UserList
import
UserList
# verify expected attributes exist
f
=
file
(
TESTFN
,
'w'
)
softspace
=
f
.
softspace
f
.
name
# merely shouldn't blow up
f
.
mode
# ditto
f
.
closed
# ditto
# verify softspace is writable
f
.
softspace
=
softspace
# merely shouldn't blow up
# verify the others aren't
for
attr
in
'name'
,
'mode'
,
'closed'
:
try
:
setattr
(
f
,
attr
,
'oops'
)
except
TypeError
:
pass
else
:
raise
TestFailed
(
'expected TypeError setting file attr
%
r'
%
attr
)
f
.
close
()
# verify writelines with instance sequence
# verify writelines with instance sequence
l
=
UserList
([
'1'
,
'2'
])
l
=
UserList
([
'1'
,
'2'
])
f
=
open
(
TESTFN
,
'wb'
)
f
=
open
(
TESTFN
,
'wb'
)
...
...
Misc/NEWS
Dosyayı görüntüle @
015dd821
...
@@ -12,6 +12,9 @@ What's New in Python 2.3 beta 2?
...
@@ -12,6 +12,9 @@ What's New in Python 2.3 beta 2?
Core and builtins
Core and builtins
-----------------
-----------------
- The softspace attribute of file objects became read-only by oversight.
It'
s
writable
again
.
Extension
modules
Extension
modules
-----------------
-----------------
...
...
Objects/fileobject.c
Dosyayı görüntüle @
015dd821
...
@@ -1962,7 +1962,8 @@ PyTypeObject PyFile_Type = {
...
@@ -1962,7 +1962,8 @@ PyTypeObject PyFile_Type = {
0
,
/* tp_call */
0
,
/* tp_call */
0
,
/* tp_str */
0
,
/* tp_str */
PyObject_GenericGetAttr
,
/* tp_getattro */
PyObject_GenericGetAttr
,
/* tp_getattro */
0
,
/* tp_setattro */
/* softspace is writable: we must supply tp_setattro */
PyObject_GenericSetAttr
,
/* tp_setattro */
0
,
/* tp_as_buffer */
0
,
/* tp_as_buffer */
Py_TPFLAGS_DEFAULT
|
Py_TPFLAGS_BASETYPE
,
/* tp_flags */
Py_TPFLAGS_DEFAULT
|
Py_TPFLAGS_BASETYPE
,
/* tp_flags */
file_doc
,
/* tp_doc */
file_doc
,
/* tp_doc */
...
...
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