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

Make sure .read() and friends always return bytes#405

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Byron merged 2 commits intogitpython-developers:masterfromnvie:master
Apr 10, 2016
Merged

Conversation

nvie
Copy link
Contributor

@nvienvie commentedApr 6, 2016

This had tripped me up when consuming from.read(4096) in a streaming fashion. All chunks will return bytes except the last one (the empty string), which is a unicode string in Python 3.

This fixes that to always return bytes, in both Python 2 and 3.

@ByronByron added this to thev1.0.3 - Fixes milestoneApr 7, 2016
@Byron
Copy link
Member

Thanks@nvie , much appreciated !
It seems it works well in python 2.x, but apparently the test itselfhas wrong expectations and thus fails in py3.x.
Do you think changing this line toassert s.readline() == b'' will do it ?

@nvie
Copy link
ContributorAuthor

nvie commentedApr 7, 2016

I've fixed the tests as you indicated. I had some trouble running the tests locally (I just tried runningtox, but it failed on different tests, not this one). My local tests are still failing, not sure why. I'll await Travis' response now and adjust accordingly.

Thanks for this awesome project,@Byron!

@nvie
Copy link
ContributorAuthor

nvie commentedApr 7, 2016

Seems all good now :)

@ByronByron merged commit9debf6b intogitpython-developers:masterApr 10, 2016
@Byron
Copy link
Member

Thanks@nvie ! Testing locally usually fails when you are on a branch. Reason for this is that GitPython uses its own git repository for read-only testing, but doesn't really deal with the edge-cases arising from it. Bad practice, I know :).

Besides: I still remember when I was first studying this git-flow page that so neatly visualised the branching scheme that so many are using today ! Thus it's great to have your name in this project's commit history :) !

@nvie
Copy link
ContributorAuthor

Thanks, that's great to hear. As the matter of fact, we're starting to use more and more of GitPython, and we're seeing some wild repositories, so expect more contributions in the future. First one is#408 :)

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
@nvie@Byron

[8]ページ先頭

©2009-2025 Movatter.jp