swagger-api / swagger-api/swagger-codegen
[Python][raw string]bad pattern with raw string
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
[Python][raw string]bad pattern with raw string
Description
raw string is not correctly used
Swagger-codegen version
2.4.4 it is a regression
Swagger declaration file content or url
Command line used for generation
Steps to reproduce
previous version:
re.search('^[\w\s:.,_-]*$', "UNITEST")
answer:<_sre.SRE_Match object at 0x132DE800>
this version:
re.search(r'^[\w\s:.,_-]*$', "UNITEST")
no match
because raw string is used but too more \
Related issues/PRs
Suggest a fix/enhancement
the good way is :
re.search(r'^[\w\s:.,_-]*$', "UNITEST")
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Python code-generation template or entry point that emits the regex shown in the reproduction, then compare its output with the previous and desired patterns. Done means generated Python uses the intended raw-string escaping and the UNITEST search matches; add or run a regression check if the project provides one.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100