Skip to content

Commit

Permalink
nitpicks
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex committed Feb 10, 2024
1 parent 8be3216 commit 234a83a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions multipart/decoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def write(self, data):
try:
decoded = base64.b64decode(val)
except binascii.Error:
raise DecodeError("There was an error raised while decoding " "base64-encoded data.")
raise DecodeError("There was an error raised while decoding base64-encoded data.")

self.underlying.write(decoded)

Expand Down Expand Up @@ -91,7 +91,7 @@ def finalize(self):
"""
if len(self.cache) > 0:
raise DecodeError(
"There are %d bytes remaining in the " "Base64Decoder cache when finalize() is called" % len(self.cache)
"There are %d bytes remaining in the Base64Decoder cache when finalize() is called" % len(self.cache)
)

if hasattr(self.underlying, "finalize"):
Expand Down
12 changes: 6 additions & 6 deletions multipart/multipart.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ def write(self, data):
# We truncate the length of data that we are to process.
new_size = int(self.max_size - self._current_size)
self.logger.warning(
"Current size is %d (max %d), so truncating " "data length from %d to %d",
"Current size is %d (max %d), so truncating data length from %d to %d",
self._current_size,
self.max_size,
data_len,
Expand Down Expand Up @@ -757,7 +757,7 @@ def write(self, data):
# We truncate the length of data that we are to process.
new_size = int(self.max_size - self._current_size)
self.logger.warning(
"Current size is %d (max %d), so truncating " "data length from %d to %d",
"Current size is %d (max %d), so truncating data length from %d to %d",
self._current_size,
self.max_size,
data_len,
Expand Down Expand Up @@ -794,11 +794,11 @@ def _internal_write(self, data, length):
if found_sep:
# If we're parsing strictly, we disallow blank chunks.
if strict_parsing:
e = QuerystringParseError("Skipping duplicate ampersand/semicolon at " "%d" % i)
e = QuerystringParseError("Skipping duplicate ampersand/semicolon at %d" % i)
e.offset = i
raise e
else:
self.logger.debug("Skipping duplicate ampersand/" "semicolon at %d", i)
self.logger.debug("Skipping duplicate ampersand/semicolon at %d", i)
else:
# This case is when we're skipping the (first)
# separator between fields, so we just set our flag
Expand Down Expand Up @@ -1037,7 +1037,7 @@ def write(self, data):
# We truncate the length of data that we are to process.
new_size = int(self.max_size - self._current_size)
self.logger.warning(
"Current size is %d (max %d), so truncating " "data length from %d to %d",
"Current size is %d (max %d), so truncating data length from %d to %d",
self._current_size,
self.max_size,
data_len,
Expand Down Expand Up @@ -1707,7 +1707,7 @@ def on_headers_finished():
vars.writer = QuotedPrintableDecoder(vars.f)

else:
self.logger.warning("Unknown Content-Transfer-Encoding: " "%r", transfer_encoding)
self.logger.warning("Unknown Content-Transfer-Encoding: %r", transfer_encoding)
if self.config["UPLOAD_ERROR_ON_BAD_CTE"]:
raise FormParserError('Unknown Content-Transfer-Encoding "{}"'.format(transfer_encoding))
else:
Expand Down

0 comments on commit 234a83a

Please sign in to comment.