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

Fix umask option bug(issues#1622) #1632

Merged
merged 2 commits into from
Oct 28, 2017
Merged

Conversation

hramezani
Copy link
Contributor

@hramezani hramezani commented Oct 24, 2017

Fix umask option bug. issue_1622

Copy link
Collaborator

@berkerpeksag berkerpeksag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also convert the example shared in #1622 to a test case?

if x.startswith('0') and not x.lower().startswith('0x'):
# for compatible with octal numbers in python3
# for compatible with octal numbers in python3
if re.match('0(\d)', x, re.IGNORECASE):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd use r'' to avoid subtle bugs.

@berkerpeksag berkerpeksag mentioned this pull request Oct 26, 2017
@hramezani
Copy link
Contributor Author

@berkerpeksag thanks, I add those examples to test_umask_config.

@berkerpeksag
Copy link
Collaborator

I think the problem here is that our test code doesn't call auto_int so even if we already added a test for --umask 0 we missed this bug.

@berkerpeksag
Copy link
Collaborator

Nevermind, the existing test was wrong.

@@ -375,6 +375,8 @@ def test_reload(options, expected):

@pytest.mark.parametrize("options, expected", [
(["--umask 0", "myapp:app"], 0),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should read:

(["--umask", "0", "myapp:app"], 0),

@@ -375,6 +375,8 @@ def test_reload(options, expected):

@pytest.mark.parametrize("options, expected", [
(["--umask 0", "myapp:app"], 0),
(["--umask 0o0", "myapp:app"], 0),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above:

(["--umask", "0o0", "myapp:app"], 0),
(["--umask", "0x0", "myapp:app"], 0),

@hramezani
Copy link
Contributor Author

@berkerpeksag, thanks, you are right. I fixed the tests

@berkerpeksag berkerpeksag merged commit 90b7dae into benoitc:master Oct 28, 2017
@berkerpeksag
Copy link
Collaborator

Thanks!

mjjbell pushed a commit to mjjbell/gunicorn that referenced this pull request Mar 16, 2018
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

Successfully merging this pull request may close these issues.

2 participants