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

File encoding LC_ALL warning #13185

Closed
mxschmitt opened this issue May 23, 2017 · 4 comments

Comments

Projects
None yet
4 participants
@mxschmitt
Copy link

commented May 23, 2017

Please follow the guide below

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.05.23. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2017.05.23

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add -v flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

[root@78d45512bea5 ~]# youtube-dl -U
WARNING: Assuming --restrict-filenames since file system encoding cannot encode all characters. Set the LC_ALL environment variable to fix this.
youtube-dl is up-to-date (2017.05.23)
[root@78d45512bea5 ~]# youtube-dl -U -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-U', u'-v']
WARNING: Assuming --restrict-filenames since file system encoding cannot encode all characters. Set the LC_ALL environment variable to fix this.
[debug] Encodings: locale ANSI_X3.4-1968, fs ANSI_X3.4-1968, out ANSI_X3.4-1968, pref ANSI_X3.4-1968
[debug] youtube-dl version 2017.05.23
[debug] Python version 2.6.6 - Linux-3.16.0-4-amd64-x86_64-with-centos-6.9-Final
[debug] exe versions: none
[debug] Proxy map: {}
youtube-dl is up-to-date (2017.05.23)

Description of your issue, suggested solution and other information

I've reproduced the error on following fresh installed docker based systems:

  • debian
  • centos:latest
  • centos:centos6
  • ubuntu:latest

(additional the error was reproduced on about 5 separate other systems which are using a software which has youtube-dl support, same warning with the same parameter like above)

The error is that the warning:
WARNING: Assuming --restrict-filenames since file system encoding cannot encode all characters. Set the LC_ALL environment variable to fix this. is displayed.

I've no idea how I can fix this and think this is an youtube-dl issue because of the fresh new installed systems.

Edit

After generating the locales and set the LC_ALL environment variable it works fine.
But are you sure, that you always want to show this warning when the env var is not set?

@yan12125

This comment has been minimized.

Copy link
Collaborator

commented May 23, 2017

But are you sure, that you always want to show this warning when the env var is not set?

That's a limitation of CPython. Without LC_ALL, Python can't handle non-ASCII characters reliably on Linux, and non-ASCII characters so common in youtube-dl that removing the warning will bring more confusion for youtube-dl users. See http://bugs.python.org/issue28180 for CPython's solution for such scenarios.

Update 2018/01/11: CPython 3.7a4 has almost done UTF-8 handling without LC_ALL.

@yan12125 yan12125 closed this May 23, 2017

@xorenio

This comment has been minimized.

Copy link

commented Jan 11, 2018

for Debian/ubuntu systems (tested and works)

Run command
$ dpkg-reconfigure locales

Now Press the spacebar to select the box, in the Box should now be a "X" press the TAB Button and select Ok.

make sure to choose a default location e.g. gd_GB.UTF-8

image

@yan12125

This comment has been minimized.

Copy link
Collaborator

commented Jan 11, 2018

Thanks for sharing this. The key is choosing a locale with ".UTF-8". Other kinds of locales may work but no guarantee.

@wantt

This comment has been minimized.

Copy link

commented Oct 22, 2018

fix problem with
vim download.sh

line 14
change from:
youtube-dl https://youtube.com/watch?v=$1 \

to:
LC_ALL=en_US.UTF-8 youtube-dl https://youtube.com/watch?v=$1 \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.