@@ -142,10 +142,6 @@ class MultipartState(IntEnum):
142142# fmt: on
143143
144144
145- def ord_char (c : int ) -> int :
146- return c
147-
148-
149145def parse_options_header (value : str | bytes ) -> tuple [bytes , dict [bytes , bytes ]]:
150146 """Parses a Content-Type header into a value in the following format: (content_type, {parameters})."""
151147 # Uses email.message.Message to parse the header as described in PEP 594.
@@ -473,7 +469,7 @@ def _get_disk_file(self) -> io.BufferedRandom | tempfile._TemporaryFileWrapper[b
473469 elif isinstance (file_dir , bytes ):
474470 dir = file_dir .decode (sys .getfilesystemencoding ())
475471 else :
476- dir = file_dir
472+ dir = file_dir # pragma: no cover
477473
478474 # Create a temporary (named) file with the appropriate settings.
479475 self .logger .info (
@@ -511,11 +507,7 @@ def on_data(self, data: bytes) -> int:
511507 Returns:
512508 The number of bytes written.
513509 """
514- pos = self ._fileobj .tell ()
515510 bwritten = self ._fileobj .write (data )
516- # true file objects write returns None
517- if bwritten is None :
518- bwritten = self ._fileobj .tell () - pos
519511
520512 # If the bytes written isn't the same as the length, just return.
521513 if bwritten != len (data ):
@@ -1381,7 +1373,7 @@ def data_callback(name: str, end_i: int, remaining: bool = False) -> None:
13811373 elif state == MultipartState .END :
13821374 # Do nothing and just consume a byte in the end state.
13831375 if c not in (CR , LF ):
1384- self .logger .warning ("Consuming a byte '0x%x' in the end state" , c )
1376+ self .logger .warning ("Consuming a byte '0x%x' in the end state" , c ) # pragma: no cover
13851377
13861378 else : # pragma: no cover (error case)
13871379 # We got into a strange state somehow! Just stop processing.
0 commit comments