New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test suite requires python-2.x #16
Comments
Hello, there is a branch called |
I get a bunch of warnings with python-3.8 on Gentoo, but the test suite does ultimately pass:
|
Oh, and I noticed you changed a warning from "The py3dns library is not installed..." to "The python3-dns library is not installed..." That misled me for a moment, because AFAIK the name "py3dns" is correct (i.e. that's what I needed to install). This is its project page: https://git.launchpad.net/py3dns |
i thought the same and i tested the patch with py3dns too. Then, working on the travis pull request, i noticed it was importing only python-dns (not pydns) and it was working, so i gave a try to python3-dns and that seems a better idea other than py3dns that requires a separate installation. Regarding the warnings: i noticed them too but i have not enough experience with python to fix them. |
I think the warnings are just a matter of calling diff --git a/rbldnsd.py b/rbldnsd.py
index 79ef6d2..8134047 100644
--- a/rbldnsd.py
+++ b/rbldnsd.py
@@ -27,13 +27,16 @@ $NS 1d ns0.example.org
class ZoneFile(object):
def __init__(self, lines=None, no_header=False):
- self._file = NamedTemporaryFile()
+ self._file = NamedTemporaryFile(delete=False)
if not no_header:
self._file.write(bytes(DUMMY_ZONE_HEADER, encoding = 'utf-8'))
if lines is not None:
self.writelines(lines)
self._file.flush()
+ def __del__(self):
+ self._file.close()
+
@property
def name(self):
return self._file.name
@@ -157,6 +160,8 @@ class Rbldnsd(object):
raise DaemonError("can not kill stop rbldnsd")
time.sleep(0.1)
+ self._stdout.close()
+
self._daemon = None
if daemon.returncode != 0:
raise DaemonError("rbldnsd exited with code %d"
diff --git a/test_acl.py b/test_acl.py
index 84c9f55..f071c08 100644
--- a/test_acl.py
+++ b/test_acl.py
@@ -44,9 +44,10 @@ no_ipv6 = not _have_ipv6()
def daemon(acl, addr='localhost'):
""" Create an Rbldnsd instance with given ACL
"""
- acl_zone = NamedTemporaryFile()
+ acl_zone = NamedTemporaryFile(delete=False)
acl_zone.writelines(bytes("%s\n" % line, encoding='utf8') for line in acl)
acl_zone.flush()
+ acl_zone.close()
dnsd = Rbldnsd(daemon_addr=addr)
dnsd.add_dataset('acl', acl_zone)
diff --git a/test_btrie.py b/test_btrie.py
index 51a61ed..6f6e450 100644
--- a/test_btrie.py
+++ b/test_btrie.py
@@ -32,7 +32,7 @@ def deduce_pointer_size(makefile='./Makefile'):
cc = make_vars['CC']
cflags = make_vars['CFLAGS']
- test_c = NamedTemporaryFile(suffix=".c")
+ test_c = NamedTemporaryFile(suffix=".c", delete=False)
test_c.write(r'''
#include <stdio.h>
#ifndef __SIZEOF_POINTER__
@@ -44,6 +44,7 @@ int main () {
}
''')
test_c.flush()
+ test_c.close()
src = test_c.name
try:
@@ -123,6 +124,9 @@ class CaptureOutput(object):
def __init__(self):
self._file = TemporaryFile()
+ def __del__(self):
+ self._file.close()
+
def fileno(self):
return self._file.fileno()
|
Thank you Michael. |
Now that python-2.x is finally being EOLed , for real this time, we swear -- from all Linux distributions -- the rbldnsd test suite needs to be updated to work with python-3.x.
The text was updated successfully, but these errors were encountered: