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
4d98489d
Kaydet (Commit)
4d98489d
authored
Eki 31, 2010
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #10265: Close file objects explicitly in sunau. Patch by Brian Brazil.
üst
b373799e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
sunau.py
Lib/sunau.py
+11
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/sunau.py
Dosyayı görüntüle @
4d98489d
...
...
@@ -154,6 +154,9 @@ class Au_read:
if
type
(
f
)
==
type
(
''
):
import
builtins
f
=
builtins
.
open
(
f
,
'rb'
)
self
.
_opened
=
True
else
:
self
.
_opened
=
False
self
.
initfp
(
f
)
def
__del__
(
self
):
...
...
@@ -275,6 +278,8 @@ class Au_read:
self
.
_soundpos
=
pos
def
close
(
self
):
if
self
.
_opened
and
self
.
_file
:
self
.
_file
.
close
()
self
.
_file
=
None
class
Au_write
:
...
...
@@ -283,11 +288,15 @@ class Au_write:
if
type
(
f
)
==
type
(
''
):
import
builtins
f
=
builtins
.
open
(
f
,
'wb'
)
self
.
_opened
=
True
else
:
self
.
_opened
=
False
self
.
initfp
(
f
)
def
__del__
(
self
):
if
self
.
_file
:
self
.
close
()
self
.
_file
=
None
def
initfp
(
self
,
file
):
self
.
_file
=
file
...
...
@@ -401,6 +410,8 @@ class Au_write:
self
.
_datalength
!=
self
.
_datawritten
:
self
.
_patchheader
()
self
.
_file
.
flush
()
if
self
.
_opened
and
self
.
_file
:
self
.
_file
.
close
()
self
.
_file
=
None
#
...
...
Misc/NEWS
Dosyayı görüntüle @
4d98489d
...
...
@@ -59,6 +59,8 @@ Core and Builtins
Library
-------
- Issue #10265: Close file objects explicitly in sunau. Patch by Brian Brazil.
- Issue #10266: uu.decode didn't close in_file explicitly when it was given
as a filename. Patch by Brian Brazil.
...
...
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