Workaround for logging bug in Python < 2.7.
Workaround for logging bug in Python < 2.7.

At program exit logging module calls flush for streams it has
intercepted without looking are they already closed. In Python 2.7
resulting ValueError is silenced, but the error and traceback gets
logged to the console with earlier versions.

We avoid the error by replacing flush method of StringIOs we've used
with a no-op lambda. Earlier the error was silenced because we set
logging.raiseExceptions to False, but nowadays such logging config is
disabled after tests are run. This finally fixes #1821.

Also added an unrelated comment to not-so-obvious code.

nmrao/robotframework,rwarren14/robotframework,Colorfulstan/robotframework,xiaokeng/robotframework,alexandrul-ci/robotframework,robotframework/robotframework,yahman72/robotframework,jorik041/robotframework,kurtdawg24/robotframework,dkentw/robotframework,wojciechtanski/robotframework,synsun/robotframework,snyderr/robotframework,nmrao/robotframework,fingeronthebutton/robotframework,snyderr/robotframework,yahman72/robotframework,kyle1986/robortframe,wojciechtanski/robotframework,JackNokia/robotframework,stasiek/robotframework,dkentw/robotframework,dkentw/robotframework,userzimmermann/robotframework,jaloren/robotframework,ChrisHirsch/robotframework,joongh/robotframework,ChrisHirsch/robotframework,Colorfulstan/robotframework,JackNokia/robotframework,ashishdeshpande/robotframework,moto-timo/robotframework,un33k/robotframework,joongh/robotframework,wojciechtanski/robotframework,jorik041/robotframework,yonglehou/robotframework,suvarnaraju/robotframework,ashishdeshpande/robotframework,fingeronthebutton/robotframework,jaloren/robotframework,joongh/robotframework,jorik041/robotframework,kyle1986/robortframe,xiaokeng/robotframework,yahman72/robotframework,fingeronthebutton/robotframework,ashishdeshpande/robotframework,synsun/robotframework,moto-timo/robotframework,moto-timo/robotframework,snyderr/robotframework,jaloren/robotframework,SivagnanamCiena/robotframework,edbrannin/robotframework,HelioGuilherme66/robotframework,rwarren14/robotframework,suvarnaraju/robotframework,dkentw/robotframework,un33k/robotframework,edbrannin/robotframework,alexandrul-ci/robotframework,JackNokia/robotframework,yonglehou/robotframework,Colorfulstan/robotframework,alexandrul-ci/robotframework,un33k/robotframework,fingeronthebutton/robotframework,xiaokeng/robotframework,fingeronthebutton/robotframework,moto-timo/robotframework,ChrisHirsch/robotframework,nmrao/robotframework,edbrannin/robotframework,edbrannin/robotframework,userzimmermann/robotframework,joongh/robotframework,xiaokeng/robotframework,ashishdeshpande/robotframework,alexandrul-ci/robotframework,ashishdeshpande/robotframework,kyle1986/robortframe,HelioGuilherme66/robotframework,yonglehou/robotframework,stasiek/robotframework,rwarren14/robotframework,yonglehou/robotframework,suvarnaraju/robotframework,kyle1986/robortframe,SivagnanamCiena/robotframework,jorik041/robotframework,SivagnanamCiena/robotframework,un33k/robotframework,un33k/robotframework,nmrao/robotframework,SivagnanamCiena/robotframework,stasiek/robotframework,jorik041/robotframework,synsun/robotframework,stasiek/robotframework,Colorfulstan/robotframework,rwarren14/robotframework,edbrannin/robotframework,ChrisHirsch/robotframework,joongh/robotframework,robotframework/robotframework,moto-timo/robotframework,ChrisHirsch/robotframework,nmrao/robotframework,robotframework/robotframework,JackNokia/robotframework,rwarren14/robotframework,wojciechtanski/robotframework,yonglehou/robotframework,userzimmermann/robotframework,SivagnanamCiena/robotframework,suvarnaraju/robotframework,xiaokeng/robotframework,kurtdawg24/robotframework,alexandrul-ci/robotframework,kurtdawg24/robotframework,synsun/robotframework,HelioGuilherme66/robotframework,yahman72/robotframework,suvarnaraju/robotframework,jaloren/robotframework,Colorfulstan/robotframework,kurtdawg24/robotframework,stasiek/robotframework,kyle1986/robortframe,kurtdawg24/robotframework,JackNokia/robotframework,wojciechtanski/robotframework,snyderr/robotframework,snyderr/robotframework,dkentw/robotframework,userzimmermann/robotframework,jaloren/robotframework,userzimmermann/robotframework,yahman72/robotframework,synsun/robotframework