[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2021-09-02 Thread Mickaël Schoentgen

Mickaël Schoentgen  added the comment:

I am wondering why the change was not backported to 3.6 and 3.7?
It introduces different behavior.

For instance, I need to keep duplicate keys from JSON data (because it is 
allowed by the RFC and it is a missing feature for tools such like HTTPie).

Have a look at repro-sorting.py.

On Python 3.6 and 3.7, the output is not sorted:

{
"dps": {
"1630064726": 5.0,
"1630064726": 3.0,
"1630064726": 6.0
}
}

Starting with Python 3.8, the output is sorted as expected:

{
"dps": {
"1630064726": 3.0,
"1630064726": 5.0,
"1630064726": 6.0
}
}

I could open pull requests for both 3.6 and 3.7 branches, if you think it is 
worth and allowed by the current maintenance status.

--
nosy: +Tiger-222
Added file: https://bugs.python.org/file50256/repro-sorting.py

___
Python tracker 
<https://bugs.python.org/issue23493>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42108] HTTPSConnection hangs forever when the percentage completed of the upload drops from 100 to 0

2020-11-05 Thread Mickaël Schoentgen

Change by Mickaël Schoentgen :


--
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue42108>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42108] HTTPSConnection hangs forever when the percentage completed of the upload drops from 100 to 0

2020-11-05 Thread Mickaël Schoentgen

Mickaël Schoentgen  added the comment:

So, after several weeks we found the issue. And it is not related to Python but 
a missing TCP keep alive option not set.

--
resolution:  -> not a bug

___
Python tracker 
<https://bugs.python.org/issue42108>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42108] HTTPSConnection hangs forever when the percentage completed of the upload drops from 100 to 0

2020-10-21 Thread Mickaël Schoentgen

New submission from Mickaël Schoentgen :

I will try to summarize my findings. I do not think having real data is 
revelant here, it seems to be a behavior issue.

I was originally using the `requests` module to `POST` some small data. The 
server will then do its stuff and it would take about 5 minutes to really 
complete. But for some reason, that call never ends.

I tried to isolate the "bad" code and tried more specific code: I reproduced 
the issue with `urllib3`, and then with `http.client.HTTPSConnection()`. I did 
not manage to go lower than that, but I may be able to try some C code with 
some help.

After having traced the script using `http.client.HTTPSConnection()`, the code 
is blocked at the `count = SSL_read(self->ssl, mem, len);` call [1].

This is it for the Python side.


Then, I translated the HTTP request to a cURL command (using the same machine, 
with the same headers and `POST` data). Surprisingly, atfer ~5 minutes, the 
call ended successfully.

