Commit a8b6b7bb authored by Jim Fulton's avatar Jim Fulton

Windows tweaks

parent a9195197
...@@ -255,7 +255,7 @@ class Handler(BaseHTTPServer.BaseHTTPRequestHandler): ...@@ -255,7 +255,7 @@ class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
self.send_header('Content-Length', str(len(out))) self.send_header('Content-Length', str(len(out)))
self.send_header('Content-Type', 'text/html') self.send_header('Content-Type', 'text/html')
else: else:
out = open(path).read() out = open(path, 'rb').read()
self.send_header('Content-Length', len(out)) self.send_header('Content-Length', len(out))
if path.endswith('.egg'): if path.endswith('.egg'):
self.send_header('Content-Type', 'application/zip') self.send_header('Content-Type', 'application/zip')
...@@ -362,10 +362,16 @@ def install_develop(project, destination): ...@@ -362,10 +362,16 @@ def install_develop(project, destination):
).write(dist.location) ).write(dist.location)
def _normalize_path(match): def _normalize_path(match):
return '/'+match.group(1).replace(os.path.sep, '/') path = match.group(1)
if os.path.sep == '\\':
path = path.replace('\\\\', '/')
if path.startswith('\\'):
path = path[1:]
return '/' + path.replace(os.path.sep, '/')
normalize_path = ( normalize_path = (
re.compile(r'''[^'" \t\n\r]+%(sep)s_TEST_%(sep)s([^"' \t\n\r]+)''' re.compile(
r'''[^'" \t\n\r]+\%(sep)s_[Tt][Ee][Ss][Tt]_\%(sep)s([^"' \t\n\r]+)'''
% dict(sep=os.path.sep)), % dict(sep=os.path.sep)),
_normalize_path, _normalize_path,
) )
......
...@@ -570,6 +570,7 @@ def test_suite(): ...@@ -570,6 +570,7 @@ def test_suite():
(re.compile('zc.buildout(-\S+)?[.]egg(-link)?'), (re.compile('zc.buildout(-\S+)?[.]egg(-link)?'),
'zc.buildout.egg'), 'zc.buildout.egg'),
(re.compile('creating \S*setup.cfg'), 'creating setup.cfg'), (re.compile('creating \S*setup.cfg'), 'creating setup.cfg'),
(re.compile('hello\%ssetup' % os.path.sep), 'hello/setup'),
]) ])
), ),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment