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

playlist.py: adding .copy() to locals() preventing kwargs to be sent … #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

myselfhimself
Copy link

…over HTTP

Both static() and basic() functions use kwargs = locals() in order to retrieve the long list of keyword arguments as a dictionary. This is practical, however in python 2.7.6, the actual "kwargs" variable does get scanned by locals() and added as a reference to that dictionary. This ends in kwargs == {...variables key-value pairs..., "kwargs": {the same key-value pairs as before}} and that ugly variable is then sent online to the Echo Nest API.. Using kwargs = locals().copy() removes that kwargs=>kwargs embedded key-value pair.

This also occurs in song.py... Let us check that later.

…over HTTP

Both static() and basic() functions use kwargs = locals() in order to retrieve the long list of keyword arguments as a dictionary. This is practical, however in python 2.7.6, the actual "kwargs" variable does get scanned by locals() and added as a reference to that dictionary. This ends in kwargs == {...variables key-value pairs..., "kwargs": {the same key-value pairs as before}} and that ugly variable is then sent online to the Echo Nest API.. Using kwargs = locals().copy() removes that kwargs=>kwargs embedded key-value pair.

This also occurs in song.py... Let us check that later.
@myselfhimself
Copy link
Author

This seems to happen maybe only during a debugging session... Or actually does not happen on my production server. I am not sure whether this pull request is really relevant...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant