Skip to content

Conversation

@Sahil-u07
Copy link

Summary

Fix bare exception handling in mkconcore.py and replace print statements with proper logging in concore.py.

Changes

mkconcore.py

  • Replace 13 bare except: with except (FileNotFoundError, IOError) as e:
  • Adds actual error message to logs for better debugging

concore.py

  • Add import logging with basic configuration
  • Replace 25+ print() statements with appropriate logging levels:
    • logging.info() for status messages
    • logging.warning() for retries and non-critical issues
    • logging.error() for errors and failures

Why This Matters

  • Bare except: catches ALL exceptions including KeyboardInterrupt and SystemExit
  • Makes debugging difficult by hiding actual errors
  • print() statements can't be controlled or redirected
  • Follows Python best practices (PEP 8)

Testing

All tests pass locally:
image

Sahil-u07 and others added 2 commits January 30, 2026 01:34
mkconcore.py:
- Replace 13 bare except: with except (FileNotFoundError, IOError) as e:
- Adds actual error message to logs for better debugging

concore.py:
- Add import logging with basic configuration
- Replace 25+ print() statements with appropriate logging levels
- logging.info() for status messages
- logging.warning() for retries and non-critical issues
- logging.error() for errors and failures

This improves debugging experience and follows Python best practices.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant