Several UnicodeDecodeError when running in/for directories containing non-ASCII chars

Bug #1289949 reported by alanjeremy
72
This bug affects 10 people
Affects Status Importance Assigned to Milestone
SubDownloader
Confirmed
Undecided
Unassigned
subdownloader (Debian)
Fix Released
Unknown
subdownloader (Ubuntu)
Fix Released
Undecided
Mattia Rizzolo
Bionic
Fix Released
Undecided
Unassigned
Cosmic
Won't Fix
Undecided
Unassigned
Disco
Won't Fix
Undecided
Unassigned

Bug Description

i cannot download any subtitles at all
the download button is grey and does not function
the log button is also grey and does not work
i tried to uninstall and reinstall; but that did not work
i made sure that port 8080 is open in my firewall
i use ubuntu 12.04 lts
if i ask for subtitles for a video file i have, i may get a list but cannot download any
if i give a movie name and ask for subtitles, i may get a list but cannot download anything

Revision history for this message
alanjeremy (deaton25) wrote :

also, now my Search button for Search by Movie Name does not work!!!!!

alanjeremy (deaton25)
Changed in subdownloader:
status: New → Incomplete
Revision history for this message
alanjeremy (deaton25) wrote :

my SUBDOWNLOADER is not downloading subtitles! It is not working!
If i click on a movie that i have already downloaded (first tab), a list of subtitles is compiled but the Download button will not work.
If i search for subtitles for a movie that i input into the search bar (second tab), a list is compiled.But the Download button does not work and no subtitles are downloaded.

PLEASE HELP

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for SubDownloader because there has been no activity for 60 days.]

Changed in subdownloader:
status: Incomplete → Expired
Revision history for this message
ds9 (stephane-lentz) wrote :

Subdownloader cannot save subtitles in directories non-ascii names : names which includes accents for instance : ~/Téléchargements

subdownloader will report when launched in cli :

Traceback (most recent call last):
  File "/usr/share/subdownloader/gui/main.py", line 1054, in onButtonDownload
    _("%s cannot be saved.\nCheck that the folder exists and you have write-access permissions.") %destinationPath ,
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 16: ordinal not in range(128)

Revision history for this message
ds9 (stephane-lentz) wrote :

Debug information :
[23:29] DEBUG::subdownloader.gui.videotreeview # setVideos-> len(videoResults) = 1
[23:29] DEBUG::subdownloader.gui.main # Downloading to: '/home/stephane/T\xc3\xa9l\xc3\xa9chargements/Arrow S02E20 HDTV XviD-FUM[ettv]/Arrow.S02E20.HDTV.XviD-FUM.srt'
[23:29] DEBUG::subdownloader.gui.main # Trying to download subtitle '/home/stephane/Téléchargements/Arrow S02E20 HDTV XviD-FUM[ettv]/Arrow.S02E20.HDTV.XviD-FUM.srt'
Traceback (most recent call last):
  File "/usr/share/subdownloader/gui/main.py", line 1054, in onButtonDownload
    _("%s cannot be saved.\nCheck that the folder exists and you have write-access permissions.") %destinationPath ,
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 16: ordinal not in range(128)

Revision history for this message
Benek (beniamin.kalinowski) wrote :

This is the problem with VideoFile object. It's _filepath attribute is one time encoded as a 'str' and other time as 'unicode'.

The fix:
in source: FileManagement/FileScan.py:

 def ScanFolder(folderpath, recursively=True, report_progress=None, progress_end=None):
+ if (type(folderpath) is not str):
+ folderpath = folderpath.encode(sys.getfilesystemencoding())
     # Let's reset the progress bar to 0%
     log.debug("Scanning Folder %s" % folderpath)

in source modules/videofile.py:

=== modified file 'modules/videofile.py'
--- modules/videofile.py 2011-02-13 09:15:02 +0000
+++ modules/videofile.py 2014-06-01 14:33:54 +0000
@@ -25,6 +25,9 @@

     def __init__(self, filepath):
         self._filepath = filepath
+ if (type(filepath) is not str):
+ import sys
+ self._filepath = filepath.encode(sys.getfilesystemencoding())
         self._size = os.path.getsize(filepath)
         self._hash = self.calculateOSDBHash()
         try:

Changed in subdownloader:
status: Expired → Confirmed
Revision history for this message
Mattia Rizzolo (mapreri) wrote :

This was fixed in 2.0.18-2.1 (as available in bionic), but then the change was reverted in 2.0.19-1 (in cosmic).

This is again fixed in the next upstream 2.1.0~rc4 that I'm preparing. I don't know if I'll get around to it in time for disco.

Changed in subdownloader (Ubuntu Bionic):
status: New → Fix Released
Changed in subdownloader (Ubuntu Cosmic):
status: New → Won't Fix
Changed in subdownloader (Ubuntu Disco):
status: New → In Progress
assignee: nobody → Mattia Rizzolo (mapreri)
Changed in subdownloader (Debian):
status: Unknown → Fix Released
Mattia Rizzolo (mapreri)
Changed in subdownloader (Ubuntu Disco):
status: In Progress → Won't Fix
assignee: Mattia Rizzolo (mapreri) → nobody
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package subdownloader - 2.1.0~rc4-2

---------------
subdownloader (2.1.0~rc4-2) unstable; urgency=medium

  * Team upload.
  * Upload to unstable
  * debian/control
    - bump Standards-Version to 4.4.0 (no changes needed)

 -- Sandro Tosi <email address hidden> Wed, 21 Aug 2019 16:42:22 -0400

Changed in subdownloader (Ubuntu):
status: In Progress → Fix Released
Mattia Rizzolo (mapreri)
summary: - unable to download any subtitles
+ Several UnicodeDecodeError when running in/for directories containing
+ non-ASCII chars
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.