-
-
Notifications
You must be signed in to change notification settings - Fork 298
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
Error on running with python3: "ModuleNotFoundError: No module named 'ConfigParser'" and the fix #799
Comments
The 'ConfigParser' library in python3 is renamed to @@ -6,11 +6,17 @@ import os
import glob
import syslog
-# pam-python is running python 2, so we use the old module here
-import ConfigParser
+import sys
+# The config parser is named in python2 as ConfigParser but in python3 as configparser
+# and here is a workaround for this.
+if sys.version_info[0] == 2:
+ import ConfigParser
+ config = ConfigParser.ConfigParser()
+else:
+ import configparser
+ config = configparser.ConfigParser()
# Read config from disk
-config = ConfigParser.ConfigParser()
config.read(os.path.dirname(os.path.abspath(__file__)) + "/config.ini") |
I've found that the similar changes already implemented in the So, @boltgolt could you please make a new release with these changes? |
Same exception here after updating ubuntu to 23:04, the suggested changes do solve the issue |
When I'm trying to log in using howdy in Ubuntu 23.04 which has python3 version by default - I've got an error:
I've searched for similar issues already, and my issue has not been reported yet.
Linux distribution (if applicable): Ubuntu 23.04
Howdy version (
sudo howdy version
): 2.6.1The text was updated successfully, but these errors were encountered: