[BUG] slugify custom separators strip valid input characters

Abierto
#9,151 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@yzf66665 ya está trabajando en esto.

Desde el 6/11/2026.

  • #9152 de @yzf66665 — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
python
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
60.6k
Forks
9.1k
Merge medio
1 d 4 h
PR fusionados (30 d)
214

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de crewAIInc/crewAI

Todos los issues de crewAIInc/crewAI

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.