[issue12004] PyZipFile.writepy gives internal error on syntax errors

2013-01-11 Thread Ben Morgan

Ben Morgan added the comment:

I've sent it again.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12004
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12004] PyZipFile.writepy gives internal error on syntax errors

2012-12-30 Thread Ben Morgan

Ben Morgan added the comment:

Okay, I've emailed a contributor agreement.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12004
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12004] PyZipFile.writepy gives internal error on syntax errors

2011-05-05 Thread Ben Morgan

Ben Morgan benpmor...@gmail.com added the comment:

I've attached a patch to test_zipfile.py. I noticed that it writes out the 
error to stdout not stderr; I don't know if this is the desired behaviour.

--
Added file: http://bugs.python.org/file21903/test-zipfile.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12004
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12004] PyZipFile.writepy gives internal error on syntax errors

2011-05-04 Thread Ben Morgan

New submission from Ben Morgan benpmor...@gmail.com:

PyZipFile.writepy gives internal error on syntax errors in files it processes.

For example, in the attached test case:
Traceback (most recent call last):
  File C:\tfs\SDKS\python\Python32\lib\py_compile.py, line 119, in compile
optimize=optimize)
  File test_zipfile_error_bad_syntax.py, line 1
syntax error
   ^
SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File C:\tfs\SDKS\python\Python32\lib\zipfile.py, line 1393, in _compile
py_compile.compile(file, doraise=True, optimize=optimize)
  File C:\tfs\SDKS\python\Python32\lib\py_compile.py, line 123, in compile
raise py_exc
py_compile.PyCompileError:   File test_zipfile_error_bad_syntax.py, line 1
syntax error
   ^
SyntaxError: invalid syntax


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File test_zipfile_error.py, line 7, in module
pzf.writepy(PYFILE)
  File C:\tfs\SDKS\python\Python32\lib\zipfile.py, line 1376, in writepy
fname, arcname = self._get_codename(pathname[0:-3], basename)
  File C:\tfs\SDKS\python\Python32\lib\zipfile.py, line 1428, in _get_codename

if _compile(file_py):
  File C:\tfs\SDKS\python\Python32\lib\zipfile.py, line 1395, in _compile
print(err.msg)
NameError: global name 'err' is not defined

Around zipfile.py:1395 
in PyZipFile._get_codename _compile
try:
py_compile.compile(file, doraise=True, optimize=optimize)
except py_compile.PyCompileError as error:
print(err.msg)
return False

The print should be printing error.msg not err.msg

--
files: test_zipfile_error.py
messages: 135170
nosy: Ben.Morgan
priority: normal
severity: normal
status: open
title: PyZipFile.writepy gives internal error on syntax errors
type: behavior
Added file: http://bugs.python.org/file21888/test_zipfile_error.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12004
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12004] PyZipFile.writepy gives internal error on syntax errors

2011-05-04 Thread Ben Morgan

Changes by Ben Morgan benpmor...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file21889/pyzipfile-error.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12004
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com