python-scapy: add upstream patch fixing python 2.x compatibility
Fixes:
http://autobuild.buildroot.net/results/829/8293529a72ac4c8e93919b8bc0ea758fbb4bc444/
Python 2.x gets confused by rb"string", but not br"string", so add an upstream patch changing the former to the latter to fix a pycompile issue with python 2.x:
error: File "/usr/lib/python2.7/site-packages/scapy/tools/generate_ethertypes.py", line 23
reg = rb".*ETHERTYPE_([^\s]+)\s.0x([0-9A-Fa-f]+).*\/\*(.*)\*\/"
^SyntaxError: invalid syntax
---
Fix is included in 2.4.4, so not for master
--- .../0001-Small-Python-2-fix.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 package/python-scapy/0001-Small-Python-2-fix.patch
package/python-scapy/0001-Small-Python-2-fix.patch new file +26 -0
@@ -0,0 +1,26 @@ +From 0c3d5e417bbd923c4729d15572c3d693d58aff81 Mon Sep 17 00:00:00 2001 +From: Gabriel <[email protected]> +Date: Wed, 21 Aug 2019 18:18:14 +0800 +Subject: [PATCH] Small Python 2 fix + +Signed-off-by: Peter Korsgaard <[email protected]> +--- + scapy/tools/generate_ethertypes.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scapy/tools/generate_ethertypes.py b/scapy/tools/generate_ethertypes.py +index 5bc5cdf9..47c38c4f 100644 +--- a/scapy/tools/generate_ethertypes.py ++++ b/scapy/tools/generate_ethertypes.py +@@ -20,7 +20,7 @@ URL = "https://raw.githubusercontent.com/openbsd/src/master/sys/net/ethertypes.h + with urllib.request.urlopen(URL) as stream: + DATA = stream.read() + +-reg = rb".*ETHERTYPE_([^\s]+)\s.0x([0-9A-Fa-f]+).*\/\*(.*)\*\/" ++reg = br".*ETHERTYPE_([^\s]+)\s.0x([0-9A-Fa-f]+).*\/\*(.*)\*\/" + COMPILED = b"""# + # Ethernet frame types + # This file describes some of the various Ethernet +-- +2.20.1 +
Signature · 1 line
2.20.1
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Peter" == Peter Korsgaard <[email protected]> writes:
Fixes:
http://autobuild.buildroot.net/results/829/8293529a72ac4c8e93919b8bc0ea758fbb4bc444/Python 2.x gets confused by rb"string", but not br"string", so add an upstream patch changing the former to the latter to fix a pycompile issue with python 2.x:
Quoted 8 lines
error: File "
/usr/lib/python2.7/site-packages/scapy/tools/generate_ethertypes.py", line 23reg = rb".*ETHERTYPE_([^\s]+)\s.0x([0-9A-Fa-f]+).*\/\*(.*)\*\/" ^SyntaxError: invalid syntax
Signed-off-by Peter Korsgaard <[email protected]>---
Fix is included in 2.4.4, so not for master
Committed to 2020.02.x, 2020.05.x and 2020.08.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard