Skip to content

Commit 9ef3b6f

Browse files
authored
Add files via upload
1 parent e6b98b6 commit 9ef3b6f

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

pyneofile_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:
@@ -8440,7 +8450,7 @@ def CheckCompressionType(infile, formatspecs=__file_format_multi_dict__, filesta
84408450
def CheckCompressionSubType(infile, formatspecs=__file_format_multi_dict__, filestart=0, closefp=True):
84418451
compresscheck = CheckCompressionType(infile, formatspecs, filestart, False)
84428452
curloc = filestart
8443-
if(not compresscheck):
8453+
if(not compresscheck and isinstance(infile, (str, bytes, os.PathLike))):
84448454
fextname = os.path.splitext(infile)[1]
84458455
if(fextname == ".gz"):
84468456
compresscheck = "gzip"
@@ -9756,6 +9766,7 @@ def NeoFileValidate(infile, fmttype="auto", filestart=0, formatspecs=__file_form
97569766
SeekToEndOfFile(fp)
97579767
CatSize = fp.tell()
97589768
CatSizeEnd = CatSize
9769+
fp.seek(0)
97599770
fp.seek(curloc, 0)
97609771
if(IsNestedDict(formatspecs)):
97619772
compresschecking = CheckCompressionType(fp, formatspecs, filestart, False)

0 commit comments

Comments
 (0)