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-104773: PEP 594: Remove the sndhdr module#104774

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
vstinner merged 1 commit intopython:mainfromvstinner:remove_sndhdr
May 24, 2023

Conversation

vstinner
Copy link
Member

@vstinnervstinner commentedMay 22, 2023
edited by github-actionsbot
Loading

@vstinner
Copy link
MemberAuthor

I ignored mentions of the sndhdr module in comments of the email module, Lib/email/mime/audio.py:

# Originally from the sndhdr module.## There are others in sndhdr that don't have MIME types. :(# Additional ones to be added to sndhdr? midi, mp3, realaudio, wma??def_what(data):# Try to identify a sound file type.## sndhdr.what() had a pretty cruddy interface, unfortunately.  This is why# we re-do it here.  It would be easier to reverse engineer the Unix 'file'# command and use the standard 'magic' file, as shipped with a modern Unix.hdr=data[:512]fakefile=BytesIO(hdr)fortestfnin_rules:ifres:=testfn(hdr,fakefile):returnreselse:returnNone

@vstinner
Copy link
MemberAuthor

Fix the Docs CI:Warning: (...)/Doc/whatsnew/3.12.rst:819: WARNING: py:mod reference target not found: sndhdr.

Copy link
Member

@hugovkhugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Please could you also update the refs in 3.11.rst?

For example with an exclamation mark:

*:pep:`594` led to the deprecations of the following modules  slated for removal in Python 3.13:+---------------------+---------------------+---------------------+---------------------+---------------------+  |:mod:`aifc`|:mod:`chunk`|:mod:`msilib`|:mod:`pipes`|:mod:`telnetlib`|+---------------------+---------------------+---------------------+---------------------+---------------------+  |:mod:`audioop`|:mod:`crypt`|:mod:`nis`|:mod:`!sndhdr`|:mod:`uu`|+---------------------+---------------------+---------------------+---------------------+---------------------+  |:mod:`cgi`|:mod:`imghdr`|:mod:`nntplib`|:mod:`spwd`|:mod:`xdrlib`|+---------------------+---------------------+---------------------+---------------------+---------------------+  |:mod:`cgitb`|:mod:`mailcap`|:mod:`ossaudiodev`|:mod:`sunau`||+---------------------+---------------------+---------------------+---------------------+---------------------+

You could do them all in a single commit/PR, to avoid lots of conflicts later.

And:

diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rstindex 14b6425cea..a1b6e18950 100644--- a/Doc/whatsnew/3.5.rst+++ b/Doc/whatsnew/3.5.rst@@ -1714,7 +1714,7 @@ support :rfc:`6531` (SMTPUTF8). sndhdr -------The :func:`~sndhdr.what` and :func:`~sndhdr.whathdr` functions  now return+The ``what`` and ``whathdr`` functions now return a :func:`~collections.namedtuple`.  (Contributed by Claudiu Popa in :issue:`18615`.)

Remove the Lib/test/sndhdrdata/ directory.
@vstinner
Copy link
MemberAuthor

I updated the doc: I added PEP 594 and replacedsndhdr with!sndhdr. I also rebased the PR on the main to retrieve recent test fixes (especially test_importlib).

@vstinnervstinnerenabled auto-merge (squash)May 24, 2023 09:18
@vstinnervstinner merged commit7b00940 intopython:mainMay 24, 2023
@vstinnervstinner deleted the remove_sndhdr branchMay 24, 2023 09:38
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@hugovkhugovkhugovk left review comments

@gpsheadgpsheadgpshead approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@vstinner@gpshead@hugovk@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp