Skip to content

bpo-14156:Add argparse.FileType for a mode of 'rb' and 'wb'#9124

Closed
hongweipeng wants to merge 2 commits into
python:masterfrom
hongweipeng:fix-issus-14156
Closed

bpo-14156:Add argparse.FileType for a mode of 'rb' and 'wb'#9124
hongweipeng wants to merge 2 commits into
python:masterfrom
hongweipeng:fix-issus-14156

Conversation

@hongweipeng

@hongweipeng hongweipeng commented Sep 9, 2018

Copy link
Copy Markdown
Contributor

Change patch to a RP.

https://bugs.python.org/issue14156

Comment thread Lib/argparse.py Outdated
file = string
closefd = True

# all other arguments are used as file names

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't this comment be moved 3 lines above?

Comment thread Lib/test/test_argparse.py
text = text.decode('ascii')
return self.name == other.name == text

class FilenoMode(object):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Inheriting object is redundant.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It doesn't matter, it is similar to class RFile(object) in the file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do I need to modify it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants