##// END OF EJS Templates
windows.rename: eliminate temp name race (issue2571)...
windows.rename: eliminate temp name race (issue2571) On Windows, os.rename reliably raises OSError with errno.EEXIST if the destination already exists (even on shares served by Samba). Windows does *not* silently overwrite the destination of a rename. So there is no need to first call os.path.exists on the chosen temp path. Trusting os.path.exists is actually harmful, since using it enables the following racy sequence of actions: 1) os.path.exists(temp) returns False 2) some evil other process creates a file with name temp 3) os.rename(dst, temp) now fails because temp has been taken Not using os.path.exists and directly trying os.rename(dst, temp) eliminates this race.

File last commit:

r13194:b549ee32 default
r13206:650314ed stable
Show More
test-doctest.py
20 lines | 502 B | text/x-python | PythonLexer
Mads Kiilerich
tests: fix readline escape characters in output for test-doctest.py
r7041 # this is hack to make sure no escape characters are inserted into the output
Matt Mackall
fix up a bunch of check-code warnings
r10413 import os
Patrick Mezard
test-doctest: remove TERM env variable only if it's there
r7078 if 'TERM' in os.environ:
Dirkjan Ochtman
clean up trailing spaces
r7184 del os.environ['TERM']
Benoit Boissinot
[extendedchangelog] encode/decode function...
r3232 import doctest
import mercurial.changelog
doctest.testmod(mercurial.changelog)
Peter Arrenbrecht
dagparser: parses and formats DAGs as concise text...
r11335 import mercurial.dagparser
Peter Arrenbrecht
debugbuilddag: build a changelog dag from a concise description...
r11337 doctest.testmod(mercurial.dagparser, optionflags=doctest.NORMALIZE_WHITESPACE)
Peter Arrenbrecht
dagparser: parses and formats DAGs as concise text...
r11335
Martin Geisler
match: add narrowmatcher class...
r12165 import mercurial.match
doctest.testmod(mercurial.match)
Mads Kiilerich
test-doctest: test the modules that contains doctests
r12594 import mercurial.url
doctest.testmod(mercurial.url)
Patrick Mezard
convert: fix builtin cvsps under Windows...
r7097 import hgext.convert.cvsps
doctest.testmod(hgext.convert.cvsps)