[issue43733] PEP 597: netrc uses locale encoding.

2021-05-01 Thread Inada Naoki


Change by Inada Naoki :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue43733] PEP 597: netrc uses locale encoding.

2021-05-01 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset fd0bc7e7f4f2c7de98a1ebc7ad1ef65b8f8f7ad6 by Inada Naoki in branch 
'master':
bpo-43733: netrc try to use UTF-8 before using locale encoding. (GH-25781)
https://github.com/python/cpython/commit/fd0bc7e7f4f2c7de98a1ebc7ad1ef65b8f8f7ad6


--

___
Python tracker 

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



[issue43733] PEP 597: netrc uses locale encoding.

2021-05-01 Thread Inada Naoki


Change by Inada Naoki :


--
keywords: +patch
pull_requests: +24472
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/25781

___
Python tracker 

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



[issue43733] PEP 597: netrc uses locale encoding.

2021-04-14 Thread Inada Naoki


Inada Naoki  added the comment:

I googled "netrc UnicodeDecodeError". It is very rare, but I found two cases.

* 
https://stackoverflow.com/questions/54748450/macos-python-3-netrc-operations-end-up-with-unicodedecodeerror
  This user uses macOS and Python tried UTF-8. But .netrc was not UTF-8.

* https://qiita.com/yuji38kwmt/items/5472c98cb800ccaab093
  This user uses Windows. They write .netrc with UTF-8, but Python used cp932.

---

There are several options:

* Use UTF-8. If user encountered UnicodeDecodeError, user need to change the 
.netrc encoding.
* Use UTF-8 with "surrogateescape" or "replace" error handler. non-UTF-8 in 
comments are ignored.
* Use latin-1. non-ASCII characters in comments are ignored.

--

___
Python tracker 

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



[issue43733] PEP 597: netrc uses locale encoding.

2021-04-13 Thread Inada Naoki


Change by Inada Naoki :


--
nosy: +xiang.zhang

___
Python tracker 

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



[issue43733] PEP 597: netrc uses locale encoding.

2021-04-05 Thread Inada Naoki


New submission from Inada Naoki :

https://github.com/python/cpython/blob/c8e5eb904e12010d2302364e1037c24a30f5e241/Lib/netrc.py#L29

Can we change the encoding="utf-8" and errors="replace"?

IMHO, comments are source of UnicodeDecodeError. So we can open file with 
binary mode and skip comments without decoding it.
But we need to decode non-comment lines lines with some encoding anyway.

--
components: Library (Lib)
messages: 390232
nosy: methane
priority: normal
severity: normal
status: open
title: PEP 597: netrc uses locale encoding.
versions: Python 3.10

___
Python tracker 

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