Suppress typing errors in fileutil, crawler, fixups.

This commit is contained in:
Jason R. Coombs 2020-11-23 13:57:37 -05:00
parent 8da82e9ed5
commit 25cce8b77e
3 changed files with 8 additions and 3 deletions

View File

@ -19,7 +19,7 @@ import os, time, struct
try:
import cPickle as pickle
except ImportError:
import pickle
import pickle # type: ignore
from twisted.internet import reactor
from twisted.application import service
from allmydata.storage.common import si_b2a

View File

@ -311,7 +311,7 @@ def precondition_abspath(path):
_getfullpathname = None
try:
from nt import _getfullpathname
from nt import _getfullpathname # type: ignore
except ImportError:
pass

View File

@ -217,7 +217,12 @@ def initialize():
# Instead it "mangles" or escapes them using \x7F as an escape character, which we
# unescape here.
def unmangle(s):
return re.sub(u'\\x7F[0-9a-fA-F]*\\;', lambda m: unichr(int(m.group(0)[1:-1], 16)), s)
return re.sub(
u'\\x7F[0-9a-fA-F]*\\;',
# type ignored for 'unichr'
lambda m: unichr(int(m.group(0)[1:-1], 16)), # type: ignore
s,
)
try:
argv = [unmangle(argv_unicode[i]).encode('utf-8') for i in xrange(0, argc.value)]