Skip to content
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

Python3 port of ndiff #1807

Closed
wants to merge 1 commit into from
Closed

Conversation

BryanQuigley
Copy link

Ports everything except for setup.py

@BryanQuigley BryanQuigley force-pushed the ndiff-python3 branch 5 times, most recently from 7838418 to fe8dc17 Compare Nov 5, 2019
@BryanQuigley BryanQuigley changed the title [WIP] Python3 port of ndiff Python3 port of ndiff Nov 5, 2019
@XVilka
Copy link

XVilka commented Dec 16, 2019

Would be nice to have for the next release, since Python 2 will be EOL in a couple weeks.

@derpadoo
Copy link

Thanks for porting this @BryanQuigley! Flake8 is flagging the cmp function. I'm not familiar with it, but it looks like it changed to:

https://docs.python.org/3.6/library/functools.html#functools.cmp_to_key

image

return cmp((self.id, self.output), (other.id, other.output))

Besides that, worked as expected in Python 3.6!

import ndiff

filename_a = "test-scans/random-1.xml"
filename_b = "test-scans/random-2.xml"

scan_a = ndiff.Scan()
scan_a.load_from_file(filename_a)
scan_b = ndiff.Scan()
scan_b.load_from_file(filename_b)

# Text
fh = open("text_output.txt", "w")
diff = ndiff.ScanDiffText(scan_a, scan_b, fh)
cost = diff.output()

# XML
fh_xml = open("xml_output.xml", "w")
diff = ndiff.ScanDiffXML(scan_a, scan_b, fh_xml)
cost = diff.output()

@BryanQuigley
Copy link
Author

Been a bit, but I think we replaced all the cmp bits before this, so removing this last one - seems to work. Thanks for the feedback -also updated because there have been other code commits...

jefferyto added a commit to jefferyto/openwrt-packages that referenced this pull request Mar 20, 2020
* Update to 7.80

* Add "full" variants for nmap and ncat that support Lua scripts (and
  OpenSSL)

* Replace libcxx fix with upstream patch[1] (CHANGELOG change was
  removed)

* Switch ndiff to use Python 3 (using a patch from Debian[2], which
  comes from an upstream PR[3] plus a port of ndiff/setup.py)

[1]: nmap/nmap@ea4e2d6
[2]: https://salsa.debian.org/pkg-security-team/nmap/-/blob/0510c602dd45f4dc0b06a6f422a9b0855564ddbb/debian/patches/0004-Python3-port-of-ndiff.patch
[3]: nmap/nmap#1807

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
jefferyto added a commit to jefferyto/openwrt-packages that referenced this pull request Mar 21, 2020
* Update to 7.80

* Add "full" variants for nmap and ncat that support Lua scripts (and
  OpenSSL)

* Replace libcxx fix with upstream patch[1] (CHANGELOG change was
  removed)

* Switch ndiff to use Python 3 (using a patch from Debian[2], which
  comes from an upstream PR[3] plus a port of ndiff/setup.py)

[1]: nmap/nmap@ea4e2d6
[2]: https://salsa.debian.org/pkg-security-team/nmap/-/blob/0510c602dd45f4dc0b06a6f422a9b0855564ddbb/debian/patches/0004-Python3-port-of-ndiff.patch
[3]: nmap/nmap#1807

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
nunojpg pushed a commit to openwrt/packages that referenced this pull request Mar 29, 2020
* Update to 7.80

* Add "full" variants for nmap and ncat that support Lua scripts (and
  OpenSSL)

* Replace libcxx fix with upstream patch[1] (CHANGELOG change was
  removed)

* Switch ndiff to use Python 3 (using a patch from Debian[2], which
  comes from an upstream PR[3] plus a port of ndiff/setup.py)

[1]: nmap/nmap@ea4e2d6
[2]: https://salsa.debian.org/pkg-security-team/nmap/-/blob/0510c602dd45f4dc0b06a6f422a9b0855564ddbb/debian/patches/0004-Python3-port-of-ndiff.patch
[3]: nmap/nmap#1807

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Ported all python scrips in ndiff/ except setup.py

Some hints on cmp taken from nmap#1484

Minor tweaks to Makefile to support python3, but unsure if
there is a better way to do that.

Seperated .travis.yml commands for easier debugging where it breaks.

This closes the easy half of nmap#1176

Resolves: nmap#1484
farmergreg pushed a commit to farmergreg/packages that referenced this pull request Sep 8, 2020
* Update to 7.80

* Add "full" variants for nmap and ncat that support Lua scripts (and
  OpenSSL)

* Replace libcxx fix with upstream patch[1] (CHANGELOG change was
  removed)

* Switch ndiff to use Python 3 (using a patch from Debian[2], which
  comes from an upstream PR[3] plus a port of ndiff/setup.py)

[1]: nmap/nmap@ea4e2d6
[2]: https://salsa.debian.org/pkg-security-team/nmap/-/blob/0510c602dd45f4dc0b06a6f422a9b0855564ddbb/debian/patches/0004-Python3-port-of-ndiff.patch
[3]: nmap/nmap#1807

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
farmergreg pushed a commit to farmergreg/packages that referenced this pull request Sep 8, 2020
* Update to 7.80

* Add "full" variants for nmap and ncat that support Lua scripts (and
  OpenSSL)

* Replace libcxx fix with upstream patch[1] (CHANGELOG change was
  removed)

* Switch ndiff to use Python 3 (using a patch from Debian[2], which
  comes from an upstream PR[3] plus a port of ndiff/setup.py)

[1]: nmap/nmap@ea4e2d6
[2]: https://salsa.debian.org/pkg-security-team/nmap/-/blob/0510c602dd45f4dc0b06a6f422a9b0855564ddbb/debian/patches/0004-Python3-port-of-ndiff.patch
[3]: nmap/nmap#1807

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
hmh pushed a commit to simetnicbr/nmap that referenced this pull request Nov 30, 2020
buildroot-auto-update pushed a commit to buildroot/buildroot that referenced this pull request Oct 21, 2021
The ndiff package provided by Nmap relies on python2; moreover, there
have been pending pull requests to move ndiff to python3 for over two
years with very little engagement by the maintainers
(nmap/nmap#1807).

Remove the option to select ndiff altogether, it is replaced by
python-pyndiff, which provides the same functionality (and more) as the
ndiff provided by nmap, and is compatible with python3.

Signed-off-by: Adam Duskett <aduskett@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Lienol pushed a commit to Lienol/openwrt-packages that referenced this pull request Dec 8, 2021
* Update to 7.80

* Add "full" variants for nmap and ncat that support Lua scripts (and
  OpenSSL)

* Replace libcxx fix with upstream patch[1] (CHANGELOG change was
  removed)

* Switch ndiff to use Python 3 (using a patch from Debian[2], which
  comes from an upstream PR[3] plus a port of ndiff/setup.py)

[1]: nmap/nmap@ea4e2d6
[2]: https://salsa.debian.org/pkg-security-team/nmap/-/blob/0510c602dd45f4dc0b06a6f422a9b0855564ddbb/debian/patches/0004-Python3-port-of-ndiff.patch
[3]: nmap/nmap#1807

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Lienol pushed a commit to Lienol/openwrt-packages that referenced this pull request Dec 9, 2021
* Update to 7.80

* Add "full" variants for nmap and ncat that support Lua scripts (and
  OpenSSL)

* Replace libcxx fix with upstream patch[1] (CHANGELOG change was
  removed)

* Switch ndiff to use Python 3 (using a patch from Debian[2], which
  comes from an upstream PR[3] plus a port of ndiff/setup.py)

[1]: nmap/nmap@ea4e2d6
[2]: https://salsa.debian.org/pkg-security-team/nmap/-/blob/0510c602dd45f4dc0b06a6f422a9b0855564ddbb/debian/patches/0004-Python3-port-of-ndiff.patch
[3]: nmap/nmap#1807

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Lienol pushed a commit to Lienol/openwrt-packages that referenced this pull request Dec 19, 2021
* Update to 7.80

* Add "full" variants for nmap and ncat that support Lua scripts (and
  OpenSSL)

* Replace libcxx fix with upstream patch[1] (CHANGELOG change was
  removed)

* Switch ndiff to use Python 3 (using a patch from Debian[2], which
  comes from an upstream PR[3] plus a port of ndiff/setup.py)

[1]: nmap/nmap@ea4e2d6
[2]: https://salsa.debian.org/pkg-security-team/nmap/-/blob/0510c602dd45f4dc0b06a6f422a9b0855564ddbb/debian/patches/0004-Python3-port-of-ndiff.patch
[3]: nmap/nmap#1807

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Lienol pushed a commit to Lienol/openwrt-packages that referenced this pull request Feb 2, 2022
* Update to 7.80

* Add "full" variants for nmap and ncat that support Lua scripts (and
  OpenSSL)

* Replace libcxx fix with upstream patch[1] (CHANGELOG change was
  removed)

* Switch ndiff to use Python 3 (using a patch from Debian[2], which
  comes from an upstream PR[3] plus a port of ndiff/setup.py)

[1]: nmap/nmap@ea4e2d6
[2]: https://salsa.debian.org/pkg-security-team/nmap/-/blob/0510c602dd45f4dc0b06a6f422a9b0855564ddbb/debian/patches/0004-Python3-port-of-ndiff.patch
[3]: nmap/nmap#1807

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Lienol pushed a commit to Lienol/openwrt-packages that referenced this pull request Feb 11, 2022
* Update to 7.80

* Add "full" variants for nmap and ncat that support Lua scripts (and
  OpenSSL)

* Replace libcxx fix with upstream patch[1] (CHANGELOG change was
  removed)

* Switch ndiff to use Python 3 (using a patch from Debian[2], which
  comes from an upstream PR[3] plus a port of ndiff/setup.py)

[1]: nmap/nmap@ea4e2d6
[2]: https://salsa.debian.org/pkg-security-team/nmap/-/blob/0510c602dd45f4dc0b06a6f422a9b0855564ddbb/debian/patches/0004-Python3-port-of-ndiff.patch
[3]: nmap/nmap#1807

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
cclauss added a commit to cclauss/nmap that referenced this pull request Nov 7, 2022
Prove the Python syntax errors as discussed in
* nmap#91
* nmap#342
* nmap#624
* nmap#665
* nmap#666
* nmap#1176
* nmap#1484
* nmap#1807
* nmap#1972
* nmap#2088 
* nmap#2279
* nmap#2287
* nmap#2446
* nmap#2493
* nmap#2522
And many more...
cclauss added a commit to cclauss/nmap that referenced this pull request Nov 7, 2022
Prove the Python syntax errors as discussed in
* nmap#91
* nmap#342
* nmap#624
* nmap#665
* nmap#666
* nmap#1176
* nmap#1484
* nmap#1807
* nmap#1972
* nmap#2088 
* nmap#2279
* nmap#2287
* nmap#2446
* nmap#2493
* nmap#2522
And many more...
@nmap-bot nmap-bot closed this in 12d41ec Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants