Skip to content

Conversation

@mrashed-dev
Copy link
Contributor

Description

In Python 2.7 the 'b' prefix ahead of a string is ignored but in Python 3 it indicates a byte literal versus a string. So on Python 3 apps implementing our SDK they would encounter an error as the Nylas API is expecting a string instead of a byte string. Now we ensure that it gets decoded back into a string to ensure it works on Python 3.

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

In Python 3, running b64encode without decoding it back again returns a byte string instead of a string
@mrashed-dev mrashed-dev requested review from a team, dominicj-nylas, mypile and theblueskies and removed request for a team September 20, 2022 20:51
@nylas nylas deleted a comment from codecov bot Sep 20, 2022
@codecov
Copy link

codecov bot commented Sep 20, 2022

Codecov Report

Merging #233 (34decb0) into main (f766d11) will increase coverage by 0.12%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #233      +/-   ##
==========================================
+ Coverage   95.83%   95.96%   +0.12%     
==========================================
  Files          15       15              
  Lines        1634     1634              
==========================================
+ Hits         1566     1568       +2     
+ Misses         68       66       -2     
Impacted Files Coverage Δ
nylas/client/client.py 96.09% <100.00%> (+0.45%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@mrashed-dev mrashed-dev requested review from a team, dantonpimentel and jumbhood and removed request for a team, dominicj-nylas and mypile September 20, 2022 21:25
Copy link

@dantonpimentel dantonpimentel left a comment

Choose a reason for hiding this comment

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

lgtm

@mrashed-dev mrashed-dev merged commit 36c2ead into main Sep 21, 2022
@mrashed-dev mrashed-dev deleted the TSDK-483-integrations-basic-auth-is-invalid-for-python branch September 21, 2022 14:37
@mrashed-dev mrashed-dev mentioned this pull request Sep 22, 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.

4 participants