Question: I have a Laravel 5.1 install that I am upgrading. I meticulously followed the instructions available at <https://laravel.com/docs/5.3/upgrade#upgrade-5.2.0> for the upgrade, including removing **Illuminate\Foundation\Providers\ArtisanServiceProvider** and **Illuminate\Routing\ControllerServiceProvider** from the *config/app.php* file (I am stressing this point, as googling for this issue has suggested this in every response).

Despite this, I am still getting this error when I run composer *cache:clear*

```
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'Illuminate\Routing\ControllerServiceProvider' not found error 

```

and see this error in my browser:

```
FatalThrowableError in ProviderRepository.php line 146:
Class 'Illuminate\Routing\ControllerServiceProvider' not found

```

Thinking that perhaps references to these classes were being cached, I checked *bootstrap/cache/services.json* and removed the references from there as well and then ran composer dump-autoload but I am still getting this error.

I also made sure to copy over example *config/app.php* from Laravel 5.2 clean install example here: <https://raw.githubusercontent.com/ziyed/Laravel-5.2/master/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php>

I have read through the similar threads on StackOverflow and Laracast and tried tried to use the advice contained inside, but nothing seems to work.

Any help would be greatly appreciated. For reference, my dev setup is running on a local XAMPP stack under a Windows 10 OS. The other environments are remote, using a traditional LAMP stack with Amazon Linux 2. I was trying to do the upgrade locally.

Answer: 
You are operating on lines, not words, since iterating over `sys.stdin` will give you strings that consist of each line of text that you input. So your logic won't be capitalizing individual words.

There is nothing wrong with your logic for capitalizing the last character of a string. The reason that you are not seeming to capitalize the end of the line is that there's an EOL character at the end of the line. The capitalization of EOL is EOL, so nothing is changed.

If you call `strip()` on the input line before you process it, you'll see the last character capitalized:

```
import sys
for s in sys.stdin:
    s = s.strip()
    s = s[0:1].upper() + s[1:len(s)-1] + s[len(s)-1:len(s)].upper()
    print(s)

```

@Calculuswhiz's answer shows you how to deal with capitalizing each word in your input.
You first have to split the line of stdin, then you can operate on each word using a `map` function. Without splitting, the stdin is only read line by line in the `for` loop.

```
#!/usr/bin/python
import sys

def capitalize(t):
    # Don't want to double print single character
    if len(t) is 1:
      return t.upper()
    else:
      return t[0].upper() + t[1:-1] + t[-1].upper()

for s in sys.stdin:
    splitLine = s.split()
    l = map(capitalize, splitLine)
    print(' '.join(l))

```

[Try it online!](https://tio.run/##XVBBTsMwELz7FYN6SCIgpeJWiRtHfoB6cOINWeTaxt4Ilc@HTQJUwhfPzM6OvZsuMsbwOM@7m/1U8r7jsE@rZvicYhaUSzHG0YDeJhbr@YtqaY4GenZ4jqESfNogkAgXp84TUmblhcObkn602fZCee3gAZ6CBoALDlsKkEmmHCDtlBLlulll8oX@G14fTr8e3Co9HO8PpxXp/ddthphRwGH5fFvEcdiCSvIsLxwIT9DCwn4e86qcbaqvQ95d3ZtlnaquULXvkUPtm8bMs4yEgcuoKyhw5BdogwOLxjnCx8RCsHBaMIu5s7pTBd8 "Python 3 – Try It Online")