-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Catch exceptions in _check_module #269
Conversation
On Fedora, a default exception hook is installed on the whole system. Uncatched exceptions are reported to Fedora using ABRT. Type "python3 -m http.ser[TAB]" on Fedora detects a bug and invites the user to report the bug to Fedora. Example of such report: Bonus: this change also adds support for encoding different than UTF-8 on Python 3. Tell me if you prefer a separated PR for that. Note: I tested my change on Python 3.7 using my other PR #268. |
* _check_module.main() now catchs IndexError and FileNotFoundError errors: raise ArgcompleteMarkerNotFound exception instead. * Replace open() with tokenize.open() to handle "# coding: xxx" encoding cookie: support source code using an encoding different than UTF-8 on Python 3.
Codecov Report
@@ Coverage Diff @@
## master #269 +/- ##
==========================================
- Coverage 83.85% 82.47% -1.38%
==========================================
Files 7 7
Lines 706 719 +13
==========================================
+ Hits 592 593 +1
- Misses 114 126 +12
Continue to review full report at Codecov.
|
I rebased this PR on top on my tox change. Oops, argcomplete supports Python 2: I didn't notce that. I adapted my PR for Python 2. |
Thanks for the PR @vstinner! I'm happy to merge this for you, however I won't be able to push a release. |
I forgot this PR that I wrote 2 months ago. Feel free to modify it if you want :-) |
@evanunderscore your discretion with this PR, please merge as you see fit and I will cut a release when ready. |
Thanks for your work @vstinner! |
errors: raise ArgcompleteMarkerNotFound exception instead.
encoding cookie: support source code using an encoding different
than UTF-8 on Python 3.