7

解决OMV apt更新软件时python报错

 3 years ago
source link: https://azhuge233.com/%e8%a7%a3%e5%86%b3omv-apt%e6%9b%b4%e6%96%b0%e8%bd%af%e4%bb%b6%e6%97%b6python%e6%8a%a5%e9%94%99/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

OpenMediaVault在执行apt update/upgrade后会报如下错误

Traceback (most recent call last):
File “/usr/lib/python3.5/weakref.py”, line 117, in remove
TypeError: ‘NoneType’ object is not callable

问题讨论和解决方法地址:Github

解决方法一:

直接执行指令

wget -O /usr/lib/python3.5/weakref.py https://raw.githubusercontent.com/python/cpython/9cd7e17640a49635d1c1f8c2989578a8fc2c1de6/Lib/weakref.py
wget -O /usr/lib/python3.5/weakref.py https://raw.githubusercontent.com/python/cpython/9cd7e17640a49635d1c1f8c2989578a8fc2c1de6/Lib/weakref.py

解决方法二:

打开/usr/lib/python3.5/weakref.py,将109行修改为

def remove(wr, selfref=ref(self), _atomic_removal=_remove_dead_weakref):
def remove(wr, selfref=ref(self), _atomic_removal=_remove_dead_weakref):

再将117行修改为

_atomic_removal(d, wr.key)
_atomic_removal(d, wr.key)

相关


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK