##// END OF EJS Templates
Merge pull request #10179 from srinivasreddy/rm_unicode_char...
Matthias Bussonnier -
r23216:636e0af5 merge
parent child Browse files
Show More
@@ -37,7 +37,7 b" if sys.platform == 'win32':"
37 --------
37 --------
38
38
39 >>> get_long_path_name('c:\\docume~1')
39 >>> get_long_path_name('c:\\docume~1')
40 u'c:\\\\Documents and Settings'
40 'c:\\\\Documents and Settings'
41
41
42 """
42 """
43 try:
43 try:
@@ -62,7 +62,7 b' def pkg_commit_hash(pkg_path):'
62 repo_commit, _ = proc.communicate()
62 repo_commit, _ = proc.communicate()
63 if repo_commit:
63 if repo_commit:
64 return 'repository', repo_commit.strip().decode('ascii')
64 return 'repository', repo_commit.strip().decode('ascii')
65 return '(none found)', u'<not found>'
65 return '(none found)', '<not found>'
66
66
67
67
68 def pkg_info(pkg_path):
68 def pkg_info(pkg_path):
@@ -251,11 +251,11 b' def test_get_long_path_name_win32():'
251
251
252 # Make a long path. Expands the path of tmpdir prematurely as it may already have a long
252 # Make a long path. Expands the path of tmpdir prematurely as it may already have a long
253 # path component, so ensure we include the long form of it
253 # path component, so ensure we include the long form of it
254 long_path = os.path.join(path.get_long_path_name(tmpdir), u'this is my long path name')
254 long_path = os.path.join(path.get_long_path_name(tmpdir), 'this is my long path name')
255 os.makedirs(long_path)
255 os.makedirs(long_path)
256
256
257 # Test to see if the short path evaluates correctly.
257 # Test to see if the short path evaluates correctly.
258 short_path = os.path.join(tmpdir, u'THISIS~1')
258 short_path = os.path.join(tmpdir, 'THISIS~1')
259 evaluated_path = path.get_long_path_name(short_path)
259 evaluated_path = path.get_long_path_name(short_path)
260 nt.assert_equal(evaluated_path.lower(), long_path.lower())
260 nt.assert_equal(evaluated_path.lower(), long_path.lower())
261
261
@@ -315,7 +315,7 b' def test_unicode_in_filename():'
315 """
315 """
316 try:
316 try:
317 # these calls should not throw unicode encode exceptions
317 # these calls should not throw unicode encode exceptions
318 path.get_py_filename(u'fooéè.py', force_win32=False)
318 path.get_py_filename('fooéè.py', force_win32=False)
319 except IOError as ex:
319 except IOError as ex:
320 str(ex)
320 str(ex)
321
321
@@ -398,11 +398,11 b' def test_unescape_glob():'
398
398
399 def test_ensure_dir_exists():
399 def test_ensure_dir_exists():
400 with TemporaryDirectory() as td:
400 with TemporaryDirectory() as td:
401 d = os.path.join(td, u'∂ir')
401 d = os.path.join(td, '∂ir')
402 path.ensure_dir_exists(d) # create it
402 path.ensure_dir_exists(d) # create it
403 assert os.path.isdir(d)
403 assert os.path.isdir(d)
404 path.ensure_dir_exists(d) # no-op
404 path.ensure_dir_exists(d) # no-op
405 f = os.path.join(td, u'ƒile')
405 f = os.path.join(td, 'ƒile')
406 open(f, 'w').close() # touch
406 open(f, 'w').close() # touch
407 with nt.assert_raises(IOError):
407 with nt.assert_raises(IOError):
408 path.ensure_dir_exists(f)
408 path.ensure_dir_exists(f)
@@ -570,7 +570,7 b' class FullEvalFormatter(Formatter):'
570 # format the object and append to the result
570 # format the object and append to the result
571 result.append(self.format_field(obj, ''))
571 result.append(self.format_field(obj, ''))
572
572
573 return u''.join(py3compat.cast_unicode(s) for s in result)
573 return ''.join(py3compat.cast_unicode(s) for s in result)
574
574
575
575
576 class DollarFormatter(FullEvalFormatter):
576 class DollarFormatter(FullEvalFormatter):
General Comments 0
You need to be logged in to leave comments. Login now