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

gh-133873: remove mark interface forwave.Wave_{read,write} objects#133874

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
picnixz merged 6 commits intopython:mainfrompicnixz:cleanup/315/wave-marks-133873
May 15, 2025
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
NextNext commit
remove mark interface for wave objects
  • Loading branch information
@picnixz
picnixz committedMay 11, 2025
commit60f7f19456abe460ba72f7cd95b7b38556cedcf7
3 changes: 1 addition & 2 deletionsDoc/deprecations/pending-removal-in-3.15.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -99,8 +99,7 @@ Pending removal in Python 3.15

* :mod:`wave`:

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

Expand Down
20 changes: 0 additions & 20 deletionsDoc/library/wave.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -123,26 +123,6 @@ Wave_read Objects

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

The following two methods are defined for compatibility with the old :mod:`!aifc`
module, and don't do anything interesting.


.. method:: getmarkers()

Returns ``None``.

.. deprecated-removed:: 3.13 3.15
The method only existed for compatibility with the :mod:`!aifc` module
which has been removed in Python 3.13.


.. method:: getmark(id)

Raise an error.

.. deprecated-removed:: 3.13 3.15
The method only existed for compatibility with the :mod:`!aifc` module
which has been removed in Python 3.13.

The following two methods define a term "position" which is compatible between
them, and is otherwise implementation dependent.
Expand Down
3 changes: 1 addition & 2 deletionsDoc/whatsnew/3.13.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1995,8 +1995,7 @@ New Deprecations

* :mod:`wave`:

* Deprecate the :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`,
and :meth:`~wave.Wave_read.getmarkers` methods of
* Deprecate the ``getmark()``, ``setmark()`` and ``getmarkers()`` methods of
the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes,
to be removed in Python 3.15.
(Contributed by Victor Stinner in :gh:`105096`.)
Expand Down
8 changes: 8 additions & 0 deletionsDoc/whatsnew/3.15.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -144,6 +144,14 @@ typing
(Contributed by Bénédikt Tran in :gh:`133823`.)


wave
----

* The ``getmark()``, ``setmark()`` and ``getmarkers()`` methods of
the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes.
(Contributed by Bénédikt Tran in :gh:`133873`.)


Porting to Python 3.15
======================

Expand Down
26 changes: 0 additions & 26 deletionsLib/test/test_wave.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -136,32 +136,6 @@ def test__all__(self):
not_exported = {'WAVE_FORMAT_PCM', 'WAVE_FORMAT_EXTENSIBLE', 'KSDATAFORMAT_SUBTYPE_PCM'}
support.check__all__(self, wave, not_exported=not_exported)

def test_read_deprecations(self):
filename = support.findfile('pluck-pcm8.wav', subdir='audiodata')
with wave.open(filename) as reader:
with self.assertWarns(DeprecationWarning):
with self.assertRaises(wave.Error):
reader.getmark('mark')
with self.assertWarns(DeprecationWarning):
self.assertIsNone(reader.getmarkers())

def test_write_deprecations(self):
with io.BytesIO(b'') as tmpfile:
with wave.open(tmpfile, 'wb') as writer:
writer.setnchannels(1)
writer.setsampwidth(1)
writer.setframerate(1)
writer.setcomptype('NONE', 'not compressed')

with self.assertWarns(DeprecationWarning):
with self.assertRaises(wave.Error):
writer.setmark(0, 0, 'mark')
with self.assertWarns(DeprecationWarning):
with self.assertRaises(wave.Error):
writer.getmark('mark')
with self.assertWarns(DeprecationWarning):
self.assertIsNone(writer.getmarkers())


class WaveLowLevelTest(unittest.TestCase):

Expand Down
29 changes: 0 additions & 29 deletionsLib/wave.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,10 +20,6 @@
compression type ('not compressed' linear samples)
getparams() -- returns a namedtuple consisting of all of the
above in the above order
getmarkers() -- returns None (for compatibility with the
old aifc module)
getmark(id) -- raises an error since the mark does not
exist (for compatibility with the old aifc module)
readframes(n) -- returns at most n frames of audio
rewind() -- rewind to the beginning of the audio stream
setpos(pos) -- seek to the specified position
Expand DownExpand Up@@ -341,16 +337,6 @@ def getparams(self):
self.getframerate(), self.getnframes(),
self.getcomptype(), self.getcompname())

def getmarkers(self):
import warnings
warnings._deprecated("Wave_read.getmarkers", remove=(3, 15))
return None

def getmark(self, id):
import warnings
warnings._deprecated("Wave_read.getmark", remove=(3, 15))
raise Error('no marks')

def setpos(self, pos):
if pos < 0 or pos > self._nframes:
raise Error('position not in range')
Expand DownExpand Up@@ -551,21 +537,6 @@ def getparams(self):
return _wave_params(self._nchannels, self._sampwidth, self._framerate,
self._nframes, self._comptype, self._compname)

def setmark(self, id, pos, name):
import warnings
warnings._deprecated("Wave_write.setmark", remove=(3, 15))
raise Error('setmark() not supported')

def getmark(self, id):
import warnings
warnings._deprecated("Wave_write.getmark", remove=(3, 15))
raise Error('no marks')

def getmarkers(self):
import warnings
warnings._deprecated("Wave_write.getmarkers", remove=(3, 15))
return None

def tell(self):
return self._nframeswritten

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
Remove the deprecated ``getmark()``, ``setmark()`` and ``getmarkers()``
methods of the:class:`~wave.Wave_read` and:class:`~wave.Wave_write`
classes. Patch by Bénédikt Tran.
Loading

[8]ページ先頭

©2009-2025 Movatter.jp