[issue36675] Doctest directives and comments missing from code samples

2021-10-25 Thread Ming Hua


Change by Ming Hua :


--
nosy: +minghua

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



[issue45176] Many regtest failures on Windows with non-ASCII account name

2021-09-21 Thread Ming Hua


Ming Hua  added the comment:

Steve Dower (steve.dower) posted:
> I'd guess that these tests are assuming that sys.executable contains only 
> ASCII characters. All the tests run in a non-ASCII working directory, so it's 
> only the runtime that is not tested propersy here.
> 
> The easiest way for Ming Hua to test this is to install for all users (into 
> Program Files), and run tests with the same user account.

I've already installed for all users, just not into the default "C:\Program 
Files\", but instead "C:\Programs\Python\".  I don't think it's the 
executable's path that is problematic, but the temporary directory where the 
tests are run (%LOCALAPPDATA%\Temp\tmpcwkfn9ct, where %LOCALAPPDATA% is 
C:\Users\\AppData\Local and therefore contains non-ASCII 
characters).

Both of these paths are shown in the error/failure logs posted in the first 
message.

I doubt installing into "C:\Program Files\" would make a difference.

--

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



[issue45176] Many regtest failures on Windows with non-ASCII account name

2021-09-12 Thread Ming Hua


Ming Hua  added the comment:

Eryk Sun (eryksun) posted:
> Python's default can be overridden to UTF-8 for standard I/O via 
> PYTHONIOENCODING, or for all I/O via PYTHONUTF8 or "-X utf8=1".

