Skip to content

Commit 6fe484d

Browse files
authored
Add files via upload
1 parent 5130468 commit 6fe484d

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

pycatfile_py3.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,6 @@ def _wrap(stream):
352352
try:
353353
import httpx
354354
havehttpx = True
355-
logging.getLogger("httpx").setLevel(logging.WARNING)
356-
logging.getLogger("httpcore").setLevel(logging.WARNING)
357355
except Exception:
358356
pass
359357

@@ -392,6 +390,18 @@ def _wrap(stream):
392390
except Exception:
393391
pass
394392

393+
NOISY_LOGGERS = (
394+
"httpx",
395+
"httpcore",
396+
"h2",
397+
"hpack",
398+
"urllib3",
399+
"requests",
400+
)
401+
402+
for name in NOISY_LOGGERS:
403+
logging.getLogger(name).setLevel(logging.WARNING)
404+
logging.getLogger(name).disabled = True
395405

396406
ftpssl = True
397407
try:
@@ -8446,7 +8456,7 @@ def CheckCompressionType(infile, formatspecs=__file_format_multi_dict__, filesta
84468456
def CheckCompressionSubType(infile, formatspecs=__file_format_multi_dict__, filestart=0, closefp=True):
84478457
compresscheck = CheckCompressionType(infile, formatspecs, filestart, False)
84488458
curloc = filestart
8449-
if(not compresscheck):
8459+
if(not compresscheck and isinstance(infile, (str, bytes, os.PathLike))):
84508460
fextname = os.path.splitext(infile)[1]
84518461
if(fextname == ".gz"):
84528462
compresscheck = "gzip"
@@ -9762,6 +9772,7 @@ def CatFileValidate(infile, fmttype="auto", filestart=0, formatspecs=__file_form
97629772
SeekToEndOfFile(fp)
97639773
CatSize = fp.tell()
97649774
CatSizeEnd = CatSize
9775+
fp.seek(0)
97659776
fp.seek(curloc, 0)
97669777
if(IsNestedDict(formatspecs)):
97679778
compresschecking = CheckCompressionType(fp, formatspecs, filestart, False)

0 commit comments

Comments
 (0)