wlc 3.2.0__tar.gz → 3.4.0__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 (149) hide show
  1. {wlc-3.2.0 → wlc-3.4.0}/CHANGES.md +52 -0
  2. {wlc-3.2.0 → wlc-3.4.0}/PKG-INFO +2 -2
  3. {wlc-3.2.0 → wlc-3.4.0}/SECURITY.md +14 -2
  4. {wlc-3.2.0 → wlc-3.4.0}/THREAT_MODEL.md +35 -18
  5. {wlc-3.2.0 → wlc-3.4.0}/pyproject.toml +14 -6
  6. {wlc-3.2.0 → wlc-3.4.0}/tests/test_base.py +28 -0
  7. {wlc-3.2.0 → wlc-3.4.0}/tests/test_client.py +18 -6
  8. wlc-3.4.0/tests/test_config.py +497 -0
  9. wlc-3.4.0/tests/test_config_discovery.py +531 -0
  10. {wlc-3.2.0 → wlc-3.4.0}/tests/test_errors.py +104 -7
  11. {wlc-3.2.0 → wlc-3.4.0}/tests/test_main.py +19 -0
  12. {wlc-3.2.0 → wlc-3.4.0}/tests/test_output.py +54 -0
  13. {wlc-3.2.0 → wlc-3.4.0}/tests/test_package.py +21 -0
  14. wlc-3.4.0/tests/test_project_config.py +418 -0
  15. wlc-3.4.0/tests/test_request_options.py +174 -0
  16. wlc-3.4.0/tests/test_tasks.py +280 -0
  17. {wlc-3.2.0 → wlc-3.4.0}/tests/test_urls.py +72 -0
  18. {wlc-3.2.0 → wlc-3.4.0}/tests/test_wlc.py +3 -3
  19. {wlc-3.2.0 → wlc-3.4.0}/wlc/__init__.py +2 -0
  20. {wlc-3.2.0 → wlc-3.4.0}/wlc/base.py +30 -10
  21. {wlc-3.2.0 → wlc-3.4.0}/wlc/client.py +88 -24
  22. wlc-3.4.0/wlc/config.py +628 -0
  23. {wlc-3.2.0 → wlc-3.4.0}/wlc/const.py +7 -1
  24. {wlc-3.2.0 → wlc-3.4.0}/wlc/exceptions.py +12 -0
  25. {wlc-3.2.0 → wlc-3.4.0}/wlc/http_debug.py +10 -1
  26. {wlc-3.2.0 → wlc-3.4.0}/wlc/main.py +23 -12
  27. {wlc-3.2.0 → wlc-3.4.0}/wlc/models.py +29 -7
  28. {wlc-3.2.0 → wlc-3.4.0}/wlc/output.py +11 -1
  29. wlc-3.4.0/wlc/request_options.py +59 -0
  30. wlc-3.4.0/wlc/tasks.py +61 -0
  31. {wlc-3.2.0 → wlc-3.4.0}/wlc/utils.py +10 -0
  32. {wlc-3.2.0 → wlc-3.4.0}/wlc.egg-info/PKG-INFO +2 -2
  33. {wlc-3.2.0 → wlc-3.4.0}/wlc.egg-info/SOURCES.txt +6 -0
  34. {wlc-3.2.0 → wlc-3.4.0}/wlc.egg-info/requires.txt +1 -1
  35. wlc-3.2.0/tests/test_config.py +0 -884
  36. wlc-3.2.0/wlc/config.py +0 -371
  37. {wlc-3.2.0 → wlc-3.4.0}/LICENSE +0 -0
  38. {wlc-3.2.0 → wlc-3.4.0}/LICENSES/CC0-1.0.txt +0 -0
  39. {wlc-3.2.0 → wlc-3.4.0}/LICENSES/GPL-3.0-or-later.txt +0 -0
  40. {wlc-3.2.0 → wlc-3.4.0}/MANIFEST.in +0 -0
  41. {wlc-3.2.0 → wlc-3.4.0}/README.md +0 -0
  42. {wlc-3.2.0 → wlc-3.4.0}/completion/wlc +0 -0
  43. {wlc-3.2.0 → wlc-3.4.0}/setup.cfg +0 -0
  44. {wlc-3.2.0 → wlc-3.4.0}/tests/__init__.py +0 -0
  45. {wlc-3.2.0 → wlc-3.4.0}/tests/test_category.py +0 -0
  46. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/.weblate +0 -0
  47. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/categories +0 -0
  48. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/categories-1 +0 -0
  49. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/changes +0 -0
  50. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components +0 -0
  51. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-android +0 -0
  52. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-android-file +0 -0
  53. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-android-file--GET--format=zip +0 -0
  54. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-olderweblate +0 -0
  55. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate +0 -0
  56. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate--DELETE-- +0 -0
  57. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate--PATCH--priority=80 +0 -0
  58. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate-changes +0 -0
  59. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate-file +0 -0
  60. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate-file--GET--format=zip +0 -0
  61. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate-lock +0 -0
  62. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate-lock--POST--lock=0 +0 -0
  63. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate-lock--POST--lock=1 +0 -0
  64. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate-lock--POST--lock=false +0 -0
  65. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate-lock--POST--lock=true +0 -0
  66. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate-repository +0 -0
  67. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate-repository--POST--operation=cleanup +0 -0
  68. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate-repository--POST--operation=commit +0 -0
  69. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate-repository--POST--operation=pull +0 -0
  70. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate-repository--POST--operation=push +0 -0
  71. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate-repository--POST--operation=reset +0 -0
  72. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate-statistics +0 -0
  73. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate-statistics--GET--page=2 +0 -0
  74. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate-statistics--GET--page=3 +0 -0
  75. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate-translations +0 -0
  76. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate-translations--GET--page=2 +0 -0
  77. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/components-hello-weblate-translations--POST--language_code=nl_BE +0 -0
  78. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/languages +0 -0
  79. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/languages--GET--page=2 +0 -0
  80. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/languages--GET--page=3 +0 -0
  81. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/languages--POST--code=tst--name=Test-Language--direction=rtl--plural=number=2--formula=n-!=-1 +0 -0
  82. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/projects +0 -0
  83. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/projects--POST--name=Hello--slug=hello--web=http---example.com---source_language=name=Malayalam--code=ml +0 -0
  84. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/projects--POST--name=denied_json--slug=denide_json--web=http---some-weblate-app.com- +0 -0
  85. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/projects-acl +0 -0
  86. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/projects-empty +0 -0
  87. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/projects-empty-components +0 -0
  88. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/projects-hello +0 -0
  89. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/projects-hello--DELETE-- +0 -0
  90. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/projects-hello-categories +0 -0
  91. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/projects-hello-changes +0 -0
  92. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/projects-hello-components +0 -0
  93. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/projects-hello-components--POST--3fcd0ab4 +0 -0
  94. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/projects-hello-components--POST--c9c26539 +0 -0
  95. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/projects-hello-languages +0 -0
  96. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/projects-hello-repository +0 -0
  97. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/projects-hello-repository--POST--operation=cleanup +0 -0
  98. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/projects-hello-repository--POST--operation=commit +0 -0
  99. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/projects-hello-repository--POST--operation=pull +0 -0
  100. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/projects-hello-repository--POST--operation=push +0 -0
  101. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/projects-hello-repository--POST--operation=reset +0 -0
  102. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/projects-hello-statistics +0 -0
  103. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/projects-invalid +0 -0
  104. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations +0 -0
  105. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations--GET--page=2 +0 -0
  106. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations--GET--page=3 +0 -0
  107. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations-hello-android-en-units +0 -0
  108. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations-hello-android-en-units--POST--key=test-monolingual--value=-test-me- +0 -0
  109. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations-hello-weblate-cs +0 -0
  110. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations-hello-weblate-cs--DELETE-- +0 -0
  111. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations-hello-weblate-cs-changes +0 -0
  112. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations-hello-weblate-cs-file +0 -0
  113. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations-hello-weblate-cs-file--GET--format=csv +0 -0
  114. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations-hello-weblate-cs-file--POST--3748506a +0 -0
  115. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations-hello-weblate-cs-file--POST--5c6a101f +0 -0
  116. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations-hello-weblate-cs-file--POST--85762547 +0 -0
  117. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations-hello-weblate-cs-file--POST--90a4957d +0 -0
  118. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations-hello-weblate-cs-file--POST--f8672b4c +0 -0
  119. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations-hello-weblate-cs-file--POST--fe040a0c +0 -0
  120. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations-hello-weblate-cs-repository +0 -0
  121. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations-hello-weblate-cs-repository--POST--operation=cleanup +0 -0
  122. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations-hello-weblate-cs-repository--POST--operation=commit +0 -0
  123. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations-hello-weblate-cs-repository--POST--operation=pull +0 -0
  124. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations-hello-weblate-cs-repository--POST--operation=push +0 -0
  125. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations-hello-weblate-cs-repository--POST--operation=reset +0 -0
  126. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations-hello-weblate-cs-statistics +0 -0
  127. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations-hello-weblate-cs-units +0 -0
  128. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/translations-hello-weblate-cs-units--GET--q=source%3A%3D%22mr%22 +0 -0
  129. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/units +0 -0
  130. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/units-123 +0 -0
  131. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/units-123--DELETE-- +0 -0
  132. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/units-123--PATCH--target=-foo---state=30 +0 -0
  133. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/api/units-123--PUT--target=-foo---state=30 +0 -0
  134. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/mock/project-local-file.pot +0 -0
  135. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/section +0 -0
  136. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/weblate.ini +0 -0
  137. {wlc-3.2.0 → wlc-3.4.0}/tests/test_data/wlc +0 -0
  138. {wlc-3.2.0 → wlc-3.4.0}/tests/test_download.py +0 -0
  139. {wlc-3.2.0 → wlc-3.4.0}/tests/test_insecure_http.py +0 -0
  140. {wlc-3.2.0 → wlc-3.4.0}/tests/test_insecure_ssl.py +0 -0
  141. {wlc-3.2.0 → wlc-3.4.0}/tests/test_lazy_object.py +0 -0
  142. {wlc-3.2.0 → wlc-3.4.0}/tests/test_signatures.py +0 -0
  143. {wlc-3.2.0 → wlc-3.4.0}/tests/test_statistics.py +0 -0
  144. {wlc-3.2.0 → wlc-3.4.0}/tests/test_utils.py +0 -0
  145. {wlc-3.2.0 → wlc-3.4.0}/wl +0 -0
  146. {wlc-3.2.0 → wlc-3.4.0}/wlc/py.typed +0 -0
  147. {wlc-3.2.0 → wlc-3.4.0}/wlc.egg-info/dependency_links.txt +0 -0
  148. {wlc-3.2.0 → wlc-3.4.0}/wlc.egg-info/entry_points.txt +0 -0
  149. {wlc-3.2.0 → wlc-3.4.0}/wlc.egg-info/top_level.txt +0 -0
