You are not logged in.

#1 2018-08-06 11:21:36

dalvak
Member
Registered: 2018-06-27
Posts: 2

Runtime Exception with Archey after Upgrade to Python 3.7

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
StopIteration

The 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:

What’s New In Python 3.7->Porting to Python 3.7->Changes in Python Behavior wrote:

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

#2 2018-08-06 12:00:08

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 1,978
Website

Re: Runtime Exception with Archey after Upgrade to Python 3.7

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

#3 2018-08-06 12:08:26

dalvak
Member
Registered: 2018-06-27
Posts: 2

Re: Runtime Exception with Archey after Upgrade to Python 3.7

Okay, thanks!

Offline

#4 2018-08-06 20:11:23

7etc/
Member
Registered: 2010-05-08
Posts: 47

Re: Runtime Exception with Archey after Upgrade to Python 3.7

see graysky2  post and fix on GitHub here.

Offline

#5 2018-08-08 06:04:02

Shrom59
Member
Registered: 2017-01-02
Posts: 20

Re: Runtime Exception with Archey after Upgrade to Python 3.7

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

#6 2018-08-08 19:47:34

miles969
Member
Registered: 2013-02-03
Posts: 23

Re: Runtime Exception with Archey after Upgrade to Python 3.7

thanks you guys, archey is back again!

dammit, i love this community

Offline

Board footer

Powered by FluxBB