Fix a regression with mimetype guessing.

Review Request #14269 — Created Dec. 13, 2024 and updated

Information

RBTools
release-5.x

Reviewers

RBTools 5.1 introduced new support for filename-based mimetype guessing
using puremagic. This made guess_mimetype keyword-only, but we still
had a call site that was passing in positional arguments, causing it to
crash when uploading binary files.

This fixes up the call site, and changes guess_mimetype to go through
the standard function signature deprecation process so call sites can
continue to pass in positional arguments with a deprecation warning.

Unit tests pass.

Summary ID
Fix a regression with mimetype guessing.
RBTools 5.1 introduced new support for filename-based mimetype guessing using `puremagic`. This made `guess_mimetype` keyword-only, but we still had a call site that was passing in positional arguments, causing it to crash when uploading binary files. This fixes up the call site, and changes `guess_mimetype` to go through the standard function signature deprecation process so call sites can continue to pass in positional arguments with a deprecation warning.
1d5d06fa5e284cdcaf3490da68a4a7d52cd09c08
Checks run (2 succeeded)
flake8 passed.
JSHint passed.
david
  1. Ship It!
  2. 
      
maubin
  1. Ship It!
  2.