VScode Platformio Error

Started getting this error today. Simply start VScode, and this comes up instead of the platformio page.

Have removed platformio, then reinstalled.

    exceptions.AttributeError: 'int' object has no attribute 'splitlines'

    C:\Users\aero_\.platformio\packages\contrib-pysite\twisted\web\server.py:199 in process

    198  `                   self._encoder = encoder`

    199  `           self.render(resrc)`

    200  `       except:`

    C:\Users\aero_\.platformio\packages\contrib-pysite\twisted\web\server.py:259 in render

    258  `       try:`

    259  `           body = resrc.render(self)`

    260  `       except UnsupportedMethod as e:`

    C:\Users\aero_\.platformio\packages\contrib-pysite\twisted\web\resource.py:250 in render

    249  `           raise UnsupportedMethod(allowedMethods)`

    250  `       return m(request)`

    251 ``

    <string>:448 in render_GET

    447 ``

    448 ``

    449 ``

    C:\Users\aero_\.platformio\packages\contrib-pysite\twisted\web\http.py:1271 in setHeader

    1270  `       """`

    1271  `       self.responseHeaders.setRawHeaders(name, [value])`

    1272 ``

    C:\Users\aero_\.platformio\packages\contrib-pysite\twisted\web\http_headers.py:220 in setRawHeaders

    219  `       encodedValues = [_sanitizeLinearWhitespace(v)`

    220  `                        for v in self._encodeValues(values)]`

    221 ``

    C:\Users\aero_\.platformio\packages\contrib-pysite\twisted\web\http_headers.py:40 in_sanitizeLinearWhitespace

    39  `   """`

    40  `   return b' '.join(headerComponent.splitlines())`

    41 ``

    exceptions.AttributeError: 'int' object has no attribute 'splitlines'

Any ideas?

Same problem over here. Even the line numbers are the same.
Looks like some sort of an update that went wrong.
I have no idea how to solve this.

3 Likes

Worked like a charm. Thank you!

1 Like

That was also the solution for me.
Thanks.

1 Like

that’s the solution indeed! still attaching a screenshot thinking it might help someone like me who is new to VS code as I struggled a bit searching for “pio update”

2 Likes