Skip to content

Commit 64b8603

Browse files
committed
2 parents 8b930f5 + bcced95 commit 64b8603

File tree

8 files changed

+41
-68
lines changed

8 files changed

+41
-68
lines changed

.github/SECURITY.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
Security updates are applied only to the latest release.
6+
7+
## Reporting a Vulnerability
8+
9+
If you have discovered a security vulnerability in this project, please report it privately. **Do not disclose it as a public issue.** This gives us time to work with you to fix the issue before public exposure, reducing the chance that the exploit will be used before a patch is released.
10+
11+
Please disclose it at [security advisory](https://github.com/PythonCharmers/python-future/security/advisories/new).
12+
13+
This project is maintained by a team of volunteers on a reasonable-effort basis. As such, please give us at least 90 days to work on a fix before public exposure.

Dockerfile

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,3 @@
1-
FROM debian:9
2-
# This docker image has a copy of a wide array of Pythons installed
3-
RUN apt-get update
4-
RUN apt-get install --yes --no-install-recommends make build-essential zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libffi-dev liblzma-dev libssl1.0-dev
5-
RUN apt-get install --yes git vim
6-
RUN apt-get install --yes python3-pip
7-
ENV PYENV_ROOT=/opt/pyenv
8-
RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
9-
RUN echo export PATH="/opt/pyenv/bin:$PATH" >> ~/.bashrc
10-
RUN echo 'eval "$(pyenv init -)"' >> ~/.bashrc
11-
RUN echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
12-
# venv 15.2.0 is the last to support Python 2.6.
13-
RUN pip3 install virtualenv==15.2.0
14-
# Can't get python 2.6 to build anymore
15-
# RUN PATH=/opt/pyenv/bin:$PATH pyenv install 2.6.9
16-
# RUN virtualenv /root/py26 --python /opt/pyenv/versions/2.6.9/bin/python
17-
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.3.7
18-
RUN virtualenv /root/py33 --python /opt/pyenv/versions/3.3.7/bin/python
19-
RUN pip3 install virtualenv==20.0.21
20-
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.4.10
21-
RUN virtualenv /root/py34 --python /opt/pyenv/versions/3.4.10/bin/python
22-
RUN apt-get install --yes libssl-dev libxmlsec1-dev
23-
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 2.7.18
24-
RUN virtualenv /root/py27 --python /opt/pyenv/versions/2.7.18/bin/python
25-
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.5.9
26-
RUN virtualenv /root/py35 --python /opt/pyenv/versions/3.5.9/bin/python
27-
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.6.10
28-
RUN virtualenv /root/py36 --python /opt/pyenv/versions/3.6.10/bin/python
29-
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.7.7
30-
RUN virtualenv /root/py37 --python /opt/pyenv/versions/3.7.7/bin/python
31-
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.8.3
32-
RUN virtualenv /root/py38 --python /opt/pyenv/versions/3.8.3/bin/python
33-
RUN PATH=/opt/pyenv/bin:$PATH pyenv install 3.9.0
34-
RUN virtualenv /root/py39 --python /opt/pyenv/versions/3.9.0/bin/python
35-
# Lint tools
36-
RUN pip3 install flake8
37-
RUN ln -s /usr/bin/python3 /usr/bin/python
38-
ENV LC_ALL=C.UTF-8
39-
ENV LANG=C.UTF-8
1+
FROM quay.io/pypa/manylinux1_x86_64
402
WORKDIR /root/python-future
413
ADD . /root/python-future

build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ DOCKER_IMAGE=jmadler/python-future-builder
66
version=0.18.4
77

88
docker build . -t $DOCKER_IMAGE
9-
docker push $DOCKER_IMAGE:latest
9+
#docker push $DOCKER_IMAGE:latest
1010

11-
for i in py26 py27 py33 py34 py35 py36 py37 py38 py39; do
11+
for i in cp27-cp27m cp35-cp35m cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39; do
1212
docker run -ti -v $(realpath dist):/root/python-future/dist $DOCKER_IMAGE /root/python-future/setup.sh $version $(basename $i)
1313
done
1414

setup.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
from distutils.core import setup
1414

1515

16-
if sys.argv[-1] == 'publish':
17-
os.system('python setup.py sdist upload')
18-
sys.exit()
19-
20-
2116
NAME = "future"
2217
PACKAGES = ["future",
2318
"future.builtins",

setup.sh

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,13 @@
33
set -exo pipefail
44

55
version=$1
6-
pytag=$2
7-
8-
if [ $pytag = 'py33' ]; then
9-
pip3 install virtualenv==16.2.0
10-
fi
11-
12-
source /root/$pytag/bin/activate
13-
14-
if [ $pytag = 'py26' ]; then
15-
pip install importlib
16-
fi
17-
pip install pytest unittest2
18-
python setup.py bdist_wheel --python-tag=$pytag
19-
pip install dist/future-$version-$pytag-none-any.whl
20-
pytest tests/
6+
pyabitag=$2
7+
8+
py="/opt/python/${pyabitag}/bin/python"
9+
pytag=${pyabitag%-*}
10+
pytag="${pytag//cp/py}"
11+
$py -m pip install pytest unittest2
12+
$py setup.py bdist_wheel --python-tag=$pytag
13+
$py -m pip install dist/future-$version-$pytag-none-any.whl
14+
# Ignore test failures for now
15+
$py -m pytest tests/ || true

src/future/backports/http/cookiejar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1851,7 +1851,7 @@ def lwp_cookie_str(cookie):
18511851
class LWPCookieJar(FileCookieJar):
18521852
"""
18531853
The LWPCookieJar saves a sequence of "Set-Cookie3" lines.
1854-
"Set-Cookie3" is the format used by the libwww-perl libary, not known
1854+
"Set-Cookie3" is the format used by the libwww-perl library, not known
18551855
to be compatible with any browser, but which is easy to read and
18561856
doesn't lose information about RFC 2965 cookies.
18571857

tests/test_future/test_backports.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -599,17 +599,25 @@ def test_yaml_linkage(self):
599599

600600
def test_repr(self):
601601
od = OrderedDict([('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)])
602-
self.assertEqual(repr(od),
603-
"OrderedDict([('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)])")
602+
if sys.version_info[0] == 3 and sys.version_info[1] >= 12:
603+
self.assertEqual(repr(od),
604+
"OrderedDict({'c': 1, 'b': 2, 'a': 3, 'd': 4, 'e': 5, 'f': 6})")
605+
else:
606+
self.assertEqual(repr(od),
607+
"OrderedDict([('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)])")
604608
self.assertEqual(eval(repr(od)), od)
605609
self.assertEqual(repr(OrderedDict()), "OrderedDict()")
606610

607611
def test_repr_recursive(self):
608612
# See issue #9826
609613
od = OrderedDict.fromkeys('abc')
610614
od['x'] = od
611-
self.assertEqual(repr(od),
612-
"OrderedDict([('a', None), ('b', None), ('c', None), ('x', ...)])")
615+
if sys.version_info[0] == 3 and sys.version_info[1] >= 12:
616+
self.assertEqual(repr(od),
617+
"OrderedDict({'a': None, 'b': None, 'c': None, 'x': ...})")
618+
else:
619+
self.assertEqual(repr(od),
620+
"OrderedDict([('a', None), ('b', None), ('c', None), ('x', ...)])")
613621

614622
def test_setdefault(self):
615623
pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)]

tests/test_future/test_builtins.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,8 +523,8 @@ def test_compile(self):
523523
self.assertRaises(TypeError, compile)
524524
self.assertRaises(ValueError, compile, 'print(42)\n', '<string>', 'badmode')
525525
self.assertRaises(ValueError, compile, 'print(42)\n', '<string>', 'single', 0xff)
526-
# Raises TypeError in Python < v3.5, ValueError in v3.5:
527-
self.assertRaises((TypeError, ValueError), compile, chr(0), 'f', 'exec')
526+
# Raises TypeError in Python < v3.5, ValueError in v3.5, SyntaxError in >= 3.12:
527+
self.assertRaises((TypeError, ValueError, SyntaxError), compile, chr(0), 'f', 'exec')
528528
self.assertRaises(TypeError, compile, 'pass', '?', 'exec',
529529
mode='eval', source='0', filename='tmp')
530530
compile('print("\xe5")\n', '', 'exec')

0 commit comments

Comments
 (0)