[GH-ISSUE #13] Error when generating config file under Windows #11

Closed
opened 2026-02-27 20:07:41 +03:00 by kerem · 7 comments
Owner

Originally created by @tomballgithub on GitHub (Jun 9, 2025).
Original GitHub issue: https://github.com/misiektoja/spotify_profile_monitor/issues/13

When trying to run the command from the instructions on the unedited source file, I see the following error when generating the config file to edit. FYI, I am using Windows

c:\Spotify_profile_monitor_save>python profile_monitor.py --generate-config > spotify_profile_monitor.conf
Traceback (most recent call last):
  File "c:\Spotify_profile_monitor_save\profile_monitor.py", line 4863, in <module>
    main()
  File "c:\Spotify_profile_monitor_save\profile_monitor.py", line 4186, in main
    print(CONFIG_BLOCK.strip("\n"))
  File "C:\Python\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2500' in position 7831: character maps to <undefined>
Originally created by @tomballgithub on GitHub (Jun 9, 2025). Original GitHub issue: https://github.com/misiektoja/spotify_profile_monitor/issues/13 When trying to run the command from the instructions on the unedited source file, I see the following error when generating the config file to edit. FYI, I am using Windows ``` c:\Spotify_profile_monitor_save>python profile_monitor.py --generate-config > spotify_profile_monitor.conf Traceback (most recent call last): File "c:\Spotify_profile_monitor_save\profile_monitor.py", line 4863, in <module> main() File "c:\Spotify_profile_monitor_save\profile_monitor.py", line 4186, in main print(CONFIG_BLOCK.strip("\n")) File "C:\Python\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\u2500' in position 7831: character maps to <undefined> ```
kerem closed this issue 2026-02-27 20:07:41 +03:00
Author
Owner

@tomballgithub commented on GitHub (Jun 9, 2025):

The fix is to change the following comment to a normal dash instead of the \u2500 dash:

# Width of horizontal line (-)
HORIZONTAL_LINE = 113
<!-- gh-comment-id:2954548106 --> @tomballgithub commented on GitHub (Jun 9, 2025): The fix is to change the following comment to a normal dash instead of the \u2500 dash: ``` # Width of horizontal line (-) HORIZONTAL_LINE = 113 ```
Author
Owner

@misiektoja commented on GitHub (Jun 9, 2025):

Thx for reporting this and suggesting a fix - I hadn't tested this on Windows and of course something had to misbehave there. Looks like I'll be issuing a round of patch releases for all my tools soon ;-)

<!-- gh-comment-id:2955468752 --> @misiektoja commented on GitHub (Jun 9, 2025): Thx for reporting this and suggesting a fix - I hadn't tested this on Windows and of course something had to misbehave there. Looks like I'll be issuing a round of patch releases for all my tools soon ;-)
Author
Owner

@misiektoja commented on GitHub (Jun 9, 2025):

Ok, issue is fixed in 2.3.1. If you're planning to use the client method, go with this version. I forgot to set the user-agent for some requests, so Spotify might notice some unusual behavior.

<!-- gh-comment-id:2957294259 --> @misiektoja commented on GitHub (Jun 9, 2025): Ok, issue is fixed in 2.3.1. If you're planning to use the client method, go with this version. I forgot to set the user-agent for some requests, so Spotify might notice some unusual behavior.
Author
Owner

@tomballgithub commented on GitHub (Jun 10, 2025):

Thanks. It's very coincidental that the cookie mechanism broke one day after you implemented a new method

<!-- gh-comment-id:2957432169 --> @tomballgithub commented on GitHub (Jun 10, 2025): Thanks. It's very coincidental that the cookie mechanism broke one day after you implemented a new method
Author
Owner

@misiektoja commented on GitHub (Jun 10, 2025):

Yeah, it looked like I work for Spotify and knew what they were planning, lol. But seriously, just a coincidence.

I checked out the changes Spotify made today and managed to get the code running again with sp_dc method. Grab the newest 2.3.2 release (pip install spotify_profile_monitor -U) if you need it (unless you switched to client method completely).

<!-- gh-comment-id:2957478389 --> @misiektoja commented on GitHub (Jun 10, 2025): Yeah, it looked like I work for Spotify and knew what they were planning, lol. But seriously, just a coincidence. I checked out the changes Spotify made today and managed to get the code running again with sp_dc method. Grab the newest 2.3.2 release (`pip install spotify_profile_monitor -U`) if you need it (unless you switched to client method completely).
Author
Owner

@tomballgithub commented on GitHub (Jun 10, 2025):

Great work, I have it working with both mechanisms, but given your warning
about using an account you don't care about, I am using the cookie
mechanism for now since I've been doing that for almost a year without issue

On Mon, Jun 9, 2025 at 9:06 PM Michal Szymanski @.***>
wrote:

misiektoja left a comment (misiektoja/spotify_profile_monitor#13)
https://github.com/misiektoja/spotify_profile_monitor/issues/13#issuecomment-2957478389

Yeah, it looked like I work for Spotify and knew what they were planning,
lol. But seriously, just a coincidence.

I checked out the changes Spotify made today and managed to get the code
running again with sp_dc method. Grab the newest 2.3.2 release (pip
install spotify_profile_monitor -U) if you need it (unless you switched
to client method completely).


Reply to this email directly, view it on GitHub
https://github.com/misiektoja/spotify_profile_monitor/issues/13#issuecomment-2957478389,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ADVRWSY2ZL2QP4G6MAO67ZT3CY4RZAVCNFSM6AAAAAB634XQNGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSNJXGQ3TQMZYHE
.
You are receiving this because you authored the thread.Message ID:
@.***>

<!-- gh-comment-id:2957538448 --> @tomballgithub commented on GitHub (Jun 10, 2025): Great work, I have it working with both mechanisms, but given your warning about using an account you don't care about, I am using the cookie mechanism for now since I've been doing that for almost a year without issue On Mon, Jun 9, 2025 at 9:06 PM Michal Szymanski ***@***.***> wrote: > *misiektoja* left a comment (misiektoja/spotify_profile_monitor#13) > <https://github.com/misiektoja/spotify_profile_monitor/issues/13#issuecomment-2957478389> > > Yeah, it looked like I work for Spotify and knew what they were planning, > lol. But seriously, just a coincidence. > > I checked out the changes Spotify made today and managed to get the code > running again with sp_dc method. Grab the newest 2.3.2 release (pip > install spotify_profile_monitor -U) if you need it (unless you switched > to client method completely). > > — > Reply to this email directly, view it on GitHub > <https://github.com/misiektoja/spotify_profile_monitor/issues/13#issuecomment-2957478389>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/ADVRWSY2ZL2QP4G6MAO67ZT3CY4RZAVCNFSM6AAAAAB634XQNGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSNJXGQ3TQMZYHE> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> >
Author
Owner

@misiektoja commented on GitHub (Jun 10, 2025):

I put the same warning about both the cookie and client method, not just the client one! Honestly, I think the client method is harder to detect since we fully simulate regular desktop client behavior.

<!-- gh-comment-id:2959017379 --> @misiektoja commented on GitHub (Jun 10, 2025): I put the same warning about both the cookie and client method, not just the client one! Honestly, I think the client method is harder to detect since we fully simulate regular desktop client behavior.
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/spotify_profile_monitor#11
No description provided.