Skip to content

Commit 6b03f82

Browse files
committed
Version 1.7.0
1 parent 445f1c3 commit 6b03f82

File tree

6 files changed

+33
-5
lines changed

6 files changed

+33
-5
lines changed

Diff for: LICENSE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2014-2023 Tomas Karabela
1+
Copyright (c) 2014-2024 Tomas Karabela
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

Diff for: docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
# General information about the project.
5353
project = u'pysubs2'
54-
copyright = u'2014-2023, Tomas Karabela'
54+
copyright = u'2014-2024, Tomas Karabela'
5555

5656
# The version info for the project you're documenting, acts as replacement for
5757
# |version| and |release|, also used in various other places throughout the

Diff for: docs/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ License
4646

4747
.. code-block:: text
4848
49-
Copyright (c) 2014-2023 Tomas Karabela
49+
Copyright (c) 2014-2024 Tomas Karabela
5050
5151
Permission is hereby granted, free of charge, to any person obtaining a copy
5252
of this software and associated documentation files (the "Software"), to deal

Diff for: docs/release-notes.rst

+23
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
Release Notes
22
=============
33

4+
**1.7.0** --- released on 2024-05-19
5+
6+
- Added ``errors`` option for :meth:`pysubs2.load()`, :meth:`pysubs2.SSAFile.save()` and related methods, exposing
7+
the encoding handling option of builtin function ``open()``. By default, this option uses value ``None`` which
8+
is consistent with behaviour of previous versions of the library. However, it's possible to use ``"surrogateescape"``
9+
to bypass the need to specify correct character encoding in some cases (see the tutorial). In the CLI, surrogateescape
10+
is now the default behaviour.
11+
- SubStation writer now correctly handles timestamps which are not rounded to centiseconds, for example
12+
``00:36:48,998`` from a SRT file no longer produces the invalid ASS timestamp ``0:36:48.100`` (Issue #83),
13+
patch by moi15moi (https://github.com/moi15moi)
14+
- MicroDVD parser now only uses FPS declaration from the first subtitle if the line starts with ``{1}{1}``,
15+
matching VLC Player behaviour; the old behaviour is available under the ``strict_fps_inference`` reader option
16+
(Issue #71)
17+
- SubStation writer now omits fractional part for numeric values if it is zero, patch by Andrey Efremov (https://github.com/PalmtopTiger)
18+
- CLI now shows help message when called without arguments (Issue #81), patches by Northurland (https://github.com/Northurland) and Andrey Efremov (https://github.com/PalmtopTiger)
19+
- pysubs2 now raises correct exception (:class:`pysubs2.exceptions.FormatAutodetectionError`) when attempting to read
20+
a JSON file that was not saved by pysubs2 (Issue #85)
21+
- More robust SubStation parser (Issues #87, #89)
22+
- Added test data to source distribution (Issue #75)
23+
- Code now passes MyPy check in strict mode, as well as Ruff check
24+
- Added support for Python 3.12, removed support for Python 3.7
25+
26+
427
**1.6.1** --- released on 2023-04-02
528

629
- WebVTT now correctly writes events in cue start order, patch by Anton Melser (https://github.com/AntonOfTheWoods)

Diff for: pysubs2/common.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def to_ssa_alignment(self) -> int:
5858

5959

6060
#: Version of the pysubs2 library.
61-
VERSION = "1.6.1"
61+
VERSION = "1.7.0"
6262

6363

6464
IntOrFloat = Union[int, float]

Diff for: pysubs2/formats/microdvd.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,16 @@ def from_file(cls, subs: "SSAFile", fp: TextIO, format_: str, fps: Optional[floa
3434
Keyword args:
3535
strict_fps_inference: If True (default), in the case when ``fps`` is not given, it will be read
3636
from the first subtitle text only if the start and end frame of this subtitle is ``{1}{1}``
37-
(matches VLC Player behaviour), otherwise `UnknownFPSError` is raised. When ``strict_fps_inference``
37+
(matches VLC Player behaviour), otherwise :class:`pysubs2.exceptions.UnknownFPSError` is raised.
38+
39+
When ``strict_fps_inference``
3840
is False, framerate will be read from the first subtitle text in this case regardless of
3941
start and end frame (which may result in bogus result, if the first subtitle is not supposed
4042
to contain framerate). Before introduction of this option, the library behaved as if this
4143
option was False.
44+
45+
.. versionchanged:: 1.7.0
46+
Added the ``strict_fps_inference`` option.
4247
"""
4348
for line in fp:
4449
match = MICRODVD_LINE.match(line)

0 commit comments

Comments
 (0)