This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Arfrever
Recipients Arfrever, brett.cannon, eric.snow, ncoghlan
Date 2013-02-18.19:34:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1361216072.99.0.454315860253.issue17222@psf.upfronthosting.co.za>
In-reply-to
Content
py_compile.compile() was always replacing contents of target file, but was not causing that a given link name would refer to a different inode. builtins.open() has correct behavior:

# stat /dev/null
  File: ‘/dev/null’
  Size: 0               Blocks: 0          IO Block: 4096   character special file
Device: 5h/5d   Inode: 3242180     Links: 1     Device type: 1,3
Access: (0666/crw-rw-rw-)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2013-02-18 20:11:07.883986147 +0100
Modify: 2013-02-18 20:11:07.883986147 +0100
Change: 2013-02-18 20:11:07.883986147 +0100
 Birth: -
# python3.4 -c 'null = open("/dev/null", "wb"); null.write(b"abc"); null.close()'
# stat /dev/null
  File: ‘/dev/null’
  Size: 0               Blocks: 0          IO Block: 4096   character special file
Device: 5h/5d   Inode: 3242180     Links: 1     Device type: 1,3
Access: (0666/crw-rw-rw-)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2013-02-18 20:11:07.883986147 +0100
Modify: 2013-02-18 20:11:07.883986147 +0100
Change: 2013-02-18 20:11:07.883986147 +0100
 Birth: -
History
Date User Action Args
2013-02-18 19:34:33Arfreversetrecipients: + Arfrever, brett.cannon, ncoghlan, eric.snow
2013-02-18 19:34:32Arfreversetmessageid: <1361216072.99.0.454315860253.issue17222@psf.upfronthosting.co.za>
2013-02-18 19:34:32Arfreverlinkissue17222 messages
2013-02-18 19:34:32Arfrevercreate