Fix Windows git commit ValueError: embedded null character.
Use git commit -F and strip NULs from argv/version strings (0.3.7). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -9,7 +9,8 @@ _VERSION_FILE = Path(__file__).resolve().parent.parent / "VERSION"
|
||||
|
||||
def _read_version() -> str:
|
||||
try:
|
||||
return _VERSION_FILE.read_text(encoding="utf-8").strip()
|
||||
text = _VERSION_FILE.read_text(encoding="utf-8-sig", errors="ignore")
|
||||
return text.replace("\0", "").strip() or "0.0.0"
|
||||
except OSError:
|
||||
return "0.0.0"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user