You are not logged in.

#1 2018-08-08 00:04:46

cirkit
Member
From: San Francisco
Registered: 2008-01-29
Posts: 78
Website

Python 3.7.0 upgrade: python-postfix-policyd-spf is broken

policyd-spf is throwing errors after yesterday's python upgrades. There was a big update of multiple python packages including python (3.6.6-1 -> 3.7.0-3). I reinstalled policyd-spf and python-pyspf from AUR thinking maybe those needed to be rebuilt, but the same "ModuleNotFoundError" persists. I also rebuilt python-postfix-policyd-spf to no avail. The problem seems to be specific to the python 3.7.0-3 upgrade.

Dependencies
python-pydns 3.2.0-1
python-pyspf 2.0.12-1

$ /usr/bin/python --version; /usr/bin/policyd-spf
Python 3.7.0
Traceback (most recent call last):
  File "/usr/bin/policyd-spf", line 39, in <module>
    import spf
ModuleNotFoundError: No module named 'spf'

Well, python-postfix-policyd-spf was definitely working fine with Python 3.6.6-1, so what I also did was install python36 3.6.6-1 from AUR, but pointing policyd-spf to this version still makes no difference.

$ /usr/bin/python3.6 /usr/bin/policyd-spf
Traceback (most recent call last):
  File "/usr/bin/policyd-spf", line 39, in <module>
    import spf
  File "/usr/lib/python3.6/site-packages/spf.py", line 128, in <module>
    import DNS    # http://pydns.sourceforge.net
ModuleNotFoundError: No module named 'DNS'
$ python3.6
Python 3.6.6 (default, Aug  7 2018, 03:32:18)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import spf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.6/site-packages/spf.py", line 128, in <module>
    import DNS    # http://pydns.sourceforge.net
ModuleNotFoundError: No module named 'DNS'

Offline

#2 2018-08-08 00:52:14

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,366
Website

Re: Python 3.7.0 upgrade: python-postfix-policyd-spf is broken

The import of spf succeeds on my system with the current version of python, python-postfix-policyd-spf, python-pydns and python-pyspf.

Check the output of pacman -Ql python-pyspf to make sure that it is installed under /usr/lib/python3.7 as expected.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#3 2018-08-08 01:32:05

cirkit
Member
From: San Francisco
Registered: 2008-01-29
Posts: 78
Website

Re: Python 3.7.0 upgrade: python-postfix-policyd-spf is broken

Thank you very much for the suggestion. Oddly enough completely uninstalling then reinstalling python-postfix-policyd-spf, python-pydns and python-pyspf still resulted in python-pyspf installing to /usr/lib/python3.6 instead of /usr/lib/python3.7. Before this, I went ahead and removed AUR package python36 so that only python37 is on the system, then installed python-pyspf which still did not go into /usr/lib/python3.7 like it should have.

What I did instead was slightly modify the PKGBUILD to point to the python3.7 binary even though /usr/bin/python is already version 3.7 so it seems a bit redundant, yet made python-pyspf correctly install to /usr/lib/python3.7.

20c20
<   python setup.py build
---
>   python3.7 setup.py build
29c29
<   python setup.py install --root="$pkgdir" --optimize=1
---
>   python3.7 setup.py install --root="$pkgdir" --optimize=1

I'm still not entirely sure why it seems like some sort of "cache" is remembering the former path and not updating to the new library 3.7 path where rebuilt packages like python-pyspf should be installing to.

Thanks again!

Offline

#4 2018-08-08 01:33:49

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 2,378

Re: Python 3.7.0 upgrade: python-postfix-policyd-spf is broken

cirkit wrote:

policyd-spf is throwing errors after yesterday's python upgrades. There was a big update of multiple python packages including python (3.6.6-1 -> 3.7.0-3). I reinstalled policyd-spf and python-pyspf from AUR thinking maybe those needed to be rebuilt, but the same "ModuleNotFoundError" persists. I also rebuilt python-postfix-policyd-spf to no avail. The problem seems to be specific to the python 3.7.0-3 upgrade.

Did you actually rebuild them or did you accidentally reinstall the previously built python 3.6 version from a $PKGDEST cache?

pacman -Qi python-pyspf # what's the build date

EDIT: oh, I see. Well, since you definitely rebuilt it, maybe you should ask what `type -a python` resolves to -- if it is something other than /usr/bin/python then that's obviously not good.

Last edited by eschwartz (2018-08-08 01:36:14)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#5 2018-08-08 02:22:16

cirkit
Member
From: San Francisco
Registered: 2008-01-29
Posts: 78
Website

Re: Python 3.7.0 upgrade: python-postfix-policyd-spf is broken

Doing `type -a python` resolves to the python symlinks pointing to python3 (3.7.0) as expected. Being that 3.6 isn't even installed, but the 3.6 paths still exist, I'm not entirely why /usr/lib/python3.7 doesn't take precedence over the former 3.6 paths.

Offline

#6 2018-08-08 13:49:58

bsujja
Member
From: Thailand
Registered: 2013-01-27
Posts: 19

Re: Python 3.7.0 upgrade: python-postfix-policyd-spf is broken

Completely remove python-postfix-policyd-spf with

$yaourt -Rdns python-postfix-policyd-spf

Then reinstall python-postfix-policyd-spf solved the problem for me.

Offline

#7 2018-08-10 12:36:42

corruption2013
Member
Registered: 2013-02-26
Posts: 10

Re: Python 3.7.0 upgrade: python-postfix-policyd-spf is broken

This broke my mail server, so annoying big_smile

However:

bsujja wrote:

Completely remove python-postfix-policyd-spf with

$yaourt -Rdns python-postfix-policyd-spf

Then reinstall python-postfix-policyd-spf solved the problem for me.

Did fixed the path to python 3.7.

Thanks for this thread!

Offline

#8 2018-08-20 08:11:30

Ztjuh
Member
Registered: 2011-05-30
Posts: 58

Re: Python 3.7.0 upgrade: python-postfix-policyd-spf is broken

I am late to the party, I just disabled spf for the time being, but now I read this and would like to fix the error. I did remove the packages with `aurman -Rdns python-postfix-policyd-spf` and reinstalled them, but this did not fix my problem. How do I fix the path?

EDIT: Nvm, I got it....

$ aurman -Rdns python-postfix-policyd-spf
$ aurman -S --rebuild python-postfix-policyd-spf

Last edited by Ztjuh (2018-08-20 08:47:14)

Offline

Board footer

Powered by FluxBB