[Checkins] SVN: zc.buildout/branches/tlotze-download-api/src/zc/buildout/download. treat download locations given as bare file paths like file:// URLs, might still break on Windows

Thomas Lotze tl at gocept.com
Thu Jun 4 03:27:48 EDT 2009


Log message for revision 100627:
  treat download locations given as bare file paths like file:// URLs, might still break on Windows

Changed:
  U   zc.buildout/branches/tlotze-download-api/src/zc/buildout/download.py
  U   zc.buildout/branches/tlotze-download-api/src/zc/buildout/download.txt

-=-
Modified: zc.buildout/branches/tlotze-download-api/src/zc/buildout/download.py
===================================================================
--- zc.buildout/branches/tlotze-download-api/src/zc/buildout/download.py	2009-06-04 07:26:36 UTC (rev 100626)
+++ zc.buildout/branches/tlotze-download-api/src/zc/buildout/download.py	2009-06-04 07:27:48 UTC (rev 100627)
@@ -134,7 +134,7 @@
 
         """
         if (self.buildout.get('offline')
-            and urlparse.urlparse(url).scheme != 'file'):
+            and urlparse.urlparse(url, 'file').scheme != 'file'):
             raise zc.buildout.UserError(
                 "Couldn't download %r in offline mode." % url)
 

Modified: zc.buildout/branches/tlotze-download-api/src/zc/buildout/download.txt
===================================================================
--- zc.buildout/branches/tlotze-download-api/src/zc/buildout/download.txt	2009-06-04 07:26:36 UTC (rev 100626)
+++ zc.buildout/branches/tlotze-download-api/src/zc/buildout/download.txt	2009-06-04 07:27:48 UTC (rev 100627)
@@ -75,8 +75,11 @@
 Traceback (most recent call last):
 UserError: Couldn't download 'http://localhost/foo.txt' in offline mode.
 
-As an exception to this rule, URLs in the ``file`` scheme will still work:
+As an exception to this rule, file system paths and URLs in the ``file``
+scheme will still work:
 
+>>> cat(download(join(server_data, 'foo.txt')))
+This is a foo text.
 >>> cat(download('file://%s/foo.txt' % server_data))
 This is a foo text.
 



More information about the Checkins mailing list