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

Update salesforce http header for Requests update #1912

Merged
merged 1 commit into from
Dec 19, 2016

Conversation

dlstadther
Copy link
Collaborator

Description

With the release of Requests 2.11, headers were strictly required to contain string-only components. This requires the casting of Content-Length to the string equivalent of the length of the data.

Motivation and Context

Fix error caused by method check_header_validity in requests/utils.py (InvalidHeader: Header value 65 must be of type str or bytes, not <type 'int'>).

Requests Issue discussion

Have you tested this? If so, how?

Runs my jobs without error.

@mention-bot
Copy link

@dlstadther, thanks for your PR! By analyzing the history of the files in this pull request, we identified @dacort to be a potential reviewer.

Copy link
Contributor

@Tarrasch Tarrasch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A test case would be good though.

@dlstadther
Copy link
Collaborator Author

I've finally gotten around to looking at testing this, but am unsure how to. The part that needs to be checked is that the header passed to requests is a dictionary of strings. Since the function does not simply return the response, but rather some portion of the parse response, I don't have access to that variable to check the header.

The other problem is fooling the function into thinking that I have a valid session and job_id.

Of course, I'll defer to you, @Tarrasch , if you really want me to move things around such that testing this is possible.

@Tarrasch
Copy link
Contributor

No I'm fine with this. You can merge this I think. :)

@dlstadther dlstadther merged commit e662acb into spotify:master Dec 19, 2016
@dlstadther dlstadther deleted the sf_fix branch December 19, 2016 15:15
@dlstadther
Copy link
Collaborator Author

Thanks for the approval @Tarrasch !

kreczko pushed a commit to kreczko/luigi that referenced this pull request Mar 28, 2017
With the introduction of Requests 2.11, headers are explicitly enforced to only contain strings. This commit corrects the header for salesforce batches.
This was referenced Jun 29, 2022
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.

3 participants