[issue46770] ConfigParser(dict_type=) not behaving as expected

2022-02-17 Thread Cyril Jouve
Cyril Jouve added the comment: you need to pass `strict=False` to ConfigParser : When `strict` is True, the parser won't allow for any section or option duplicates while reading from a single source (file, string or dictionary). Default is True. --

[issue45713] gcc warning when compiling Modules/expat/xmltok_ns.c

2022-02-08 Thread Cyril Jouve
Change by Cyril Jouve : -- keywords: +patch nosy: +Cyril Jouve nosy_count: 2.0 -> 3.0 pull_requests: +29393 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31022 ___ Python tracker <https://bugs.python.org/i

[issue46159] Segfault when using trace functions in 3.11a3

2022-02-08 Thread Cyril Jouve
Cyril Jouve added the comment: this looks related to https://github.com/nedbat/coveragepy/issues/1294 / https://github.com/nedbat/coveragepy/issues/1316 related to binary incompatibility in coverage (6.2) binary wheel built with 3.11alpha2 and running on 3.11alpha3 or later. Latest release

[issue44000] Current PY_VERSION 3.10.0a7+ does not conform to PEP 440

2021-05-01 Thread Cyril Jouve
Cyril Jouve added the comment: sure, I'll raise the issue with poetry then. -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.

[issue44000] Current PY_VERSION 3.10.0a7+ does not conform to PEP 440

2021-05-01 Thread Cyril Jouve
New submission from Cyril Jouve : It was changed from 3.10.0a7 to 3.10.0a7+ in https://github.com/python/cpython/commit/04eecf7fac8bb8d7a19d14cf2009088046956ab5 According to https://www.python.org/dev/peps/pep-0440/#public-version-identifiers, it should be something like 3.10.0a7.post1 or

[issue30988] Exception parsing invalid email address headers starting or ending with dot

2019-11-29 Thread Cyril Nicodème
Cyril Nicodème added the comment: Hi! I confirm this problem too, also with the SMTPUTF8 policy. I was able to reproduce this error on my end (Python v3.7.5). Note that when calling `message_from_bytes` without policy, there is no errors. -- nosy: +cnicodeme

[issue34155] email.utils.parseaddr mistakenly parse an email

2019-07-03 Thread Cyril Nicodème
Cyril Nicodème added the comment: This thread has been really interesting to follow, I'm glad to have opened it :) I would agree with Barry here, it should follow the documentation. BUT, I would suggest to add a "strict" parameter that would throw exceptions depending on th

[issue34155] email.utils.parseaddr mistakenly parse an email

2018-07-19 Thread Cyril Nicodème
New submission from Cyril Nicodème : Hi! I'm trying to parse some emails, and I discovered that email.utils.parseaddr wrongly parse an email. Here's the corresponding header: > From: =?utf-8?Q?z...@redacted.com.cn=E3=82=86=E2=86=91=E3=82=86?= =?utf-8?Q?=E3=82=83=E3=82=85=E3=8

[issue33560] tuple.index() could return a more explicit error message

2018-05-17 Thread Cyril Roelandt
New submission from Cyril Roelandt : The tuple.index() method returns an error message that does not allow users to know what element was being looked for inside the tuple: >>> ().index(1) Traceback (most recent call last): File "", line 1, in ValueError: tuple.index(x):

[issue32732] LoggingAdapter ignores extra kwargs of Logger#log()