Here is the verbose output of cURL:

  100   1040 0  100   104  0217 --:--:-- --:--:-- --:--:--   216
  100   1040 0  100   104  0 70  0:00:01  0:00:01 --:--:--70
  100   1040 0  100   104  0 41  0:00:02  0:00:02 --:--:--41
  100   1040 0  100   104  0 29  0:00:03  0:00:03 --:--:--29
  100   1040 0  100   104  0 23  0:00:04  0:00:04 --:--:--23
  100   1040 0  100   104  0 18  0:00:05  0:00:05 --:--:-- 0
  100   1040 0  100   104  0 15  0:00:06  0:00:06 --:--:-- 0
  100   1040 0  100   104  0 13  0:00:08  0:00:07  0:00:01 0
  100   1040 0  100   104  0 12  0:00:08  0:00:08 --:--:-- 0
  100   1040 0  100   104  0 10  0:00:10  0:00:09  0:00:01 0
  100   1040 0  100   104  0  9  0:00:11  0:00:10  0:00:01 0
  100   1040 0  100   104  0  9  0:00:11  0:00:11 --:--:-- 0
  100   1040 0  100   104  0  8  0:00:13  0:00:12  0:00:01 0
  100   1040 0  100   104  0  7  0:00:14  0:00:13  0:00:01 0
  100   1040 0  100   104  0  7  0:00:14  0:00:14 --:--:-- 0
  100   1040 0  100   104  0  6  0:00:17  0:00:15  0:00:02 0
  100   1040 0  100   104  0  6  0:00:17  0:00:16  0:00:01 0
  100   1040 0  100   104  0  5  0:00:20  0:00:17  0:00:03 0
  100   1040 0  100   104  0  5  0:00:20  0:00:18  0:00:02 0
  100   1040 0  100   104  0  5  0:00:20  0:00:19  0:00:01 0
  100   1040 0  100   104  0  5  0:00:20  0:00:20 --:--:-- 0
  100   1040 0  100   104  0  4  0:00:26  0:00:21  0:00:05 0
  100   1040 0  100   104  0  4  0:00:26  0:00:22  0:00:04 0
  100   1040 0  100   104  0  4  0:00:26  0:00:23  0:00:03 0
  100   1040 0  100   104  0  4  0:00:26  0:00:24  0:00:02 0
  100   1040 0  100   104  0  4  0:00:26  0:00:25  0:00:01 0
  100   1040 0  100   104  0  3  0:00:34  0:00:26  0:00:08 0
  100   1040 0  100   104  0  3  0:00:34  0:00:27  0:00:07 0
  100   1040 0  100   104  0  3  0:00:34  0:00:28  0:00:06 0
  100   1040 0  100   104  0  3  0:00:34  0:00:29  0:00:05 0
  100   1040 0  100   104  0  3  0:00:34  0:00:30  0:00:04 0
  100   1040 0  100   104  0  3  0:00:34  0:00:31  0:00:03 0
  100   1040 0  100   104  0  3  0:00:34  0:00:32  0:00:02 0
  100   1040 0  100   104  0  3  0:00:34  0:00:33  0:00:01 0
  100   1040 0  100   104  0  3  0:00:34  0:00:34 --:--:-- 0
  100   1040 0  100   104  0  2  0:00:52  0:00:35  0:00:17 0
  100   1040 0  100   104  0  2  0:00:52  0:00:36  0:00:16 0
  100   1040 0  100   104  0  2  0:00:52  0:00:37  0:00:15 0
  100   1040 0  100   104  0  2  0:00:52  0:00:38  0:00:14 0
  100   1040 0  100   104  0  2  0:00:52  0:00:39  0:00:13 0
  100   1040 0  100   104  0  2  0:00:52  0:00:40  0:00:12 0
  100   1040 0  100   104  0  2  0:00:52  0:00:41  0:00:11 0
  100   1040 0  100   104  0  2  0:00:52  0:00:42  0:00:10 0
  100   1040 0  100   104  0  2  0:00:52  0:00:43  0:00:09 0
  100   1040 0  100   104  0  2  0:00:52  0:00:44  0:00:08 0
  100   1040 0  100   104  0  2  0:00:52  0:00:45  0:00:07 0
  100   1040 0  100   104  0  2  0:00:52  0:00:46  0:00:06 0
  100   1040 0  100   104  0  2  0:00:52  0:00:47  0:00:05 0
  100   1040 0  100   104  0  2  0:00:52  0:00:48  0:00:0

[issue26185] zipfile.ZipInfo slots can raise unexpected AttributeError

2020-08-02 Thread Mickaël Schoentgen

Mickaël Schoentgen  added the comment:

The ticket could be closed, right? The fix was merged quite some time ago.

--
nosy: +Tiger-222

___
Python tracker 
<https://bugs.python.org/issue26185>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18378] locale.getdefaultlocale() fails on Mac OS X with default language set to English

2019-07-23 Thread Mickaël Schoentgen

Change by Mickaël Schoentgen :


--
nosy: +Tiger-222

___
Python tracker 
<https://bugs.python.org/issue18378>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25998] doctest terminates when accessing __wrapped__ raises an error

2019-07-13 Thread Mickaël Schoentgen

Mickaël Schoentgen  added the comment:

Attached a simple reproduction script.

--
Added file: https://bugs.python.org/file48477/unwrapable_ob.py

___
Python tracker 
<https://bugs.python.org/issue25998>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25998] doctest terminates when accessing __wrapped__ raises an error

2019-07-13 Thread Mickaël Schoentgen

Change by Mickaël Schoentgen :


--
keywords: +patch
pull_requests: +14551
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/14756

___
Python tracker 
<https://bugs.python.org/issue25998>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25998] doctest terminates when accessing __wrapped__ raises an error

2019-07-13 Thread Mickaël Schoentgen

Mickaël Schoentgen  added the comment:

Working on it at EuroPython 2019.

FTR I tested on Python 3.6.9, 3.7.4 and 3.9.0a0 without issue.
I think this was fixed with 
https://github.com/rtweeks/werkzeug/commit/c643980b93e9bde4431cd99ece30f07e00160f84.

But the doctest issue remains and this is on what I will focus.

--
nosy: +Tiger-222

___
Python tracker 
<https://bugs.python.org/issue25998>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26185] zipfile.ZipInfo slots can raise unexpected AttributeError

2019-05-20 Thread Mickaël Schoentgen

Change by Mickaël Schoentgen :


--
pull_requests: +13350

___
Python tracker 
<https://bugs.python.org/issue26185>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36439] Inconsistencies with datetime.fromtimestamp(t) when t < 0

