[GH-ISSUE #178] Incorrectly Causes Returns when Artist or Title has Japanese Characters #91

Closed
opened 2026-02-27 23:20:47 +03:00 by kerem · 2 comments
Owner

Originally created by @Chris-Perkins on GitHub (Apr 1, 2017).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/178

A bit of a weird one. I have Dream Sweet in Sea Major in my playlist by "ミラクルミュージカル". I was having problems with my program due to what I thought was my own programming logic.

I then put in the example function on Spotipy's own website for getting all tracks off a playlist. Here are the raw results:

CODE:

            for i, item in enumerate(tracks['items']):
                track = item['track']
                print("Attempting to add %s" % track['name'])
                print("   %d %32.32s %s" % (i, track['artists'][0]['name'],
                                                              track['name']))
                print('Doesn\'t get here on Japanese artist')

OUTPUT:

Attempting to add Bohemian Purgatory Part. 1
0 World's End Girlfriend Bohemian Purgatory Part. 1
Doesn't get here on Japanese artist
Attempting to add Bohemian Purgatory Part. 2
1 World's End Girlfriend Bohemian Purgatory Part. 2
Doesn't get here on Japanese artist
Attempting to add Just You
2 Pierce Fulton Just You
Doesn't get here on Japanese artist
.... more output
Attempting to add Me and Your Mama
7 Childish Gambino Me and Your Mama
Doesn't get here on Japanese artist
Attempting to add Dream Sweet in Sea Major

After attempting to add the artist with Japanese characters, my function returns despite the above code being in an infinite loop with no way to escape but user input.

I should also note that there are 20 songs in this playlist.

I'm also guessing this doesn't necessarily have to do with Japanese characters, but non-latin or ascii characters in general.

Originally created by @Chris-Perkins on GitHub (Apr 1, 2017). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/178 A bit of a weird one. I have Dream Sweet in Sea Major in my playlist by "ミラクルミュージカル". I was having problems with my program due to what I thought was my own programming logic. I then put in the example function on Spotipy's own website for getting all tracks off a playlist. Here are the raw results: CODE: > for i, item in enumerate(tracks['items']): > track = item['track'] > print("Attempting to add %s" % track['name']) > print(" %d %32.32s %s" % (i, track['artists'][0]['name'], > track['name'])) > print('Doesn\'t get here on Japanese artist') OUTPUT: > Attempting to add Bohemian Purgatory Part. 1 > 0 World's End Girlfriend Bohemian Purgatory Part. 1 > Doesn't get here on Japanese artist > Attempting to add Bohemian Purgatory Part. 2 > 1 World's End Girlfriend Bohemian Purgatory Part. 2 > Doesn't get here on Japanese artist > Attempting to add Just You > 2 Pierce Fulton Just You > Doesn't get here on Japanese artist > .... more output > Attempting to add Me and Your Mama > 7 Childish Gambino Me and Your Mama > Doesn't get here on Japanese artist > Attempting to add Dream Sweet in Sea Major After attempting to add the artist with Japanese characters, my function returns despite the above code being in an infinite loop with no way to escape but user input. I should also note that there are 20 songs in this playlist. I'm also guessing this doesn't necessarily have to do with Japanese characters, but non-latin or ascii characters in general.
kerem 2026-02-27 23:20:47 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@622michael commented on GitHub (Apr 6, 2017):

I fixed this issue by adding ensure_ascii=false to the json.dumps in the client.py file.

<!-- gh-comment-id:292361790 --> @622michael commented on GitHub (Apr 6, 2017): I fixed this issue by adding ensure_ascii=false to the json.dumps in the client.py file.
Author
Owner

@stephanebruckert commented on GitHub (Jan 17, 2020):

I can't find the exact same playlist you are talking about and can't reproduce it with japanese artists, track names or playlist names. Please let me know if you still have this issue and feel free to re-open with a complete and minimal code sample.

<!-- gh-comment-id:575728953 --> @stephanebruckert commented on GitHub (Jan 17, 2020): I can't find the exact same playlist you are talking about and can't reproduce it with japanese artists, track names or playlist names. Please let me know if you still have this issue and feel free to re-open with a complete and minimal code sample.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#91
No description provided.