Title: [138776] trunk/Tools
- Revision
- 138776
- Author
- [email protected]
- Date
- 2013-01-03 20:21:09 -0800 (Thu, 03 Jan 2013)
Log Message
Downloads can be flaky, so try downloading multiple times.
https://bugs.webkit.org/show_bug.cgi?id=105976
Patch by Tim 'mithro' Ansell <[email protected]> on 2013-01-03
Reviewed by Eric Seidel.
* Scripts/webkitpy/common/system/autoinstall.py:
(AutoInstaller._download_to_stream):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (138775 => 138776)
--- trunk/Tools/ChangeLog 2013-01-04 03:56:32 UTC (rev 138775)
+++ trunk/Tools/ChangeLog 2013-01-04 04:21:09 UTC (rev 138776)
@@ -1,3 +1,13 @@
+2013-01-03 Tim 'mithro' Ansell <[email protected]>
+
+ Downloads can be flaky, so try downloading multiple times.
+ https://bugs.webkit.org/show_bug.cgi?id=105976
+
+ Reviewed by Eric Seidel.
+
+ * Scripts/webkitpy/common/system/autoinstall.py:
+ (AutoInstaller._download_to_stream):
+
2013-01-03 Eric Seidel <[email protected]>
Rename Tool.port to deprecated_port in preparation for removing more callers
Modified: trunk/Tools/Scripts/webkitpy/common/system/autoinstall.py (138775 => 138776)
--- trunk/Tools/Scripts/webkitpy/common/system/autoinstall.py 2013-01-04 03:56:32 UTC (rev 138775)
+++ trunk/Tools/Scripts/webkitpy/common/system/autoinstall.py 2013-01-04 04:21:09 UTC (rev 138776)
@@ -284,17 +284,27 @@
return new_path
def _download_to_stream(self, url, stream):
- try:
- netstream = urllib.urlopen(url)
- except IOError, err:
- # Append existing Error message to new Error.
- message = ('Could not download Python modules from URL "%s".\n'
- " Make sure you are connected to the internet.\n"
- " You must be connected to the internet when "
- "downloading needed modules for the first time.\n"
- " --> Inner message: %s"
- % (url, err))
- raise IOError(message)
+ failures = 0
+ while True:
+ try:
+ netstream = urllib.urlopen(url)
+ break
+ except IOError, err:
+ # Try multiple times
+ if failures < 5:
+ _log.warning("Failed to download %s, %s retrying" % (
+ url, err))
+ failures += 1
+ continue
+
+ # Append existing Error message to new Error.
+ message = ('Could not download Python modules from URL "%s".\n'
+ " Make sure you are connected to the internet.\n"
+ " You must be connected to the internet when "
+ "downloading needed modules for the first time.\n"
+ " --> Inner message: %s"
+ % (url, err))
+ raise IOError(message)
code = 200
if hasattr(netstream, "getcode"):
code = netstream.getcode()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes