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

fix: Fix type error in pssh-box.py with Python 3.10+ #1187

Merged
merged 2 commits into from
May 1, 2023

Conversation

Brainiarc7
Copy link
Contributor

@Brainiarc7 Brainiarc7 commented Mar 15, 2023

A single-line change on #L170 to wv.protection_scheme = struct.unpack('>L', bytes(protection_scheme, encoding='utf-8'))[0], needed to work around this issue on Ubuntu 22.04LTS+ running Python 3.10+:

TypeError: a bytes-like object is required, not 'str'

On line 170.

…not 'str''

A single-line change on #L170 to `wv.protection_scheme = struct.unpack('>L', bytes(protection_scheme, encoding='utf-8'))[0]`, needed to work around this issue on Ubuntu 22.04LTS+ running Python 3.10+:

```sh
TypeError: a bytes-like object is required, not 'str'
```
On line 170.
@Brainiarc7 Brainiarc7 changed the title Resolves the bug around 'TypeError: a bytes-like object is required, … fix: Solve the "Type error: A Bytes-Like Object Is Required, Not ‘str’" encountered when running pssh-box.py Mar 16, 2023
The patch has been updated to pass lint tests. 
The change is now within the line length limit(s).
@joeyparrish
Copy link
Member

Looks good. Thanks for contributing!

@joeyparrish joeyparrish changed the title fix: Solve the "Type error: A Bytes-Like Object Is Required, Not ‘str’" encountered when running pssh-box.py fix: Fix type error in pssh-box.py with Python 3.10+ May 1, 2023
@joeyparrish joeyparrish merged commit 161947f into shaka-project:main May 1, 2023
joeyparrish pushed a commit that referenced this pull request May 1, 2023
A single-line change on #L170 to `wv.protection_scheme =
struct.unpack('>L', bytes(protection_scheme, encoding='utf-8'))[0]`,
needed to work around this issue on Ubuntu 22.04LTS+ running Python
3.10+:

```sh
TypeError: a bytes-like object is required, not 'str'
```
On line 170.
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants