jaymzh / pius

PGP Individual User Signer
Other
98 stars 25 forks source link

AttributeError: type object 'PiusParser' has no attribute 'FP_RE' #133

Closed sliptonic closed 4 years ago

sliptonic commented 4 years ago

I was at the FOSDEM keysigning party on Sunday. I'm trying to generate a keyring from the txt list and getting this error. Did I miss a dependency somewhere?

pius-keyring-mgr build -r ./fosdem-ksp-keyring.gpg -f ksp-fosdem2020.txt Traceback (most recent call last): File "/usr/local/bin/pius-keyring-mgr", line 876, in main() File "/usr/local/bin/pius-keyring-mgr", line 840, in main keys.extend(PiusParser.parse_flatfile(options.flat_file)) File "/usr/local/bin/pius-keyring-mgr", line 146, in parse_flatfile matches = self.FP_RE.findall(contents) AttributeError: type object 'PiusParser' has no attribute 'FP_RE'

jaymzh commented 4 years ago

Give the attached PR a shot.

jaymzh commented 4 years ago

Can you point me the list of keys? I'll poke at it today. In the new error, it's not clear what's going on... and when we did the massive refactor last year, I don't know the -f codepath was one we tested as well. :/ I'll get ya sorted though! Thanks for reporting.

sliptonic commented 4 years ago

https://ksp.fosdem.org/files/

jaymzh commented 4 years ago

This works for me, but that's because the text argument to the subprocess module was added in python 3.7. We could probably work around it - but since 3.7 was released almost 2 years ago, if you have access to python 3.7 that'd be preferable.

sliptonic commented 4 years ago

I can install python 3.7 in parallel but would rather not make it the default. The current version (19.3) of mint still ships with 3.6.9.

I changed the shbang for the /usr/local/bin/pius-keyring-mgr to use python3.7 but then got this error:

Traceback (most recent call last): File "/usr/local/bin/pius-keyring-mgr", line 23, in from libpius.util import PiusUtil as util ModuleNotFoundError: No module named 'libpius' Error in sys.excepthook: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook from apport.fileutils import likely_packaged, get_recent_crashes File "/usr/lib/python3/dist-packages/apport/init.py", line 5, in from apport.report import Report File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in import apport.fileutils File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in from apport.packaging_impl import impl as packaging File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in import apt File "/usr/lib/python3/dist-packages/apt/init.py", line 23, in import apt_pkg ModuleNotFoundError: No module named 'apt_pkg'

Original exception was: Traceback (most recent call last): File "/usr/local/bin/pius-keyring-mgr", line 23, in from libpius.util import PiusUtil as util ModuleNotFoundError: No module named 'libpius'

jaymzh commented 4 years ago

You'll need to re-run the PIUS installation using setup.py pointed at your 3.7 installation.