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

Do we need http.server as dependency? #26343

Closed
dano6 opened this issue Aug 16, 2020 · 2 comments
Closed

Do we need http.server as dependency? #26343

dano6 opened this issue Aug 16, 2020 · 2 comments
Labels

Comments

@dano6
Copy link

@dano6 dano6 commented Aug 16, 2020

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

Hello guys, I am trying to use youtube-dl in Ubuntu Touch project. Importing http.server is causing sandbox violations and throws a phyton error. Can we edit this https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/compat.py#L2358 4 lines of code that http.server wouldn't be compulsory? I was looking that it is used just for tests. I am not a python coder, so I am not sure how to write correct MR. Thanks for the answer.

@dano6 dano6 added the question label Aug 16, 2020
@dano6
Copy link
Author

@dano6 dano6 commented Aug 16, 2020

This is complete error, ideal would be get '/etc/mime.types' out of sandbox, but it will complicate things for me

"PyOtherSide error: Traceback (most recent call last):\n\n  File \"qrc:/Qml//ytdl_wrapper.py\", line 6, in <module>\n    import youtube_dl\n\n  File \"/opt/click.ubuntu.com/quickddit/0.9/youtube_dl/__init__.py\", line 15, in <module>\n    from .options import (\n\n  File \"/opt/click.ubuntu.com/quickddit/0.9/youtube_dl/options.py\", line 8, in <module>\n    from .downloader.external import list_external_downloaders\n\n  File \"/opt/click.ubuntu.com/quickddit/0.9/youtube_dl/downloader/__init__.py\", line 3, in <module>\n    from .common import FileDownloader\n\n  File \"/opt/click.ubuntu.com/quickddit/0.9/youtube_dl/downloader/common.py\", line 9, in <module>\n    from ..compat import compat_os_name\n\n  File \"/opt/click.ubuntu.com/quickddit/0.9/youtube_dl/compat.py\", line 2359, in <module>\n    import http.server as compat_http_server\n\n  File \"/usr/lib/python3.5/http/server.py\", line 628, in <module>\n    class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):\n\n  File \"/usr/lib/python3.5/http/server.py\", line 836, in SimpleHTTPRequestHandler\n    mimetypes.init() # try to read system mime.types\n\n  File \"/usr/lib/python3.5/mimetypes.py\", line 353, in init\n    db.read(file)\n\n  File \"/usr/lib/python3.5/mimetypes.py\", line 202, in read\n    with open(filename, encoding='utf-8') as fp:\n\nPermissionError: [Errno 13] Permission denied: '/etc/mime.types'\n"
qml: python error: Cannot import module: ytdl_wrapper (Traceback (most recent call last):

  File "qrc:/Qml//ytdl_wrapper.py", line 6, in <module>
    import youtube_dl

  File "/opt/click.ubuntu.com/quickddit/0.9/youtube_dl/__init__.py", line 15, in <module>
    from .options import (

  File "/opt/click.ubuntu.com/quickddit/0.9/youtube_dl/options.py", line 8, in <module>
    from .downloader.external import list_external_downloaders

  File "/opt/click.ubuntu.com/quickddit/0.9/youtube_dl/downloader/__init__.py", line 3, in <module>
    from .common import FileDownloader

  File "/opt/click.ubuntu.com/quickddit/0.9/youtube_dl/downloader/common.py", line 9, in <module>
    from ..compat import compat_os_name

  File "/opt/click.ubuntu.com/quickddit/0.9/youtube_dl/compat.py", line 2359, in <module>
    import http.server as compat_http_server

  File "/usr/lib/python3.5/http/server.py", line 628, in <module>
    class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):

  File "/usr/lib/python3.5/http/server.py", line 836, in SimpleHTTPRequestHandler
    mimetypes.init() # try to read system mime.types

  File "/usr/lib/python3.5/mimetypes.py", line 353, in init
    db.read(file)

  File "/usr/lib/python3.5/mimetypes.py", line 202, in read
    with open(filename, encoding='utf-8') as fp:

PermissionError: [Errno 13] Permission denied: '/etc/mime.types'
)
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Aug 16, 2020

You can though it will break tests.

@dstftw dstftw closed this Aug 16, 2020
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.