@@ -1,5 +1,44 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.4.0
4
+
5
+ * Released on 23rd November 2026.
6
+ * Wait for queued Weblate operations to complete and report their outcome.
7
+ Set the wait with `--task-timeout` or `task_timeout`. The default is 30
8
+ minutes, and zero allows unlimited waiting. Python callers can also use
9
+ `Weblate.wait_for_task()` directly.
10
+ * Reject empty explicit configuration paths and stop with an error when the
11
+ selected user configuration cannot be read. Continue XDG discovery past
12
+ directories when a later configuration file is available.
13
+ * Preserve API path case when matching URL-scoped API keys and reject duplicate
14
+ origins in transport exception settings.
15
+ * Report malformed URLs and non-string URL values in API responses as client
16
+ errors before sending a follow-up request.
17
+ * Validate HTTP retry and timeout settings before sending requests.
18
+ * Escape additional invisible Unicode characters and surrogate code points in
19
+ interactive CLI output. Also escape terminal controls in interactive debug
20
+ logs.
21
+ * Updated the CA certificate bundle, development dependencies, CI actions, and
22
+ Docker base images.
23
+
24
+ ## 3.3.0
25
+
26
+ * Released on 10th November 2026.
27
+ * Bound automatic project configuration discovery to the nearest repository
28
+ root and, on POSIX systems, trusted ownership and permissions, including
29
+ symlink targets.
30
+ * Added `--project-config` to explicitly select project configuration and
31
+ `--no-config` to disable configuration-file loading.
32
+ * Prevented malformed configuration errors from exposing file contents,
33
+ including API keys, in CLI diagnostics and Python exceptions.
34
+ * Reject API keys containing anything other than printable ASCII.
35
+ * Match URL-scoped API keys regardless of whether the default port is explicit,
36
+ while preserving precedence for exact URL matches.
37
+ * Reject Unicode compatibility forms of traversal and URL syntax in object
38
+ paths.
39
+ * Updated the threat model to clarify configuration and credential boundaries.
40
+ * Updated development dependencies, CI actions, and Docker base images.
41
+
3
42
  ## 3.2.0