FWIW, I did test with "-X utf8" option and it wasn't any better.  Just tested 
"python.exe -X utf8=1 -m test -W test_cmd_line_script" with 3.10.0 rc2 again, 
and got 6 errors and 2 failures this way (1 more error than without "-X 
utf8=1").  There is also this new error message:

0:00:01 [1/1] test_cmd_line_script
Warning -- Uncaught thread exception: UnicodeDecodeError
Exception in thread Thread-60 (_readerthread):
Traceback (most recent call last):
  File "C:\Programs\Python\python310\lib\threading.py", line 1009, in 
_bootstrap_inner
self.run()
  File "C:\Programs\Python\python310\lib\threading.py", line 946, in run
self._target(*self._args, **self._kwargs)
  File "C:\Programs\Python\python310\lib\subprocess.py", line 1494, in 
_readerthread
buffer.append(fh.read())
  File "C:\Programs\Python\python310\lib\codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbb in position 69: 
invalid start byte

--

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



[issue45176] Many regtest failures on Windows with non-ASCII account name

2021-09-12 Thread Ming Hua


New submission from Ming Hua :

Background:
Since at least Windows 8, it is possible to invoke the input method engine 
(IME) when installing Windows and creating accounts.  So at least among 
simplified Chinese users, it's not uncommon to have a Chinese account name.

Issue:
After successful installation using the 64-bit .exe installer for Windows, just 
to be paranoid (and to get familiar with Python's test framework), I decided to 
run the bundled regression tests.  To my surprise I got many failures.  The 
following is the summary of "python.exe -m test" with 3.8 some months ago 
(likely 3.8.6):

371 tests OK.

11 tests failed:
test_cmd_line_script test_compileall test_distutils test_doctest
test_locale test_mimetypes test_py_compile test_tabnanny
test_urllib test_venv test_zipimport_support

43 tests skipped:
test_asdl_parser test_check_c_globals test_clinic test_curses
test_dbm_gnu test_dbm_ndbm test_devpoll test_epoll test_fcntl
test_fork1 test_gdb test_grp test_ioctl test_kqueue
test_multiprocessing_fork test_multiprocessing_forkserver test_nis
test_openpty test_ossaudiodev test_pipes test_poll test_posix
test_pty test_pwd test_readline test_resource test_smtpnet
test_socketserver test_spwd test_syslog test_threadsignals
test_timeout test_tix test_tk test_ttk_guionly test_urllib2net
test_urllibnet test_wait3 test_wait4 test_winsound test_xmlrpc_net
test_xxtestfuzz test_zipfile64

Total duration: 59 min 49 sec
Tests result: FAILURE

The failures all look similar though, it seems Python on Windows assumes the 
home directory of the user, "C:\Users\\", is either in ASCII or UTF-8 
encoding, while it is actually in Windows native codepage, in my case cp936 for 
simplified Chinese (zh-CN).

To take a couple of examples (these are from recent testing with 3.10.0 rc2):

> python.exe -m test -W test_cmd_line_script
0:00:03 Run tests sequentially
0:00:03 [1/1] test_cmd_line_script
[...]
test_consistent_sys_path_for_direct_execution 
(test.test_cmd_line_script.CmdLineTest) ... ERROR
[...]
test_directory_error (test.test_cmd_line_script.CmdLineTest) ... FAIL
[...]
ERROR: test_consistent_sys_path_for_direct_execution 
(test.test_cmd_line_script.CmdLineTest)
--
Traceback (most recent call last):
  File "C:\Programs\Python\python310\lib\test\test_cmd_line_script.py", line 
677, in test_consistent_sys_path_for_direct_execution
out_by_name = kill_python(p).decode().splitlines()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbb in position 9: invalid 
start byte
[...]
FAIL: test_directory_error (test.test_cmd_line_script.CmdLineTest)
--
Traceback (most recent call last):
  File "C:\Programs\Python\python310\lib\test\test_cmd_line_script.py", line 
268, in test_directory_error
self._check_import_error(script_dir, msg)
  File "C:\Programs\Python\python310\lib\test\test_cmd_line_script.py", line 
151, in _check_import_error
self.assertIn(expected_msg.encode('utf-8'), err)
AssertionError: b"can't find '__main__' module in 'C:Users\xe5<5 bytes 
redacted>AppDataLocalTemptmpcwkfn9ct'" not found in 
b"C:\\Programs\\Python\\python310\\python.exe: can't find '__main__' module in 
'C:Users\xbb<3 bytes 
redacted>AppDataLocalTemptmpcwkfn9ct'\r\n"
[...]
--
Ran 44 tests in 29.769s

FAILED (failures=2, errors=5)
test test_cmd_line_script failed
test_cmd_line_script failed (5 errors, 2 failures) in 30.4 sec

== Tests result: FAILURE ==

In the above test_directory_error AssertionError message I redacted part of the 
path as my account name is my real name.  Hope the issue is clear enough 
despite the redaction, since the "\xe5<5 bytes redacted>" part is 6 bytes and 
apparently in UTF-8 (for two Chinese characters) and the "\xbb<3 bytes 
redacted>" part is 4 bytes and apparently in cp936.

Postscript:
As I've said above, I discovered this issue some time ago, but only have time 
now to report it.  I believe I've see these failures in 3.8.2/6, 3.9.7, and 
3.10.0 rc2.  It shouldn't be hard to reproduce for people with ways to create 
account with non-ASCII name on Windows.  If reproducing turns out to be 
difficult though, I'm happy to provide more information and/or run more tests.

--
components: Tests
messages: 401659
nosy: minghua
priority: normal
severity: normal
status: open
title: Many regtest failures on Windows with non-ASCII account name
versions: Python 3.10, Python 3.8, Python 3.9

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



[issue45147] Typo in "What's New In Python 3.10" documentation

2021-09-09 Thread Ming Hua


Change by Ming Hua :


--
title: Type in "What's New In Python 3.10" documentation -> Typo in "What's New 
In Python 3.10" documentation

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



[issue45147] Type in "What's New In Python 3.10" documentation

2021-09-09 Thread Ming Hua


New submission from Ming Hua :

It's just a small typo, but since the documentation recommends reporting to bug 
tracker, here it is.

After downloading the 64-bit Windows Installer for 3.10.0 rc2 and successfully 
installing on my Windows 10, the "Python 3.10 Manuals" in start menu opens a 
(presumably) .chm documentation in Windows HTML Helper.  There in the "What's 
New in Python" > "What's New In Python 3.10" > "Deprecated" section, first 
paragraph, last line, is:
If future releases it will be changed...
It should be "IN future releases" instead.

--
assignee: docs@python
components: Documentation
messages: 401435
nosy: docs@python, minghua
priority: normal
severity: normal
status: open
title: Type in "What's New In Python 3.10" documentation
versions: Python 3.10

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