Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-32021: Support brotli .br encoding in mimetypes #12200

Merged
merged 2 commits into from Jan 12, 2020

Conversation

@philmcmahon
Copy link
Contributor

philmcmahon commented Mar 6, 2019

Currently python mimetypes does not support the brotli file extension. Brotli has decent browser support at this point.

My particular use case for this is that I would like the AWS S3 CLI to automatically set the Content-Type and Content-Encoding headers on brotli files uploaded to it - so for example a file script.js.br would have Content-Type: 'application/javascript' and Content-Encoding br. This relies on mimetypes.

https://bugs.python.org/issue32021

@philmcmahon philmcmahon requested a review from python/email-team as a code owner Mar 6, 2019
@the-knights-who-say-ni

This comment has been minimized.

Copy link

the-knights-who-say-ni commented Mar 6, 2019

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for your contribution, we look forward to reviewing it!

@ned-deily

This comment has been minimized.

Copy link
Member

ned-deily commented Mar 13, 2019

@bitdancer, @warsaw Any reason you can think of to not merge this?

@csabella csabella requested a review from maxking Nov 16, 2019
@maxking

This comment has been minimized.

Copy link
Contributor

maxking commented Jan 12, 2020

It looks like .br is now an officially recognized content-encoding as per https://www.iana.org/assignments/http-parameters/http-parameters.xhtml#content-coding, so I think we should get this merged.

Copy link
Contributor

maxking left a comment

LGTM

@maxking maxking merged commit b2b4a51 into python:master Jan 12, 2020
5 checks passed
5 checks passed
Azure Pipelines PR #20190311.9 succeeded
Details
bedevere/issue-number Issue number 32021 found
Details
bedevere/news News entry found in Misc/NEWS.d
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@bedevere-bot

This comment has been minimized.

Copy link

bedevere-bot commented Jan 12, 2020

@maxking: Please replace # with GH- in the commit message next time. Thanks!

@bedevere-bot

This comment has been minimized.

Copy link

bedevere-bot commented Jan 12, 2020

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot x86 Gentoo Installed with X 3.x has failed when building commit b2b4a51.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/128/builds/133) and take a look at the build logs.
  4. Check if the failure is related to this commit (b2b4a51) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/128/builds/133

Failed tests:

  • test_smtpnet

Failed subtests:

  • test_connect_starttls - test.test_smtpnet.SmtpTest
  • test_connect - test.test_smtpnet.SmtpSSLTest
  • test_connect_using_sslcontext - test.test_smtpnet.SmtpSSLTest

Summary of the results of the build (if available):

== Tests result: FAILURE then FAILURE ==

406 tests OK.

1 test failed:
test_smtpnet

13 tests skipped:
test_asdl_parser test_check_c_globals test_clinic test_devpoll
test_gdb test_ioctl test_kqueue test_msilib test_startfile
test_winconsoleio test_winreg test_winsound test_zipfile64

1 re-run test:
test_smtpnet

Total duration: 31 min 50 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.9/test/test_smtpnet.py", line 68, in test_connect_using_sslcontext
    server = smtplib.SMTP_SSL(self.testServer, self.remotePort, context=context)
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.9/smtplib.py", line 1032, in __init__
    SMTP.__init__(self, host, port, local_hostname, timeout,
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.9/smtplib.py", line 253, in __init__
    (code, msg) = self.connect(host, port)
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.9/smtplib.py", line 339, in connect
    (code, msg) = self.getreply()
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.9/smtplib.py", line 396, in getreply
    raise SMTPServerDisconnected("Connection unexpectedly closed")
smtplib.SMTPServerDisconnected: Connection unexpectedly closed


Traceback (most recent call last):
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.9/test/test_smtpnet.py", line 51, in test_connect
    server = smtplib.SMTP_SSL(self.testServer, self.remotePort)
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.9/smtplib.py", line 1032, in __init__
    SMTP.__init__(self, host, port, local_hostname, timeout,
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.9/smtplib.py", line 253, in __init__
    (code, msg) = self.connect(host, port)
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.9/smtplib.py", line 339, in connect
    (code, msg) = self.getreply()
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.9/smtplib.py", line 396, in getreply
    raise SMTPServerDisconnected("Connection unexpectedly closed")
smtplib.SMTPServerDisconnected: Connection unexpectedly closed


Traceback (most recent call last):
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.9/test/test_smtpnet.py", line 34, in test_connect_starttls
    server.starttls(context=context)
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.9/smtplib.py", line 772, in starttls
    self.sock = context.wrap_socket(self.sock,
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.9/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.9/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.9/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
OSError: [Errno 0] Error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.