From c59ca0fca1fb292778ec89fc47a9c358ec902087 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 26 Mar 2023 14:13:20 -0400 Subject: [PATCH 1/3] enforced utf-8 encoding on imported files --- beets/ui/commands.py | 2 +- docs/reference/cli.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 6c8e25b85..68cc7b635 100755 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -958,7 +958,7 @@ def import_files(lib, paths, query): if config['import']['log'].get() is not None: logpath = syspath(config['import']['log'].as_filename()) try: - loghandler = logging.FileHandler(logpath) + loghandler = logging.FileHandler(logpath, encoding='utf-8') except OSError: raise ui.UserError("could not open log file for writing: " "{}".format(displayable_path(logpath))) diff --git a/docs/reference/cli.rst b/docs/reference/cli.rst index da119d0f8..7737c4498 100644 --- a/docs/reference/cli.rst +++ b/docs/reference/cli.rst @@ -172,7 +172,7 @@ Optional command flags: Just point the ``beet import`` command at a directory of files that are already catalogged in your library. Beets will automatically detect this - situation and avoid duplicating any items. In this situation, the "copy + situation and avoid duplicating any items. A UTF-8 encoding will be enforced on your imported file. In this situation, the "copy files" option (``-c``/``-C`` on the command line or ``copy`` in the config file) has slightly different behavior: it causes files to be *moved*, rather than duplicated, if they're already in your library. (The same is From 6539cdcfc5068834b3d226e8e8e72c819708996d Mon Sep 17 00:00:00 2001 From: root Date: Sun, 26 Mar 2023 14:20:10 -0400 Subject: [PATCH 2/3] added to changelog --- docs/changelog.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 9071f8831..dc911f540 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -11,6 +11,8 @@ for Python 3.6). New features: +* Added UTF-8 encoding enforcement to imported files in `beets/beets/ui/commands.py`. + :bug:`4693` * Added additional error handling for `spotify` plugin. :bug:`4686` * We now import the remixer field from Musicbrainz into the library. From b3b26efe88bf3dc41bacd4fbc27249a3cd6352e7 Mon Sep 17 00:00:00 2001 From: elyang0214 Date: Sun, 2 Apr 2023 11:13:53 -0400 Subject: [PATCH 3/3] Updated documentation to be less redundant in docs/referece/cli.rst and more accurate in docs/changelog.rst. --- docs/changelog.rst | 2 +- docs/reference/cli.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index d2f9e4c6e..6aa2c7302 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -11,7 +11,7 @@ for Python 3.6). New features: -* Added UTF-8 encoding enforcement to imported files in `beets/beets/ui/commands.py`. +* --from-logfile now parses log files using a UTF-8 encoding in `beets/beets/ui/commands.py`. :bug:`4693` * Added additional error handling for `spotify` plugin. :bug:`4686` diff --git a/docs/reference/cli.rst b/docs/reference/cli.rst index 7737c4498..da119d0f8 100644 --- a/docs/reference/cli.rst +++ b/docs/reference/cli.rst @@ -172,7 +172,7 @@ Optional command flags: Just point the ``beet import`` command at a directory of files that are already catalogged in your library. Beets will automatically detect this - situation and avoid duplicating any items. A UTF-8 encoding will be enforced on your imported file. In this situation, the "copy + situation and avoid duplicating any items. In this situation, the "copy files" option (``-c``/``-C`` on the command line or ``copy`` in the config file) has slightly different behavior: it causes files to be *moved*, rather than duplicated, if they're already in your library. (The same is