librus-python-api 1.10.3__tar.gz → 1.11.1__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 (59) hide show
  1. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/API.md +4 -2
  2. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/CHANGELOG.md +27 -0
  3. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/PKG-INFO +8 -6
  4. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/README.md +7 -5
  5. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/__init__.py +1 -1
  6. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/_windows_filesystem.py +22 -5
  7. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/config.py +1 -1
  8. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/exceptions.py +10 -0
  9. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/.gitignore +0 -0
  10. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/LICENSE +0 -0
  11. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/SECURITY.md +0 -0
  12. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/pyproject.toml +0 -0
  13. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/_notification_bootstrap.py +0 -0
  14. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/_notification_codec.py +0 -0
  15. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/_storage.py +0 -0
  16. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/announcements.py +0 -0
  17. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/attachment_routes.py +0 -0
  18. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/attachments.py +0 -0
  19. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/attendance.py +0 -0
  20. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/attendance_frequency.py +0 -0
  21. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/budget.py +0 -0
  22. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/checkpoint.py +0 -0
  23. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/class_free_days.py +0 -0
  24. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/completed_lessons.py +0 -0
  25. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/detail_fields.py +0 -0
  26. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/diagnostics.py +0 -0
  27. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/files.py +0 -0
  28. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/formative_grades.py +0 -0
  29. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/gateway_grades.py +0 -0
  30. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/grade_parsers.py +0 -0
  31. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/grade_records.py +0 -0
  32. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/homework_range.py +0 -0
  33. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/inspect_page.py +0 -0
  34. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/justifications.py +0 -0
  35. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/lifecycle.py +0 -0
  36. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/markup.py +0 -0
  37. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/message_content.py +0 -0
  38. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/messages.py +0 -0
  39. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/models.py +0 -0
  40. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/modern_body.py +0 -0
  41. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/modern_mailbox.py +0 -0
  42. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/modern_messages.py +0 -0
  43. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/notification_models.py +0 -0
  44. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/notification_persistence.py +0 -0
  45. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/notification_workflow.py +0 -0
  46. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/notifications.py +0 -0
  47. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/parsers.py +0 -0
  48. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/parsing.py +0 -0
  49. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/persistence.py +0 -0
  50. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/py.typed +0 -0
  51. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/recipients.py +0 -0
  52. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/scheduler.py +0 -0
  53. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/school_reads.py +0 -0
  54. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/school_year_archive.py +0 -0
  55. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/sending.py +0 -0
  56. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/service.py +0 -0
  57. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/timetable.py +0 -0
  58. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/src/librus_python_api/transport.py +0 -0
  59. {librus_python_api-1.10.3 → librus_python_api-1.11.1}/uv.lock +0 -0
@@ -335,7 +335,8 @@ cell and 262144 total rendered characters, plus the shared transport/tree bounds
335
335
 
336
336
  The observed `Brak danych` information notice returns empty `years` and
337
337
  `achievements`. The notice that the archive is temporarily unavailable while
338
- Synergia fills it with the previous school year raises `MaintenanceError` (1.10.3). Missing tables without that explicit marker still raise `PARSE`;
338
+ Synergia fills it with the previous school year raises `TemporarilyUnavailableError`
339
+ (1.11.0; `MaintenanceError` in 1.10.3). Missing tables without that explicit marker still raise `PARSE`;
339
340
  an empty notice combined with data tables is rejected. Repeated school years
340
341
  (including a class-change layout) are ambiguous and raise `PARSE`. Unknown
341
342
  geometry/markup raises `UNSUPPORTED_CAPABILITY`; bounds raise `LIMIT`, never
@@ -1292,10 +1293,11 @@ text. `error_for(kind)` builds one.
1292
1293
  | `AccessDeniedError` | Denied, or an unexpected redirect or identity |
1293
1294
  | `ViewDisabledError` | The school administrator disabled this view |
1294
1295
  | `ModuleUnavailableError` | The school's Synergia variant does not include this module; exact same-origin unavailable redirect or fixed page notice, without follow/retry ([contract](contracts/module-unavailable.md)) |
1296
+ | `TemporarilyUnavailableError` | Synergia shows a fixed notice that this view is unavailable for now, such as the school-year archive while it is filled with the previous year (1.11.0); other views still work, nothing pauses, retry later |
1295
1297
  | `UnsupportedCapabilityError` | A recognized but unsupported layout or content |
