question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG: Python crashes with bad function arguments

See original GitHub issue

Code Sample, a copy-pastable example if possible

import pandas as pd
s = pd.Series(range(10))
s.rolling(0).min()

Problem description

Python crashes instead of raising an Exception

Expected Output

raising an Exception

Output of pd.show_versions()

INSTALLED VERSIONS

commit: None python: 3.6.6.final.0 python-bits: 64 OS: Linux OS-release: 4.15.0-33-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8

pandas: 0.23.4 pytest: None pip: 10.0.1 setuptools: 39.2.0 Cython: None numpy: 1.15.0 scipy: 1.1.0 pyarrow: None xarray: None IPython: 6.4.0 sphinx: None patsy: None dateutil: 2.7.3 pytz: 2018.5 blosc: None bottleneck: None tables: None numexpr: None feather: None matplotlib: 2.2.2 openpyxl: None xlrd: None xlwt: None xlsxwriter: None lxml: None bs4: 4.6.3 html5lib: 1.0.1 sqlalchemy: None pymysql: None psycopg2: None jinja2: 2.10 s3fs: None fastparquet: None pandas_gbq: None pandas_datareader: None

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Rasoricommented, Feb 1, 2021

I could not reproduce the error with latest master on linux.

import pandas as pd
print(pd.__version__)
print(pd.Series(range(10)).rolling(0).min())
import platform; print(platform.uname())

1.3.0.dev0+592.g9c33e5e4f
0   NaN
1   NaN
2   NaN
3   NaN
4   NaN
5   NaN
6   NaN
7   NaN
8   NaN
9   NaN
dtype: float64
uname_result(system='Linux', node='Tupsulakki', release='5.8.0-41-generic', version='#46-Ubuntu SMP Mon Jan 18 16:48:44 UTC 2021', machine='x86_64', processor='x86_64')
0reactions
JannickTiecommented, May 3, 2021

Works fine on Windows with latest master

import pandas as pd
print(pd.__version__)
print(pd.Series(range(10)).rolling(0).min())
import platform; print(platform.uname())

1.3.0.dev0+1501.g70352c2a23
0   NaN
1   NaN
2   NaN
3   NaN
4   NaN
5   NaN
6   NaN
7   NaN
8   NaN
9   NaN
dtype: float64
uname_result(system='Windows', node='Cube', release='10', version='10.0.19041', machine='AMD64', processor='Intel64 Family 6 Model 94 Stepping 3, GenuineIntel')
Read more comments on GitHub >

github_iconTop Results From Across the Web

python crashes with error function takes 2 arguments (3 given)
What I think I'm doing is passing the mouse location as a tuple (and the self argument). Clearly it works on the first...
Read more >
Issue 29327: SystemError or crash in sorted(iterable=[])
sort() doesn't. sorted(iterable=[]) fails on calling internally list.sort(iterable=[]), not when sorted() parses its arguments. The change ...
Read more >
Chapter 5 - Finding Code Smells - Invent with Python
Code that causes a program to crash is obviously wrong, but crashes aren't the only ... and a new function with a parameter...
Read more >
Python Error Handling
What is an exception? An exception is a runtime condition that could cause your program to crash. Almost every modern programming language handles...
Read more >
The 10 Most Common Mistakes That Python Developers Make
Python allows you to specify that a function argument is optional by providing a ... error') except ValueError as e: print('value error') print(e)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found