Skip to content

Commit c5a5a1b

Browse files
1. Don't crash if settings plist is corrupted.
2. Make add_doc_to_wheels catch more of my mistakes. 3. Update stats
1 parent de75310 commit c5a5a1b

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

dev/release_tools/release_steps.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ h. Version 3.0(.1): 292 Mac, 434 Windows.
120120
i. Version 3.0.2: 68 Mac, 70 Windows.
121121
j. Version 3.0.3: 667 Mac, 1333 Windows. (36% Mac, 64% Windows for 3.0.*)
122122
h. Version 3.1.*: 883 Mac, 1482 Windows. (37% Mac, 63% Windows)
123+
k. Version 3.2: 607 Mac, 740 Windows, 134 Linux (41% Mac, 50% Windows, 9% Linux)
123124

124125
Average downloads for 2015-3-22 through 2017-10-26.
125126

doc_src/add_doc_to_wheels.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
from zipfile import ZipFile
1515

1616
doc_zipfile = os.path.abspath(sys.argv[1])
17+
if not doc_zipfile.endswith('.zip'):
18+
raise ValueError('First argument should be a zipfile')
19+
1720
wheel_names = glob.glob(sys.argv[2] + '/snappy-*.whl')
1821
if len(wheel_names) == 0:
1922
raise ValueError('No snappy wheels in wheeldir!')
@@ -40,7 +43,7 @@ def normalize(path):
4043

4144
print('Unpacking docs..')
4245
with ZipFile(doc_zipfile) as doc_zip:
43-
if len({path.split('/')[0] for path in doc_zip.namelist()}) == 1:
46+
if len({path.split('/')[0] for path in doc_zip.namelist()}) < 5:
4447
raise ValueError('doc zipfile has top-level directory, bailing')
4548

4649
subprocess.check_call(['unzip', '-q', doc_zipfile, '-d', target_doc_dir])

python/settings.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ def find_settings(self):
7171
def read_settings(self):
7272
if self.setting_file and os.path.exists(self.setting_file):
7373
with open(self.setting_file, 'rb') as setting_file:
74-
new_settings = plistlib.load(setting_file)
74+
try:
75+
new_settings = plistlib.load(setting_file)
76+
except: # file has been corrupted, ignore it.
77+
return
7578

7679
if 'font' in new_settings:
7780
family, size, info = new_settings['font']

0 commit comments

Comments
 (0)