Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update documents.rst#1514

Open
ibrahim-ogunbiyi wants to merge 1 commit intopython-openxml:masterfrom
ibrahim-ogunbiyi:patch-2
Open

Update documents.rst#1514
ibrahim-ogunbiyi wants to merge 1 commit intopython-openxml:masterfrom
ibrahim-ogunbiyi:patch-2

Conversation

@ibrahim-ogunbiyi
Copy link

I think it's best to replaceStringIO withBytesIO since we are working with bytes. This ensures that beginners, or anyone skimming the documentation and copying code, end up with correct and functional code.

cksachdev reacted with thumbs up emoji
I think it's best to replace `StringIO` with `BytesIO` since we are working with bytes. This ensures that beginners, or anyone skimming the documentation and copying code, end up with correct and functional code.

with open('foobar.docx', 'rb') as f:
source_stream =StringIO(f.read())
source_stream =BytesIO(f.read())
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, interesting. I'm sure this is an artifact of this documentation being written during the Python 2 era, whenStringIO actually meant "read bytes".

I'll put it on the shortlist and fix it up next time I'm in there.

@ibrahim-ogunbiyi
Copy link
Author

Alright noted

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

Reviewers

@scannyscannyscanny left review comments

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@ibrahim-ogunbiyi@scanny

[8]ページ先頭

©2009-2026 Movatter.jp