Use non-empty file in checkwrite. Improve checkwrite messages.
enforce str to encoded_rquest return
Merge pull request #4171 from AndresTanasijczuk/checkwrite

Use non-empty file in checkwrite. Improve checkwrite messages.
Merge pull request #4170 from qunox/enforcestr

enforce str to encoded_rquest return