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

ValueError: No escaped character on Windows versions with Python 3 #22001

Closed
Nebelwerfer-G opened this issue Aug 4, 2019 · 2 comments
Closed

ValueError: No escaped character on Windows versions with Python 3 #22001

Nebelwerfer-G opened this issue Aug 4, 2019 · 2 comments
Labels

Comments

@Nebelwerfer-G
Copy link

@Nebelwerfer-G Nebelwerfer-G commented Aug 4, 2019

Checklist

  • I'm asking a question
  • I've looked through the README and FAQ for similar questions
  • I've searched the bugtracker for similar questions including closed ones

Question

Running version 2018.08.02 from multiple sources (Chocolatey/pip/official standalone executables), my youtube-dl seems to occationally raise the following error when dealing with any commands requires Internet connection or including a URL:

PS C:\Users\fearh\Desktop\POD> youtube-dl.exe -U -v
Traceback (most recent call last):
  File "c:\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python36\Scripts\youtube-dl.exe\__main__.py", line 9, in <module>
  File "c:\python36\lib\site-packages\youtube_dl\__init__.py", line 474, in main
    _real_main(argv)
  File "c:\python36\lib\site-packages\youtube_dl\__init__.py", line 58, in _real_main
    parser, opts, args = parseOpts(argv)
  File "c:\python36\lib\site-packages\youtube_dl\options.py", line 904, in parseOpts
    user_conf = _readUserConf()
  File "c:\python36\lib\site-packages\youtube_dl\options.py", line 83, in _readUserConf
    default=None)
  File "c:\python36\lib\site-packages\youtube_dl\options.py", line 52, in _readOptions
    res = compat_shlex_split(contents, comments=True)
  File "c:\python36\lib\shlex.py", line 305, in split
    return list(lex)
  File "c:\python36\lib\shlex.py", line 295, in __next__
    token = self.get_token()
  File "c:\python36\lib\shlex.py", line 105, in get_token
    raw = self.read_token()
  File "c:\python36\lib\shlex.py", line 206, in read_token
    raise ValueError("No escaped character")
ValueError: No escaped character
PS C:\Users\fearh\Desktop\POD> youtube-dl.exe "https://www.youtube.com/watch?v=BaW_jenozKc" -v
Traceback (most recent call last):
  File "c:\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python36\Scripts\youtube-dl.exe\__main__.py", line 9, in <module>
  File "c:\python36\lib\site-packages\youtube_dl\__init__.py", line 474, in main
    _real_main(argv)
  File "c:\python36\lib\site-packages\youtube_dl\__init__.py", line 58, in _real_main
    parser, opts, args = parseOpts(argv)
  File "c:\python36\lib\site-packages\youtube_dl\options.py", line 904, in parseOpts
    user_conf = _readUserConf()
  File "c:\python36\lib\site-packages\youtube_dl\options.py", line 83, in _readUserConf
    default=None)
  File "c:\python36\lib\site-packages\youtube_dl\options.py", line 52, in _readOptions
    res = compat_shlex_split(contents, comments=True)
  File "c:\python36\lib\shlex.py", line 305, in split
    return list(lex)
  File "c:\python36\lib\shlex.py", line 295, in __next__
    token = self.get_token()
  File "c:\python36\lib\shlex.py", line 105, in get_token
    raw = self.read_token()
  File "c:\python36\lib\shlex.py", line 206, in read_token
    raise ValueError("No escaped character")
ValueError: No escaped character

However commands like --help or --version works fine.
Commands tested on Python 3.4 and 3.6 and similar error persists. I have read the part regarding escaping characters in the command line and I feel it's probably not an youtube-dl issue, but in desperate efforts on finding solutions I decided to post here anyway.

@lightmare
Copy link
Contributor

@lightmare lightmare commented Aug 4, 2019

It appears you have a malformed user configuration file. Either find and fix this config, or run with --ignore-config option to skip reading it.

@lightmare lightmare mentioned this issue Aug 4, 2019
5 of 9 tasks complete
@Nebelwerfer-G
Copy link
Author

@Nebelwerfer-G Nebelwerfer-G commented Aug 4, 2019

This is the very issue, many thanks.

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
2 participants
You can’t perform that action at this time.