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

Calculate bytes sent by the Python client using byte buffer #9

Merged
merged 1 commit into from
Jan 15, 2019
Merged

Calculate bytes sent by the Python client using byte buffer #9

merged 1 commit into from
Jan 15, 2019

Conversation

mzarnowski
Copy link

For each command, the entire user environment is being send to the server. Any variable in the environment can contain a unicode (e.g. PS1 - a fancy prompt configuration)

Sending messages works as follows:
given buffer buf (a string):

  1. calculate the amount of bytes sent - by using len(buf)
  2. send the header containing the length of the string message
  3. convert string to bytes using bbuf = to_bytes(buf)
  4. send bytes from bbuf

The amount of bytes should be calculated using bbuf: (len(bbuf), not len(buf))

@mzarnowski mzarnowski changed the title count bytes (not characters) when sending message Calculate bytes sent by the Python client using byte buffer Jan 15, 2019
Copy link

@jvican jvican left a comment

Choose a reason for hiding this comment

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

Thanks, trusting that this works, I'm merging and I'll add this to the bloop release happening today.

@jvican jvican merged commit c070891 into scalacenter:bloop-1.0.0 Jan 15, 2019
@mzarnowski mzarnowski deleted the pynailgun-send-unicode-correctly branch January 16, 2019 15:51
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.

2 participants