[issue37489] pickling instance which inherited from Exception with keyword only parameter

2019-07-03 Thread liugang
Change by liugang : -- nosy: +alexandre.vassalotti ___ Python tracker <https://bugs.python.org/issue37489> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37489] pickling instance which inherited from Exception with keyword only parameter

2019-07-02 Thread liugang
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__

[issue35304] The return of truncate(size=None) (file io) is unexpected

2018-11-23 Thread liugang
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

[issue35304] The return of truncate(size=None) (file io) is unexpected

2018-11-23 Thread liugang
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+

[issue28804] file tell() report incorrect file position on Windows (but Linux is OK)

2016-11-25 Thread liugang
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' >

[issue28804] file tell() report incorrect file position (Windows, Linux is OK)

2016-11-25 Thread liugang
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