[issue32655] File mode should be a constant

2019-05-30 Thread Berker Peksag
Berker Peksag added the comment: Changing the value of mode also changes its repr. This seems like a bug to me. It's probably too late to change TextIOWrapper.__repr__(). I think this needs to be discussed on python-dev first. >>> f = open("README.rst") >>> f <_io.TextIOWrapper

[issue32655] File mode should be a constant

2018-01-25 Thread Nitish
Nitish added the comment: It appears some files like Lib/tokenize.py changes the mode of TextIOWrapper: text = TextIOWrapper(buffer, encoding, line_buffering=True) text.mode = 'r' setting of mode via _PyObject_SetAttrId(wrapper, _mode, modeobj) is done

[issue32655] File mode should be a constant

2018-01-24 Thread R. David Murray
R. David Murray added the comment: That isn't a bug. Python doesn't protect you from doing the wrong thing, in general. On the other hand, it might be a worthwhile improvement to make it read-only in this case. Especially since, as you point out, other seemingly

[issue32655] File mode should be a constant

2018-01-24 Thread Марат Нагаев
New submission from Марат Нагаев : Hey guys, I find bug in Python. If you'll try to file stream using open function you can edit file mode: Watch git: https://gist.github.com/nagayev/7d17ead7b3bc2b06f2445fb5d9122a5c In fact,mode don't changed,so mode shoul be constant