From 5a4c2f520fbef7532e5935f4b2da38b1dfb406db Mon Sep 17 00:00:00 2001 From: hernani Date: Fri, 11 Jun 2010 14:24:24 +0000 Subject: [PATCH] Fixes a python < 2.6 compatibility issue in the importer. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@407 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum_modules/sximporter/views.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/forum_modules/sximporter/views.py b/forum_modules/sximporter/views.py index 76bc8e4..95e6826 100644 --- a/forum_modules/sximporter/views.py +++ b/forum_modules/sximporter/views.py @@ -12,9 +12,15 @@ def sximporter(request): dump = ZipFile(request.FILES['dump']) members = [f for f in dump.namelist() if f.endswith('.xml')] extract_to = os.path.join(os.path.dirname(__file__), 'tmp') - dump.extractall(extract_to, members) - importer.sximport(extract_to, request.POST) + + for m in members: + f = open(os.path.join(extract_to, m), 'w') + f.write(dump.read(m)) + f.close() + + #dump.extractall(extract_to, members) dump.close() + importer.sximport(extract_to, request.POST) return render_to_response('modules/sximporter/page.html', { 'names': list -- 2.39.5