Skip to content

Conversation

@philmcmahon
Copy link
Contributor

@philmcmahon 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

@the-knights-who-say-ni
Copy link

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
Copy link
Member

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

@csabella csabella requested a review from maxking November 16, 2019 02:24
@maxking
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 maxking left a comment

Choose a reason for hiding this comment

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

LGTM

@maxking maxking added the type-feature A feature request or enhancement label Jan 12, 2020
@maxking maxking merged commit b2b4a51 into python:master Jan 12, 2020
@bedevere-bot
Copy link

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

@bedevere-bot
Copy link

⚠️⚠️⚠️ 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

shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
Add support for brotli encoding in the encoding_map.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants