Yes iam sorry, i should have given more insight. Here is it.
Here it is the whole code of files.py (initianlly posted a snippet but later i though so it was not good enough) responsible to present print greek filenames and let the user pick one filename for download.
http://pastebin.com/qXasy5iU
And here is the the metrites.py snippet that calls files.py via subprocess to run. When it comes to subprocess trying to call files.py which in turn tries to print filenames with greek letters:
if page.endswith('.html'):
with open('/home/nikos/public_html/' + page, encoding='utf-8') as f:
htmldata = f.read()
htmldata = htmldata % (quote, music)
template = htmldata + counter
elif page.endswith('.py'):
htmldata = subprocess.check_output( '/home/nikos/public_html/cgi-bin/' + page )
template = htmldata.decode('utf-8') + counter
print( template )
Here is the error appearing:
http://pastebin.com/iTg0mJbF
I'am looking 5 days for this , please someone help me. Thank you very much.
If i'm right, the solution is to fix the file names to ensure that they are all valid UTF-8 names. If i view the directory containing these files in a file browser that supports UTF-8, i see file names containing Mojibake?
==================================
So, i just renamed one file from 'Euxi tou Ihsou.mp3' => 'Eυχή του Ιησού.mp3' and here is how it appears in the filename directory listing via Chrome.
superhost.gr/data/apps/
It doesn't display the file with proper Greek but with !@#$%^&...
So, when files.py needs to actually open that file, it cannot decode its stored byte stream from the hdd to proper 'utf-8' charset.
So, how to properly fix those filenames if this is the problem?