[issue22826] Support context management protocol in bkfile

2015-03-20 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
resolution:  - fixed
stage: commit review - resolved
status: open - closed

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



[issue22826] Support context management protocol in bkfile

2015-03-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ea8c3166d1c2 by Serhiy Storchaka in branch 'default':
Issue #22826: The result of open() in Tools/freeze/bkfile.py is now better
https://hg.python.org/cpython/rev/ea8c3166d1c2

--
nosy: +python-dev

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



[issue22826] Support context management protocol in bkfile

2015-03-19 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
assignee:  - serhiy.storchaka
stage: patch review - commit review

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



[issue22826] Support context management protocol in bkfile

2014-12-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
keywords: +needs review

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



[issue22826] Support context management protocol in bkfile

2014-12-15 Thread Berker Peksag

Berker Peksag added the comment:

The second patch raises RuntimeError: maximum recursion depth exceeded if the 
target file is exist.

  File /home/berker/projects/cpython/default/Tools/freeze/bkfile.py, line 
18, in close
f.close()
RuntimeError: maximum recursion depth exceeded

--
nosy: +berker.peksag

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



[issue22826] Support context management protocol in bkfile

2014-12-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Good catch Berker. Updated patch fixes recursion issue.

--
Added file: http://bugs.python.org/file37456/bkfile3.patch

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



[issue22826] Support context management protocol in bkfile

2014-11-09 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch makes bkfile (file-like class used in freeze) support the 
context management protocol. This makes bkfile more file-like and makes the use 
of it simpler and more robust.

--
components: Demos and Tools
files: bkfile.diff
keywords: patch
messages: 230888
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Support context management protocol in bkfile
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file37152/bkfile.diff

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



[issue22826] Support context management protocol in bkfile

2014-11-09 Thread Raymond Hettinger

Raymond Hettinger added the comment:

This looks correct and it improves readability.

One nit,  please put the doubled with on a single line instead of using the 
awkward line break (which looks weird with respect to the indentation of the 
with-block):

+with open(config_c_in) as infp, bkfile.open(config_c, 'w') as outfp:

--
nosy: +rhettinger

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



[issue22826] Support context management protocol in bkfile

2014-11-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Raymond. I found my old patch written 5 months ago. It drastically 
simplifies bkfile by using monkey-patching. What approach looks better to you?

--
Added file: http://bugs.python.org/file37157/bkfile2.patch

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