New submission from TitanSnow :
``ConfigParser.write()`` writes a superfluous final blank line.
Example::
import configparser
cp = configparser.ConfigParser()
cp['section1'] = {'key': 'value'}
cp['section2'] = {'key':
TitanSnow added the comment:
**It's not final newline \n !**
Maybe what I said confused. The "final blank line"
does not mean the "final newline char".
It means an extra blank line after last line.
It might be clearer to represent it in a string::
'[secti
TitanSnow added the comment:
Patch updated, included documentation and tests.
--
Added file: https://bugs.python.org/file47461/bpo-32917.patch
___
Python tracker
<https://bugs.python.org/issue32
Change by TitanSnow :
Removed file: https://bugs.python.org/file47460/final_blank_line.patch
___
Python tracker
<https://bugs.python.org/issue32917>
___
___
Python-bug
Change by TitanSnow :
--
pull_requests: +5622
___
Python tracker
<https://bugs.python.org/issue12345>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by TitanSnow :
--
pull_requests: +5621
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue32917>
___
___
Python-bugs-list mai
Change by TitanSnow :
Removed file: https://bugs.python.org/file47461/bpo-32917.patch
___
Python tracker
<https://bugs.python.org/issue32917>
___
___
Python-bugs-list m
TitanSnow added the comment:
Hi Cheryl,
I think you may misunderstand.
What it means is to open URL in
the *same tab*, not *same window*,
which is not described in documentation.
Hi Tommy,
It’s hard to say what is “the same tab”.
Is it the current tab or the tab opened by
last
TitanSnow added the comment:
Yes, I think so.
Maybe, in a web application, to achieve this,
the way is to use a GUI library then use its
web view widget.
--
___
Python tracker
<https://bugs.python.org/issue32
TitanSnow added the comment:
I’m afraid of breaking the backward compatibility.
--
___
Python tracker
<https://bugs.python.org/issue32917>
___
___
Python-bug
TitanSnow added the comment:
If we treat the original behavior as a bug,
it’s much easier to write a patch
that just changes the default behavior
and never outputs a final blank line.
I have looked through the testsuite of it.
It seems that the original author had knew
the final blank line and
New submission from TitanSnow :
``islice()`` does not support negative values for start or stop,
which does not matter for plain iterators.
However, for some cases, we have a sized iterable object
which is not subscriptable, using ``islice()`` makes
code ugly::
d = OrderedDict()
for i
TitanSnow added the comment:
> But I didn't thought that a superfluous final blank line causes any problems.
> What software has a problem with it?
Currently I have not found a program that has problem with
the superfluous final blank line, and I think there won’t be.
> Remo
TitanSnow added the comment:
For the case of sequential writes to the same file,
I think it’s a invalid use case.
The file can be created or modified by
user or other applications, breaking the assume of
ConfigParser. It’s better to have a method to merge
two ConfigParser objects then writes it
Change by TitanSnow :
--
pull_requests: +5816
___
Python tracker
<https://bugs.python.org/issue12345>
___
___
Python-bugs-list mailing list
Unsubscribe:
TitanSnow added the comment:
Now I have thought about it and realized that
it's not suitable for islice.
But there's still a common use case to
drop some elements from the beginning or
ending of a iterable, which is also a main
reason why I wanted islice to support
negative values of
16 matches
Mail list logo