[BUG] slugify custom separators strip valid input characters

Aperta
#9,151 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@yzf66665 ci sta già lavorando.

Dal 6/11/2026.

  • #9152 di @yzf66665 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Start with crewai/utilities/string_utils.py and inspect slugify to see how it normalizes and joins text segments. Add regression cases for the custom separators shown in the issue and for existing default behavior, then run the relevant tests. Done when valid input characters are preserved, separators are treated literally, and the default behavior remains covered.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Description

slugify treats the separator as characters to strip and as a regex replacement string, rather than as a literal delimiter. A separator containing letters can remove letters from the original input even when that input needs no normalization.

Reproduction

from crewai.utilities.string_utils import slugify

slugify('sand', separator='and')  # 's', expected 'sand'
slugify('box x x', separator='x')  # 'bo', expected 'boxxxxx'
slugify('hello world', separator='\\')  # re.PatternError

Verified against main commit 305d6a0 on Windows with Python 3.13.9 by loading the unchanged utility module directly. The function has no third-party imports. Searches for slugify in issues and open PRs found no matching report.

Proposed fix

Join the non-empty normalized text segments with the literal separator. This preserves existing underscore/hyphen behavior without stripping valid letters or interpreting backslashes. Add regression cases for custom separators and existing default behavior.

This report and proposed fix are AI-assisted (Codex). The llm-generated label is requested as required by CONTRIBUTING.md.

Lingua principale
Python
Stelle
60.6k
Fork
9.1k
Merge medio
1g 4h
PR unite (30g)
214

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di crewAIInc/crewAI

Tutte le issue di crewAIInc/crewAI

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.