On 2019-03-07 17:19, tony wrote:
> Python 3.5.3 (default, Sep 27 2018, 17:25:39)
> >>> "a\\nb".decode("string-escape")
> Traceback (most recent call last):
> File "", line 1, in
> AttributeError: 'str' object has no attribute 'decode'
Looks like bytestring.decode('unicode_escape') does what y
On Thursday, March 7, 2019 at 10:38:03 AM UTC-6, jim.wo...@gmail.com wrote:
> On Saturday, October 1, 2016 at 9:57:24 AM UTC-5, Thorsten Kampe wrote:
> > Hi,
> >
> > ConfigParser escapes `\n` in ini values as `\\n`. Is there a way to
> > signal to ConfigParser that there is a line break?
> >
> >
On Saturday, October 1, 2016 at 9:57:24 AM UTC-5, Thorsten Kampe wrote:
> Hi,
>
> ConfigParser escapes `\n` in ini values as `\\n`. Is there a way to
> signal to ConfigParser that there is a line break?
>
> Thorsten
And now we know!
I think they should have named Python 3 something else
--
htt
On 07/03/2019 16:58, jim.womeld...@gmail.com wrote:
> On Thursday, March 7, 2019 at 8:55:31 AM UTC-6, tony wrote:
>> On 07/03/2019 14:16, jim.womeld...@gmail.com wrote:
>>> On Saturday, October 1, 2016 at 7:41:40 PM UTC-5, Ned Batchelder wrote:
On Saturday, October 1, 2016 at 6:25:16 PM UTC-4,
tony wrote:
>> On Saturday, October 1, 2016 at 7:41:40 PM UTC-5, Ned Batchelder wrote:
>>> If you want to have \n mean a newline in your config file, you can
>>> do the conversion after you read the value:
>>>
>>> >>> "a\\nb".decode("string-escape")
>>> 'a\nb'
> How does that translate t
On Thursday, March 7, 2019 at 8:55:31 AM UTC-6, tony wrote:
> On 07/03/2019 14:16, jim.womeld...@gmail.com wrote:
> > On Saturday, October 1, 2016 at 7:41:40 PM UTC-5, Ned Batchelder wrote:
> >> On Saturday, October 1, 2016 at 6:25:16 PM UTC-4, Thorsten Kampe wrote:
> >>> * Ben Finney (Sun, 02 Oct
On 07/03/2019 14:16, jim.womeld...@gmail.com wrote:
> On Saturday, October 1, 2016 at 7:41:40 PM UTC-5, Ned Batchelder wrote:
>> On Saturday, October 1, 2016 at 6:25:16 PM UTC-4, Thorsten Kampe wrote:
>>> * Ben Finney (Sun, 02 Oct 2016 07:12:46 +1100)
Thorsten Kampe writes:
> Co
On Saturday, October 1, 2016 at 7:41:40 PM UTC-5, Ned Batchelder wrote:
> On Saturday, October 1, 2016 at 6:25:16 PM UTC-4, Thorsten Kampe wrote:
> > * Ben Finney (Sun, 02 Oct 2016 07:12:46 +1100)
> > >
> > > Thorsten Kampe writes:
> > >
> > > > ConfigParser escapes `\n` in ini values as `\\n`.
Thorsten Kampe wrote:
> * Ned Batchelder (Sat, 1 Oct 2016 17:41:28 -0700 (PDT))
>> If you want to have \n mean a newline in your config file, you can
>> do the conversion after you read the value:
>>
>> >>> "a\\nb".decode("string-escape")
>> 'a\nb'
>
> Interesting approach (although it
On Sun, Oct 2, 2016 at 9:34 PM, Thorsten Kampe
wrote:
>> If you want to have \n mean a newline in your config file, you can
>> do the conversion after you read the value:
>>
>> >>> "a\\nb".decode("string-escape")
>> 'a\nb'
>
> Interesting approach (although it does not work with Python 3:
* Ned Batchelder (Sat, 1 Oct 2016 17:41:28 -0700 (PDT))
>
> On Saturday, October 1, 2016 at 6:25:16 PM UTC-4, Thorsten Kampe wrote:
> > * Ben Finney (Sun, 02 Oct 2016 07:12:46 +1100)
> > >
> > > Thorsten Kampe writes:
> > >
> > > > ConfigParser escapes `\n` in ini values as `\\n`.
> >
> > Inde
On Saturday, October 1, 2016 at 6:25:16 PM UTC-4, Thorsten Kampe wrote:
> * Ben Finney (Sun, 02 Oct 2016 07:12:46 +1100)
> >
> > Thorsten Kampe writes:
> >
> > > ConfigParser escapes `\n` in ini values as `\\n`.
>
> Indenting solves the problem. I'd rather keep it one line per value
> but it s
* Ben Finney (Sun, 02 Oct 2016 07:12:46 +1100)
>
> Thorsten Kampe writes:
>
> > ConfigParser escapes `\n` in ini values as `\\n`.
Indenting solves the problem. I'd rather keep it one line per value
but it solves the problem.
Thorsten
--
https://mail.python.org/mailman/listinfo/python-list
* Terry Reedy (Sat, 1 Oct 2016 15:44:39 -0400)
>
> On 10/1/2016 10:56 AM, Thorsten Kampe wrote:
>
> > ConfigParser escapes `\n` in ini values as `\\n`. Is there a way to
> > signal to ConfigParser that there is a line break?
>
> Without an example or two, I don't really understand the question e
Thorsten Kampe writes:
> ConfigParser escapes `\n` in ini values as `\\n`.
How do you demonstrate that?
Here is an example text of a config file::
>>> import io
>>> import textwrap
>>> config_text = textwrap.dedent(r"""
... [foo]
... wibble = Lorem\nipsum.
...
On 10/1/2016 10:56 AM, Thorsten Kampe wrote:
ConfigParser escapes `\n` in ini values as `\\n`. Is there a way to
signal to ConfigParser that there is a line break?
Without an example or two, I don't really understand the question enough
to answer.
--
Terry Jan Reedy
--
https://mail.python.
Hi,
ConfigParser escapes `\n` in ini values as `\\n`. Is there a way to
signal to ConfigParser that there is a line break?
Thorsten
--
https://mail.python.org/mailman/listinfo/python-list
17 matches
Mail list logo