Use tokenize.open for run_checks and add note to TODO

This commit is contained in:
Florian Bruhin 2014-08-07 14:56:27 +02:00
parent 4ff9804f2c
commit 75b4fe9ce2
2 changed files with 4 additions and 1 deletions

View File

@ -55,6 +55,8 @@ Downloads
Improvements / minor features
=============================
- Use tokenize.open where appropriate.
- Add pylint checker to warn on open() without encoding.
- We should have something like utils.debug.qenum_key for QFlags.
- Honour icognito mode for cookies etc.
- Make sure commands in config are _complete_

View File

@ -36,6 +36,7 @@ import os
import os.path
import unittest
import logging
import tokenize
from collections import OrderedDict
try:
@ -186,7 +187,7 @@ def check_vcs_conflict(target):
for (dirpath, _dirnames, filenames) in os.walk(target):
for name in (e for e in filenames if e.endswith('.py')):
fn = os.path.join(dirpath, name)
with open(fn, 'r') as f:
with tokenize.open(fn) as f:
for line in f:
if any(line.startswith(c * 7) for c in '<>=|'):
print("Found conflict marker in {}".format(fn))