pass unicode path to listdir to get back unicode filenames
This commit is contained in:
parent
5fc0fdf067
commit
e6e07a017d
3 changed files with 3 additions and 3 deletions
|
@ -280,7 +280,7 @@ class ArgumentsTestCase(utils.TestCase):
|
||||||
self.patched['wakatime.packages.requests.adapters.HTTPAdapter.send'].return_value = response
|
self.patched['wakatime.packages.requests.adapters.HTTPAdapter.send'].return_value = response
|
||||||
|
|
||||||
with utils.TemporaryDirectory() as tempdir:
|
with utils.TemporaryDirectory() as tempdir:
|
||||||
filename = list(filter(lambda x: x.endswith('.txt'), os.listdir('tests/samples/codefiles/unicode')))[0]
|
filename = list(filter(lambda x: x.endswith('.txt'), os.listdir(u('tests/samples/codefiles/unicode'))))[0]
|
||||||
entity = os.path.join('tests/samples/codefiles/unicode', filename)
|
entity = os.path.join('tests/samples/codefiles/unicode', filename)
|
||||||
shutil.copy(entity, os.path.join(tempdir, filename))
|
shutil.copy(entity, os.path.join(tempdir, filename))
|
||||||
entity = os.path.realpath(os.path.join(tempdir, filename))
|
entity = os.path.realpath(os.path.join(tempdir, filename))
|
||||||
|
|
|
@ -493,7 +493,7 @@ class MainTestCase(utils.TestCase):
|
||||||
self.patched['wakatime.packages.requests.adapters.HTTPAdapter.send'].return_value = response
|
self.patched['wakatime.packages.requests.adapters.HTTPAdapter.send'].return_value = response
|
||||||
|
|
||||||
with utils.TemporaryDirectory() as tempdir:
|
with utils.TemporaryDirectory() as tempdir:
|
||||||
filename = list(filter(lambda x: x.endswith('.txt'), os.listdir('tests/samples/codefiles/unicode')))[0]
|
filename = list(filter(lambda x: x.endswith('.txt'), os.listdir(u('tests/samples/codefiles/unicode'))))[0]
|
||||||
entity = os.path.join('tests/samples/codefiles/unicode', filename)
|
entity = os.path.join('tests/samples/codefiles/unicode', filename)
|
||||||
shutil.copy(entity, os.path.join(tempdir, filename))
|
shutil.copy(entity, os.path.join(tempdir, filename))
|
||||||
entity = os.path.realpath(os.path.join(tempdir, filename))
|
entity = os.path.realpath(os.path.join(tempdir, filename))
|
||||||
|
|
|
@ -76,7 +76,7 @@ except ImportError:
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
def __exit__(self, exc_type, exc_value, traceback):
|
def __exit__(self, exc_type, exc_value, traceback):
|
||||||
shutil.rmtree(self.name)
|
shutil.rmtree(u(self.name))
|
||||||
|
|
||||||
|
|
||||||
class NamedTemporaryFile(object):
|
class NamedTemporaryFile(object):
|
||||||
|
|
Loading…
Reference in a new issue