2018-03-01 Thread Cyril Martin
Cyril Martin added the comment: Hello Vinay, I strongly disagree with you. In the Python documentation (https://docs.python.org/3/library/logging.html), we can read the following for the debug function: > The third keyword argument is extra which can be used to pass a dictionary > wh

[issue32732] LoggingAdapter ignores extra kwargs of Logger#log()

2018-02-28 Thread Cyril Martin
Cyril Martin added the comment: Hi Stéphane, I ask you a question about the change you suggest. The PR has not progress. Do you wait something from me? -- ___ Python tracker <https://bugs.python.org/issue32

[issue32732] LoggingAdapter ignores extra kwargs of Logger#log()

2018-01-31 Thread Cyril Martin
New submission from Cyril Martin : - LoggerAdapter processes only extra kwargs given during its __init__ So extra kwargs, given to Logger#log are ignored when we configure a LoggerAdapter (same for: debug, info, warning etc). - I expect extras are merged. More precisely, I expect local extra

[issue24850] syslog.syslog() does not return error when unable to send the log

2015-08-12 Thread Cyril Bouthors
New submission from Cyril Bouthors: Hi guys, syslog.syslog() does not report any error when it fails to send messages to syslog. To reproduce: Stop sysglog: sudo /etc/init.d/rsyslog stop Run than Python code: import syslog syslog.syslog('test') It does not fail. Strace shows t

[issue9177] ssl.read/write on closed socket raises AttributeError

2010-07-06 Thread Cyril
New submission from Cyril : This: import socket, ssl s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ssl_sock = ssl.wrap_socket(s) ssl_sock.connect(('www.verisign.com', 443)) ssl_sock.close() ssl_sock.read(1024) raises: Traceback (most recent call last): File "/tmp/b

[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-04-07 Thread Cyril
Cyril added the comment: Here is a patch that implements SSLSocket.get_mode/set_mode, with the SSL_MODE_ENABLE_PARTIAL_WRITE and SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER constants defined in the ssl module. The patch contains a test case and documentation. It's made against trunk 44327 and

[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-31 Thread Cyril
Cyril added the comment: I had a look at how M2Crypto and pyOpenSSL handled this: - M2Crypto has wrappers around SSL_set_mode that let you set the modes you want. From their changelog [1], it was required to be able to operate with Twisted. By default, though, they only set

[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-30 Thread Cyril
Cyril added the comment: > Hmm, indeed. What you can do, very simply, is cache the getvalue() > result once you have generated it. After some thoughts, it's not really an option: my cStringIO.StringIO buffer is, well a buffer. To append data to the buffer, I call buffer.write().

[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-26 Thread Cyril
Cyril added the comment: Switching to a documentation issue is fine to me. Indeed I can just cache the result of StringIO.getvalue(), although it feels a bit crude. I won't be able to create a documentation patch since English is not my primary language. While you're at it, th

[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-26 Thread Cyril
Cyril added the comment: pitrou: that's debatable, since the Python programmer has no control over memory pointers. As I said, I have a cStringIO buffer, and two consecutive calls to buffer.getvalue() yield different objects. What can I do about it? I think it's a rather sane scena

[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-26 Thread Cyril
Cyril added the comment: r.david.murray: ah, sure :) However, I'm not sure a test case is absolutely required for this issue for two reasons: - the fix is trivial: it's a one-liner that enables a SSL mode that explicitely authorizes SSL_write to be called a second time with a a

[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-26 Thread Cyril
Cyril added the comment: I forgot to talk about the conditions in which I stumbled upon that bug. I use a cStringIO.StringIO as a send buffer. When the socket is ready to send data, I call ssl_socket.send(send_buffer.getvalue()). Unfortunately, two consecutive calls to send_buffer.getvalue

[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-26 Thread Cyril
Cyril added the comment: You're right about the assert, I've just uploaded a new patch. In non-blocking mode, ssl_socket.send(data) will return either 0 (which means nothing was sent, you'll have to try again), or len(data) when everything was sent. It can't return anyt

[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-26 Thread Cyril
Cyril added the comment: The following test case exhibits the bug, but I'm not sure it will fail every time as it depends on 2 things: - your connection speed (I guess) - I used the following trick to have 2 identical strings with a different id (memory address): data = (('xx&#x

[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

2010-03-26 Thread Cyril
New submission from Cyril : ssl.SSLSocket.write on non-blocking sockets will fail with: _ssl.c:1217: error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry on a write retry, if the buffer address has changed between the initial call and the retry (when the initial call returned 0