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

Available dictionaries fails. #1

Open
Achaean opened this issue Sep 24, 2023 · 9 comments
Open

Available dictionaries fails. #1

Achaean opened this issue Sep 24, 2023 · 9 comments

Comments

@Achaean
Copy link

Achaean commented Sep 24, 2023

Available dictionaries fails, because can't connect to SF.NET.
Screenshot_20230924_215606

@nerijus
Copy link
Owner

nerijus commented Sep 25, 2023

I am able to open http://opendict.sf.net in a browser, which redirects to https://opendict.sourceforge.net/. Maybe it was temporary error?

@Achaean
Copy link
Author

Achaean commented Sep 26, 2023

I can also open the site in a browser.
I'm only getting the error, from inside the program.

@nerijus
Copy link
Owner

nerijus commented Sep 26, 2023

Have you tried to change a line in lib/config.py from:

      self.repository = \
               'http://opendict.sf.net/Repository/Data/opendict-add-ons.xml'

to

      self.repository = \
               'https://opendict.sourceforge.net/Repository/Data/opendict-add-ons.xml'

does it work then?

@Achaean
Copy link
Author

Achaean commented Sep 27, 2023

Nope! :-(
Screenshot_2

@nerijus
Copy link
Owner

nerijus commented Sep 27, 2023

Hmm, strange. Have you used **https**://opendict.sourceforge.net/Repository/Data/opendict-add-ons.xml as I suggested or http?

@Achaean
Copy link
Author

Achaean commented Sep 27, 2023

I didn't change something - configured - altered in any way etc.
I only downloaded the source -> and (as root) "make install".

I don't know if its useful, but here's console's output:

>opendict
17:53:03: Warning: Mismatch between the program and library build versions detected.
The library used 3.0 (wchar_t,compiler with C++ ABI 1014,wx containers,compatible with 2.8),
and wxPython used 3.0 (wchar_t,compiler with C++ ABI 1013,wx containers,compatible with 2.8).
/usr/lib64/python2.7/site-packages/wx-3.0-gtk3/wx/_core.py:16629: UserWarning: wxPython/wxWidgets release number mismatch
warnings.warn("wxPython/wxWidgets release number mismatch")
>

@nerijus
Copy link
Owner

nerijus commented Sep 27, 2023

This warning is harmless. Did it work with https?

@Achaean
Copy link
Author

Achaean commented Sep 27, 2023

No.
Screenshot_3
Screenshot_4

@nerijus
Copy link
Owner

nerijus commented Nov 18, 2023

I think I found a problem - "Content-Length" header may not exist. curl -v https://opendict.sourceforge.net/Repository/Data/opendict-add-ons.xml confirms it. Please try this patch (or change the lines manually):

--- lib/util.py.orig	2016-04-04 23:40:40.434904601 +0300
+++ lib/util.py	2023-11-18 20:24:41.328049504 +0200
@@ -218,23 +218,13 @@
         try:
             self.statusMessage = _("Connecting to %s...") % serverName
             self.up = urllib2.urlopen(self.url)
-            fileSize = int(self.up.info().getheader('Content-length'))
         except Exception, e:
             self.errorMessage = "Unable to connect to %s" % serverName
             self.done = True
             return
 
-        count = 0
-
         try:
-            while not self.stopRequested and count < fileSize:
-                bytes = self.up.read(1024)
-                count += len(bytes)
-                self.buffer += bytes
-                self.percents = int(float(count) / fileSize * 100)
-                self.statusMessage = _("Downloading... %d%%") % self.percents
-                time.sleep(0.005) # To lower CPU usage
-                
+            self.buffer += self.up.read()
             self.up.close()
             self.done = True
             self.statusMessage = _("Done")

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

No branches or pull requests

2 participants