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

subprocess: don't use shell #1254

Merged
merged 1 commit into from
Apr 11, 2021
Merged

subprocess: don't use shell #1254

merged 1 commit into from
Apr 11, 2021

Conversation

dotlambda
Copy link
Contributor

There is no need to.

@Silverarmor Silverarmor changed the base branch from master to dev April 9, 2021 12:03
@Silverarmor Silverarmor requested a review from xnetcat April 9, 2021 12:03
Copy link
Member

@xnetcat xnetcat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spotDL will crash if ffmpeg is not found, because Popen throws an exception FileNotFoundError: [WinError 2] The system cannot find the file specified before we check return code

this should work

    try:
        process = subprocess.Popen(
            ['ffmpeg', '-version'],
            stdout=subprocess.PIPE, stderr=subprocess.PIPE
        )
    except FileNotFoundError:
        print("FFmpeg was not found, spotDL cannot continue.", file=sys.stderr)
        return False

@Silverarmor
Copy link
Member

Please pull changes from upstream/dev

@Silverarmor Silverarmor added the Enhancement Enhancing spotDL label Apr 11, 2021
There is no need to.
@dotlambda
Copy link
Contributor Author

@Silverarmor done

@Silverarmor Silverarmor merged commit 739a08a into spotDL:dev Apr 11, 2021
@dotlambda dotlambda deleted the patch-1 branch April 11, 2021 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Enhancing spotDL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants