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

Add Python 3.12 to test matrix. #667

Merged
merged 4 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout source code
uses: actions/checkout@v3
Expand Down
94 changes: 52 additions & 42 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ pyright = "^1.1.307"
pre-commit = "^2.15.0"
pytest-cov = "^3.0.0"
ruff = "^0.0.259"
pyyaml = "^6.0.1"

[tool.poetry.group.docs]
optional = true
Expand Down
4 changes: 2 additions & 2 deletions unblob/cli.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env python3
import atexit
import sys
from importlib.metadata import version
from pathlib import Path
from typing import Dict, Iterable, List, Optional, Tuple

import click
import pkg_resources
from rich.console import Console
from rich.panel import Panel
from rich.table import Table
Expand Down Expand Up @@ -36,7 +36,7 @@ def restore_cursor():


def get_version():
return pkg_resources.get_distribution("unblob").version
return version("unblob")


def show_version(
Expand Down
8 changes: 7 additions & 1 deletion unblob/handlers/compression/_gzip_reader.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import gzip
import zlib

from ...file_utils import DEFAULT_BUFSIZE

Expand All @@ -10,14 +11,19 @@ def read_header(self):
self._init_read()
return self._read_gzip_header()

def _add_read_data(self, data):
self._crc = zlib.crc32(data, self._crc)
self._stream_size = self._stream_size + len(data)

def read(self):
uncompress = b""

while True:
buf = self._fp.read(DEFAULT_BUFSIZE)

uncompress = self._decompressor.decompress(buf, DEFAULT_BUFSIZE)
self._fp.prepend(self._decompressor.unconsumed_tail)
if hasattr(self._decompressor, "unconsumed_tail"):
self._fp.prepend(self._decompressor.unconsumed_tail)
self._fp.prepend(self._decompressor.unused_data)

if uncompress != b"":
Expand Down
Loading