Fix prepare-dev.py hook installation on Python 3
Review Request #10680 — Created Sept. 5, 2019 and submitted
There were two issues in the implementation of
install_git_hooks
that
prevented it from working on Python 3:
- an old-style (0777) octal literal was used instead of a new-style one
(0o777): old-style literals are not supported on Python 3; and
- bytes and unicode were being mixed inos.path.join
, which is not an
issue in Python 2 but is on Python 3.Since
prepare-dev.py
is intended to install dependencies, we can't
assume the presence ofsix
, so we determine the correct string type
manually.
Ran prepare-dev.py under Python 2 and Python 3 and it created git
hooks successfully.
- Commit:
-
f9773ad7db70963d94d81c0de898fcffa7408bd3b3028a9d588a1fe51aaebe18221ae1110eba82d4
- Diff:
-
Revision 2 (+11 -1)
Checks run (2 succeeded)
- Change Summary:
-
Rebase on top of latest master.
- Commit:
-
b3028a9d588a1fe51aaebe18221ae1110eba82d41f96fcf03828b7a0b1ce71c7a1fdb2ee04a9c095
- Diff:
-
Revision 3 (+11 -1)
Checks run (2 succeeded)
- Change Summary:
-
Addressed david's issues.
- Commit:
-
1f96fcf03828b7a0b1ce71c7a1fdb2ee04a9c0951a1c1efdc43ae959e92271a5c4fcc4b4ac290871
- Diff:
-
Revision 4 (+1219 -1839)
Checks run (2 succeeded)
- Change Summary:
-
- Commit:
-
1a1c1efdc43ae959e92271a5c4fcc4b4ac290871747677fa5046a02fdcb2835ce916b24cf2cd7346
- Diff:
-
Revision 5 (+4 -1)
Checks run (2 succeeded)
- Commit:
-
747677fa5046a02fdcb2835ce916b24cf2cd7346b9d4ca192e8c88550c8ff1bbf4dcd6160aef0fb0
Checks run (2 succeeded)
- Commit:
-
b9d4ca192e8c88550c8ff1bbf4dcd6160aef0fb09f69293e3878a4bef4c692cd0acc9312258d6e5f
- Diff:
-
Revision 7 (+6 -3)