Fixed path escaping for tanks.wq

This commit is contained in:
Paul S. Ferrell 2009-12-16 08:00:10 -07:00
parent 39d7b98852
commit 750e8f4715
2 changed files with 3 additions and 3 deletions

View File

@ -40,7 +40,7 @@ class Pflanzarr:
tmpPlayers = os.listdir(self._playerDir) tmpPlayers = os.listdir(self._playerDir)
players = [] players = []
for p in tmpPlayers: for p in tmpPlayers:
p = unquote(p) p = unquote(p, safe='')
if not (p.startswith('.') or p.endswith('#') or p.endswith('~'))\ if not (p.startswith('.') or p.endswith('#') or p.endswith('~'))\
and p in colors: and p in colors:
players.append(p) players.append(p)
@ -401,7 +401,7 @@ class Pflanzarr:
colors = {} colors = {}
for line in file: for line in file:
try: try:
team, passwd, color = map(unquote, line.split('\t')) team, passwd, color = map(unquote, line.split('\t'),['']*3)
colors[team] = '#%s' % color colors[team] = '#%s' % color
except: except:
colors[team] = errorColor colors[team] = errorColor

View File

@ -49,7 +49,7 @@ if team not in teams.teams:
if passwd != teams.teams[team][0]: if passwd != teams.teams[team][0]:
print('<p>Invalid password.</p>'); done() print('<p>Invalid password.</p>'); done()
path = os.path.join(Config.DATA_PATH, 'ai/players', quote(team) ) path = os.path.join(Config.DATA_PATH, 'ai/players', quote(team, safe='') )
file = open(path, 'w') file = open(path, 'w')
file.write(code) file.write(code)
file.close() file.close()