4
43
 
5
44
  * Released on 3rd November 2026.
@@ -36,6 +75,7 @@
36
75
  ## 3.0.0
37
76
 
38
77
  * Released on 8th October 2026.
78
+
39
79
  * Breaking Python API changes:
40
80
 
41
81
  * Require keyword arguments for client construction, request options,
@@ -46,10 +86,14 @@
46
86
  is required.
47
87
  * `WeblateConfig.find_config()` and `WeblateConfig.find_project_config()` now
48
88
  return `pathlib.Path` objects instead of strings when a file is found.
89
+
49
90
  * Reject cyclic category hierarchies and category nesting deeper than three
50
91
  levels.
92
+
51
93
  * Raised minimum dependency versions to exclude vulnerable releases.
94
+
52
95
  * Added testing with Python 3.15 and improved type annotations.
96
+
53
97
  * Updated development dependencies, CI actions, and Docker base images.
54
98
 
55
99
  ## 2.2.1
@@ -113,17 +157,25 @@
113
157
  ## 2.0.0
114
158
 
115
159
  * Released on 21st April 2026.
160
+
116
161
  * Possibly breaking changes:
117
162
 
118
163
  * Renamed the retry configuration option from `method_whitelist` to `allowed_methods`.
119
164
  * Tightened configuration loading: explicit `--config` is authoritative, missing explicit config files fail, and project discovery uses the nearest config file.
