github-backup 0.51.1__tar.gz → 0.51.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. {github_backup-0.51.1 → github_backup-0.51.2}/CHANGES.rst +29 -1
  2. {github_backup-0.51.1/github_backup.egg-info → github_backup-0.51.2}/PKG-INFO +1 -1
  3. github_backup-0.51.2/github_backup/__init__.py +1 -0
  4. {github_backup-0.51.1 → github_backup-0.51.2}/github_backup/github_backup.py +26 -15
  5. {github_backup-0.51.1 → github_backup-0.51.2/github_backup.egg-info}/PKG-INFO +1 -1
  6. github_backup-0.51.2/requirements.txt +0 -0
  7. github_backup-0.51.1/github_backup/__init__.py +0 -1
  8. github_backup-0.51.1/requirements.txt +0 -1
  9. {github_backup-0.51.1 → github_backup-0.51.2}/LICENSE.txt +0 -0
  10. {github_backup-0.51.1 → github_backup-0.51.2}/MANIFEST.in +0 -0
  11. {github_backup-0.51.1 → github_backup-0.51.2}/README +0 -0
  12. {github_backup-0.51.1 → github_backup-0.51.2}/README.rst +0 -0
  13. {github_backup-0.51.1 → github_backup-0.51.2}/bin/github-backup +0 -0
  14. {github_backup-0.51.1 → github_backup-0.51.2}/github_backup.egg-info/SOURCES.txt +0 -0
  15. {github_backup-0.51.1 → github_backup-0.51.2}/github_backup.egg-info/dependency_links.txt +0 -0
  16. {github_backup-0.51.1 → github_backup-0.51.2}/github_backup.egg-info/top_level.txt +0 -0
  17. {github_backup-0.51.1 → github_backup-0.51.2}/github_backup.egg-info/zip-safe +0 -0
  18. {github_backup-0.51.1 → github_backup-0.51.2}/release-requirements.txt +0 -0
  19. {github_backup-0.51.1 → github_backup-0.51.2}/setup.cfg +0 -0
  20. {github_backup-0.51.1 → github_backup-0.51.2}/setup.py +0 -0
  21. {github_backup-0.51.1 → github_backup-0.51.2}/tests/test_attachments.py +0 -0
@@ -1,10 +1,38 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
- 0.51.1 (2025-11-16)
4
+ 0.51.2 (2025-11-16)
5
5
  -------------------
6
6
  ------------------------
7
7
 
8
+ Fix
9
+ ~~~
10
+ - Improve CA certificate detection with fallback chain. [Rodos]
11
+
12
+ The previous implementation incorrectly assumed empty get_ca_certs()
13
+ meant broken SSL, causing false failures in GitHub Codespaces and other
14
+ directory-based cert systems where certificates exist but aren't pre-loaded.
15
+ It would then attempt to import certifi as a workaround, but certifi wasn't
16
+ listed in requirements.txt, causing the fallback to fail with ImportError
17
+ even though the system certificates would have worked fine.
18
+
19
+ This commit replaces the naive check with a layered fallback approach that
20
+ checks multiple certificate sources. First it checks for pre-loaded system
21
+ certs (file-based systems). Then it verifies system cert paths exist
22
+ (directory-based systems like Ubuntu/Debian/Codespaces). Finally it attempts
23
+ to use certifi as an optional fallback only if needed.
24
+
25
+ This approach eliminates hard dependencies (certifi is now optional), works
26
+ in GitHub Codespaces without any setup, and fails gracefully with clear hints
27
+ for resolution when SSL is actually broken rather than failing with
28
+ ModuleNotFoundError.
29
+
30
+ Fixes #444
31
+
32
+
33
+ 0.51.1 (2025-11-16)
34
+ -------------------
35
+
8
36
  Fix
9
37
  ~~~
10
38
  - Prevent duplicate attachment downloads. [Rodos]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: github-backup
3
- Version: 0.51.1
3
+ Version: 0.51.2
4
4
  Summary: backup a github user or organization
5
5
  Home-page: http://github.com/josegonzalez/python-github-backup
6
6
  Author: Jose Diaz-Gonzalez
@@ -0,0 +1 @@
1
+ __version__ = "0.51.2"
@@ -37,22 +37,33 @@ FNULL = open(os.devnull, "w")
37
37
  FILE_URI_PREFIX = "file://"
38
38
  logger = logging.getLogger(__name__)
39
39
 
40
+ # Setup SSL context with fallback chain
40
41
  https_ctx = ssl.create_default_context()
41
- if not https_ctx.get_ca_certs():
42
- import warnings
43
-
44
- warnings.warn(
45
- "\n\nYOUR DEFAULT CA CERTS ARE EMPTY.\n"
46
- + "PLEASE POPULATE ANY OF:"
47
- + "".join(
48
- ["\n - " + x for x in ssl.get_default_verify_paths() if type(x) is str]
49
- )
50
- + "\n",
51
- stacklevel=2,
52
- )
53
- import certifi
54
-
55
- https_ctx = ssl.create_default_context(cafile=certifi.where())
42
+ if https_ctx.get_ca_certs():
43
+ # Layer 1: Certificates pre-loaded from system (file-based)
44
+ pass
45
+ else:
46
+ paths = ssl.get_default_verify_paths()
47
+ if (paths.cafile and os.path.exists(paths.cafile)) or (
48
+ paths.capath and os.path.exists(paths.capath)
49
+ ):
50
+ # Layer 2: Cert paths exist, will be lazy-loaded on first use (directory-based)
51
+ pass
52
+ else:
53
+ # Layer 3: Try certifi package as optional fallback
54
+ try:
55
+ import certifi
56
+
57
+ https_ctx = ssl.create_default_context(cafile=certifi.where())
58
+ except ImportError:
59
+ # All layers failed - no certificates available anywhere
60
+ sys.exit(
61
+ "\nERROR: No CA certificates found. Cannot connect to GitHub over SSL.\n\n"
62
+ "Solutions you can explore:\n"
63
+ " 1. pip install certifi\n"
64
+ " 2. Alpine: apk add ca-certificates\n"
65
+ " 3. Debian/Ubuntu: apt-get install ca-certificates\n\n"
66
+ )
56
67
 
57
68
 
58
69
  def logging_subprocess(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: github-backup
3
- Version: 0.51.1
3
+ Version: 0.51.2
4
4
  Summary: backup a github user or organization
5
5
  Home-page: http://github.com/josegonzalez/python-github-backup
6
6
  Author: Jose Diaz-Gonzalez
File without changes
@@ -1 +0,0 @@
1
- __version__ = "0.51.1"
@@ -1 +0,0 @@
1
-
File without changes
File without changes
File without changes