2019-03-26 Thread Mickaël Schoentgen

Change by Mickaël Schoentgen :


--
title: OSes inconsistency whith datetime.fromtimestamp(t) when t < 0 -> 
Inconsistencies with datetime.fromtimestamp(t) when t < 0

___
Python tracker 
<https://bugs.python.org/issue36439>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36439] OSes inconsistency whith datetime.fromtimestamp(t) when t < 0

2019-03-26 Thread Mickaël Schoentgen

Change by Mickaël Schoentgen :


--
title: [Windows] datetime.fromtimestamp(t) when t < 0 fails on Python 3.6 -> 
OSes inconsistency whith datetime.fromtimestamp(t) when t < 0

___
Python tracker 
<https://bugs.python.org/issue36439>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36439] [Windows] datetime.fromtimestamp(t) when t < 0 fails on Python 3.6

2019-03-26 Thread Mickaël Schoentgen

Mickaël Schoentgen  added the comment:

And also reproduced on 3.8.0a3.

--
versions: +Python 3.8

___
Python tracker 
<https://bugs.python.org/issue36439>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36439] [Windows] datetime.fromtimestamp(t) when t < 0 fails on Python 3.6

2019-03-26 Thread Mickaël Schoentgen

Mickaël Schoentgen  added the comment:

Reproduced on 3.6.8 and 3.7.3.

--
type:  -> behavior
versions: +Python 3.7

___
Python tracker 
<https://bugs.python.org/issue36439>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36439] [Windows] datetime.fromtimestamp(t) when t < 0 fails on Python 3.6

2019-03-26 Thread Mickaël Schoentgen

New submission from Mickaël Schoentgen :

A similar issue was resolved with issue29097 (with 0 <= t <= 86399).

Here, we have an inconsistency between OSes when using 
datetime.fromtimestamp(t) when t < 0.
Tested on Python 3.6.7.

GNU/Linux:

>>> datetime.fromtimestamp(-1)
datetime.datetime(1970, 1, 1, 0, 59, 59)

macOS:

>>> datetime.fromtimestamp(-1)
datetime.datetime(1970, 1, 1, 0, 59, 59)

Windows (7 and 10):

>>> datetime.fromtimestamp(-1)
Traceback (most recent call last):
  File "", line 1, in 
OSError: [Errno 22] Invalid argument


I think having a similar behavior between all Oses would be great, right?

--
messages: 338893
nosy: Tiger-222
priority: normal
severity: normal
status: open
title: [Windows] datetime.fromtimestamp(t) when t < 0 fails on Python 3.6
versions: Python 3.6

___
Python tracker 
<https://bugs.python.org/issue36439>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31658] xml.sax.parse won't accept path objects

2019-01-14 Thread Mickaël Schoentgen

Change by Mickaël Schoentgen :


--
versions: +Python 3.7, Python 3.8

___
Python tracker 
<https://bugs.python.org/issue31658>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30235] Validate shutil supports path-like objects, update docs accordingly

2019-01-14 Thread Mickaël Schoentgen

Change by Mickaël Schoentgen :


--
versions: +Python 3.8

___
Python tracker 
<https://bugs.python.org/issue30235>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32689] shutil.move raises AttributeError if first argument is a pathlib.Path object and destination is a directory

2019-01-14 Thread Mickaël Schoentgen

Change by Mickaël Schoentgen :


--
versions: +Python 3.7, Python 3.8

___
Python tracker 
<https://bugs.python.org/issue32689>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30235] Validate shutil supports path-like objects, update docs accordingly

2019-01-14 Thread Mickaël Schoentgen

Mickaël Schoentgen  added the comment:

There is another place where the use of Path objects is not yet working: when 
move() is given a directory as argument. A patch is in review in issue32689.

--

___
Python tracker 
<https://bugs.python.org/issue30235>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30235] Validate shutil supports path-like objects, update docs accordingly

2019-01-14 Thread Mickaël Schoentgen

Change by Mickaël Schoentgen :


--
nosy: +Tiger-222

___
Python tracker 
<https://bugs.python.org/issue30235>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35643] SyntaxWarning: invalid escape sequence in Modules/_sha3/cleanup.py

2019-01-02 Thread Mickaël Schoentgen

Change by Mickaël Schoentgen :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue35643>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35643] SyntaxWarning: invalid escape sequence in Modules/_sha3/cleanup.py

2019-01-02 Thread Mickaël Schoentgen

Change by Mickaël Schoentgen :


--
resolution: fixed -> 
status: closed -> open
versions: +Python 3.6, Python 3.7

___
Python tracker 
<https://bugs.python.org/issue35643>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35643] SyntaxWarning: invalid escape sequence in Modules/_sha3/cleanup.py

