Commit cef81ebf authored by jim's avatar jim

Windows tweaks

git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@70244 62d5b8a3-27da-0310-9561-8e5933582275
parent d333c878
...@@ -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,11 +362,17 @@ def install_develop(project, destination): ...@@ -362,11 +362,17 @@ 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(
% dict(sep=os.path.sep)), r'''[^'" \t\n\r]+\%(sep)s_[Tt][Ee][Ss][Tt]_\%(sep)s([^"' \t\n\r]+)'''
% 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