1296
1298
  | `ParseError` | The page or JSON does not match the expected structure |
1297
1299
  | `StaleCursorError` | A previously valid continuation no longer matches the current sequence; restart explicitly |
1298
- | `ThrottledError`, `MaintenanceError` | HTTP 429 or 503; the shared scheduler pauses. Since 1.10.3 `MaintenanceError` is also the archive's notice that it is being filled, with no pause |
1300
+ | `ThrottledError`, `MaintenanceError` | HTTP 429 or 503; the shared scheduler pauses. In 1.10.3 only, `MaintenanceError` was also the archive's loading notice, now `TemporarilyUnavailableError` |
1299
1301
  | `ConnectionError`, `OperationTimeoutError` | Transport failure or budget deadline |
1300
1302
  | `LimitError` | A request, byte, item or queue bound was reached |
1301
1303
  | `ClosedError` | The service is closed |
@@ -1,5 +1,32 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.11.1 (2026-11-21) - Windows stores shared by several processes
4
+
5
+ - Windows: a durable store shared by several processes could report
6
+ `StorageError`, including on the save that records a dispatched send.
7
+ Between the store's sidecar check and its open, another process's
8
+ commit can delete SQLite's rollback journal or leave it pending deletion.
9
+ A journal that is gone is now absent, as on POSIX; one that stays and
10
+ cannot be opened still fails closed after bounded retries. On Windows CI,
11
+ the two-process durable-send test failed in 36 of 180 repeated runs before
12
+ and in none after.
13
+
14
+ ## 1.11.0 (2026-11-21) - A view unavailable for now has its own error
15
+
16
+ - New `ErrorKind.TEMPORARILY_UNAVAILABLE` and `TemporarilyUnavailableError`:
17
+ Synergia shows a fixed notice that this one view is unavailable for now,
18
+ while other views still work. Retry later; nothing pauses the shared
19
+ scheduler. The school-year archive's notice that it is being filled with
20
+ the previous school year's data raises it. In 1.10.3 that notice raised
21
+ `MaintenanceError`, which otherwise means HTTP 503 with the whole service
22
+ paused, so consumers and both live checkers took the archive notice for an
23
+ outage. Code that caught `MaintenanceError` for the archive should catch
24
+ `TemporarilyUnavailableError` instead. A consumer that publishes
25
+ `ErrorKind` in a schema, such as `SendResult.reason`, gains the value
26
+ `temporarily_unavailable`.
27
+ - Live check: a temporarily unavailable view no longer ends the login's run;
28
+ the step is still reported as a problem because the view was not read.
29
+
3
30
  ## 1.10.3 (2026-11-20) - Pages read on Windows; grade details without periods
4
31
 
5
32
  Thank you, @mpietson, for krzysztofbury/librus-mcp#121, with the libxml2 error
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: librus-python-api
3
- Version: 1.10.3
3
+ Version: 1.11.1
4
4
  Summary: Independent bounded async Librus Synergia client
5
5
  Project-URL: Repository, https://github.com/krzysztofbury/librus-python-api
6
6
  Project-URL: Issues, https://github.com/krzysztofbury/librus-python-api/issues
@@ -42,9 +42,11 @@ private ACLs. Windows installations include `pywin32` and `tzdata` automatically
42
42
  Network paths, reparse-point paths and unsafe storage permissions fail closed.
