mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-02 09:17:59 +00:00
Suppress typing errors in fileutil, crawler, fixups.
This commit is contained in:
parent
8da82e9ed5
commit
25cce8b77e
@ -19,7 +19,7 @@ import os, time, struct
|
|||||||
try:
|
try:
|
||||||
import cPickle as pickle
|
import cPickle as pickle
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import pickle
|
import pickle # type: ignore
|
||||||
from twisted.internet import reactor
|
from twisted.internet import reactor
|
||||||
from twisted.application import service
|
from twisted.application import service
|
||||||
from allmydata.storage.common import si_b2a
|
from allmydata.storage.common import si_b2a
|
||||||
|
@ -311,7 +311,7 @@ def precondition_abspath(path):
|
|||||||
|
|
||||||
_getfullpathname = None
|
_getfullpathname = None
|
||||||
try:
|
try:
|
||||||
from nt import _getfullpathname
|
from nt import _getfullpathname # type: ignore
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -217,7 +217,12 @@ def initialize():
|
|||||||
# Instead it "mangles" or escapes them using \x7F as an escape character, which we
|
# Instead it "mangles" or escapes them using \x7F as an escape character, which we
|
||||||
# unescape here.
|
# unescape here.
|
||||||
def unmangle(s):
|
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:
|
try:
|
||||||
argv = [unmangle(argv_unicode[i]).encode('utf-8') for i in xrange(0, argc.value)]
|
argv = [unmangle(argv_unicode[i]).encode('utf-8') for i in xrange(0, argc.value)]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user