Git Product home page Git Product logo

Comments (13)

kitterma avatar kitterma commented on September 27, 2024 1

Thanks. I can confirm the problem and I've added a test that replicates it.

from pyspf.

sdgathman avatar sdgathman commented on September 27, 2024

Would like to have a "quantum" mode for i='list' that both matches and does not match. Right now, it never matches, which is a useful heuristic.

from pyspf.

kitterma avatar kitterma commented on September 27, 2024

I guess not crashing would be a nice first step.

from pyspf.

sdgathman avatar sdgathman commented on September 27, 2024

It is broken in python3. The problem is that ipaddress has ip_network whereas ipaddr (py2) has IPNetwork. Should we ditch or fork python2 at this point?

Fedora has dropped python2-ipaddress and python2-ipaddr as of Fedora 32.

from pyspf.

kitterma avatar kitterma commented on September 27, 2024

Debian has dropped them as well. I have no problem at all with dropping support for python2. It's no longer supported by the Python developers, so I don't think we need to do so for future development.

from pyspf.

sdgathman avatar sdgathman commented on September 27, 2024

I think I will drop support for ipaddr. If you must run py2, then python2-ipaddress can be installed from older versions of Fedora. EL6 dies in Nov 2020. EL7 has python3.6. So python3.6 is my new minimum target. But there is no point in throwing away already existing py2 compatibility without a good reason. Therefore, I will drop support for ipaddr.

from pyspf.

kitterma avatar kitterma commented on September 27, 2024

Does ipaddress on python2 work? I haven't tried it with pyspf, but in other contexts I have run into huge UTF-8 issues because ipaddress assumes a UTF-8 environment that python2 doesn't reliably provide.

from pyspf.

sdgathman avatar sdgathman commented on September 27, 2024

A hacked ipaddress on python2 works. Such as released on Fedora. For instance, the hacked ipaddress provides a Bytes class, which I import on python2.

from pyspf.

sdgathman avatar sdgathman commented on September 27, 2024

I pushed dropping ipaddr support to master. This fixes this issue for python3. Python2 and ipaddr support can continue in another branch as suggested by @kitterma.

from pyspf.

kitterma avatar kitterma commented on September 27, 2024

OK. As long as it works, I have no objection to dropping ipaddr.

from pyspf.

sdgathman avatar sdgathman commented on September 27, 2024

At this point, hacking on ipaddress for python2 would be easier than try to match the not quite the same APIs.

from pyspf.

sdgathman avatar sdgathman commented on September 27, 2024

@shay-cyesec The list feature is not a full implementation, but a quick heuristic that works by always not matching and listing the ips not matched. A full implementation would keep a list for each result, and make recursive calls for both matching and not matching.

from pyspf.

evgeni avatar evgeni commented on September 27, 2024

FWIW, tests still fail on Python 3.7 and 3.8 for me with:

File "/home/evgeni/Devel/pyspf/.tox/py38/lib/python3.8/site-packages/spf.py", line 576, in spf.query.check
Failed example:
    r.check()
Expected:
    ('fail', 550, 'SPF fail - not authorized')
Got:
    ('none', 250, '')

from pyspf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.