From 305b3161c4b5a716604f84b89e6b52a310dae90a Mon Sep 17 00:00:00 2001 From: PeninsulaInd Date: Wed, 18 Mar 2026 18:56:48 -0500 Subject: [PATCH] Replace unicode arrows with ASCII in log/output strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Windows cp1252 console encoding can't handle → (U+2192), causing UnicodeEncodeError in logging. Replaced with -> in all runtime strings. Co-Authored-By: Claude Opus 4.6 (1M context) --- cheddahbot/agent.py | 2 +- cheddahbot/scheduler.py | 18 +++++++++--------- cheddahbot/tools/autocora.py | 2 +- cheddahbot/tools/content_creation.py | 4 ++-- cheddahbot/tools/press_release.py | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cheddahbot/agent.py b/cheddahbot/agent.py index 38904fa..dfda94f 100644 --- a/cheddahbot/agent.py +++ b/cheddahbot/agent.py @@ -394,7 +394,7 @@ class Agent: # Log to daily memory if self._memory: try: - self._memory.log_daily(f"[Execution] {prompt[:200]}\n→ {result[:500]}") + self._memory.log_daily(f"[Execution] {prompt[:200]}\n-> {result[:500]}") except Exception as e: log.warning("Failed to log execution to memory: %s", e) diff --git a/cheddahbot/scheduler.py b/cheddahbot/scheduler.py index 41025d5..e5c5dac 100644 --- a/cheddahbot/scheduler.py +++ b/cheddahbot/scheduler.py @@ -40,7 +40,7 @@ _pipeline_err_log.setLevel(logging.INFO) HEARTBEAT_OK = "HEARTBEAT_OK" -# Only tasks in these statuses are eligible for xlsx → ClickUp matching. +# Only tasks in these statuses are eligible for xlsx ->ClickUp matching. # "to do" is excluded to prevent accidental matches and AutoCora race conditions. # To force-reuse an xlsx for a "to do" task, set status to "running cora" first. _CORA_ELIGIBLE_STATUSES = frozenset({"running cora", "error"}) @@ -136,7 +136,7 @@ class Scheduler: resp.raise_for_status() answer = resp.json()["choices"][0]["message"]["content"].strip() result = "YES" in answer.upper() - log.debug("LLM plural check: '%s' vs '%s' → %s (%s)", a, b, result, answer) + log.debug("LLM plural check: '%s' vs '%s' ->%s (%s)", a, b, result, answer) except Exception as e: log.warning("LLM plural check failed for '%s' vs '%s': %s", a, b, e) result = False @@ -542,8 +542,8 @@ class Scheduler: # Move to "automation underway" on ClickUp immediately client.update_task_status(task_id, self.config.clickup.automation_status) - log.info("Executing ClickUp task: %s → %s", task.name, tool_name) - self._notify(f"Executing ClickUp task: **{task.name}** → Skill: `{tool_name}`") + log.info("Executing ClickUp task: %s ->%s", task.name, tool_name) + self._notify(f"Executing ClickUp task: **{task.name}** ->Skill: `{tool_name}`") self._register_execution(task_id, task.name, tool_name) try: @@ -821,7 +821,7 @@ class Scheduler: """Try to match a watched .xlsx file to a ClickUp task and run the pipeline.""" filename = xlsx_path.name # Normalize filename stem for matching - # e.g., "precision-cnc-machining" → "precision cnc machining" + # e.g., "precision-cnc-machining" ->"precision cnc machining" stem = xlsx_path.stem.lower().replace("-", " ").replace("_", " ") stem = re.sub(r"\s+", " ", stem).strip() @@ -1277,7 +1277,7 @@ class Scheduler: task.id, f"New Cora XLSX distributed — resetting from error to running cora.", ) - log.info("Distributor: reset task %s (%s) from error → running cora", task.id, task.name) + log.info("Distributor: reset task %s (%s) from error ->running cora", task.id, task.name) except Exception as e: log.warning("Distributor: failed to reset task %s: %s", task.id, e) @@ -1289,7 +1289,7 @@ class Scheduler: except OSError as e: log.warning("Could not move %s to processed: %s", filename, e) - log.info("Cora distributor: %s → %s", filename, ", ".join(copied_to)) + log.info("Cora distributor: %s ->%s", filename, ", ".join(copied_to)) self._notify( f"Cora distributor: **{filename}** copied to {', '.join(copied_to)}.\n" f"Matched tasks: {', '.join(matched_names)}", @@ -1505,7 +1505,7 @@ class Scheduler: def _check_cora_file_status(self, cora_tasks) -> dict[str, str]: """For each 'running cora' task, check where its xlsx sits on the network. - Returns a dict of task_id → human-readable status note. + Returns a dict of task_id ->human-readable status note. """ from .tools.linkbuilding import _fuzzy_keyword_match, _normalize_for_match @@ -1519,7 +1519,7 @@ class Scheduler: "content_processed": Path(self.config.content.cora_inbox) / "processed", } - # Build a map: normalized_stem → set of folder keys + # Build a map: normalized_stem ->set of folder keys file_locations: dict[str, set[str]] = {} for folder_key, folder_path in folders.items(): if not folder_path.exists(): diff --git a/cheddahbot/tools/autocora.py b/cheddahbot/tools/autocora.py index 030dcfe..62ecd1b 100644 --- a/cheddahbot/tools/autocora.py +++ b/cheddahbot/tools/autocora.py @@ -347,7 +347,7 @@ def submit_autocora_jobs(target_date: str = "", ctx: dict | None = None) -> str: client.update_task_status(tid, "automation underway") submitted.append(group["keyword"]) - log.info("Submitted AutoCora job: %s → %s", group["keyword"], job_id) + log.info("Submitted AutoCora job: %s -> %s", group["keyword"], job_id) # Build response lines = [f"AutoCora submission ({label}):"] diff --git a/cheddahbot/tools/content_creation.py b/cheddahbot/tools/content_creation.py index fdf6255..42a63cb 100644 --- a/cheddahbot/tools/content_creation.py +++ b/cheddahbot/tools/content_creation.py @@ -489,7 +489,7 @@ def _build_optimization_prompt( f"Generate `{work_dir}/optimization_instructions.md` — a surgical playbook " f"for the human editor with these sections:\n\n" f"1. **Executive Summary** — one-paragraph overview of optimization opportunity\n" - f"2. **Heading Changes** — specific H1/H2/H3 modifications with before→after\n" + f"2. **Heading Changes** — specific H1/H2/H3 modifications with before/after\n" f"3. **Sections to Expand** — which sections need more content and what to add\n" f"4. **Entity Integration Points** — exact locations to weave in missing entities\n" f"5. **Meta Tag Updates** — title tag and meta description recommendations\n" @@ -645,7 +645,7 @@ def _finalize_optimization( for name, fpath in found_files.items(): dest = net_dir / name dest.write_bytes(fpath.read_bytes()) - log.info("Copied %s → %s", fpath, dest) + log.info("Copied %s -> %s", fpath, dest) except OSError as e: log.warning("Could not copy deliverables to network path %s: %s", net_dir, e) diff --git a/cheddahbot/tools/press_release.py b/cheddahbot/tools/press_release.py index 76f214a..57490eb 100644 --- a/cheddahbot/tools/press_release.py +++ b/cheddahbot/tools/press_release.py @@ -1270,7 +1270,7 @@ def submit_press_release( if link_list: output_parts.append("\n**Links:**") for link in link_list: - output_parts.append(f' - "{link["anchor"]}" → {link["url"]}') + output_parts.append(f' - "{link["anchor"]}" -> {link["url"]}') if link_warnings: output_parts.append("\n**Link warnings:**")