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

sys.exc_clear is not available in python3 #1049

Closed
jaimeMF opened this issue Jul 15, 2013 · 3 comments
Closed

sys.exc_clear is not available in python3 #1049

jaimeMF opened this issue Jul 15, 2013 · 3 comments
Labels
bug

Comments

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jul 15, 2013

PS C:\Users\jaime\Documents\GitHub\youtube-dl> python.exe -m youtube_dl -v
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v']
[debug] youtube-dl version 2013.07.12
Traceback (most recent call last):
  File "C:\Python33\lib\subprocess.py", line 1106, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ".\youtube_dl\__init__.py", line 588, in _real_main
    cwd=os.path.dirname(os.path.abspath(__file__)))
  File "C:\Python33\lib\subprocess.py", line 820, in __init__
    restore_signals, start_new_session)
  File "C:\Python33\lib\subprocess.py", line 1112, in _execute_child
    raise WindowsError(*e.args)
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python33\lib\runpy.py", line 160, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python33\lib\runpy.py", line 73, in _run_code
    exec(code, run_globals)
  File ".\youtube_dl\__main__.py", line 18, in <module>
    youtube_dl.main()
  File ".\youtube_dl\__init__.py", line 634, in main
    _real_main(argv)
  File ".\youtube_dl\__init__.py", line 594, in _real_main
    sys.exc_clear()
AttributeError: 'module' object has no attribute 'exc_clear'

This function was removed in python 3: http://docs.python.org/3.3/whatsnew/3.0.html#library-changes
I haven't noticed it until I test it on Windows, since I don't have git installed.
What's the alternative in python 3?

@jaimeMF
Copy link
Collaborator Author

@jaimeMF jaimeMF commented Jul 17, 2013

I guess de29c41 fixes it.

@jaimeMF jaimeMF closed this Jul 17, 2013
@sheeit
Copy link

@sheeit sheeit commented Mar 15, 2019

This doesn't fix it, it merely hides it in a try/catch.
I can't find sys.exc_clear anywhere in the python 3 documentation, so it might as well be removed, in my opinion.

@rautamiekka
Copy link

@rautamiekka rautamiekka commented Mar 15, 2019

It doesn't seem there's an actual way around this. Back in 2011 fabioz/Pydev@ed35a22 did it by using hasattr(...) function.

It seems sys.exc_clear() was deleted cuz whatever data that function cleared is/should already be automatically cleared by the time you execute the function.

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