Skip to content

Commit 7ca4461

Browse files
committed
limnoria_test: Escape Windows' \ in paths
1 parent 3d4adb1 commit 7ca4461

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/scripts/limnoria_test.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
###
44
# Copyright (c) 2002-2005, Jeremiah Fincher
55
# Copyright (c) 2011, James McCoy
6-
# Copyright (c) 2010-2021, Valentin Lorentz
6+
# Copyright (c) 2010-2026, Valentin Lorentz
77
# All rights reserved.
88
#
99
# Redistribution and use in source and binary forms, with or without
@@ -34,6 +34,7 @@
3434
import os
3535
import sys
3636
import time
37+
import codecs
3738
import shutil
3839
import fnmatch
3940
from tempfile import TemporaryDirectory
@@ -50,6 +51,8 @@
5051
os.makedirs(os.path.join(main_temp_dir.name, 'data'))
5152
os.makedirs(os.path.join(main_temp_dir.name, 'logs'))
5253

54+
encoder = codecs.getencoder("unicode_escape")
55+
5356
registryFilename = os.path.join(main_temp_dir.name, 'conf', 'test.conf')
5457
with open(registryFilename, 'w') as fd:
5558
fd.write("""
@@ -72,9 +75,9 @@
7275
supybot.nick: test
7376
supybot.databases.users.allowUnregistration: True
7477
""".format(
75-
temp_conf=os.path.join(main_temp_dir.name, 'conf'),
76-
temp_data=os.path.join(main_temp_dir.name, 'data'),
77-
temp_logs=os.path.join(main_temp_dir.name, 'logs')
78+
temp_conf=encoder(os.path.join(main_temp_dir.name, 'conf'))[0].decode(),
79+
temp_data=encoder(os.path.join(main_temp_dir.name, 'data'))[0].decode(),
80+
temp_logs=encoder(os.path.join(main_temp_dir.name, 'logs'))[0].decode(),
7881
))
7982

8083
import supybot.registry as registry

0 commit comments

Comments
 (0)