43
43
  See [platform requirements](contracts/persistence.md#windows-disk-boundary-25).
44
44
 
45
- **Status:** `1.10.3` reads pages with the libxml2 that lxml's Windows wheels
46
- bundle, reads a grade detail table without period headings and types the
47
- archive's loading notice as maintenance. `1.10.2` rejects a date whose weekday
45
+ **Status:** `1.11.1` fixes a Windows store shared by several processes
46
+ reporting `StorageError`, also after a dispatched send. `1.11.0` raises `TemporarilyUnavailableError` for the archive's
47
+ loading notice, a view that is unavailable for now while the rest of Synergia
48
+ works. `1.10.3` reads pages with the libxml2 that lxml's Windows wheels
49
+ bundle and reads a grade detail table without period headings. `1.10.2` rejects a date whose weekday
48
50
  label names another day and a completed-lesson cell with more than one comma,
49
51
  and fixes two cache bugs. `1.10.1` reads descriptive grades that the new-schema table
50
52
  shows as grade boxes. `1.10.0` returns behaviour points as a typed value
@@ -81,7 +83,7 @@ See [limitations](#supported-features-and-limitations) below.
81
83
  Install the exact release from PyPI after its gated publication completes:
82
84
 
83
85
  ```sh
84
- python -m pip install librus-python-api==1.10.3
86
+ python -m pip install librus-python-api==1.11.1
85
87
  ```
86
88
 
87
89
  Pin the exact version qualified by your application. Before publication, use a
@@ -97,7 +99,7 @@ python -m pip install .
97
99
  To install a locally built wheel instead:
98
100
 
99
101
  ```sh
100
- python -m pip install ./dist/librus_python_api-1.10.3-py3-none-any.whl
102
+ python -m pip install ./dist/librus_python_api-1.11.1-py3-none-any.whl
101
103
  ```
102
104
 
103
105
  No console script or background process is installed: import the library in your
@@ -16,9 +16,11 @@ private ACLs. Windows installations include `pywin32` and `tzdata` automatically
16
16
  Network paths, reparse-point paths and unsafe storage permissions fail closed.
17
17
  See [platform requirements](contracts/persistence.md#windows-disk-boundary-25).
18
18
 
19
- **Status:** `1.10.3` reads pages with the libxml2 that lxml's Windows wheels
20
- bundle, reads a grade detail table without period headings and types the
21
- archive's loading notice as maintenance. `1.10.2` rejects a date whose weekday
19
+ **Status:** `1.11.1` fixes a Windows store shared by several processes
20
+ reporting `StorageError`, also after a dispatched send. `1.11.0` raises `TemporarilyUnavailableError` for the archive's
21
+ loading notice, a view that is unavailable for now while the rest of Synergia
22
+ works. `1.10.3` reads pages with the libxml2 that lxml's Windows wheels
23
+ bundle and reads a grade detail table without period headings. `1.10.2` rejects a date whose weekday
22
24
  label names another day and a completed-lesson cell with more than one comma,
23
25
  and fixes two cache bugs. `1.10.1` reads descriptive grades that the new-schema table
24
26
  shows as grade boxes. `1.10.0` returns behaviour points as a typed value
@@ -55,7 +57,7 @@ See [limitations](#supported-features-and-limitations) below.
55
57
  Install the exact release from PyPI after its gated publication completes:
56
58
 
57
59
  ```sh
58
- python -m pip install librus-python-api==1.10.3
60
+ python -m pip install librus-python-api==1.11.1
59
61
  ```
60
62
 
61
63
  Pin the exact version qualified by your application. Before publication, use a
@@ -71,7 +73,7 @@ python -m pip install .
71
73
  To install a locally built wheel instead:
72
74
 
73
75
  ```sh
74
- python -m pip install ./dist/librus_python_api-1.10.3-py3-none-any.whl
76
+ python -m pip install ./dist/librus_python_api-1.11.1-py3-none-any.whl
75
77
  ```
76
78
 
77
79
  No console script or background process is installed: import the library in your
@@ -1,7 +1,7 @@
1
1
  """Independent bounded async client. General live compatibility is unqualified."""
2
2
 
3
3
  # Before the imports: config reads it for the User-Agent.
4
- __version__ = "1.10.3"
4
+ __version__ = "1.11.1"
5
5
 
6
6
  from librus_python_api.attachments import AttachmentStream, ModernAttachmentStream
7
7
  from librus_python_api.budget import RequestBudget
@@ -3,6 +3,7 @@
3
3
  import ntpath
4
4
  import os
5
5
  import sys
6
+ import time
6
7
  from collections.abc import Callable
7
8
  from functools import partial
8
9
  from pathlib import Path
@@ -18,6 +19,11 @@ import winerror
18
19
  from librus_python_api.exceptions import ErrorKind, LibrusError
19
20
 
20
21
  _TRUSTED_SYSTEM_SIDS = {"S-1-5-18", "S-1-5-32-544"}
22
+ # Another process's SQLite deletes its rollback journal when it commits. A
23
+ # sidecar that is gone or pending deletion when it is opened is retried this
24
+ # often before the open failure stands.
25
+ _SIDECAR_ATTEMPTS = 40
26
+ _SIDECAR_RETRY_SECONDS = 0.025
21
27
  _MAX_PATH_COMPONENTS = 128
22
28
  _MAX_ACES = 16
23
29
 
@@ -310,11 +316,22 @@ class WindowsDirectory:
310
316
  def check_sidecar(self, name: str, maximum: int) -> None:
311
317
  # A private pinned parent excludes other OS principals from replacement.
312
318
  # Same-user writers remain outside the threat boundary on both platforms.
313
- try:
314
- (self.path / name).lstat()
315
- except FileNotFoundError:
316
- return
317
- self.check_file(name, maximum)
319
+ # Between the lstat and the open, another process's commit can delete
320
+ # the journal, or leave it pending deletion, and the open fails. Once
321
+ # it is gone it is absent, as on POSIX; a sidecar that stays and still
322
+ # cannot be opened fails closed after the bounded retries.
323
+ for attempt in range(_SIDECAR_ATTEMPTS):
324
+ try:
325
+ (self.path / name).lstat()
326
+ self.check_file(name, maximum)
327
+ except FileNotFoundError:
328
+ return
329
+ except OSError:
330
+ if attempt == _SIDECAR_ATTEMPTS - 1:
331
+ raise
332
+ else:
333
+ return
334
+ time.sleep(_SIDECAR_RETRY_SECONDS)
318
335
 
319
336
 
320
337
  def acquire_lock(directory: WindowsDirectory, name: str, held: list[int]) -> None:
@@ -1075,7 +1075,7 @@ PAGE_NOTICES = MappingProxyType(
1075
1075
  "Opcja chwilowo niedostępna. Aktualnie trwa proces zasilania archiwum "
1076
1076
  "danymi z poprzedniego roku szkolnego. Po zakończeniu procesu "
1077
1077
  "zasilania opcja zostanie ponownie udostępniona."
1078
- ): ErrorKind.MAINTENANCE,
1078
+ ): ErrorKind.TEMPORARILY_UNAVAILABLE,
1079
1079
  }
1080
1080
  )
1081
1081
  MODULE_UNAVAILABLE_PATH = "/modul_niedostepny"
@@ -21,6 +21,7 @@ __all__ = [
21
21
  "SessionExpiredError",
22
22
  "StorageError",
23
23
  "StaleCursorError",
24
+ "TemporarilyUnavailableError",
24
25
  "ThrottledError",
25
26
  "UnknownDeliveryError",
26
27
  "UnsupportedCapabilityError",
@@ -40,6 +41,7 @@ class ErrorKind(StrEnum):
40
41
  UNSUPPORTED_CAPABILITY = "unsupported_capability"
41
42
  VIEW_DISABLED = "view_disabled"
42
43
  MODULE_UNAVAILABLE = "module_unavailable"
44
+ TEMPORARILY_UNAVAILABLE = "temporarily_unavailable"
43
45
  THROTTLED = "throttled"
44
46
  MAINTENANCE = "maintenance"
45
47
  CONNECTION = "connection"
@@ -119,6 +121,13 @@ class ModuleUnavailableError(LibrusError):
119
121
  """The school's Synergia product variant does not include this module."""
120
122
 
121
123
 
124
+ class TemporarilyUnavailableError(LibrusError):
125
+ """Synergia says this view is unavailable for now; other views still work.
126
+
127
+ Retry later. Unlike MaintenanceError, nothing pauses the shared scheduler.
128
+ """
129
+
130
+
122
131
  class ThrottledError(LibrusError):
123
132
  pass
124
133
 
@@ -176,6 +185,7 @@ _ERROR_TYPES: dict[ErrorKind, type[LibrusError]] = {
176
185
  ErrorKind.UNSUPPORTED_CAPABILITY: UnsupportedCapabilityError,
177
186
  ErrorKind.VIEW_DISABLED: ViewDisabledError,
178
187
  ErrorKind.MODULE_UNAVAILABLE: ModuleUnavailableError,
188
+ ErrorKind.TEMPORARILY_UNAVAILABLE: TemporarilyUnavailableError,
179
189
  ErrorKind.THROTTLED: ThrottledError,
180
190
  ErrorKind.MAINTENANCE: MaintenanceError,
181
191
  ErrorKind.CONNECTION: ConnectionError,