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

disappearing non-ascii symbols in filename when launched by cgi-script of apache #504

Open
Sorseg opened this issue Oct 29, 2012 · 3 comments
Open

Comments

@Sorseg
Copy link

@Sorseg Sorseg commented Oct 29, 2012

python /media/storage/dev/youtube/youtubedl.py -c -v --no-mtime -o %(id)s=%(title)s.%(ext)s http://www.youtube.com/watch?v=fijMt9I5NHM

When I launch this line from console or from python script even when logged in by user www-data everything works ok, but when this line is launched inside script, which is invoked by cgi-script, the youtubedl.py replaces cyrillic letters in the name of output file with random number of spaces. What can be the cause?

code:

import subprocess as sp
ydl = "python /media/storage/dev/youtube/youtubedl.py -c -v --no-mtime -o %(id)s=%(title)s.%(ext)s"
dwnl = sp.Popen(ydl.split()+[url], stdout = sp.PIPE)
@Sorseg
Copy link
Author

@Sorseg Sorseg commented Oct 29, 2012

And no error/warnings in stderr

@Sorseg Sorseg closed this Oct 29, 2012
@Sorseg
Copy link
Author

@Sorseg Sorseg commented Oct 29, 2012

I decided to make sure this is not an apache mod_cgi bug first

@Sorseg Sorseg reopened this Oct 30, 2012
@Sorseg
Copy link
Author

@Sorseg Sorseg commented Oct 30, 2012

If I do in same script

with open(u'/media/storage/youtube/downloaded/проверка'.encode('utf8'),'a') as ff:
   ff.write("asdfasdf")

it works fine, the file is created

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.