Skip to content

Commit 50dddbd

Browse files
committed
chore: sync cli.py and common_utils.py from development
1 parent eb9c6ac commit 50dddbd

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

src/omnipkg/cli.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2036,7 +2036,10 @@ def main():
20362036
_("🗑️ Uninstalling Python interpreter(s): {}").format(", ".join(python_versions))
20372037
)
20382038
for version in python_versions:
2039-
result = pkg_instance.remove_interpreter(version, force=args.force)
2039+
result = pkg_instance.remove_interpreter(
2040+
version,
2041+
force=args.force or not is_interactive
2042+
)
20402043
if result != 0:
20412044
safe_print(_("⚠️ Warning: Failed to remove Python {}").format(version))
20422045

src/omnipkg/common_utils.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ def safe_print(*args, **kwargs):
2929
Detects non-UTF8 sessions (like cp1252) and strips emojis to prevent mojibake.
3030
"""
3131
from omnipkg.i18n import _
32-
32+
3333
# CRITICAL WINDOWS FIX: Force proper output handling
3434
if sys.platform == "win32":
3535
# Always flush on Windows to prevent buffer corruption
3636
kwargs["flush"] = True
37-
37+
3838
# Ensure stdout/stderr are properly flushed before printing
3939
try:
4040
sys.stdout.flush()
@@ -43,17 +43,17 @@ def safe_print(*args, **kwargs):
4343
pass
4444
elif "flush" not in kwargs:
4545
kwargs["flush"] = True
46-
46+
4747
try:
4848
_builtin_print(*args, **kwargs)
49-
49+
5050
# CRITICAL: Force additional flush on Windows after print
5151
if sys.platform == "win32":
5252
try:
5353
sys.stdout.flush()
5454
except:
5555
pass
56-
56+
5757
except UnicodeEncodeError:
5858
try:
5959
safe_args = []
@@ -76,14 +76,14 @@ def safe_print(*args, **kwargs):
7676
else:
7777
safe_args.append(arg)
7878
_builtin_print(*safe_args, **kwargs)
79-
79+
8080
# CRITICAL: Force flush after fallback print too
8181
if sys.platform == "win32":
8282
try:
8383
sys.stdout.flush()
8484
except:
8585
pass
86-
86+
8787
except Exception:
8888
_builtin_print("[omnipkg: Encoding Error - Shell might not support UTF-8]", flush=True)
8989
if sys.platform == "win32":
@@ -374,7 +374,7 @@ class ProcessCorruptedException(Exception):
374374

375375
class UVFailureDetector:
376376
"""Detects UV dependency resolution failures."""
377-
377+
378378
FAILURE_PATTERNS = [
379379
"No solution found when resolving dependencies",
380380
"ResolutionImpossible",

0 commit comments

Comments
 (0)