Skip to content

Commit

Permalink
Fix installation on Python 3.5 and lower on stable (#2533)
Browse files Browse the repository at this point in the history
* Fix installation on Python 3.5 and lower on stable

The unix-ar package requires Python 3.6. Only install it on Python 3.6 then and use the Python 2 fallback for Python <= 3.5 too.

* Update CHANGELOG
  • Loading branch information
peace-maker authored Jan 26, 2025
1 parent 9472ec1 commit e9d9bd9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ The table below shows which release corresponds to each branch, and what date th
[2476]: https://github.com/Gallopsled/pwntools/pull/2476
[2364]: https://github.com/Gallopsled/pwntools/pull/2364

## 4.14.1

- [#2533][2533] Fix installation on Python 3.5 and lower

[2533]: https://github.com/Gallopsled/pwntools/pull/2533

## 4.14.0 (`stable`)

- [#2356][2356] Add local libc database provider for libcdb
Expand Down
3 changes: 2 additions & 1 deletion pwnlib/libcdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import time
import six
import tempfile
import sys

from pwnlib.context import context
from pwnlib.elf import ELF
Expand Down Expand Up @@ -419,7 +420,7 @@ def _extract_tarfile(cache_dir, data_filename, tarball):

def _extract_debfile(cache_dir, package_filename, package):
# Extract data.tar in the .deb archive.
if six.PY2:
if sys.version_info < (3, 6):
if not which('ar'):
log.error('Missing command line tool "ar" to extract .deb archive. Please install "ar" first.')

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dependencies = [
"colored_traceback<0.4; python_version < '3'",
"colored_traceback; python_version >= '3'",
"pathlib2; python_version < '3.4'",
"unix-ar; python_version >= '3'",
"unix-ar; python_version >= '3.6'",
"zstandard",
]

Expand Down

0 comments on commit e9d9bd9

Please sign in to comment.