2019-01-02 Thread Mickaël Schoentgen

Change by Mickaël Schoentgen :


--
keywords: +patch, patch
pull_requests: +10801, 10802
stage:  -> patch review

___
Python tracker 
<https://bugs.python.org/issue35643>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35643] SyntaxWarning: invalid escape sequence in Modules/_sha3/cleanup.py

2019-01-02 Thread Mickaël Schoentgen

Change by Mickaël Schoentgen :


--
keywords: +patch
pull_requests: +10801
stage:  -> patch review

___
Python tracker 
<https://bugs.python.org/issue35643>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35643] SyntaxWarning: invalid escape sequence in Modules/_sha3/cleanup.py

2019-01-02 Thread Mickaël Schoentgen

New submission from Mickaël Schoentgen :

This warning is emitted on Modules/_sha3/cleanup.py, line 11:

SyntaxWarning: invalid escape sequence \
  CPP2 = re.compile("\ //(.*)")

--
components: Extension Modules
messages: 332888
nosy: Tiger-222
priority: normal
severity: normal
status: open
title: SyntaxWarning: invalid escape sequence in Modules/_sha3/cleanup.py
type: enhancement
versions: Python 3.8

___
Python tracker 
<https://bugs.python.org/issue35643>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35416] Fix potential resource warnings in distutils

2018-12-05 Thread Mickaël Schoentgen

Mickaël Schoentgen  added the comment:

OK then I updated the PR to only update code that would really leak resources.

--

___
Python tracker 
<https://bugs.python.org/issue35416>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35416] Fix potential resource warnings in distutils

2018-12-05 Thread Mickaël Schoentgen

Mickaël Schoentgen  added the comment:

I saw it but it is quite old and targetting 3.5. I opended this issue to target 
only distutils, easier to eventually backport than a big patch on a lot of 
files.

--

___
Python tracker 
<https://bugs.python.org/issue35416>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35416] Fix potential resource warnings in distutils

2018-12-05 Thread Mickaël Schoentgen

Change by Mickaël Schoentgen :


--
keywords: +patch
pull_requests: +10157
stage:  -> patch review

___
Python tracker 
<https://bugs.python.org/issue35416>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35416] Fix potential resource warnings in distutils

2018-12-05 Thread Mickaël Schoentgen

New submission from Mickaël Schoentgen :

I am looking to clean-up potential ResourceWarnings in distutils. The patch 
will provide 2 changes:
- ensure file descriptor are always closed when it is not the case
- and uniformization of the "with open(...)" use

--
components: Distutils
messages: 331097
nosy: Tiger-222, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: Fix potential resource warnings in distutils
type: enhancement
versions: Python 3.8

___
Python tracker 
<https://bugs.python.org/issue35416>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34500] Fix ResourceWarning in difflib.py

2018-08-25 Thread Mickaël Schoentgen

Mickaël Schoentgen  added the comment:

This is a little patch to mostly keep aligned with 
https://github.com/google/python-fire/pull/135.

--

___
Python tracker 
<https://bugs.python.org/issue34500>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34500] Fix ResourceWarning in difflib.py

2018-08-25 Thread Mickaël Schoentgen

Change by Mickaël Schoentgen :


--
keywords: +patch
pull_requests: +8397
stage:  -> patch review

___
Python tracker 
<https://bugs.python.org/issue34500>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34500] Fix ResourceWarning in difflib.py

2018-08-25 Thread Mickaël Schoentgen

New submission from Mickaël Schoentgen :

Fix 2 unclosed files in the documentation and the difflib.py script:

diff.py:77: ResourceWarning: unclosed file <_io.TextIOWrapper 
name='/tmp/tmpnby8pemn' mode='U' encoding='UTF-8'>
fromlines = open(fromfile, 'U').readlines()
diff.py:78: ResourceWarning: unclosed file <_io.TextIOWrapper 
name='/tmp/tmpnby8pemm' mode='U' encoding='UTF-8'>
self.tolines = open(tofile, 'U').readlines()

--
assignee: docs@python
components: Demos and Tools, Documentation
messages: 324071
nosy: David Bieber, Tiger-222, docs@python
priority: normal
severity: normal
status: open
title: Fix ResourceWarning in difflib.py
versions: Python 2.7

___
Python tracker 
<https://bugs.python.org/issue34500>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31658] xml.sax.parse won't accept path objects

2018-07-30 Thread Mickaël Schoentgen

Change by Mickaël Schoentgen :


--
keywords: +patch
pull_requests: +8078
stage:  -> patch review

___
Python tracker 
<https://bugs.python.org/issue31658>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com