Skip to content

panic at bytes() #1401

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

Closed
rls1004 opened this issue Sep 22, 2019 · 2 comments · Fixed by #1418
Closed

panic at bytes() #1401

rls1004 opened this issue Sep 22, 2019 · 2 comments · Fixed by #1418
Labels
C-compat A discrepancy between RustPython and CPython

Comments

@rls1004
Copy link
Contributor

rls1004 commented Sep 22, 2019

Feature

Expected Result

>>> bytes(-1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: negative count

Actual Result

>>>>> bytes(-1)
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:378:21

Code to check for negative size should be added.

@rls1004 rls1004 added the C-compat A discrepancy between RustPython and CPython label Sep 22, 2019
@vazrupe
Copy link
Contributor

vazrupe commented Sep 23, 2019

can I take this?

@coolreader18
Copy link
Member

Yep, go ahead!

vazrupe added a commit to vazrupe/RustPython that referenced this issue Sep 26, 2019
vazrupe added a commit to vazrupe/RustPython that referenced this issue Sep 26, 2019
vazrupe added a commit to vazrupe/RustPython that referenced this issue Sep 26, 2019
vazrupe added a commit to vazrupe/RustPython that referenced this issue Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-compat A discrepancy between RustPython and CPython
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants