Page MenuHomePhabricator

noreferences.py: reference section is duplicated
Open, HighPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

The diff is shown here - link

What happens?:
It adds duplicate "Примечания" section header while it is already present in the article. As I understand, referencesSections in noreferences.py define where the reflist template should be added and "Примечания" is already named there (line 411).

What should have happened instead?:
If the section "Примечания" already exists, it shouldn't be added once again

Related Objects

StatusSubtypeAssignedTask
OpenBUG REPORTNone
ResolvedFeatureXqt

Event Timeline

Xqt renamed this task from reference section is duplicated to reflinks.py: reference section is duplicated.Aug 7 2025, 9:03 AM
Xqt triaged this task as High priority.
Xqt moved this task from Backlog to references on the Pywikibot-Scripts board.
Xqt renamed this task from reflinks.py: reference section is duplicated to noreferences.py: reference section is duplicated.Aug 7 2025, 9:09 AM

obviously re.compile(r'\r?\n=+ *Примечания *=+ *\r?\n') does not match because line feed is missing here at the end of the page:

го владельцами стали их дети  Элмо и Юлиус<ref>{{Cite web|url=https://www.savotta.fi/fi/pages/history-1|title=Savotta – tehty kestämään vuodesta 1955|lang=fi|website=Savotta|access-date=2025-08-02|url-status=live}}</ref>.

== Примечания ==

Hint: Maybe textlib.extract_sections should be used instead to split sections.