From 616b940614af0fa14a33da1e05739434ad2e4f5b Mon Sep 17 00:00:00 2001 From: lxcxjxhx Date: Mon, 6 Jul 2026 23:50:40 +0800 Subject: [PATCH] fix: Fix file handle and HTTP response resource leaks --- setup.py | 5 ++++- src/utils/common.py | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index a4302ce496..c5e67beac3 100644 --- a/setup.py +++ b/setup.py @@ -15,11 +15,14 @@ from setuptools import setup, find_packages +with open('README.md', 'r', encoding='utf-8') as f: + long_description = f.read() + setup( name='commix', version='4.2.dev', description='Automated All-in-One OS Command Injection Exploitation Tool', - long_description=open('README.md').read(), + long_description=long_description, long_description_content_type='text/markdown', author='Anastasios Stasinopoulos', url='https://commixproject.com', diff --git a/src/utils/common.py b/src/utils/common.py index 3e37b22609..46b6ff23b8 100644 --- a/src/utils/common.py +++ b/src/utils/common.py @@ -210,7 +210,9 @@ def create_github_issue(err_msg, exc_msg): ) try: - content = _urllib.request.urlopen(request, timeout=settings.TIMEOUT).read() + response = _urllib.request.urlopen(request, timeout=settings.TIMEOUT) + content = response.read() + response.close() _ = json.loads(content) duplicate = _["total_count"] > 0