wking / rss2email

open-source tool for Windows, Mac OS and UNIX for getting news from RSS feeds in email
http://pypi.python.org/pypi/rss2email/
GNU General Public License v2.0
268 stars 48 forks source link

import_name issue after switching to 3.8 #118

Open arunpersaud opened 4 years ago

arunpersaud commented 4 years ago

Hi

after switching to 3.8 I'm gettting the following error for a news feed where I set up a post process hook.

Traceback (most recent call last): File "/usr/bin/r2e", line 5, in rss2email.main.run() File "/usr/lib/python3.8/site-packages/rss2email/main.py", line 171, in run args.func(feeds=feeds, args=args) File "/usr/lib/python3.8/site-packages/rss2email/command.py", line 92, in run feeds.save() File "/usr/lib/python3.8/site-packages/rss2email/feeds.py", line 348, in save feed.save_to_config() File "/usr/lib/python3.8/site-packages/rss2email/feed.py", line 261, in save_to_config value = self._get_configured_option_value( File "/usr/lib/python3.8/site-packages/rss2email/feed.py", line 308, in _get_configured_option_value return _util.import_name(value) File "/usr/lib/python3.8/site-packages/rss2email/util.py", line 114, in import_name raise ValueError(obj) ValueError: <function news_hook at 0x7f7846e2dee0>

The hook I want to call is in a file called myhook.py called news_hook.

I added a print statement in util.py:import_name and get the following:

PROTO 4 0 FRAME 24 2 SHORT_BINUNICODE myhook 11 MEMOIZE None 19 SHORT_BINUNICODE news_hook 20 MEMOIZE None 31 STACK_GLOBAL None 32 MEMOIZE None 33 STOP None 34

Seems it never gets a 'GLOBAL' opcode which the function is looking for... I don't understand opcodes enough to know what's going on here though.

Arun

arunpersaud commented 4 years ago

Seems to be related to change in opcodes for pickle version 3 vs 4.

https://www.python.org/dev/peps/pep-3154/

Ekleog commented 3 years ago

Hello,

This repository has been deprecated for a few years now, and has been replaced by https://github.com/rss2email/rss2email .

If this issue is still relevant to you, and not fixed with v3.12.2, could you please reopen the issue there?

Cheers, Leo