8000 Bad regexp in crackfortran.py · Issue #8791 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

8000 Bad regexp in crackfortran.py #8791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jwilk opened this issue Mar 17, 2017 · 4 comments
Closed

Bad regexp in crackfortran.py #8791

jwilk opened this issue Mar 17, 2017 · 4 comments
Labels

Comments

@jwilk
Copy link
Contributor
jwilk commented Mar 17, 2017

numpy/f2py/crackfortran.py contains the following code:

determineexprtype_re_3 = re.compile(
    r'\A[+-]?[\d.]+[\d+-de.]*(_(P<name>[\w]+)|)\Z', re.I)

But here +-d means all characters between + and d, which includes, among others, all uppercase letters and a bunch of punctuation characters.
If you want - to be meant literally, you need to escape it, or place it as the first or last character inside [].

The dubious regexp was found using pydiatra.

@charris
Copy link
Member
charris commented Mar 17, 2017

Looks like a valid problem

@zixu-zhao
Copy link

Hi, could I take this issue? I would like to make contribution here :)

@charris
Copy link
Member
charris commented Mar 20, 2017

Sure, no need to ask permission to submit a fix.

@zixu-zhao
Copy link

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
0