Lektor

Latest version: v3.3.11

Safety actively analyzes 619599 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 6

3.4.0b11

Security

Prior to this release it was possible to create files outside of the
`content` tree using the admin API. (Normally, the admin API should not
be made accessible to untrusted parties, since the point of the API to
to allow for editing of the Lektor project content.)

- Better sanitation of DB file paths, better validation of path passed
to `make_editor_session`. ([1179])
- Better validation of API parameters. ([1181])

[1179]: https://github.com/lektor/lektor/pull/1179
[1181]: https://github.com/lektor/lektor/pull/1181

3.4.0b10

Bugs Fixed

Admin Server

- Fix `"re.error: bad escape \u"` exception. ([1177])

[1177]: https://github.com/lektor/lektor/pull/1177

3.4.0b9

Compatibility

- Drop support for python 3.7. ([1173])
- Officially support python 3.12. ([1167])
- Remove pin on `werkzeug<3`. ([1172], [1171])

Refactorings

This release includes a significant continuation of refactoring of the
code in `lektor.imagetools` which started in [1104]:

- We now use Pillow to access image file metadata (e.g. dimensions,
format, and EXIF tags). This replaces some homegrown code for
reading basic image metadata and `exifread` for EXIF tag access.

- Some internal API has been cleaned up.

- Compatibility with various versions of Pillow has been increased.

See [1138] for details.

Features Removed

- Removed `--no-reload` option to the `lektor server` command. This was added in 3.4.0b4 as part of 1027 and seems no longer necessary since now live-reload can be disabled on a per-window bases (see 1164).

Features Added

- Added Turkish translation. Thank you [\uyar]! ([1157])

Admin GUI

- Replace the _“Edit Pencil”_ with a toolbar containing both an _Edit_
button and a toggle that can be used to disable
_Live-reload_. ([1164])

Bugs Fixed

Admin GUI

- Use a real link (`<a href=...`) for the "Return to Website" button. ([1164])

Jinja Globals

- Fix `bag()` to object the pad from `site` in the Jinja context, rather than from the Lektor build context. ([1155])

Plugins

- Use symlinks when constructing Lektor's private virtual
environment. This fixes issues install plugins on macOS. ([1161],
[1159])

Style

- Update prettier, update eslint rules. ([1153])
- Update to latest pylint, black, flake8. Use flake8-bugbear. ([1162])
- Update npm locks, upgrade esbuild, update tests to React 18 APIs. ([1170])
- Apply `pyupgrade --py38-plus` to codebase ([1174])

[\uyar]: https://github.com/uyar
[1138]: https://github.com/lektor/lektor/pull/1138
[1153]: https://github.com/lektor/lektor/pull/1153
[1155]: https://github.com/lektor/lektor/pull/1155
[1157]: https://github.com/lektor/lektor/pull/1157
[1159]: https://github.com/lektor/lektor/issues/1159
[1161]: https://github.com/lektor/lektor/pull/1161
[1162]: https://github.com/lektor/lektor/pull/1162
[1164]: https://github.com/lektor/lektor/pull/1164
[1167]: https://github.com/lektor/lektor/pull/1167
[1170]: https://github.com/lektor/lektor/issues/1170
[1171]: https://github.com/lektor/lektor/issues/1171
[1172]: https://github.com/lektor/lektor/pull/1172
[1173]: https://github.com/lektor/lektor/pull/1173
[1174]: https://github.com/lektor/lektor/pull/1174

3.4.0b8

Bugs Fixed

- When there are multiple _asset_ trees being merged (i.e. when
_themes_ are in use), avoid building shadowed assets. ([908],
[1147])
- Fix asset URL resolution in the dev server when asset extensions
differ from that of their source. ([1111], [1147])

[908]: https://github.com/lektor/lektor/issues/908
[1111]: https://github.com/lektor/lektor/issues/1111
[1147]: https://github.com/lektor/lektor/pull/1147

3.4.0b7

Slightly Breaking Changes

- The `--profile` option has been removed from the `lektor build` command. ([1137])

Bugs Fixed

- Pin `watchfiles>=0.12`. (Our tests use the `stop_event` parameter of `watchfiles.watch`.)
- Fix exception from `describe_build_func` when building thumbnails with verbose logging enabled.
- Fix "FATAL: exception not rethrown" message when `lektor server` is stopped. ([1145])
- Fix multiple browser new tabs when `lektor server --browse` is used with `LEKTOR_DEV` set ([1145])
- Fix mypy errors in `lektor.admin.modules`.
- Fix `Builder.touch_site_config` so that it actually touches the site
config. This fixes the _Refresh Build_ button of the admin
UI. ([1146])
- Ensure that `Artifact.open` respects the value of its `encoding` argument when opening files. ([1146])
- Fix logic flaw in `FileInfo.unchanged` which, under certain
circumstances, causes source files to be considered unchanged even
if their size (or mtime) is changed. ([1146])

[1137]: https://github.com/lektor/lektor/pull/1137
[1145]: https://github.com/lektor/lektor/pull/1145
[1146]: https://github.com/lektor/lektor/pull/1146

3.4.0b6

Possibly Breaking Changes

- Our Publisher API has changed. This will eventually require updates
to any custom Publisher classes provided by Lektor
plugins. Previously, the `publish` method of `Publisher` subclasses
was passed a `werkzeug.urls.URL` instance as its `target_url`
argument. Werkzeug has deprecated the `URL` class, so now the
`target_url` will be passed as a string. (The publishers are now
responsible for was parsing the target URL themselves.) For the
interim, in an effort to avoid immediately breaking existing
plugins, we pass a fancy subclass of `str` that implements most of
the attributes and methods of `werkzeug.urls.URL`. ([1143], [1142])

- Interpret relative paths passed via the `--output-path` command-line
parameter relative to the current working directory. Interpret
relative paths configured for `output_path` in the _project file_
relative to the directory containing the project file (as the
[docs](https://www.getlektor.com/docs/project/file/#project) claim
should happen). Previously, both paths were interpreted —
incorrectly, in both cases — relative to the _project directory_.
([1103], [1120])

- The `query` attribute of fields of type `"url"` now returns the
IRI-encoded (internationalized) version of the URL query. (This
matches the existing behavior of the `host`, `path`, and `anchor`
attributes.) ([1143])

Deprecations

- The (unused) `lektor.db.Pad.make_absolute_url` method is deprecated. ([1143])

Features

- We now use [Pillow] (instead of ImageMagick) to generate image
thumbnails. Installation of ImageMagick was a significant pain-point
for some. In addition the Pillow-based thumbnailing code appears to
be noticeably faster than the ImageMagick version. ([1104])

- A _Preferences Dialog_ has been added to the admin GUI that allows
customization of which hotkeys trigger the _Save_, _Edit_,
_(Save &) Preview_, and _Search_ actions. ([1052])

Bugs Fixed

- Re-export `ImprovedRenderer`, `MarkdownConfig`, and `escape` from
`lektor.markdown`. These were removed in [992] when support for
mistune 2.x was added. Restoring them allows most older plugins
written for Lektor<3.4 to work, so long as mistune is pinned to
version 0.x. ([1134])

- Better input validation and error reporting for the `dateformat`,
`timeformat` and `datetimeformat` jinja filters. Previously, these
filters did not handle unexpected input types gracefully. ([1122],
[1121])

- Allow the user to customize the python [warnings filter] when
running the CLI. Previously, Lektor unconditionally set the
warnings filter to `"default"` (enabling one-shot display of _all_
warning types.) Now, if the warnings filter has been explicitly set
(via [PYTHONWARNINGS] or [-W][python-W]) it is left
alone. ([e2d0274])
- DB-path URL resolution of relative paths from _virtual source objects_. ([1133])

- Relative URL-path resolution from pages with "." in their slug. ([1133])

- Avoid the use of `warnings.catch_warnings` which was introduced in
[1113]. Its use resets the warnings registry resulting in undesired
repition of seen warnings. ([1135]).

Bit-Rot

- Update frontend npm dependencies. ([1126])

Other Changes

- Use [watchfiles] instead of `watchdog` when monitoring for file changes. ([1136])

- Optimization: Thumbnail file names are now generated based on the
final thumbnail parameters (e.g. their actual dimensions, rather than
their requested dimensions.) This minimizes the possibility of generating
multiple identical thumbnails with different file names. ([1139])

- Tighten [click] constraints on Path parameters. This results in
better and earlier error messages when, e.g., a readable file is
expected, but a path to a directory is passed. ([1124])

- We reduced the size of our distribution wheel and sdist files by
roughly factor of two by omitting all but the `.woff2` variants of
the fonts for the frontend, and by excluding [sourcesContent] from
the JS and CSS sourcemaps. ([1130], [1115])

[e2d0274]: https://github.com/lektor/lektor/commit/e2d02746a488e4a4d05ba8a01443e7a90315a2fb
[1052]: https://github.com/lektor/lektor/pull/1052
[1103]: https://github.com/lektor/lektor/issues/1103
[1104]: https://github.com/lektor/lektor/pull/1104
[1115]: https://github.com/lektor/lektor/issues/1115
[1120]: https://github.com/lektor/lektor/pull/1120
[1121]: https://github.com/lektor/lektor/issues/1121
[1122]: https://github.com/lektor/lektor/pull/1122
[1124]: https://github.com/lektor/lektor/pull/1124
[1126]: https://github.com/lektor/lektor/pull/1126
[1130]: https://github.com/lektor/lektor/pull/1130
[1133]: https://github.com/lektor/lektor/pull/1133
[1134]: https://github.com/lektor/lektor/pull/1134
[1136]: https://github.com/lektor/lektor/pull/1136
[1139]: https://github.com/lektor/lektor/pull/1139
[1142]: https://github.com/lektor/lektor/issues/1142
[1143]: https://github.com/lektor/lektor/pull/1143
[click]: https://pypi.org/project/click/
[warnings filter]: https://docs.python.org/3/library/warnings.html#the-warnings-filter
[PYTHONWARNINGS]: https://docs.python.org/3/using/cmdline.html#envvar-PYTHONWARNINGS
[python-W]: https://docs.python.org/3/using/cmdline.html#cmdoption-W
[Pillow]: https://pillow.readthedocs.io/en/stable/
[sourcesContent]: https://esbuild.github.io/api/#sources-content
[watchfiles]: https://github.com/samuelcolvin/watchfiles

Page 1 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.