Skip to content

Conversation

katsyoshi
Copy link
Contributor

@katsyoshi katsyoshi commented Aug 13, 2019

Doesn't work seeking position when set input class of StringIO.

I add position for StringIOs.

example: https://gist.github.com/katsyoshi/bfd86639d9464f60f27b26e20a85c720

@esparta
Copy link
Contributor

esparta commented Aug 14, 2019

I'm seeing the failure on your gist, can you add a test case for this StringIO input?

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

Thanks.

Could you use input.read instead of input.string[input.pos..-1]? Because input.string[..] is character based not byte based. It means that this implementation doesn't work for multibyte characters.

Could you add a test for this case? Or should I add a test for this?

@katsyoshi
Copy link
Contributor Author

@kou @esparta thank you comments.
I replaced string range chars to read. I added test using StringIO.

@kou
Copy link
Member

kou commented Aug 20, 2019

Thanks. I've fixed some remaining problems:

  • We don't need to use rewind when we use seek.
  • There are some needless rewinds.
  • The added test doesn't use StringIO. We need to use StringIO for this case.

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.

3 participants