Skip to content

Commit

Permalink
Merge pull request #86 from LuminosoInsight/realpath
Browse files Browse the repository at this point in the history
Use os.path.realpath, not os.path.abspath, to detect output filename collision.
  • Loading branch information
Rob Speer committed Jan 8, 2018
2 parents 680b4f8 + 27e78b1 commit bdc6f22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ftfy/cli.py
Expand Up @@ -82,7 +82,7 @@ def main():
if args.output == '-':
outfile = sys.stdout
else:
if os.path.abspath(args.output) == os.path.abspath(args.filename):
if os.path.realpath(args.output) == os.path.realpath(args.filename):
sys.stderr.write(SAME_FILE_ERROR_TEXT)
sys.exit(1)
outfile = open(args.output, 'w', encoding='utf-8')
Expand Down

0 comments on commit bdc6f22

Please sign in to comment.