Change by liugang :
--
nosy: +alexandre.vassalotti
___
Python tracker
<https://bugs.python.org/issue37489>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from liugang :
-- code 1
import pickle
class MyException():
def __init__(self, desc, *, item):
super().__init__()
self.desc = desc
self.item = item
def __getnewargs_ex__(self):
print('called in {}.__getnewargs_ex__'.format(self.__class__
liugang added the comment:
# Run in Windows 10
# Code snippet 1
f = open('test', "w+")
f.write('xxx\nyyy\nzzz')
f.seek(0)
f.readline()
print(f.tell()) # 5
x = f.truncate()
print(x) # 13 - why it is 13, not 5?
# Code snippet 2
f = open('test', "w+")
f.write('xxx\n
New submission from liugang :
-- run in Windows 10
1 -
f = open('test', "w+")
f.write('xxx\nyyy\nzzz')
f.seek(0)
f.readline()
print(f.tell()) # output 5 (xxx\r\n)
x = f.truncate()
print(x) # output 13 (xxx\r\nyyy\r\nzzz), why it is 13, not 5?
2 -
f = open('test', "w+
liugang added the comment:
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit
(AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> f = open('e:\\1.txt')
>>> f.readline()
'1\n'
>
New submission from liugang:
D:\Python35\python.exe "D:\PyCharm Community Edition
2016.3\helpers\pydev\pydevconsole.py" 8871 8872
PyDev console: starting.
import sys; print('Python %s on %s' % (sys.version, sys.platform))
sys.path.extend(['C:\\Users\\liugang10\\PycharmProjects\\unti