This commit is contained in:
Iliyan Angelov
2025-12-01 06:50:10 +02:00
parent 91f51bc6fe
commit 62c1fe5951
4682 changed files with 544807 additions and 31208 deletions

View File

@@ -0,0 +1,14 @@
# Copyright (c) 2016 Rackspace, Inc.
#
# SPDX-License-Identifier: Apache-2.0
"""Utility functions for formatting plugins for Bandit."""
import io
def wrap_file_object(fileobj):
"""If the fileobj passed in cannot handle text, use TextIOWrapper
to handle the conversion.
"""
if isinstance(fileobj, io.TextIOBase):
return fileobj
return io.TextIOWrapper(fileobj)