@@ -194,8 +194,8 @@ def match_path(path, pattern):
194
194
if pattern :
195
195
pattern = os .path .relpath (pattern )
196
196
197
- pattern_components = pattern .split ('/' )
198
- path_components = path .split ('/' )[:len (pattern_components )]
197
+ pattern_components = pattern .split (os . path . sep )
198
+ path_components = path .split (os . path . sep )[:len (pattern_components )]
199
199
return fnmatch ('/' .join (path_components ), pattern )
200
200
201
201
@@ -438,8 +438,8 @@ def parse_host(addr, is_win32=False, tls=False):
438
438
"Bind address needs a port: {0}" .format (addr ))
439
439
440
440
if proto == "http+unix" or proto == 'npipe' :
441
- return "{0}://{1}" .format (proto , host )
442
- return "{0}://{1}:{2}{3}" .format (proto , host , port , path )
441
+ return "{0}://{1}" .format (proto , host ). rstrip ( '/' )
442
+ return "{0}://{1}:{2}{3}" .format (proto , host , port , path ). rstrip ( '/' )
443
443
444
444
445
445
def parse_devices (devices ):
@@ -986,6 +986,9 @@ def format_environment(environment):
986
986
def format_env (key , value ):
987
987
if value is None :
988
988
return key
989
+ if isinstance (value , six .binary_type ):
990
+ value = value .decode ('utf-8' )
991
+
989
992
return u'{key}={value}' .format (key = key , value = value )
990
993
return [format_env (* var ) for var in six .iteritems (environment )]
991
994
0 commit comments