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
056dac1b
Kaydet (Commit)
056dac1b
authored
Kas 12, 2006
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Bug #1067760: Deprecate passing floats to file.seek.
üst
065f0c8a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
4 deletions
+20
-4
libstdtypes.tex
Doc/lib/libstdtypes.tex
+1
-0
NEWS
Misc/NEWS
+2
-0
fileobject.c
Objects/fileobject.c
+17
-4
No files found.
Doc/lib/libstdtypes.tex
Dosyayı görüntüle @
056dac1b
...
...
@@ -1689,6 +1689,7 @@ flush the read-ahead buffer.
behavior.
Note that not all file objects are seekable.
\versionchanged
{
Passing float values as offset has been deprecated
}
[2.6]
\end{methoddesc}
\begin{methoddesc}
[file]
{
tell
}{}
...
...
Misc/NEWS
Dosyayı görüntüle @
056dac1b
...
...
@@ -12,6 +12,8 @@ What's New in Python 2.6 alpha 1?
Core and builtins
-----------------
- Bug #1067760: Deprecate passing floats to file.seek.
- Bug #1591996: Correctly forward exception in instance_contains().
- Bug #1588287: fix invalid assertion for `1,2` in debug builds.
...
...
Objects/fileobject.c
Dosyayı görüntüle @
056dac1b
...
...
@@ -540,7 +540,7 @@ file_seek(PyFileObject *f, PyObject *args)
int
whence
;
int
ret
;
Py_off_t
offset
;
PyObject
*
offobj
;
PyObject
*
offobj
,
*
off_index
;
if
(
f
->
f_fp
==
NULL
)
return
err_closed
();
...
...
@@ -548,12 +548,25 @@ file_seek(PyFileObject *f, PyObject *args)
whence
=
0
;
if
(
!
PyArg_ParseTuple
(
args
,
"O|i:seek"
,
&
offobj
,
&
whence
))
return
NULL
;
off_index
=
PyNumber_Index
(
offobj
);
if
(
!
off_index
)
{
if
(
!
PyFloat_Check
(
offobj
))
return
NULL
;
/* Deprecated in 2.6 */
PyErr_Clear
();
if
(
PyErr_Warn
(
PyExc_DeprecationWarning
,
"integer argument expected, got float"
))
return
NULL
;
off_index
=
offobj
;
Py_INCREF
(
offobj
);
}
#if !defined(HAVE_LARGEFILE_SUPPORT)
offset
=
PyInt_AsLong
(
off
obj
);
offset
=
PyInt_AsLong
(
off
_index
);
#else
offset
=
PyLong_Check
(
off
obj
)
?
PyLong_AsLongLong
(
off
obj
)
:
PyInt_AsLong
(
offobj
);
offset
=
PyLong_Check
(
off
_index
)
?
PyLong_AsLongLong
(
off
_index
)
:
PyInt_AsLong
(
off_index
);
#endif
Py_DECREF
(
off_index
);
if
(
PyErr_Occurred
())
return
NULL
;
...
...
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