Dāvis added the comment:
The problem is that most of time you have no control over that FTP server but
you still want to download files from that FTP server using Python. Currently
that's just not possible. Maybe there could be some flag to enable workarounds
for these
Change by Dāvis :
--
keywords: +patch
pull_requests: +12662
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36570>
___
___
Python-
New submission from Dāvis :
It's not uncommon to encounter FTP servers which are misconfigured and return
unroutable host IP (eg. internal IP) when using passive mode
See: https://superuser.com/a/1195591
Most FTP clients such as FileZilla and WinSCP use a workaround when they
encounter
Dāvis added the comment:
And looks like only way to specify console's codepage is with
`encoding=os.device_encoding(2)` which will have to be used for 99% of cases. I
don't see other way...
--
___
Python tracker
<http://bugs.python.
Dāvis added the comment:
Still can't specify encoding for getstatusoutput and getoutput. Also it uses
wrong encoding by default, most of time it will be console's codepage instead
of ANSI codepage which is used now.
--
nosy: +davispuh
Dāvis added the comment:
Steve Dower (steve.dower)
> [...]
> Anything else requires a real console with a real person with a real keyboard.
FYI, not really, it is possible to fully automatically test console's
output/input using WinAPI functions like WriteC
Dāvis added the comment:
That is a great PIP, but it will take a lot of time to be implemented and it
doesn't really solve this issue.
This is different issue than filename/path encoding. Here we need to decode
binary output from other applications and that for a lot of applications wil
Dāvis added the comment:
ping? Could someone review my patch?
--
___
Python tracker
<http://bugs.python.org/issue27179>
___
___
Python-bugs-list mailing list
Unsub
Changes by Dāvis :
Added file:
http://bugs.python.org/file43316/subprocess_fix_encoding_v4fixed.patch
___
Python tracker
<http://bugs.python.org/issue27179>
___
___
Pytho
Changes by Dāvis :
Removed file: http://bugs.python.org/file43315/subprocess_fix_encoding_v4.patch
___
Python tracker
<http://bugs.python.org/issue27179>
___
___
Pytho
Dāvis added the comment:
> Note that patch 3 requires setting `encoding` for even python.exe as a child
> process, because sys.std* default to ANSI when isatty(fd) isn't true.
I've updated my patch so that Python outputs in consoles encoding for pipes too.
So now in Power
Dāvis added the comment:
Of course I agree that proper solution is to use Unicode/Wide API but that's
much more work to implement and I rather have now this half-fix which works for
most of cases than nothing till whenever Unicode support is implemented which
might be nowhere soon.
Dāvis added the comment:
it makes no sense to not use better encoding default in some cases like my
patch does. Most programs use console's encoding not ANSI codepage and thus by
limiting default only to ANSI codepage we force basically everyone to always
specify encoding. This is cu
Dāvis added the comment:
> qprocess.exe (also to console)
> quser.exe (also to console)
these are broken (http://i.imgur.com/0zIhHrv.png)
>chcp 1257
>quser
USERNAME SESSIONNAME
dvis console
> chcp 775
> q
Dāvis added the comment:
if there's no console then os.device_encoding won't fail, it will just return
None which means that ANSI codepage will be used like it currently is and so
here it doesn't change anything, current behavior stays.
Also like I showed TextIOWrappe
Dāvis added the comment:
There is right encoding, it's encoding that's actually used. Here we're inside
subprocess.Popen which does the actual winapi.CreateProcess call and thus we
can check for any creationflags and adjust encoding logic accordingly. I would
say almost all
Changes by Dāvis :
Added file: http://bugs.python.org/file43101/subprocess_fix_encoding_v2_b.patch
___
Python tracker
<http://bugs.python.org/issue27179>
___
___
Pytho
Changes by Dāvis :
Removed file: http://bugs.python.org/file43094/subprocess_fix_encoding.patch
___
Python tracker
<http://bugs.python.org/issue27179>
___
___
Python-bug
Dāvis added the comment:
I looked at #27048 and indeed it's affected by this bug, it happens to me too
(I've non-ASCII symbols in %PATH%) and this my patch fixes that.
on my system without patch
> python -c "from distutils import _msvccompiler; _msvccompiler._get_vc_env(
Dāvis added the comment:
there's no such "ā" command, it's just used to get non-ASCII output
cmd will return:
'ā' is not recognized as an internal or external command,
operable program or batch file.
and this will be encoded in consoles encoding (UTF8 in my examp
New submission from Dāvis:
subprocess uses wrong encoding on Windows.
On Windows 10 with Python 3.5.1
from Command Prompt (cmd.exe)
> chcp 65001
> python -c "import subprocess; subprocess.getstatusoutput('ā')"
Traceback (most recent call last):
File "",
21 matches
Mail list logo