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
ab1f4674
Kaydet (Commit)
ab1f4674
authored
Mar 15, 2007
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #1681153: the wave module now closes a file object it opened if
initialization failed.
üst
8784bae6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
wave.py
Lib/wave.py
+12
-2
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/wave.py
Dosyayı görüntüle @
ab1f4674
...
...
@@ -159,7 +159,12 @@ class Wave_read:
f
=
__builtin__
.
open
(
f
,
'rb'
)
self
.
_i_opened_the_file
=
f
# else, assume it is an open file object already
self
.
initfp
(
f
)
try
:
self
.
initfp
(
f
)
except
:
if
self
.
_i_opened_the_file
:
f
.
close
()
raise
def
__del__
(
self
):
self
.
close
()
...
...
@@ -297,7 +302,12 @@ class Wave_write:
if
isinstance
(
f
,
basestring
):
f
=
__builtin__
.
open
(
f
,
'wb'
)
self
.
_i_opened_the_file
=
f
self
.
initfp
(
f
)
try
:
self
.
initfp
(
f
)
except
:
if
self
.
_i_opened_the_file
:
f
.
close
()
raise
def
initfp
(
self
,
file
):
self
.
_file
=
file
...
...
Misc/NEWS
Dosyayı görüntüle @
ab1f4674
...
...
@@ -173,6 +173,9 @@ Core and builtins
Library
-------
-
Patch
#
1681153
:
the
wave
module
now
closes
a
file
object
it
opened
if
initialization
failed
.
-
Bug
#
767111
:
fix
long
-
standing
bug
in
urllib
which
caused
an
AttributeError
instead
of
an
IOError
when
the
server
's response didn'
t
contain
a
valid
HTTP
status
line
.
...
...
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