bad data from urllib when run from MS .bat file

Bengt Richter bokr at
Mon Sep 20 07:15:55 CEST 2004

On Sat, 18 Sep 2004 16:23:40 -0600, "Stuart McGraw" <smcg4191 at> wrote:

>I just spent a $*#@!*&^&% hour registering at ^$#@#%^ 
>Sourceforce and trying to submit a Python bug report
>but it still won't let me.  I give up.  Maybe someone who 
>cares will see this post, or maybe it will save time for 
>someone else who runs into this problem...
>- Microsoft Windows 2000 Pro
>- Python 2.3.4
>- urllib (version shipped with Python-2.3.4)
> urllib returns corrupted data when reading an EUC-JP encoded 
> web page, from a python script run from a MS Windows .BAT 
>file, but not when the same script is run from the command line.
Just a thought: in case your command line is being interpreted
by cmd.exe and .bat by something else ( you could
check if it makes a difference, e.g.,

copy test.bat test.cmd

and try it again? (explicitly as test.cmd, not just test, since any
same-name .com or .exe or .bat may have priority over .cmd)
You can probably investigate the latter by something like

 [21:54] C:\pywk\junk>echo %pathext%

Bengt Richter

More information about the Python-list mailing list