Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3f61ea3

Browse files
authored
gh-133873: remove deprecated mark interface forwave.Wave_{read,write} objects (#133874)
1 parent319acf3 commit3f61ea3

File tree

7 files changed

+14
-79
lines changed

7 files changed

+14
-79
lines changed

‎Doc/deprecations/pending-removal-in-3.15.rst‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ Pending removal in Python 3.15
9999

100100
*:mod:`wave`:
101101

102-
* The:meth:`~wave.Wave_read.getmark`,:meth:`!setmark`,
103-
and:meth:`~wave.Wave_read.getmarkers` methods of
102+
* The ``getmark()``, ``setmark()`` and ``getmarkers()`` methods of
104103
the:class:`~wave.Wave_read` and:class:`~wave.Wave_write` classes
105104
have been deprecated since Python 3.13.
106105

‎Doc/library/wave.rst‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -123,26 +123,6 @@ Wave_read Objects
123123

124124
Rewind the file pointer to the beginning of the audio stream.
125125

126-
The following two methods are defined for compatibility with the old:mod:`!aifc`
127-
module, and don't do anything interesting.
128-
129-
130-
..method::getmarkers()
131-
132-
Returns ``None``.
133-
134-
..deprecated-removed::3.13 3.15
135-
The method only existed for compatibility with the:mod:`!aifc` module
136-
which has been removed in Python 3.13.
137-
138-
139-
..method::getmark(id)
140-
141-
Raise an error.
142-
143-
..deprecated-removed::3.13 3.15
144-
The method only existed for compatibility with the:mod:`!aifc` module
145-
which has been removed in Python 3.13.
146126

147127
The following two methods define a term "position" which is compatible between
148128
them, and is otherwise implementation dependent.

‎Doc/whatsnew/3.13.rst‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,8 +1995,7 @@ New Deprecations
19951995

19961996
*:mod:`wave`:
19971997

1998-
* Deprecate the:meth:`~wave.Wave_read.getmark`,:meth:`!setmark`,
1999-
and:meth:`~wave.Wave_read.getmarkers` methods of
1998+
* Deprecate the ``getmark()``, ``setmark()`` and ``getmarkers()`` methods of
20001999
the:class:`~wave.Wave_read` and:class:`~wave.Wave_write` classes,
20012000
to be removed in Python 3.15.
20022001
(Contributed by Victor Stinner in:gh:`105096`.)

‎Doc/whatsnew/3.15.rst‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,15 @@ typing
144144
(Contributed by Bénédikt Tran in:gh:`133823`.)
145145

146146

147+
wave
148+
----
149+
150+
* Removed the ``getmark()``, ``setmark()`` and ``getmarkers()`` methods
151+
of the:class:`~wave.Wave_read` and:class:`~wave.Wave_write` classes,
152+
which were deprecated since Python 3.13.
153+
(Contributed by Bénédikt Tran in:gh:`133873`.)
154+
155+
147156
Porting to Python 3.15
148157
======================
149158

‎Lib/test/test_wave.py‎

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -136,32 +136,6 @@ def test__all__(self):
136136
not_exported= {'WAVE_FORMAT_PCM','WAVE_FORMAT_EXTENSIBLE','KSDATAFORMAT_SUBTYPE_PCM'}
137137
support.check__all__(self,wave,not_exported=not_exported)
138138

139-
deftest_read_deprecations(self):
140-
filename=support.findfile('pluck-pcm8.wav',subdir='audiodata')
141-
withwave.open(filename)asreader:
142-
withself.assertWarns(DeprecationWarning):
143-
withself.assertRaises(wave.Error):
144-
reader.getmark('mark')
145-
withself.assertWarns(DeprecationWarning):
146-
self.assertIsNone(reader.getmarkers())
147-
148-
deftest_write_deprecations(self):
149-
withio.BytesIO(b'')astmpfile:
150-
withwave.open(tmpfile,'wb')aswriter:
151-
writer.setnchannels(1)
152-
writer.setsampwidth(1)
153-
writer.setframerate(1)
154-
writer.setcomptype('NONE','not compressed')
155-
156-
withself.assertWarns(DeprecationWarning):
157-
withself.assertRaises(wave.Error):
158-
writer.setmark(0,0,'mark')
159-
withself.assertWarns(DeprecationWarning):
160-
withself.assertRaises(wave.Error):
161-
writer.getmark('mark')
162-
withself.assertWarns(DeprecationWarning):
163-
self.assertIsNone(writer.getmarkers())
164-
165139

166140
classWaveLowLevelTest(unittest.TestCase):
167141

‎Lib/wave.py‎

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020
compression type ('not compressed' linear samples)
2121
getparams() -- returns a namedtuple consisting of all of the
2222
above in the above order
23-
getmarkers() -- returns None (for compatibility with the
24-
old aifc module)
25-
getmark(id) -- raises an error since the mark does not
26-
exist (for compatibility with the old aifc module)
2723
readframes(n) -- returns at most n frames of audio
2824
rewind() -- rewind to the beginning of the audio stream
2925
setpos(pos) -- seek to the specified position
@@ -341,16 +337,6 @@ def getparams(self):
341337
self.getframerate(),self.getnframes(),
342338
self.getcomptype(),self.getcompname())
343339

344-
defgetmarkers(self):
345-
importwarnings
346-
warnings._deprecated("Wave_read.getmarkers",remove=(3,15))
347-
returnNone
348-
349-
defgetmark(self,id):
350-
importwarnings
351-
warnings._deprecated("Wave_read.getmark",remove=(3,15))
352-
raiseError('no marks')
353-
354340
defsetpos(self,pos):
355341
ifpos<0orpos>self._nframes:
356342
raiseError('position not in range')
@@ -551,21 +537,6 @@ def getparams(self):
551537
return_wave_params(self._nchannels,self._sampwidth,self._framerate,
552538
self._nframes,self._comptype,self._compname)
553539

554-
defsetmark(self,id,pos,name):
555-
importwarnings
556-
warnings._deprecated("Wave_write.setmark",remove=(3,15))
557-
raiseError('setmark() not supported')
558-
559-
defgetmark(self,id):
560-
importwarnings
561-
warnings._deprecated("Wave_write.getmark",remove=(3,15))
562-
raiseError('no marks')
563-
564-
defgetmarkers(self):
565-
importwarnings
566-
warnings._deprecated("Wave_write.getmarkers",remove=(3,15))
567-
returnNone
568-
569540
deftell(self):
570541
returnself._nframeswritten
571542

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Remove the deprecated ``getmark()``, ``setmark()`` and ``getmarkers()``
2+
methods of the:class:`~wave.Wave_read` and:class:`~wave.Wave_write`
3+
classes, which were deprecated since Python 3.13. Patch by Bénédikt Tran.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp