Hi,
After I upgrade from V115 to V117, I realize V117 breaks my python script with urllib library.
When I re-write the V115 image, the python is working again.
Not sure is this a bug or something else?
update:
my apt-get update also breaks after update to V117
When you say “breaks your python script and apt-get update”, please could you provide us with more information. Either a screenshot of the error/issue when it occurs, or a copy and paste over SSH.
With the requested information above, we should be able to assist you
Sure, Thank you for the reply. Here is the output of one of the scripts that I am using to update the noip ddns.
Traceback (most recent call last):
File “noip.py”, line 7, in
web_page = urllib.urlopen("> http://iptools.bizhat.com/ipv4.php> ")
File “/usr/lib/python2.7/urllib.py”, line 87, in urlopen
return opener.open(url)
File “/usr/lib/python2.7/urllib.py”, line 213, in open
return getattr(self, name)(url)
File “/usr/lib/python2.7/urllib.py”, line 350, in open_http
h.endheaders(data)
File “/usr/lib/python2.7/httplib.py”, line 997, in endheaders
self._send_output(message_body)
File “/usr/lib/python2.7/httplib.py”, line 850, in _send_output
self.send(msg)
File “/usr/lib/python2.7/httplib.py”, line 812, in send
self.connect()
File “/usr/lib/python2.7/httplib.py”, line 793, in connect
self.timeout, self.source_address)
File “/usr/lib/python2.7/socket.py”, line 553, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
IOError: [Errno socket error] [Errno -2] Name or service not known
Another script using urllib
Traceback (most recent call last):
File “afraid.py”, line 20, in
newip = urllib2.urlopen("> http://ip.dnsexit.com/> ").read().strip()
File “/usr/lib/python2.7/urllib2.py”, line 154, in urlopen
return opener.open(url, data, timeout)
File “/usr/lib/python2.7/urllib2.py”, line 431, in open
response = self._open(req, data)
File “/usr/lib/python2.7/urllib2.py”, line 449, in _open
‘_open’, req)
File “/usr/lib/python2.7/urllib2.py”, line 409, in _call_chain
result = func(*args)
File “/usr/lib/python2.7/urllib2.py”, line 1227, in http_open
return self.do_open(httplib.HTTPConnection, req)
File “/usr/lib/python2.7/urllib2.py”, line 1197, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno -2] Name or service not known>
Strange. Is it possible the urllib2 library you have is only python3 compatible?
The apt-get update error, could you paste the error or screenshot it please? There may be a issue with a repo that is causing this. Could even be linked to your python issue if packages were installed from various repos.
#/etc/network/interfaces
#Please use DietPi-Config to modify network settings.
# Local
auto lo
iface lo inet loopback
# Ethernet
allow-hotplug eth1
....
will say, if you want to alter your network settings, please use menu " 7 Network Options: Adapters " in:
root@oDroid-C1-TEST:~# dietpi-config
In this menu you can as well disable WiFi adapter:
Correct is:
# Wifi
. . .
#dns-nameservers 8.8.8.8 8.8.4.4
" dietpi-config " did this. Where is no need, to edit " /etc/network/interfaces " manually, to disable WiFi adapter.
But if you edit the file manually before, you have to set it now “once” by hand, so dietpi-config can work correct.
BWT: - to have one, both, fallback network adapters working at the same time, having two different gateways or subnets, working infrastructure mod, static IP or dhcp, with WiFi HotSpot, with PiHole installed and so on, is a new feature in v116/ v117: https://github.com/Fourdee/DietPi/issues/273#issuecomment-210905921
And yes, it was a long and stony journey for @Fourdee to get it on work.
Yes, after following Fourdee’s instruction, it works. I changed the /etc/network/interfaces back to the default setting of dietpi.
dietpi-config works, but I do not have wifi, so no option for me to disable it.
Yes, I am able to change my network setting.
Internet works fine. I can ping google.com now.
I plan to upgrade to V118 today. Hopefully no problem. Will make back up image for current setting, in case of failed.