-
Notifications
You must be signed in to change notification settings - Fork 6k
Fix zip bundle structure #27150
Fix zip bundle structure #27150
Conversation
|
Should I try to add some test(s) where we unzip this file and make sure the paths come out right? :\ |
|
You could try just inspecting it with https://docs.python.org/3/library/zipfile.html from |
|
Ok, added a test. In doing that I found that I was using |
| cwd=SRC_DIR | ||
| ) | ||
| stdout_data, stderr_data = p.communicate(input=' '.join(codepoints)) | ||
| stdout_data, stderr_data = p.communicate(input=' '.join(codepoints).encode()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.encode is needed for python3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also pass universal_newlines=True to subprocess.Popen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to .encode, or instead of it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh I see instead of it.
| with ZipFile(FONT_SUBSET_ZIP, 'r') as zip: | ||
| files = zip.namelist() | ||
| if 'font-subset%s' % EXE not in files: | ||
| print('expected %s to contain font-subset%s' % (files, EXE)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fail if it got inserted into the zip as Users/me/src/flutter/engine/src/flutter/tools/font-subset instead of just font-subset.
zanderso
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
| cwd=SRC_DIR | ||
| ) | ||
| stdout_data, stderr_data = p.communicate(input=' '.join(codepoints)) | ||
| stdout_data, stderr_data = p.communicate(input=' '.join(codepoints).encode()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also pass universal_newlines=True to subprocess.Popen.
* Fix zip bundle structure * Add test, make test.py python3 safe
* Fix zip bundle structure * Add test, make test.py python3 safe
We shouldn't be
rebase_pathing the destination.Before:
After: