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.

IndexError: pop from empty list error

See original GitHub issue

Hello, 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:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jaspernbrouwercommented, Jun 15, 2016

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!

0reactions
jcharaouicommented, Oct 2, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

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