Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

BUG: ColloquialWordswapConverter identifier ignores custom substitution values

クローズ
#3,289 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@ShivamSharma43 がすでに取り組んでいます。

2026年10月18日 から。

  • #3290 @ShivamSharma43 による — マージ済み

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
security

調査の方向性

Read ColloquialWordswapConverter's identifier construction and compare it with LeetspeakConverter, which the issue identifies as handling full custom mappings. Check how the converter's identifier is tested; done means configurations with identical keys but different substitution values have different identifiers and both can register. A linked open pull request indicates this work is already underway.

索引モデルが issue の本文から書いたものです。

説明

Describe the bug

ColloquialWordswapConverter identifies custom_substitutions only by their keys (substitution_keys). Two converters whose custom dictionaries have the same words but different substitutions produce different output but share one hash.

Because the default registry name comes from that hash, registering a second configuration without a custom name raises a duplicate-name error, and memory and analytics cannot tell the configurations apart. LeetspeakConverter already handles the same case by adding a custom_substitutions_hash of the full mapping. This is the same kind of problem as #3242 and #3244.

Steps/Code to Reproduce
import asyncio

from pyrit.converter import ColloquialWordswapConverter
from pyrit.registry import ConverterRegistry

papa = ColloquialWordswapConverter(deterministic=True, custom_substitutions={"father": ["papa"]})
bapa = ColloquialWordswapConverter(deterministic=True, custom_substitutions={"father": ["bapa"]})
print(papa.get_identifier().unique_name, bapa.get_identifier().unique_name)
print(asyncio.run(papa.convert_async(prompt="my father")).output_text)
print(asyncio.run(bapa.convert_async(prompt="my father")).output_text)

registry = ConverterRegistry()
registry.instances.register(papa)
registry.instances.register(bapa)
Expected Results

The two converters have different identifiers, and both register.

Actual Results
ColloquialWordswapConverter::ab18d07b ColloquialWordswapConverter::ab18d07b
my papa
my bapa
ValueError: Instance 'ColloquialWordswapConverter::ab18d07b' already exists
Screenshots

N/A

Versions
  • OS: Windows 11
  • Python version: 3.11.9
  • PyRIT version: installed from main (5b594e00) in editable mode
主要言語
Python
スター
4.6k
フォーク
962
平均マージ
2日 16時間
マージ済み PR(30日)
354

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/PyRIT のほかの issue

microsoft/PyRIT の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。