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

stats -e fails on windows when path contains some characters #1891

Closed
GuilhermeHideki opened this issue Feb 22, 2016 · 5 comments
Closed

stats -e fails on windows when path contains some characters #1891

GuilhermeHideki opened this issue Feb 22, 2016 · 5 comments
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."

Comments

@GuilhermeHideki
Copy link
Member

Python can't get the size of some files because it can't find the correct folder or file, throwing OSError 2 and 3's.

Problem

It's probably a difference on windows paths / linux or decoding?
https://github.com/beetbox/beets/blob/master/beets/ui/commands.py#L1260

Examples:

Chinese characters on 1.07 2Cellos feat. 郎朗 - Clocks.m4a

could not get size of X:\lts\music\#\2Cellos\Albums\[2012] In2ition {256 kbps AAC}\1.07 2Cellos feat. 郎朗 - Clocks.m4a: 
[Error 2] The system cannot find the file specified: 'X:\\lts\\music\\#\\2Cellos\\Albums\\[2012] In2ition {256 kbps AAC}\\1.07 2Cellos feat. \xe9\x83\x8e\xe6\x9c\x97 - Clocks.m4a'

Apostrophe on X:\lts\music\Z\ZZ Top\Albums\[1971] ZZ Top’s First Album {320 kbps MP3}\1.01 ZZ Top - (Somebody Else Been) Shaking Your Tree.mp3

could not get size of X:\lts\music\Z\ZZ Top\Albums\[1971] ZZ Top’s First Album {320 kbps MP3}\1.01 ZZ Top - (Somebody Else Been) Shaking Your Tree.mp3:
[Error 3] The system cannot find the path specified: 'X:\\lts\\music\\Z\\ZZ Top\\Albums\\[1971] ZZ Top\xe2\x80\x99s First Album {320 kbps MP3}\\1.01 ZZ Top - (Somebody Else Been) Shaking Your Tree.mp3'

Setup

  • OS: Win 10
  • Python version: 2.7.11
  • beets version: lastest
My configuration:
  • I don't "asciify" my paths
  • codepage is 1252 in chcp, locale.getdefaultlocale() = ('en_US', 'cp1252') and terminal_encoding: cp1252
@sampsyo sampsyo added the needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature." label Feb 22, 2016
@sampsyo
Copy link
Member

sampsyo commented Feb 22, 2016

Thanks for the report! I think the fix was relatively straightforward—can you please check whether the above commit fixes this?

@GuilhermeHideki
Copy link
Member Author

This reduces the quantity of problems, but now I get Unicode problems with the apostrophe \u2019

could not get size of X:\lts\music\B\Bruce Springsteen\Albums\[1984] Born in the U.S.A. {320 kbps MP3}\1.09 Bruce Springsteen - I’m Goin’ Down.mp3:
[Error 2] The system cannot find the file specified: u'\\\\?\\X:\\lts\\music\\B\\Bruce Springsteen\\Albums\\[1984] Born in the U.S.A. {320 kbps MP3}\\1.09 Bruce Springsteen - I\u2019m Goin\u2019 Down.mp3'

@sampsyo
Copy link
Member

sampsyo commented Feb 22, 2016

There's an apostrophe in one of the examples above too. Was that affected?

@GuilhermeHideki
Copy link
Member Author

Oh, my bad. some files had inconsistent paths, so I renamed manually the file to the same as in beets and use move. This had the typewriter apostrophe instead of the curly one.

This is fixed 😄

@sampsyo
Copy link
Member

sampsyo commented Feb 22, 2016

Woohoo!

shamangeorge added a commit to shamangeorge/beets that referenced this issue Mar 1, 2016
* master: (246 commits)
  Fix beetbox#1896 (bungled fix to beetbox#1895)
  Minor docs refinements for beetbox#1894
  Human-readable message in non-pretend mode (beetbox#1894)
  changelog entry for new convert.album_art_maxwidth option
  tweaks for style, option name
  Fix beetbox#1895: don't assume SC data is bytes
  Slightly more logical instruction placement
  Update ISSUE_TEMPLATE.md
  doc note for new copy_album_art_maxwidth option
  revert a chunk of the work to be the way it was
  better text for artwork resize/copy logs
  fix indentation
  add copy_album_art_maxwidth config option to convert plugin
  move and split fetchart valid_image
  Fix beetbox#1891: Missing `syspath` in `beet stats -e`
  Suggest ways to describe problems
  Start an issue template
  beet import: there is no such option: -M
  Grammar/formatting refinement for beetbox#1878
  fix documentation error
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."
Projects
None yet
Development

No branches or pull requests

2 participants