mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
56ce3468b4
Different Python & OS versions have different environ behavior wrt accepted types & encoding. Since we're migrating to be Python 3 only, lets change our code to assume strings always work as that's what the newer Python 3 does. This will fail under Python 2 for some env vars, mostly on Windows, but the effort of maintaining shim layers that can handle these edge cases isn't worth it when we're dropping that code. We leave the logic in the `repo` launcher for now as it is simple, and we want it to be able to switch versions a bit longer than the rest of the tree. Here's the support table: | *NIX | Windows | Python 2 | ASCII string | str or bytes, not unicode | Python 3 | str or bytes | str only | Windows uses strings natively in its environment all the time. But it doesn't allow unicode strings under Python 2, so we have to encode. Python 2 on *NIX is funky in that it always lowers to ASCII, so we had to manually encode to avoid errors regardless of unicode or str. Python 3 on Windows & *NIX will accept strings. *NIX will also accept bytes but Windows will not. Bug: https://crbug.com/gerrit/12145 Change-Id: I3cf8f95a06902754ea1f08ad4b28503f7063531b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/248972 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Michael Mortensen <mmortensen@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> |
||
---|---|---|
.. | ||
__init__.py | ||
abandon.py | ||
branches.py | ||
checkout.py | ||
cherry_pick.py | ||
diff.py | ||
diffmanifests.py | ||
download.py | ||
forall.py | ||
gitc_delete.py | ||
gitc_init.py | ||
grep.py | ||
help.py | ||
info.py | ||
init.py | ||
list.py | ||
manifest.py | ||
overview.py | ||
prune.py | ||
rebase.py | ||
selfupdate.py | ||
smartsync.py | ||
stage.py | ||
start.py | ||
status.py | ||
sync.py | ||
upload.py | ||
version.py |