IndexError: pop from empty list error
See original GitHub issueHello, I have noticed the following error sometimes.
> git status
# On branch master
nothing to commit (working directory clean)
2015-06-17 19:49:41,251:ERROR:shell:gitstatus:Exception while computing segment: pop from empty list
Traceback (most recent call last):
File "/home/user/.local/lib/python2.7/site-packages/powerline/segment.py", line 173, in process_segment
contents = segment['contents_func'](pl, segment_info)
File "/home/user/.local/lib/python2.7/site-packages/powerline/segment.py", line 412, in <lambda>
contents_func = lambda pl, segment_info: _contents_func(pl=pl, segment_info=segment_info, **args)
File "/home/user/.local/lib/python2.7/site-packages/powerline_gitstatus/segments.py", line 127, in __call__
branch, detached, behind, ahead = self.parse_branch(status.pop(0))
IndexError: pop from empty list
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:14 (7 by maintainers)
Top Results From Across the Web
Index error: pop from empty list - python - Stack Overflow
Your code is trying to pop another element after 'Boy' which does not exist. All you need to fix is: while len(new_list) <=...
Read more >Annoying "IndexError: pop from empty list" : r/learnpython
The objective of the code was for the pop() function to stop at the specific number written below but it doesn't.
Read more >How to Use The Python List pop() Method - AskPython
When using the Python list pop() method, if our list is empty, we cannot pop from it anymore. This will raise an IndexError...
Read more >getting IndexError: pop from empty list error while creating the ...
I gave the input correctly. This happened while building the vgg model. This error is coming in the following line of code. img_features...
Read more >Python .pop() – How to Pop from a List or an Array in Python
By default, if there is no index specified, the pop() method will remove the last item that is contained in the list. This...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is very useful information indeed. I’ve got a much better picture of what’s happening with older versions. I might be able to provide a fix without needing to get hold of such a version. I’ll look into at when I have some time to spare!
I attempted to reproduce the error on Ubuntu 12.04 LTS which shipped git 1.7.9.5, but was unable. The prompt seems to work fine, and the branch name is displayed correctly, even with a
git status --branch --porcelain
command that has no output.Please reopen if this is still an issue that some users are encountering.