Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

importfeeds: Configuration error due to handling of "dir" option on Python 3 #2467

Closed
Armael opened this issue Mar 3, 2017 · 5 comments
Closed
Labels
bug bugs that are confirmed and actionable python 3 Arises from the Python 2->3 transition.

Comments

@Armael
Copy link

Armael commented Mar 3, 2017

Problem

Running beet import /my/album terminates with the following message: configuration error: importfeeds.dir: must be a filename, not bytes.

Setup

  • OS: Archlinux
  • Python version: 3.6.0
  • beets version: 1.4.4 (latest git)
  • Turning off plugins made problem go away: yes

The output of beet config is:

importfeeds:
    dir: !!binary |
        L3Bvb2wvbXVzaXF1ZQ==
    relative_to:
    formats: m3u
    m3u_name: imported.m3u
    absolute_path: no
directory: /pool/musique
library: /pool/musiclibrary.blb

plugins: fromfilename embedart fetchart lastgenre thumbnails importfeeds
embedart:
    ifempty: yes
    maxwidth: 0
    auto: yes
    compare_threshold: 0
    remove_art_file: no
fetchart:
    enforce_ratio: 5%
    auto: yes
    minwidth: 0
    maxwidth: 0
    cautious: no
    cover_names:
    - cover
    - front
    - art
    - album
    - folder
    sources:
    - filesystem
    - coverart
    - itunes
    - amazon
    - albumart
    google_key: REDACTED
    google_engine: 001442825323518660753:hrh5ch1gjzm
    fanarttv_key: REDACTED
    store_source: no
lastgenre:
    count: 5
    force: no
    whitelist: yes
    min_weight: 10
    fallback:
    canonical: no
    source: album
    auto: yes
    separator: ', '
    prefer_specific: no

import:
    log: /pool/beets_import.log
thumbnails:
    auto: yes
    force: no
    dolphin: no

The ~/.config/beets/config.yaml itself is:

directory: /pool/musique
library: /pool/musiclibrary.blb

plugins: fromfilename embedart fetchart lastgenre thumbnails importfeeds

embedart:
    ifempty: yes

fetchart:
    enforce_ratio: 5%

lastgenre:
    count: 5
    force: no

import:
#    incremental: yes                                                                                                                                                                                               
    log: /pool/beets_import.log

importfeeds:
    formats: m3u
@ghost
Copy link

ghost commented Mar 3, 2017

we should probably drop the Gio backend, but I was hoping to wait til we dropped py2 and could rely on the newer pathlib completely

@sampsyo
Copy link
Member

sampsyo commented Mar 3, 2017

You're right that it would be nice to drop Gio, @jrobeson (although that applies to the other ticket, #2466).

@sampsyo
Copy link
Member

sampsyo commented Mar 3, 2017

Thanks for the additional report, @Armael. It looks like we have a problem with the handling of that config option in that plugin on Python 3 that could use some refactoring. Specifically, we are currently assigning into config['dir'] to provide automatic defaults and relative path resolution, but sometimes that results in bytestring paths in that field. The as_field accessor, however, assumes a human-entered Unicode pathname.

I think the right solution here is a healthy refactoring, which will avoid updating the configuration structure and instead provide a one-way path that determines the directory.

@sampsyo sampsyo changed the title configuration error: importfeeds.dir: must be a filename, not bytes importfeeds: Configuration error due to handling of "dir" option on Python 3 Mar 3, 2017
@sampsyo sampsyo added bug bugs that are confirmed and actionable python 3 Arises from the Python 2->3 transition. labels Mar 3, 2017
@jjlawren
Copy link

Is there a workaround available for this?

@djl
Copy link
Member

djl commented Aug 20, 2017

Fixed in f909f09.

@djl djl closed this as completed Aug 20, 2017
sampsyo added a commit that referenced this issue Aug 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs that are confirmed and actionable python 3 Arises from the Python 2->3 transition.
Projects
None yet
Development

No branches or pull requests

4 participants