Skip to content

Fix Python 3 and modern OpenCV compatibility - #1133

Closed
RBQAAQ wants to merge 1 commit into
boltgolt:devfrom
RBQAAQ:fix/python3-compat-v2
Closed

Fix Python 3 and modern OpenCV compatibility#1133
RBQAAQ wants to merge 1 commit into
boltgolt:devfrom
RBQAAQ:fix/python3-compat-v2

Conversation

@RBQAAQ

@RBQAAQ RBQAAQ commented Jul 27, 2026

Copy link
Copy Markdown

Summary

Fix compatibility issues in Howdy 2.x when running with Python 3 and modern OpenCV/NumPy versions.

Changes

  • Support both Python 3 configparser and the legacy Python 2 ConfigParser module.
  • Replace deprecated datetime.datetime.utcnow() with a timezone-aware UTC datetime.
  • Flatten the OpenCV histogram result before summing and iterating over it, preventing scalar indexing errors with modern OpenCV and NumPy.

Problems fixed

Before these changes, I encountered:

ModuleNotFoundError: No module named 'ConfigParser'
IndexError: invalid index to scalar variable
DeprecationWarning: datetime.datetime.utcnow() is deprecated

Tested environment

  • Arch Linux
  • Howdy 2.6.1
  • Python 3.14
  • OpenCV 5.0.0
  • pam_python3.so
  • UVC infrared camera using an 8-bit GREY stream

Validation

I verified that:

  • howdy test displays the infrared camera feed correctly.
  • howdy add successfully enrolls a face model.
  • PAM authentication through sudo succeeds.
  • Password fallback works after face detection times out.
  • The modified files pass python3 -m py_compile.

This branch is based on the v2.6.1 tag. GitHub reports that it cannot be merged automatically into dev, so the commit may need to be rebased or cherry-picked onto the appropriate branch.

@RBQAAQ

RBQAAQ commented Jul 27, 2026

Copy link
Copy Markdown
Author

Closing this pull request because two parts overlap with existing pull requests:

The remaining datetime change is already fixed on the current mainline, while #1111 concerns a backport to Howdy 2.6.1. Since there is currently no dedicated 2.x maintenance branch, this PR cannot target an appropriate merge base.

I will add my real-system validation results and tested commit to #1111 so maintainers can cherry-pick or use it for a future 2.6.1 maintenance release.

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