Skip to content

Commit fdc7499

Browse files
committed
Fix pyini save process
1 parent f3fc1f5 commit fdc7499

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Uliweb Change Log
3636
* Add `post_do` and `print_sql` function to orm.
3737
* Change `generic/template_files/common/views.py` to `views.py.tmpl`
3838
* Add GenericReference value `(Model, object_id)` support
39+
* Fix pyini save process
3940

4041
0.1.6 Version
4142
-----------------

‎test/test_pyini.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class = 'py'
104104
<BLANKLINE>
105105
>>> x.default.list = ['cde'] #for mutable object will merge the data, including dict type
106106
>>> print x.default.list
107-
['cde', 'abc']
107+
['abc', 'cde']
108108
>>> x.default.d = {'a':'a'}
109109
>>> x.default.d = {'b':'b'}
110110
>>> print x.default.d

‎uliweb/utils/pyini.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,9 @@ def save(self, filename=None):
339339
for s in self.keys():
340340
section = self[s]
341341
section.dumps(f)
342+
343+
if need_close:
344+
f.close()
342345

343346
def __read_line(self, f):
344347
g = tokenize.generate_tokens(f.readline)

0 commit comments

Comments
 (0)