Repository: biolab/orange3-text

Issue:
text processing module with slow internet conection
[textprocessingerr.txt](https://github.com/biolab/orange3-text/files/4551540/textprocessingerr.txt)
<!--
This is an issue template. Please fill in the relevant details in the
sections below.
-->
Hi! I have slow internet connection, less than 400Kbit/s. And when I use text preprocessing module I have an error.
If I disconnect my internet connection (disable wifi), the text processing module works fine.
If I have have internet connection more than 3Mbit/s, everything works fine.
##### Text version 0.9/0.8
##### Orange version 3.26/3.25





Discussion:
Thanks for reporting this, we will have a look.
Hi @pavelbs, I tried to reproduce your error. I used the Network Link Conditioner to simulated a bad connection (different speeds, package lost rates, delays). I couldn't reproduce the particular error. It seems that in your case the text which is retrieved from the server is somehow corrupted, even the response from the server is 200 (OK). We can try to catch this particular error anyway. I am just interested in whether this error happens every time you try to load the Preprocess Text widget?

Btw. we have another issue with the Preprocess text widget. If I limit connection to much, it takes forever to load the widget. It seems that there is no reasonable timeout set. I will recheck this issue when #506 is merged since it does not make sense to fix it.
 This error occurs every time I try to load the Preprocess Text widget. I live in a small village. My nearest cell tower is 20 km from me. I have 3G amplifier from aliexpress + 3G wifi router and handmade 3G antenna.
 (Orange38) [pavelbs@pavelbs-pc-manjaro orange3]$ ping mail.ru
PING mail.ru (94.100.180.201) 56(84) bytes of data.
64 bytes from mail.ru (94.100.180.201): icmp_seq=1 ttl=47 time=118 ms
64 bytes from mail.ru (94.100.180.201): icmp_seq=2 ttl=47 time=199 ms
64 bytes from mail.ru (94.100.180.201): icmp_seq=3 ttl=47 time=158 ms
64 bytes from mail.ru (94.100.180.201): icmp_seq=4 ttl=47 time=190 ms
64 bytes from mail.ru (94.100.180.201): icmp_seq=5 ttl=47 time=148 ms
64 bytes from mail.ru (94.100.180.201): icmp_seq=6 ttl=47 time=158 ms
64 bytes from mail.ru (94.100.180.201): icmp_seq=7 ttl=47 time=149 ms
64 bytes from mail.ru (94.100.180.201): icmp_seq=8 ttl=47 time=315 ms
64 bytes from mail.ru (94.100.180.201): icmp_seq=9 ttl=47 time=167 ms
64 bytes from mail.ru (94.100.180.201): icmp_seq=10 ttl=47 time=136 ms
64 bytes from mail.ru (94.100.180.201): icmp_seq=11 ttl=47 time=155 ms

@pavelbs thank you for your fast response. We are not completely sure that the error is caused by the slow connection (but it is possible anyway). We would like to inspect your problem further, so we ask you if you can run the script attached to this comment and paste us the pickle file that it generates. It will give us an idea of what is happening with the response in your case.

[example.py.zip](https://github.com/biolab/orange3-text/files/4586455/example.py.zip)

done
[response.pkl.zip](https://github.com/biolab/orange3-text/files/4590920/response.pkl.zip)


@pavelbs thank you. This reveals the reason behind the error. Can I just ask you for another test? I changed the script a bit can you run it and send me a response? I just want to know if our assumptions are correct.

[example1.py.zip](https://github.com/biolab/orange3-text/files/4592207/example1.py.zip)
done
[response.pkl.zip](https://github.com/biolab/orange3-text/files/4592852/response.pkl.zip)


Resolving patch:
diff --git a/orangecontrib/text/preprocess/normalize.py b/orangecontrib/text/preprocess/normalize.py
--- a/orangecontrib/text/preprocess/normalize.py
+++ b/orangecontrib/text/preprocess/normalize.py
@@ -103,7 +103,7 @@ def file_to_language(file):
 
 
 class UDPipeModels:
-    server_url = "http://file.biolab.si/files/udpipe/"
+    server_url = "https://file.biolab.si/files/udpipe/"
 
     def __init__(self):
         self.local_data = os.path.join(data_dir(versioned=False), 'udpipe/')


Test patch: