Python finding next word permutation with function generator
1. Review


The name nextperm is misleading as (i) it generates permutations that precede its argument; (ii) it generates multiple permutations, not just one. So a name like preceding_permutations would be clearer.
There is no need for try: ... finally: or raise StopIteration or return. If we try to get additional values from a generator that has finished, then Python automatically raises StopIteration. For example:

&gt;&gt;&gt; def generator():
...     yield 1
&gt;&gt;&gt; g = generator()
&gt;&gt;&gt; next(g)
1
&gt;&gt;&gt; next(g)
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
StopIteration

It's not necessary to convert word to a list on each iteration of the while loop, because on subsequent iterations we already have this list in the variable wordlist.
All the permutations are the same length, so it is not necessary to reassign length on each loop.
This loop goes all the way down to index_1:

for index_2 in range(length, index_1-1, -1):


But when index_2 == index_1, the condition wordlist[index_2] &lt; wordlist[index_1] can never be true. So this iteration is wasted. It would be better to write the second loop like this:

for index_2 in range(length, index_1, -1):

Reversed ranges are quite tricky to reason about, and this kind of mistake is easy to make, so we should consider using reversed instead to make things simpler:

for index_2 in reversed(range(index_1 + 1, length + 1)):


(And similarly for index_1.)
When I read the name "length", I expect this to be the length of the word, not the length of the word minus one. So it would be easier to follow the logic if we had length = len(wordlist), and adjusted the ranges accordingly.
The code reverses the last part of wordlist, leaving the first part unchanged:

_first = wordlist[0:index_1+1]
_second = wordlist[-1:index_1:-1]
wordlist = _first + _second


It would make sense to implement this using a slice assignment:

wordlist[index_1 + 1:] = reversed(wordlist[index_1 + 1:])


This has several advantages: we avoid having to take the slice for the first part of the list, we reuse the memory in wordlist, and the use of reversed makes it clear what is happenig and reduces the risk of getting the slice indexes wrong.
The names index_1 and index_2 are used a lot: it would shorten the code and make it easier to read if we had names like i and j.
The stoploop logic can be removed if we introduce a local function that generates pairs of indexes:

def indexes():
    for i in reversed(range(length - 1)):
        for j in reversed(range(i + 1, length)):
            yield i, j


Now the two loops over the indexes can be combined into one:

for i, j in indexes():


and since we now have a single loop, we can break out of it using break, with no need for stoploop.


2. Revised code

def preceding_permutations(word):
    """Generate the permutations of word that precede it, in reverse
    lexicographical order.

    &gt;&gt;&gt; ' '.join(preceding_permutations('bdca'))
    'bdac bcda bcad badc bacd adcb adbc acdb acbd abdc abcd'

    """
    word = list(word)
    length = len(word)
    def indexes():
        for i in reversed(range(length - 1)):
            for j in reversed(range(i + 1, length)):
                yield i, j
    while True:
        for i, j in indexes():
            if word[j] &lt; word[i]:
                word[j], word[i] = word[i], word[j]
                word[i + 1:] = reversed(word[i + 1:])
                yield ''.join(word)
                break
        else:
            break