-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
UnicodeEncodeError with os.path.isdir in NetworkManager.createRequest #1450
Comments
Hello. I would like to contribute for this issue. I think this is a very awesome tool and it would be great if I could make even a small contribution to this project. Could you please give me some pointers on how to begin? |
Hey @anantkaushik89! The first step would be to reproduce this issue on the newest git version by cloning the repo, and running If you still see the same crash, I'd recommend reading through the contributing docs (though you can certainly ignore some irrelevant parts of it), and then getting the testsuite running with Then you can handle the Let me know if something was unclear and you need more help! |
Thanks so much @The-Compiler !! This does make life lot easier for me. I'll definitely get started and try to play around with the code base. |
Hi @The-Compiler , can you help in one doubt? I installed qutebrower on my system. I tried opening files which have unicode characters in them like http://www.w3.org/2001/06/utf-8-test/postscript-utf-8.html. I also tried opening file in directories where the name contains something like %20 etc. I was able to open both these without issues. Could you please tell a bit more on what the error was? Is it opening a local html file with unicode characters? Any sample file or url which you think can point me to the error would be very helpful. Just to add, I am using :open command and then opening the file? Does the issue need some other steps in reproducing it? |
You'll need to start qutebrowser with |
Hey @anantkaushik89, just found this issue again - were you able to reproduce it? Do you need help with something? Or did you move on to something else? 😉 |
Hi @The-Compiler , you did guess it right :) I had tried back then to work this out and see the error but couldnt find it. I moved on to something else then |
@The-Compiler I can't reproduce this, running Using version info:
|
@7lb Note that this is about files with non-ascii characters in the filename, not the contents. |
Oh, I missed that. I blame being tired. Will try to reproduce tomorrow if I have the time. |
I've written a patch which encodes the path string to utf-8 before checking its existence. This should work no matter the current encoding you're in. |
I just realized that I actually fixed the same error but for a different part than was mentioned in this issue. I reproduced this with:
@The-Compiler If you think the solution for this is okay, then I can also apply it to the section mentioned at the top of the issue. |
I was sure I had added a comment yesterday. Anyway, the short of it was that I could only reproduce this crash using the webkit backend, but the webengine backend had different issues but no crash. @lejar I understand your patch fixes the webengine issues, does it also solve the webkit crash? In that case it would probably be best to merge your patch if it doesn't have any other side effects, seems cleaner. Let's see what Florian & others think. |
I think there might be two seperate issues here (one for webkit and one for webengine). Unfortunately I haven't set up webkit on my computer so I can't test this right now. For me #3175 does not resolve the crash on webengine. The crash that I get when following @lejar's reproduction steps is:
@lejar's patch solves this crash for me and the open works fine. |
@lejar I'm not sure this is a proper solution, for two reasons:
I think the proper solution is to just assume the path doesn't exist when we can't decode the input - after all, for all we know, that path can't exist with the current filesystem encoding. |
@The-Compiler Good point. I'll make it so that the path is "not found" when we get a unicode error there. |
@The-Compiler Since 7lb is working on the webkit fix, I only fixed the one I found in urlutils. PR #3177 |
Interestingly enough I could not reproduce the crash in webengine because I tried different ways. To note: Opening the file from the command line displays an url with many Running qutebrowser and calling Running qutebrowser and calling So, there are multiple issues here. I'll try those three ways to open a file with the webkit backend and see what happens. |
Report with
LC_ALL=C
:The text was updated successfully, but these errors were encountered: