[issue2142] difflib.unified_diff(...) produces invalid patches

2018-10-11 Thread Xiao Di Guan


Change by Xiao Di Guan :


--
nosy: +puxlit

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



[issue29427] Option to skip padding for base64 urlsafe encoding/decoding

2018-10-11 Thread Xiao Di Guan


Change by Xiao Di Guan :


--
nosy: +puxlit

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



[issue34958] urllib.error.HTTPError.fp is not closed when error is finalized on Windows

2018-10-11 Thread Xiao Di Guan


New submission from Xiao Di Guan :

Following changes introduced in bpo-15002, HTTPError closes its fp when GCed 
via tempfile._TemporaryFileCloser's finalizer. However, the current 
implementation of _TemporaryFileCloser only defines __del__ for non-NT 
platforms.

Assuming HTTPError.fp is part of the API (though it's currently undocumented), 
and assuming the desired behaviour is to close fp when HTTPError is finalized, 
then perhaps _TemporaryFileCloser should always define __del__?

A contrived example follows:

```
from urllib.error import HTTPError
from urllib.request import urlopen

def make_request():
try:
urlopen('https://httpbin.org/status/418')
assert False
except HTTPError as err:
assert err.code == 418
return err.fp

fp = make_request()
assert fp.isclosed()  # Fails on Windows, passes on other platforms
```

--
components: Library (Lib)
messages: 327532
nosy: puxlit
priority: normal
severity: normal
status: open
title: urllib.error.HTTPError.fp is not closed when error is finalized on 
Windows
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7

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



[issue34958] urllib.error.HTTPError.fp is not closed when error is finalized on Windows

2018-10-18 Thread Xiao Di Guan


Change by Xiao Di Guan :


--
nosy: +orsenthil

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