Modified: trunk/Tools/ChangeLog (282301 => 282302)
--- trunk/Tools/ChangeLog 2021-09-10 23:29:37 UTC (rev 282301)
+++ trunk/Tools/ChangeLog 2021-09-10 23:39:55 UTC (rev 282302)
@@ -1,3 +1,16 @@
+2021-09-10 Jonathan Bedard <jbed...@apple.com>
+
+ [webkitcorepy] AutoInstall occasionally raising SSL error (Part 2)
+ https://bugs.webkit.org/show_bug.cgi?id=230169
+ <rdar://problem/82767008>
+
+ Reviewed by Dewei Zhu.
+
+ * Scripts/libraries/webkitcorepy/setup.py: Bump version.
+ * Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py: Ditto.
+ * Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py:
+ (Package.archives): Add retry when listing archives.
+
2021-09-10 David Kilzer <ddkil...@apple.com>
Fix ASan+UBSan builds: part two
Modified: trunk/Tools/Scripts/libraries/webkitcorepy/setup.py (282301 => 282302)
--- trunk/Tools/Scripts/libraries/webkitcorepy/setup.py 2021-09-10 23:29:37 UTC (rev 282301)
+++ trunk/Tools/Scripts/libraries/webkitcorepy/setup.py 2021-09-10 23:39:55 UTC (rev 282302)
@@ -30,7 +30,7 @@
setup(
name='webkitcorepy',
- version='0.10.2',
+ version='0.10.3',
description='Library containing various Python support classes and functions.',
long_description=readme(),
classifiers=[
Modified: trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py (282301 => 282302)
--- trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py 2021-09-10 23:29:37 UTC (rev 282301)
+++ trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py 2021-09-10 23:39:55 UTC (rev 282302)
@@ -42,7 +42,7 @@
from webkitcorepy.call_by_need import CallByNeed
from webkitcorepy.editor import Editor
-version = Version(0, 10, 2)
+version = Version(0, 10, 3)
from webkitcorepy.autoinstall import Package, AutoInstall
if sys.version_info > (3, 0):
Modified: trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py (282301 => 282302)
--- trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py 2021-09-10 23:29:37 UTC (rev 282301)
+++ trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py 2021-09-10 23:39:55 UTC (rev 282302)
@@ -178,68 +178,80 @@
AutoInstall._verify_index()
path = 'simple/{}/'.format(self.pypi_name)
- response = AutoInstall._request('https://{}/{}'.format(AutoInstall.index, path))
- try:
- if response.code != 200:
- raise ValueError('The package {} was not found on {}'.format(self.pypi_name, AutoInstall.index))
+ count = 0
+ while count <= (AutoInstall.times_to_retry or 0):
+ response = None
+ try:
+ response = AutoInstall._request('https://{}/{}'.format(AutoInstall.index, path))
+ if response.code != 200:
+ raise ValueError('The package {} was not found on {}'.format(self.pypi_name, AutoInstall.index))
- packages = SimplyPypiIndexPageParser.parse(response.read().decode("UTF-8"))
- cached_tags = None
+ packages = SimplyPypiIndexPageParser.parse(response.read().decode("UTF-8"))
+ cached_tags = None
- for package in reversed(packages):
- if self.wheel:
- match = re.search(r'.+-([^-]+-[^-]+-[^-]+).whl', package['name'])
- if not match:
- continue
+ for package in reversed(packages):
+ if self.wheel:
+ match = re.search(r'.+-([^-]+-[^-]+-[^-]+).whl', package['name'])
+ if not match:
+ continue
- from packaging import tags
+ from packaging import tags
- if not cached_tags:
- cached_tags = set(AutoInstall.tags())
+ if not cached_tags:
+ cached_tags = set(AutoInstall.tags())
- if all([tag not in cached_tags for tag in tags.parse_tag(match.group(1))]):
- continue
+ if all([tag not in cached_tags for tag in tags.parse_tag(match.group(1))]):
+ continue
- extension = 'whl'
+ extension = 'whl'
- else:
- if package['name'].endswith(('.tar.gz', '.tar.bz2')):
- extension = 'tar.gz'
- elif package['name'].endswith('.zip'):
- extension = 'zip'
else:
+ if package['name'].endswith(('.tar.gz', '.tar.bz2')):
+ extension = 'tar.gz'
+ elif package['name'].endswith('.zip'):
+ extension = 'zip'
+ else:
+ continue
+
+ requires = package.get('data-requires-python')
+ if requires and not AutoInstall.version.matches(requires):
continue
- requires = package.get('data-requires-python')
- if requires and not AutoInstall.version.matches(requires):
- continue
+ version_candidate = re.search(r'\d+\.\d+(\.\d+)?', package["name"])
+ if not version_candidate:
+ continue
+ version = Version(*version_candidate.group().split('.'))
+ if self.version and version not in self.version:
+ continue
- version_candidate = re.search(r'\d+\.\d+(\.\d+)?', package["name"])
- if not version_candidate:
- continue
- version = Version(*version_candidate.group().split('.'))
- if self.version and version not in self.version:
- continue
+ link = package['href'].split('#')[0]
+ if '://' not in link:
+ depth = 0
+ while link.startswith('../'):
+ depth += 1
+ link = link[3:]
+ link = 'https://{}/{}{}'.format(AutoInstall.index, '/'.join(path.split('/')[depth:]), link)
- link = package['href'].split('#')[0]
- if '://' not in link:
- depth = 0
- while link.startswith('../'):
- depth += 1
- link = link[3:]
- link = 'https://{}/{}{}'.format(AutoInstall.index, '/'.join(path.split('/')[depth:]), link)
+ self._archives.append(self.Archive(
+ name=self.pypi_name,
+ link=link,
+ version=version,
+ extension=extension,
+ ))
- self._archives.append(self.Archive(
- name=self.pypi_name,
- link=link,
- version=version,
- extension=extension,
- ))
+ self._archives = sorted(self._archives, key=lambda archive: archive.version)
+ return self._archives
- self._archives = sorted(self._archives, key=lambda archive: archive.version)
- return self._archives
- finally:
- response.close()
+ except (IOError, URLError) as e:
+ if count > (AutoInstall.times_to_retry or 0):
+ raise
+ else:
+ AutoInstall.log(str(e))
+ AutoInstall.log('Failed to download {}, retrying'.format(self.name))
+ finally:
+ if response:
+ response.close()
+ count += 1
def is_cached(self):
manifest = AutoInstall.manifest.get(self.name)