﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32986	Possible dead or incorrect code in Lexer.create_token() related to TRANSLATOR_COMMENT_MARK	Chris Jerdonek	Chris Jerdonek	"While working on [https://github.com/django/django/pull/14739 this PR] for ticket #32919, I noticed that `Lexer.create_token()` has a branch of code that looks like it might be wrong or not needed.

Specifically, [https://github.com/django/django/blob/4f3acf957918843b4c40ff2edfb929bcfaa3730e/django/template/base.py#L391 this line] seems always to be true. It's true both when `TRANSLATOR_COMMENT_MARK` is found and not found. It's only false when `token_string` starts with `TRANSLATOR_COMMENT_MARK` since `str.find()` is used (as it returns the index). However, when I tried modifying the code in [https://github.com/django/django/pull/14742 this test PR] to raise an exception in the false code path, the test suite still passed. So it's not clear to me if the `str.find()` call is needed, or if it's just incorrect.
"	Cleanup/optimization	closed	Template system	dev	Normal	fixed		Claude Paroz	Ready for checkin	1	0	0	0	0	0
