Raven sends awfully lot of requests' private data (and thereby private data of people) to Sentry, which frankly it mustn't.
Fortunately reimplementing the Connect middleware is not too difficult, but there are bits of data gathering that are not possible to overwrite without changing the source. LINES_OF_CONTEXT that grabs the contents of the source files is one of those bits. If anything, that should be set as a property in some Raven object that would make it possible to disable source sending entirely.
So I agree that there can be improvements to limit the user data that's being sent to Sentry. That is something that at least the main raven-python does.
As far as the LINES_OF_CONTEXT, I disagree. That's something that's pretty core to them all. What is your concern about sending the context lines?
Well, I don't want any source code transmitted off the server. File paths, fine, but no contents.
At the moment this is possible via the dataCallback config option documented here. Specifically look at modifying or removing data.exception.stacktrace, which is an object with a frames property which is an array of frame objects that each look something like:
pre_context: ['previous', 'lines', 'of', 'code'],
context_line: ' throw new Error(\'oh no an error!\');',
post_context: ['following', 'lines', 'of', 'code']
I'll add an item to the roadmap to create a more easily configurable filter to do this like Raven::Processor::RemoveStacktrace from raven-ruby.