Skip to content

Commit 888f143

Browse files
fix: replace Unicode symbols with ASCII for Windows cp1252 compatibility
Replace non-ASCII characters (U+2713, U+2717, U+2192, U+2014) with ASCII equivalents (+, x, ->, -) to prevent UnicodeEncodeError on Windows terminals using legacy cp1252 encoding. Rich color markup still conveys pass/fail/warn semantics via green/red/yellow styling.
1 parent 243ab44 commit 888f143

1 file changed

Lines changed: 27 additions & 27 deletions

File tree

concore_cli/commands/doctor.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def doctor_check(console):
191191
console.print()
192192
console.print(
193193
Panel.fit(
194-
"[bold]concore Doctor System Readiness Report[/bold]",
194+
"[bold]concore Doctor - System Readiness Report[/bold]",
195195
border_style="cyan",
196196
)
197197
)
@@ -203,22 +203,22 @@ def doctor_check(console):
203203
# Python version
204204
py_version = platform.python_version()
205205
if sys.version_info >= (3, 9):
206-
console.print(f" [green][/green] Python {py_version} (>= 3.9 required)")
206+
console.print(f" [green]+[/green] Python {py_version} (>= 3.9 required)")
207207
passed += 1
208208
else:
209209
console.print(
210-
f" [red][/red] Python {py_version} concore requires Python >= 3.9"
210+
f" [red]x[/red] Python {py_version} - concore requires Python >= 3.9"
211211
)
212212
errors += 1
213213

214214
# concore installation
215215
try:
216216
from concore_cli import __version__
217217

218-
console.print(f" [green][/green] concore {__version__} installed")
218+
console.print(f" [green]+[/green] concore {__version__} installed")
219219
passed += 1
220220
except ImportError:
221-
console.print(" [red][/red] concore package not found")
221+
console.print(" [red]x[/red] concore package not found")
222222
errors += 1
223223

224224
# CONCOREPATH
@@ -227,15 +227,15 @@ def doctor_check(console):
227227
writable = os.access(str(concore_path), os.W_OK)
228228
status = "writable" if writable else "read-only"
229229
if writable:
230-
console.print(f" [green][/green] CONCOREPATH: {concore_path} ({status})")
230+
console.print(f" [green]+[/green] CONCOREPATH: {concore_path} ({status})")
231231
passed += 1
232232
else:
233233
console.print(
234234
f" [yellow]![/yellow] CONCOREPATH: {concore_path} ({status})"
235235
)
236236
warnings += 1
237237
else:
238-
console.print(f" [red][/red] CONCOREPATH: {concore_path} (not found)")
238+
console.print(f" [red]x[/red] CONCOREPATH: {concore_path} (not found)")
239239
errors += 1
240240

241241
console.print()
@@ -266,25 +266,25 @@ def doctor_check(console):
266266
warnings += 1
267267
console.print(
268268
f" [yellow]![/yellow] {tool_label}{exe_info}"
269-
f"{version_str} {path}{extra}"
269+
f"{version_str} -> {path}{extra}"
270270
)
271271
continue
272272
console.print(
273-
f" [green][/green] {tool_label}{exe_info}"
274-
f"{version_str} {path}{extra}"
273+
f" [green]+[/green] {tool_label}{exe_info}"
274+
f"{version_str} -> {path}{extra}"
275275
)
276276
passed += 1
277277
else:
278278
hint = tool_def["install_hints"].get(plat_name, "")
279279
hint_str = f" (install: {hint})" if hint else ""
280-
# Docker, MATLAB, Verilog are optional show as warning
280+
# Docker, MATLAB, Verilog are optional - show as warning
281281
if tool_label in ("MATLAB", "Verilog (iverilog)", "Docker"):
282282
console.print(
283-
f" [yellow]![/yellow] {tool_label} Not found{hint_str}"
283+
f" [yellow]![/yellow] {tool_label} -> Not found{hint_str}"
284284
)
285285
warnings += 1
286286
else:
287-
console.print(f" [red][/red] {tool_label} Not found{hint_str}")
287+
console.print(f" [red]x[/red] {tool_label} -> Not found{hint_str}")
288288
errors += 1
289289

290290
console.print()
@@ -314,32 +314,32 @@ def doctor_check(console):
314314
]
315315
)
316316
console.print(
317-
f" [green][/green] {filename} "
317+
f" [green]+[/green] {filename} -> "
318318
f"{line_count} tool path(s) configured"
319319
)
320320
elif filename == "concore.mcr":
321321
if os.path.exists(os.path.expanduser(content)):
322-
console.print(f" [green][/green] {filename} {content}")
322+
console.print(f" [green]+[/green] {filename} -> {content}")
323323
passed += 1
324324
else:
325325
console.print(
326-
f" [yellow]![/yellow] {filename} "
326+
f" [yellow]![/yellow] {filename} -> "
327327
f"path does not exist: {content}"
328328
)
329329
warnings += 1
330330
continue
331331
elif filename == "concore.sudo":
332-
console.print(f" [green][/green] {filename} {content}")
332+
console.print(f" [green]+[/green] {filename} -> {content}")
333333
elif filename == "concore.repo":
334-
console.print(f" [green][/green] {filename} {content}")
334+
console.print(f" [green]+[/green] {filename} -> {content}")
335335
else:
336-
console.print(f" [green][/green] {filename} Enabled")
336+
console.print(f" [green]+[/green] {filename} -> Enabled")
337337
passed += 1
338338
except Exception:
339-
console.print(f" [yellow]![/yellow] {filename} Could not read")
339+
console.print(f" [yellow]![/yellow] {filename} -> Could not read")
340340
warnings += 1
341341
else:
342-
console.print(f" [dim][/dim] {filename} Not set ({description})")
342+
console.print(f" [dim]-[/dim] {filename} -> Not set ({description})")
343343

344344
# Build environment variable list from TOOL_DEFINITIONS config_keys
345345
env_vars = []
@@ -349,10 +349,10 @@ def doctor_check(console):
349349
env_vars.append("DOCKEREXE")
350350
env_set = [v for v in env_vars if os.environ.get(v)]
351351
if env_set:
352-
console.print(f" [green][/green] Environment variables: {', '.join(env_set)}")
352+
console.print(f" [green]+[/green] Environment variables: {', '.join(env_set)}")
353353
passed += 1
354354
else:
355-
console.print(" [dim][/dim] No concore environment variables set")
355+
console.print(" [dim]-[/dim] No concore environment variables set")
356356

357357
console.print()
358358

@@ -362,20 +362,20 @@ def doctor_check(console):
362362
for pkg in REQUIRED_PACKAGES:
363363
found, version = _check_package(pkg)
364364
if found:
365-
console.print(f" [green][/green] {pkg} {version}")
365+
console.print(f" [green]+[/green] {pkg} {version}")
366366
passed += 1
367367
else:
368-
console.print(f" [red][/red] {pkg} Not installed (pip install {pkg})")
368+
console.print(f" [red]x[/red] {pkg} -> Not installed (pip install {pkg})")
369369
errors += 1
370370

371371
for pkg, install_hint in OPTIONAL_PACKAGES.items():
372372
found, version = _check_package(pkg)
373373
if found:
374-
console.print(f" [green][/green] {pkg} {version}")
374+
console.print(f" [green]+[/green] {pkg} {version}")
375375
passed += 1
376376
else:
377377
console.print(
378-
f" [yellow]![/yellow] {pkg} Not installed ({install_hint})"
378+
f" [yellow]![/yellow] {pkg} -> Not installed ({install_hint})"
379379
)
380380
warnings += 1
381381

0 commit comments

Comments
 (0)