Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

BUG: within word punctuation insertion can never land at the last two positions of the prompt

Aperta Adatta ai principianti
#3,565 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@ManoharPaturi ci sta già lavorando.

Dal 27/10/2026.

Valutazione

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

Direzione di ricerca

Inizia leggendo InsertPunctuationConverter._insert_within_words e il relativo docstring, poi esamina i test di InsertPunctuationConverter. Riproduci il comportamento segnalato con il prompt di tre caratteri abc e i seed da 0 a 299. Il lavoro è completato quando è possibile raggiungere ogni punto di inserimento, compreso quello immediatamente prima dell’ultimo carattere e quello dopo il carattere finale.

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

Descrizione

Description

InsertPunctuationConverter._insert_within_words samples insertion indices from range(len(prompt_list) minus 1), so for a prompt of n characters only positions 0 through n minus 2 are ever chosen. Of the n plus 1 possible insertion points, a punctuation mark can never land immediately before the last character or after the final character, no matter the seed.

For the three character prompt abc, 300 different seeds produce only prefixes at offsets 0 and 1: outputs like ab!c or abc! are unreachable, while the method docstring says punctuation is inserted at any indices in the prompt.

Expected Behavior

Every insertion point of the prompt, before the first character through after the last, should be reachable.

Reproduction Steps

  1. Run InsertPunctuationConverter(between_words=False, word_swap_ratio=1.0, seed=s).convert_async(prompt="abc", ...) for seeds 0 through 299.
  2. Collect the offset of the inserted punctuation.
  3. Only offsets 0 and 1 ever appear on main.

Minimal Reproduction

offsets = set()
for seed in range(300):
    out = await InsertPunctuationConverter(between_words=False, word_swap_ratio=1.0, seed=seed).convert_async(prompt="abc", input_type="text")
    offsets |= {i for i, ch in enumerate(out.output_text) if not ch.isalnum()}
# {0, 1} on main

Environment

PyRIT main. Python 3.11.

Lingua principale
Python
Stelle
4.7k
Fork
980
Merge medio
2g 9h
PR unite (30g)
422

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

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 microsoft/PyRIT

Tutte le issue di microsoft/PyRIT

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.