You are not logged in.
Hi,
I have just updated to Python 3.7 and found that the Archey package appeared to be broken by the upgrade and was giving me the following exception message when I ran it:
/usr/bin/archey3:862: DeprecationWarning: The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in future versions. Use ConfigParser directly instead.
config = ArcheyConfigParser()
Traceback (most recent call last):
File "/usr/bin/archey3", line 805, in parse_display
raise StopIteration
StopIterationThe above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/bin/archey3", line 869, in <module>
main()
File "/usr/bin/archey3", line 866, in main
archey.run(options.screenshot)
File "/usr/bin/archey3", line 728, in run
print(self.render())
File "/usr/bin/archey3", line 734, in render
results = self.prepare_results()
File "/usr/bin/archey3", line 753, in prepare_results
for cls_name, args in self.parse_display():
RuntimeError: generator raised StopIteration
I believe that this is due to the changes in python behavior in python 3.7 or more specifically the following change:
PEP 479 is enabled for all code in Python 3.7, meaning that StopIteration exceptions raised directly or indirectly in coroutines and generators are transformed into RuntimeError exceptions. (Contributed by Yury Selivanov in bpo-32670.)
If I change line 805 in Archey from
raise StopIteration
To:
return
It now works as expected as the runtime exception is now not thrown.
My question is now what should I do? Should this be fixed in the Arch Linux package or should I be submitting a pull request to upstream?
Thanks for any help!
Offline
I just opened a pull request upstream.
Edit: The repo seems to be abandoned since 2011. So I doubt that the maintainer will fix it.
Last edited by schard (2018-08-06 12:04:29)
macro_rules! yolo { { $($tokens:tt)* } => { unsafe { $($tokens)* } }; }
Offline
Okay, thanks!
Offline
I fixed this by doing this changes
551: class ArcheyConfigParser(configparser.SafeConfigParser): (depreciated?)
by
551: class ArcheyConfigParser(configparser.ConfigParser):
805: raise StopIteration (depreciated?)
by
805: return
Is the Archlinux Package will be updated ?
Offline
thanks you guys, archey is back again!
dammit, i love this community
Offline