120
165
  * Tightened URL, download, and output safety: invalid or cross-origin URLs are rejected, binary downloads to terminals are refused, and text, CSV, and HTML output is escaped.
166
+
121
167
  * Added `WLC_URL` and `WLC_KEY` environment variable support.
168
+
122
169
  * Added unit-level CLI commands.
170
+
123
171
  * Updated models and statistics for the current Weblate API while preserving older statistics responses.
172
+
124
173
  * Fixed retry configuration and request adapter wiring.
174
+
125
175
  * Escaped generated HTML output ([GHSA-gx2m-mcc2-r4p3](https://github.com/WeblateOrg/wlc/security/advisories/GHSA-gx2m-mcc2-r4p3)), hardened CSV and terminal output, and redacted authorization headers from debug logs.
176
+
126
177
  * Improved nested category handling, unit editing, help texts, and error messages.
178
+
127
179
  * Split implementation modules, moved tests out of the installed package, and updated packaging, dependencies, Docker images, and CI.
128
180
 
129
181
  ## 1.17.2
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wlc
3
- Version: 3.2.0
3
+ Version: 3.4.0
4
4
  Summary: A command-line utility for Weblate, translation tool with tight version control integration
5
5
  Author-email: Michal Čihař <michal@weblate.org>
6
6
  License-Expression: GPL-3.0-or-later
@@ -32,7 +32,7 @@ Requires-Python: >=3.10
32
32
  Description-Content-Type: text/markdown
33
33
  License-File: LICENSE
34
34
  Requires-Dist: argcomplete
35
- Requires-Dist: certifi>=2026.10.23
35
+ Requires-Dist: certifi>=2026.11.20
36
36
  Requires-Dist: idna>=3.15
37
37
  Requires-Dist: python-dateutil
38
38
  Requires-Dist: pyxdg>=0.26
@@ -8,14 +8,26 @@ This file is maintained in https://github.com/WeblateOrg/meta/
8
8
 
9
9
  # Weblate security
10
10
 
11
- If you believe you have found a security vulnerability in a Weblate project,
12
- **do not open a public issue**. Report it privately by emailing
11
+ Report **low and medium severity** security issues in a Weblate project as
12
+ public GitHub issues in the affected repository.
13
+
14
+ For **high and critical severity** vulnerabilities, **do not open a public
15
+ issue**. Report them privately by emailing
13
16
  [security@weblate.org](mailto:security@weblate.org) or selecting
14
17
  **Security → Report a vulnerability** in this repository.
15
18
 
19
+ If you are unsure of the severity, you may start privately. If the security
20
+ team assesses the issue as low or medium severity, we will ask you to continue
21
+ in a public GitHub issue.
22
+
16
23
  Please describe the issue, affected versions, and steps to reproduce it, if
17
24
  known.
18
25
 
26
+ Public discussion allows the community to help review and fix low and medium
27
+ severity issues, while private coordination focuses on vulnerabilities with
28
+ serious impact. We publish security advisories only for high and critical
29
+ severity vulnerabilities, not for low or medium severity issues.
30
+
19
31
  For security scope and assumptions, consult this repository's threat model if
20
32
  it has one, or the [Weblate threat model][threat-model] for the main application.
21
33
  The [security documentation][reporting] explains the full reporting and
@@ -22,8 +22,15 @@ CLI output, or downloaded files.
22
22
  variables, user configuration, explicit configuration, upload inputs, and
23
23
  user-selected output paths are trusted instructions. The operating system,
24
24
  runtime, installed package, and these trusted sources are assumed intact.
25
- - **Checked-out repository:** Automatic discovery loads user configuration and
26
- then the nearest project configuration in the current directory or a parent.
25
+ - **Checked-out repository:** Automatic discovery loads user configuration first and
26
+ stops with an error if the selected file cannot be read. It then loads the
27
+ nearest eligible project configuration in the current directory or
28
+ a parent, stopping at the nearest repository root. On POSIX systems discovery
29
+ also stops at directories owned by another non-root user or writable by
30
+ everyone; discovered files must meet the same permission rules. Group-writable
31
+ locations remain trusted. Symlink targets must stay within these discovery
32
+ boundaries. Windows uses repository boundaries without POSIX permission
33
+ checks; access is governed by Windows ACLs.
27
34
  Project configuration is intentionally trusted to select the endpoint,
28
35
  repository defaults, request parameters, and a matching URL-scoped key. It
29
36
  cannot acquire an unrelated unscoped CLI/environment key or supply transport
@@ -44,7 +51,10 @@ CLI output, or downloaded files.
44
51
  validate and escape data for their own use.
45
52
 
46
53
  An explicit `--config` loads only the named file and disables user and project
47
- configuration discovery; CLI/environment overrides still apply. Direct
54
+ configuration discovery. `--project-config` loads user configuration and the
55
+ explicitly selected project file, bypassing discovery location checks while
56
+ retaining project credential and transport restrictions. `--no-config` disables
57
+ all configuration-file loading; CLI/environment overrides still apply. Direct
48
58
  construction of `Weblate` does not discover project configuration. Python
49
59
  callers opt into configuration resolution by passing a `WeblateConfig`.
50
60
 
@@ -55,19 +65,21 @@ See the [configuration documentation][configuration-docs] and
55
65
 
56
66
  ### Configuration and credentials
57
67
 
58
- - When project discovery supplies the otherwise-effective URL, a CLI or
68
+ - When project configuration supplies the otherwise-effective URL, a CLI or
59
69
  environment key must be paired with a URL from the same source: `--key` with
60
70
  `--url`, or `WLC_KEY` with `WLC_URL`. Repository-selected destinations cannot
61
71
  silently receive these unscoped secrets.
62
- - Automatically discovered project configuration cannot enable authenticated
72
+ - Project configuration cannot enable authenticated
63
73
  insecure HTTP, disable TLS verification, or supply insecure origin entries.
64
74
  Transport exceptions require a CLI/environment setting paired with its own
65
- URL, or a matching origin in trusted user or explicit configuration. An
75
+ URL, or a matching origin in trusted user or complete explicit configuration. An
66
76
  unscoped CLI/environment exception cannot be combined with a project URL.
77
+ Each transport exception section accepts only one entry per normalized origin.
78
+ - URL-scoped keys preserve case distinctions in the API path.
67
79
  - Authentication comes only from configured API-key sources. Automatic
68
80
  `.netrc`/`NETRC` authentication is disabled, URL-embedded credentials are
69
- rejected, and keys containing carriage returns or line feeds are rejected
70
- before HTTP request construction.
81
+ rejected, and keys containing anything other than printable ASCII are
82
+ rejected before HTTP request construction.
71
83
 
72
84
  These rules protect credential sources and transport policy while preserving
73
85
  repository-driven endpoint selection. A key supplied by a repository for its
@@ -120,9 +132,9 @@ Coverage: [download tests](tests/test_download.py).
120
132
 
121
133
  - Supported CLI rendering and handled diagnostics escape terminal controls and
122
134
  the supported Unicode bidi and invisible controls on interactive streams.
123
- This includes structured text/CSV values and diagnostics from malformed
124
- server data. It does not promise protection against all Unicode confusables
125
- or misleading text.
135
+ This includes structured text/CSV values, CLI debug records, and diagnostics
136
+ from malformed server data. It does not promise protection against all Unicode
137
+ confusables or misleading text.
126
138
  - HTML rendering escapes keys and values. CSV rendering neutralizes formula
127
139
  prefixes, including Unicode compatibility forms and those hidden behind
128
140
  leading controls, whitespace, marks, or common invisible characters. CSV
@@ -131,13 +143,13 @@ Coverage: [download tests](tests/test_download.py).
131
143
  - Raw downloaded translation bytes are refused when standard output is an
132
144
  interactive terminal.
133
145
  - wlc's debug helpers redact sensitive outgoing request headers and omit request
134
- bodies and uploaded contents. This is not general log sanitization: URLs,
135
- request parameter values, response content, and reason phrases may appear,
136
- and debug output does not receive the supported renderers' terminal-safety
137
- guarantee. Do not put secrets in request parameters.
146
+ bodies and uploaded contents. URLs, request parameter values, response content,
147
+ and reason phrases may appear in logs. Do not put secrets in request parameters.
138
148
 
139
149
  Handled CLI errors also mask exact configured authorization values and
140
- credentials as defense in depth. This does not provide confidentiality against
150
+ credentials as defense in depth. Configuration syntax diagnostics omit file
151
+ contents, including when Python callers format the resulting exception.
152
+ This does not provide confidentiality against
141
153
  the selected server, which already receives the key and can return arbitrary
142
154
  content, including transformed or partial secrets. Successful output and Python
143
155
  results can likewise contain server-provided secrets. A failure of exact-value
@@ -165,7 +177,10 @@ Implementation and coverage: [output implementation](wlc/output.py),
165
177
  the installed CLI.
166
178
  - **Repository and server selection:** Review project configuration before
167
179
  relying on its endpoint and defaults; use a trusted explicit `--config` to
168
- disable discovery. A CLI or environment URL can still use a matching key from
180
+ replace discovery or `--no-config` to avoid file loading. Discovery checks do
181
+ not secure a namespace being concurrently replaced, evaluate additional ACL
182
+ grants, or protect against members of a trusted writable group. A CLI or
183
+ environment URL can still use a matching key from
169
184
  discovered project configuration; supply a trusted key explicitly when its
170
185
  identity matters. Do not commit valuable keys to project configuration.
171
186
  Choose a server appropriate for the data and operations sent to it. Server
@@ -176,7 +191,9 @@ Implementation and coverage: [output implementation](wlc/output.py),
176
191
  server impersonation.
177
192
  - **Availability and retries:** There are no strict limits on response size,
178
193
  pagination, aggregate time, memory, disk use, or retry cost against a selected
179
- server. Timeouts and retries are operational controls. Retrying state-changing
194
+ server. Task polling has a configurable 30-minute default deadline. Zero allows
195
+ unlimited polling, and an in-flight request and its retries can outlast the
196
+ deadline. Stopping a wait leaves the server task running. Retrying state-changing
180
197
  methods can repeat effects. Output can be partial after failure, including
181
198
  incomplete JSON or HTML; consumers must check the exit status.
182
199
  - **Content and integrations:** Origin, filename, and output containment do not
@@ -13,10 +13,10 @@ lint = [
13
13
  { include-group = "pylint" }
14
14
  ]
15
15
  pre-commit = [
16
- "prek==0.5.9"
16
+ "prek==0.5.11"
17
17
  ]
18
18
  pylint = [
19
- "pylint==4.1.3"
19
+ "pylint==4.1.4"
20
20
  ]
21
21
  test = [
22
22
  "pytest-cov==7.1.0",
@@ -25,12 +25,19 @@ test = [
25
25
  "responses==0.26.3"
26
26
  ]
27
27
  types = [
28
- "ty==0.0.96",
28
+ "ty==0.0.108",
29
29
  "mypy==2.4.1",
30
- "types-pyxdg==0.28.0.20261017",
31
- "types-python-dateutil==2.9.0.20261029",
30
+ "types-pyxdg==0.28.0.20261122",
31
+ "types-python-dateutil==2.9.0.20261122",
32
32
  "types-requests==2.33.0.20261030"
33
33
  ]
34
+ package-lint = [
35
+ "check-manifest==0.51",
36
+ "check-wheel-contents==0.6.3",
37
+ "pydistcheck==0.11.3",
38
+ "pyroma==5.0.1",
39
+ "twine==7.0.0"
40
+ ]
34
41
 
35
42
  [project]
36
43
  classifiers = [
@@ -52,7 +59,7 @@ classifiers = [
52
59
  ]
53
60
  dependencies = [
54
61
  "argcomplete",
55
- "certifi>=2026.10.23",
62
+ "certifi>=2026.11.20",
56
63
  "idna>=3.15",
57
64
  "python-dateutil",
58
65
  "pyxdg>=0.26",
@@ -96,6 +103,7 @@ Twitter = "https://twitter.com/WeblateOrg"
96
103
 
97
104
  [tool.check-manifest]
98
105
  ignore = [
106
+ "uv.lock",
99
107
  ".dockerignore",
100
108
  "Dockerfile",
101
109
  ".well-known/*",
@@ -17,10 +17,12 @@ from io import BytesIO, StringIO
17
17
  from pathlib import Path
18
18
  from typing import TYPE_CHECKING, Literal, NoReturn, TextIO, cast
19
19
  from unittest import TestCase
20
+ from unittest.mock import patch
20
21
 
21
22
  import responses
22
23
  from requests.exceptions import RequestException
23
24
 
25
+ from wlc.config import WeblateConfig
24
26
  from wlc.main import SettingsSource, main
25
27
 
26
28
  if TYPE_CHECKING:
@@ -35,6 +37,32 @@ DATA_TEST_BASE = TEST_DATA / "api"
35
37
  TEST_CONFIG = TEST_DATA / "wlc"
36
38
  TEST_SECTION = TEST_DATA / "section"
37
39
  BODY_HASH_THRESHOLD = 100
40
+ CONFIG_PARSE_MARKER = "synthetic-config-secret"
41
+ CONFIG_PARSE_ERRORS = (
42
+ (f"[keys]\n{CONFIG_PARSE_MARKER}\n", "ParsingError at line 2"),
43
+ (f"key = {CONFIG_PARSE_MARKER}\n", "MissingSectionHeaderError at line 1"),
44
+ (
45
+ f"[keys]\n{CONFIG_PARSE_MARKER} = first\n{CONFIG_PARSE_MARKER} = second\n",
46
+ "DuplicateOptionError at line 3",
47
+ ),
48
+ (
49
+ f"[{CONFIG_PARSE_MARKER}]\n[{CONFIG_PARSE_MARKER}]\n",
50
+ "DuplicateSectionError at line 2",
51
+ ),
52
+ )
53
+
54
+
55
+ def load_discovered_config(
56
+ directory: Path, user_config: Path | None = None, *, section: str = "weblate"
57
+ ) -> WeblateConfig:
58
+ """Load configuration using project discovery from the given directory."""
59
+ config = WeblateConfig(section=section)
60
+ with (
61
+ patch.object(Path, "cwd", return_value=directory),
62
+ patch.object(WeblateConfig, "find_config", return_value=user_config),
63
+ ):
64
+ config.load()
65
+ return config
38
66
 
39
67
 
40
68
  class BufferedStringIO(StringIO):
@@ -296,19 +296,31 @@ class WeblateAuthenticationTest(APITest):
296
296
  obj = Weblate(key="KEY").get_object("acl")
297
297
  self.assertEqual(obj.name, "ACL")
298
298
 
299
- def test_api_key_rejects_line_breaks(self) -> None:
300
- """API keys with line breaks should be rejected without disclosure."""
301
- for line_break in ("\r", "\n"):
302
- with self.subTest(line_break=repr(line_break)):
303
- key = f"invalid-secret{line_break}continuation"
299
+ def test_api_key_rejects_unsafe_characters(self) -> None:
300
+ """API keys unsafe in a header should be rejected without disclosure."""
301
+ for code in (
302
+ *range(0x20), # C0 controls and line breaks
303
+ *range(0x7F, 0xA0), # DEL and C1 controls
304
+ 0xA0, # Encodable as Latin-1, but not ASCII
305
+ 0xE9,
306
+ 0x2028, # Not encodable as Latin-1
307
+ 0x1F511,
308
+ ):
309
+ with self.subTest(code=hex(code)):
310
+ key = f"invalid-secret{chr(code)}continuation"
304
311
  with self.assertRaises(WeblateException) as raised:
305
312
  Weblate(key=key)
306
313
 
307
314
  message = str(raised.exception)
308
- self.assertIn("must not contain", message)
315
+ self.assertIn("printable ASCII", message)
309
316
  self.assertNotIn("invalid-secret", message)
310
317
  self.assertNotIn("continuation", message)
311
318
 
319
+ def test_api_key_accepts_printable_ascii(self) -> None:
320
+ """Every printable ASCII character should remain usable in an API key."""
321
+ key = "".join(chr(code) for code in range(0x20, 0x7F))
322
+ self.assertEqual(Weblate(key=key).key, key)
323
+
312
324
  def assert_netrc_authentication_is_ignored(self) -> None:
313
325
  """Assert netrc credentials are not added or used over an API token."""
314
326
  for key, expected in (("", None), ("KEY", "Token KEY")):