Skip to content
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

Regular expression in minicluster _get_namenode_port has invalid escape sequence in python >= 3.8 #24

Open
kthemer opened this issue Feb 28, 2024 · 0 comments

Comments

@kthemer
Copy link

kthemer commented Feb 28, 2024

This regular expression:
m = re.match(".Started MiniDFSCluster -- namenode on port (\d+).", line)

found here:
https://github.com/internetarchive/snakebite-py3/blob/master/snakebite/minicluster.py#L204

is not returning the namenode port as desired, rather NoneType, which leads to the error:
"TypeError: %d format: a number is required, not NoneType"

I suspect this is caused by python 3.8 (and above) throwing an invalid escape sequence error when encountering "\d"

I suspect the solution is to pass the regular expression as a raw string, i.e.:
m = re.match(r".Started MiniDFSCluster -- namenode on port (\d+).", line)

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

No branches or pull requests

1 participant