As per my comment: https://github.com/rwb27/picamera/commit/4cacb2bdc58a213f8b2683152e3290e54eb94e81#commitcomment-39911271 `memoryview()` creates a different object in Python 2 than in Python 3. Which means in Python 2 it doesn't work in the `with ... as` statement.