[Git][security-tracker-team/security-tracker][master] 4 commits: bin/report-vuln: split imports
Emilio Pozuelo Monfort
pochu at debian.org
Thu Aug 6 07:25:09 BST 2020
Emilio Pozuelo Monfort pushed to branch master at Debian Security Tracker / security-tracker
Commits:
9b9f4012 by Emilio Pozuelo Monfort at 2020-08-06T08:24:33+02:00
bin/report-vuln: split imports
- - - - -
9ba765b1 by Emilio Pozuelo Monfort at 2020-08-06T08:24:33+02:00
bin/report-vuln: adapt urllib import for py3
- - - - -
92bb7cfe by Emilio Pozuelo Monfort at 2020-08-06T08:24:33+02:00
bin/report-vuln: decode the url data
We get a bytes object under python 3.
- - - - -
1d50990b by Emilio Pozuelo Monfort at 2020-08-06T08:24:33+02:00
bin/report-vuln: switch to python3
- - - - -
1 changed file:
- bin/report-vuln
Changes:
=====================================
bin/report-vuln
=====================================
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
#
# generate bug report content/mail for a given package name and a
# number of CVE ids
@@ -9,11 +9,13 @@
#
# export http_proxy if you need to use an http proxy to report bugs
-from __future__ import print_function
-
import argparse
from tempfile import NamedTemporaryFile
-import sys, re, urllib, os
+import os
+import re
+import sys
+from urllib.parse import urlencode
+from urllib.request import urlopen
from textwrap import wrap
temp_id = re.compile('(?:CVE|cve)\-[0-9]{4}-XXXX')
@@ -57,10 +59,10 @@ def gen_index(ids):
return ret
def http_get(id):
- param = urllib.urlencode({'name' : id})
+ param = urlencode({'name' : id})
resp = ''
try:
- f = urllib.urlopen('https://cve.mitre.org/cgi-bin/cvename.cgi?%s' % param)
+ f = urlopen('https://cve.mitre.org/cgi-bin/cvename.cgi?%s' % param)
resp = f.read()
except Exception as e:
error('on doing HTTP request' + str(e))
@@ -78,7 +80,7 @@ def get_cve(id):
ret = ''
resp = http_get(id)
- for line in resp.rsplit('\n'):
+ for line in resp.decode('utf-8').rsplit('\n'):
if r.match(line):
desc = True
continue
View it on GitLab: https://salsa.debian.org/security-tracker-team/security-tracker/-/compare/ba0ab3e3b206a6dfc5ae59590e3b74535ed0f1b8...1d50990bd477bdd356b2e82787eacde64a7a0ae0
--
View it on GitLab: https://salsa.debian.org/security-tracker-team/security-tracker/-/compare/ba0ab3e3b206a6dfc5ae59590e3b74535ed0f1b8...1d50990bd477bdd356b2e82787eacde64a7a0ae0
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-security-tracker-commits/attachments/20200806/c5fb0e76/attachment-0001.html>
More information about the debian-security-tracker-commits
mailing list