@@ -34,16 +34,14 @@ def __len__(self) -> int:
3434 return self ._length
3535
3636 def _check_not_closed (self ) -> None :
37- # https://github.com/PyCQA/pylint/issues/3484
38- # pylint: disable=using-constant-test
3937 if self .closed :
4038 raise ValueError ("I/O operation on closed file" )
4139
4240 def fileno (self ) -> int :
4341 try :
44- return cast (BinaryIO , self .fileobj ).fileno () # type: ignore[attr-defined]
42+ return cast (" BinaryIO" , self .fileobj ).fileno () # type: ignore[attr-defined]
4543 except AttributeError :
46- raise UnsupportedOperation ("fileno" ) # pylint: disable=raise-missing- from
44+ raise UnsupportedOperation ("fileno" ) from None
4745
4846 def seekable (self ) -> bool :
4947 """Return a bool indicating whether object supports random access."""
@@ -188,7 +186,7 @@ def close(self) -> None:
188186
189187 # the methods below are expected to be implemented by subclasses
190188
191- def _read (self , size : int ) -> bytes : # pragma: no cover
189+ def _read (self , size : int ) -> bytes : # pragma: no cover # noqa: ARG002
192190 """Read and return up to size bytes, where size is an int.
193191
194192 The size will not exceed the number of bytes between self._pos and
@@ -205,7 +203,7 @@ def _write_before(self) -> None:
205203 def _write_after (self ) -> None :
206204 """This method is called after the last write operation (usually on file close)."""
207205
208- def _write (self , data : bytes ) -> int : # pragma: no cover
206+ def _write (self , data : bytes ) -> int : # pragma: no cover # noqa: ARG002
209207 """Writes as many bytes from data as possible, and return the number
210208 of bytes written.
211209
@@ -217,7 +215,7 @@ def _write(self, data: bytes) -> int: # pragma: no cover
217215 """
218216 raise UnsupportedOperation ("write" )
219217
220- def _truncate (self , size : int ) -> None : # pragma: no cover
218+ def _truncate (self , size : int ) -> None : # pragma: no cover # noqa: ARG002
221219 """Truncate the file to the given size.
222220 This resizing can extend or reduce the current file size.
223221
@@ -286,7 +284,7 @@ def _write_after(self) -> None:
286284 if self ._fileobjs :
287285 last_fileobj = self ._fileobjs .last_item
288286 if last_fileobj :
289- last_fileobj ._write_end () # pylint: disable=protected-access
287+ last_fileobj ._write_end () # noqa: SLF001
290288 else :
291289 del self ._fileobjs [self ._fileobjs .last_key ]
292290
@@ -301,7 +299,7 @@ def _write(self, data: bytes) -> int:
301299 fileobj = self ._get_fileobj ()
302300
303301 # newly created fileobj should be writable
304- # otherwire this will raise UnsupportedOperation
302+ # otherwise this will raise UnsupportedOperation
305303 return fileobj .write (data )
306304
307305 def _truncate (self , size : int ) -> None :
@@ -329,7 +327,7 @@ def _change_fileobj(self) -> None:
329327 last_fileobj = self ._fileobjs .last_item
330328 if last_fileobj :
331329 if last_fileobj .writable ():
332- last_fileobj ._write_end () # pylint: disable=protected-access
330+ last_fileobj ._write_end () # noqa: SLF001
333331 else :
334332 del self ._fileobjs [self ._fileobjs .last_key ]
335333
0 commit comments