-
-
Notifications
You must be signed in to change notification settings - Fork 907
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1725 from EliahKagan/strings
Revise comments, docstrings, some messages, and a bit of code
- Loading branch information
Showing
67 changed files
with
3,521 additions
and
3,063 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
# -*- coding: utf-8 -*- | ||
# config.py | ||
# compat.py | ||
# Copyright (C) 2008, 2009 Michael Trier ([email protected]) and contributors | ||
# | ||
# This module is part of GitPython and is released under | ||
# the BSD License: https://opensource.org/license/bsd-3-clause/ | ||
"""utilities to help provide compatibility with python 3""" | ||
|
||
"""Utilities to help provide compatibility with Python 3.""" | ||
|
||
# flake8: noqa | ||
|
||
import locale | ||
|
@@ -50,7 +51,7 @@ def safe_decode(s: AnyStr) -> str: | |
|
||
|
||
def safe_decode(s: Union[AnyStr, None]) -> Optional[str]: | ||
"""Safely decodes a binary string to unicode""" | ||
"""Safely decode a binary string to Unicode.""" | ||
if isinstance(s, str): | ||
return s | ||
elif isinstance(s, bytes): | ||
|
@@ -72,7 +73,7 @@ def safe_encode(s: AnyStr) -> bytes: | |
|
||
|
||
def safe_encode(s: Optional[AnyStr]) -> Optional[bytes]: | ||
"""Safely encodes a binary string to unicode""" | ||
"""Safely encode a binary string to Unicode.""" | ||
if isinstance(s, str): | ||
return s.encode(defenc) | ||
elif isinstance(s, bytes): | ||
|
@@ -94,7 +95,7 @@ def win_encode(s: AnyStr) -> bytes: | |
|
||
|
||
def win_encode(s: Optional[AnyStr]) -> Optional[bytes]: | ||
"""Encode unicodes for process arguments on Windows.""" | ||
"""Encode Unicode strings for process arguments on Windows.""" | ||
if isinstance(s, str): | ||
return s.encode(locale.getpreferredencoding(False)) | ||
elif isinstance(s, bytes): | ||
|
Oops, something went wrong.