Skip to content

[3.8] bpo-37150: Throw ValueError if FileType class object was passed in add_argument (GH-13805)#13901

Merged
miss-islington merged 1 commit into
python:3.8from
miss-islington:backport-03d5831-3.8
Jun 7, 2019
Merged

[3.8] bpo-37150: Throw ValueError if FileType class object was passed in add_argument (GH-13805)#13901
miss-islington merged 1 commit into
python:3.8from
miss-islington:backport-03d5831-3.8

Conversation

@miss-islington

@miss-islington miss-islington commented Jun 7, 2019

Copy link
Copy Markdown
Contributor

There is a possibility that someone (like me) accidentally will omit parentheses with FileType arguments after FileType, and parser will contain wrong file until someone will try to use it.

Example:

parser = argparse.ArgumentParser()
parser.add_argument('-x', type=argparse.FileType)

https://bugs.python.org/issue37150
(cherry picked from commit 03d5831)

Co-authored-by: zygocephalus grrrr@protonmail.com

https://bugs.python.org/issue37150

…d_argument (pythonGH-13805)

There is a possibility that someone (like me) accidentally will omit parentheses with `FileType` arguments after `FileType`, and parser will contain wrong file until someone will try to use it.

Example:
```python
parser = argparse.ArgumentParser()
parser.add_argument('-x', type=argparse.FileType)
```

https://bugs.python.org/issue37150
(cherry picked from commit 03d5831)

Co-authored-by: zygocephalus <grrrr@protonmail.com>
@miss-islington

Copy link
Copy Markdown
Contributor Author

@zygocephalus: Status check is done, and it's a success ✅ .

2 similar comments
@miss-islington

Copy link
Copy Markdown
Contributor Author

@zygocephalus: Status check is done, and it's a success ✅ .

@miss-islington

Copy link
Copy Markdown
Contributor Author

@zygocephalus: Status check is done, and it's a success ✅ .

@miss-islington
miss-islington merged commit 606ac58 into python:3.8 Jun 7, 2019
@miss-islington
miss-islington deleted the backport-03d5831-3.8 branch June 7, 2019 21:12
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.

5 participants