Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: More accurate test for text-like files #2939

Merged
merged 1 commit into from
Jan 27, 2016

Conversation

Qlogin
Copy link
Contributor

@Qlogin Qlogin commented Jan 19, 2016

Fixes #2703


In UTF-8 one character can be represented by multiple bytes. If such bytes have not been placed in the same chunk (CHUNKSIZE=1024), function 'is_text_file' from encoding.py will fail on this input.
Solution is to use IncrementadDecoder.

It is possible that issue #2703 is related to this fix. Since the file attached to issue is determined as binary, spyder tries to open it with external program (console) (instead of editing)

@ccordoba12
Copy link
Member

@Qlogin, thanks for your work on fixing this problem. Could you upload a file that's showing the error you're reporting here?


@blink1073, you introduced the is_text_file function, so could you give a quick review to this PR?

@blink1073
Copy link
Contributor

I think it looks sound, thanks @Qlogin!

@Qlogin
Copy link
Contributor Author

Qlogin commented Jan 20, 2016

@ccordoba12, sorry, I've used GitHub not so long. All I could do is to attach archive with test file.
test.zip

@goanpeca goanpeca changed the title more accurate test for text-like files PR: More accurate test for text-like files Jan 27, 2016
@goanpeca
Copy link
Member

@blink1073 / @ccordoba12 is this ready for merging?

@blink1073
Copy link
Contributor

I think so.

@ccordoba12
Copy link
Member

Thanks a lot for your fix @Qlogin!! I verified that this fixes the problem reported in #2703 :-)

ccordoba12 added a commit that referenced this pull request Jan 27, 2016
PR: More accurate test for text-like files
@ccordoba12 ccordoba12 merged commit a79eee5 into spyder-ide:master Jan 27, 2016
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.

File in Project Explorer is being executed(?) on dbl-click
4 participants