Rémy Hubscher [:natim] added the comment:
Thank you for the clarification :)
--
___
Python tracker
<https://bugs.python.org/issue36222>
___
___
Python-bugs-list m
New submission from Rémy Hubscher [:natim] :
Refs: https://github.com/Martiusweb/asynctest/issues/114
I was trying to mock a `asyncio.run(asyncio.gather())` call and I discovered
that while it was working with `loop.run_until_complete` it wasn't with
`asyncio.run`
Is there a reason for
Rémy Hubscher [:natim] added the comment:
> I modified Python 3.7.1 to enable the UTF-8 Mode when the LC_CTYPE is
> "POSIX". In Python 3.7.0, the UTF-8 Mode is only enabled if the LC_CTYPE is
> "C"
Ok works for me thanks :)
--
_
Rémy Hubscher [:natim] added the comment:
Unicode is complicated, the answer is somewhere here:
https://unicodebook.readthedocs.io/
Sorry for the bothering, I thought it was a bug but apparently it's a feature.
Thank you for your help, thank you for making Python b
Rémy Hubscher [:natim] added the comment:
Here are the locale set:
```
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME
Rémy Hubscher [:natim] added the comment:
I believe Python 3.7 brings explicit unicode encoding/decoding.
If depending on the environment the create_subprocess_exec method can fail, I
believe we should not try to encode the command lines attribute but rather
enforce it to be bytes
Rémy Hubscher [:natim] added the comment:
Here we go:
```
$ python3.7 demo.py
utf-8
UTF-8
Traceback (most recent call last):
File "demo.py", line 21, in
asyncio.run(main())
File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_c
Rémy Hubscher [:natim] added the comment:
I am adding the following info:
If I run the following on the Docker image where I got the error I get:
```
import sys
import locale
print(sys.getdefaultencoding())
print(locale.getpreferredencoding())
```
utf-8
ANSI_X3.4-1968
While if I run it on
Rémy Hubscher [:natim] added the comment:
I though this would be sufficient to actually reproduce the issue.
However it seems that if the system encoding is UTF-8 it does work properly.
Here is the traceback I had:
```
UnicodeEncodeError: 'ascii' codec can't encode char
Rémy Hubscher [:natim] added the comment:
> List of strings works on both my local Linux box and CPython test suite.
Indeed that's why I posted this bug report, in my opinion it should work only
with bytes string.
> Can you elaborate? On which OS? What is your error message? Can
New submission from Rémy Hubscher [:natim] :
Asyncio.create_subprocess_exec accepts a list of str as parameter which lead to
UnicodeEncodeError I think it should accept only bytes shouldn't it?
--
components: asyncio
messages: 327945
nosy: asvetlov, natim, yselivanov
priority: n
Rémy HUBSCHER added the comment:
Here is the patch for the test case.
--
hgrepos: +84
Added file: http://bugs.python.org/file23428/test_util.patch
___
Python tracker
<http://bugs.python.org/issue12
Rémy HUBSCHER added the comment:
Ok, I am working on it.
--
___
Python tracker
<http://bugs.python.org/issue12703>
___
___
Python-bugs-list mailing list
Unsub
Rémy HUBSCHER added the comment:
It is exactly what explained Alexis.
The __import__ can failed in two case :
- The module doesn't exist
- There is a error in the module
With the previous behaviour, even if the module exist, the message was that it
doesn't exists. And it was the
Rémy HUBSCHER added the comment:
Actually it is not the same problem for
`distutils.util.Distribution.get_command_class` my mistake.
--
___
Python tracker
<http://bugs.python.org/issue12
Rémy HUBSCHER added the comment:
Hello, I did the patch, but I have no idea of how to make a test for it.
More over, I have seen a similar problem each time there is this code in the
Python code (here in distutils.util.Distribution.get_command_class) :
try
New submission from Rémy HUBSCHER :
I patched it for redbarrel but there is the same bug on distutils2.
This patch allow to see the error raised when loading the module instead of
saying that the module does not exists.
https://bitbucket.org/tarek/redbarrel/changeset/2cf6d7e32081#chg
17 matches
Mail list logo