[pypy-issue] [issue1756] inconsistent with CPython when writing to a truncated file

houqp tracker at bugs.pypy.org
Wed May 7 02:52:22 CEST 2014


New submission from houqp <dave2008713+pypy.tracker at gmail.com>:

Hi PyPy dev,

I run into following inconsistent behaviour between CPython and PyPy.

This is what I got from pypy:

```
>>>> f = open('/tmp/foo', 'a+')
>>>> f.write('123')
>>>> f.truncate(0)
>>>> f.write('1')
>>>> f.close()
>>>> open('/tmp/foo', 'r').read()
'\x00\x00\x00\x001'
```

While in Python 2.6, 2.7, I got '1' instead.

----------
messages: 6851
nosy: dave2008, pypy-issue
priority: bug
status: unread
title: inconsistent with CPython when writing to a truncated file

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1756>
________________________________________


More information about the pypy-issue mailing list