[issue417388] pythonw.exe will not work

2022-04-10 Thread admin


Change by admin :


--
github: None -> 34374

___
Python tracker 

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



[issue400764] fix to make os.popen work under pythonw.exe

2022-04-10 Thread admin


Change by admin :


___
Python tracker 

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



[issue400764] fix to make os.popen work under pythonw.exe

2022-04-10 Thread admin


Change by admin :


--
github: None -> 32534

___
Python tracker 

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



[issue38533] v3.7.5 py script run ok with python.exe but not pythonw.exe (python silent console not working)

2020-08-24 Thread Steve Dower


Steve Dower  added the comment:

Assuming the fix for this was released, given lack of other information.

--
resolution:  -> fixed
stage:  -> 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



[issue38533] v3.7.5 py script run ok with python.exe but not pythonw.exe (python silent console not working)

2019-10-25 Thread Steve Dower


Steve Dower  added the comment:

> FWIW, the very first thing that I checked was the dependencies of pythonw.exe

The version in the Store has a different build of pythonw.exe (because it has 
to be able to determine its user site-packages location differently).

Dump of file C:\Program 
Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1520.0_x64__hd69rhyc2wevp\pythonw.exe

File Type: EXECUTABLE IMAGE

  Image has the following dependencies:

api-ms-win-core-libraryloader-l1-2-0.dll
api-ms-win-core-com-l1-1-0.dll
api-ms-win-core-errorhandling-l1-1-0.dll
SHELL32.dll
python37.dll
MSVCP140.dll  ** bug here, but already fixed for next release
VCRUNTIME140.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-environment-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
api-ms-win-crt-math-l1-1-0.dll
api-ms-win-crt-stdio-l1-1-0.dll
api-ms-win-crt-locale-l1-1-0.dll
api-ms-win-crt-string-l1-1-0.dll
api-ms-win-core-handle-l1-1-0.dll
api-ms-win-core-synch-l1-1-0.dll
api-ms-win-core-rtlsupport-l1-1-0.dll
api-ms-win-core-processthreads-l1-1-0.dll
api-ms-win-core-processthreads-l1-1-1.dll
api-ms-win-core-debug-l1-1-0.dll
api-ms-win-core-profile-l1-1-0.dll
api-ms-win-core-sysinfo-l1-1-0.dll
api-ms-win-core-interlocked-l1-1-0.dll
KERNEL32.dll
api-ms-win-core-winrt-l1-1-0.dll
api-ms-win-core-winrt-string-l1-1-0.dll
OLEAUT32.dll
api-ms-win-core-winrt-error-l1-1-1.dll
api-ms-win-core-winrt-error-l1-1-0.dll

--

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



[issue38533] v3.7.5 py script run ok with python.exe but not pythonw.exe (python silent console not working)

2019-10-25 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

For me, 'pyw -3.7 -m idlelib' in Command Prompt opens IDLE with 3.7.5.  So does 
the equivalent run by clicking the IDLE icon:
C:\Programs\Python37\pythonw.exe "C:\Programs\Python37\Lib\idlelib\idle.pyw"

This report reminds me that I should continue to install and minimally test 
each release.

--
nosy: +terry.reedy

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



[issue38533] v3.7.5 py script run ok with python.exe but not pythonw.exe (python silent console not working)

2019-10-21 Thread Eryk Sun


Eryk Sun  added the comment:

> At least one package in 3.8 still contained a dependency on the C++ 
> runtime

FWIW, the very first thing that I checked was the dependencies of pythonw.exe, 
in case maybe I had a dependent DLL that's not distributed with Windows. 
There's nothing out of the ordinary:

C:\Program Files\Python37>sigcheck -nobanner pythonw.exe
C:\Program Files\Python37\pythonw.exe:
Verified:   Signed
Signing date:   7:12 PM 10/14/2019
Publisher:  Python Software Foundation
Company:Python Software Foundation
Description:Python
Product:Python
Prod version:   3.7.5
File version:   3.7.5
MachineType:64-bit

C:\Program Files\Python37>dumpbin /nologo /dependents pythonw.exe

Dump of file pythonw.exe

File Type: EXECUTABLE IMAGE

  Image has the following dependencies:

python37.dll
VCRUNTIME140.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-math-l1-1-0.dll
api-ms-win-crt-stdio-l1-1-0.dll
api-ms-win-crt-locale-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
KERNEL32.dll

  Summary

1000 .data
1000 .pdata
1000 .rdata
1000 .reloc
   14000 .rsrc
2000 .text

--

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



[issue38533] v3.7.5 py script run ok with python.exe but not pythonw.exe (python silent console not working)

2019-10-21 Thread Jon


Jon  added the comment:

When I have some time.  Maybe this weekend.  3.7.4 is working ok right now for 
production level.  So I didn't bother with anything else yet.

Might help someone else in the meantime though.  Glad to see that someone is 
taking the complaint seriously :)

--

___
Python tracker 

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



[issue38533] v3.7.5 py script run ok with python.exe but not pythonw.exe (python silent console not working)

2019-10-21 Thread Steve Dower


Steve Dower  added the comment:

Can you try installing https://aka.ms/vs/16/release/VC_redist.x64.exe and then 
see if it makes a difference?

At least one package in 3.8 still contained a dependency on the C++ runtime, 
which we do not include, and it's possible that 3.7.5 had the same issue. Both 
will be fixed in the next updates, but the workaround is to install the file 
above.

--

___
Python tracker 

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



[issue38533] v3.7.5 py script run ok with python.exe but not pythonw.exe (python silent console not working)

2019-10-20 Thread Jon


Jon  added the comment:

BTW, I have win10 x64 v 1809 b 17763.720.

--

___
Python tracker 

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



[issue38533] v3.7.5 py script run ok with python.exe but not pythonw.exe (python silent console not working)

2019-10-20 Thread Jon


Jon  added the comment:

@eryk.  Could I just have separate folder with each python minor version?  I 
would keep it portable and just reference the python/pythonw.exe filepath 
directly for each version when I run.

I could just download the 3.7.5 and drop it anywhere.

--

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



[issue38533] v3.7.5 py script run ok with python.exe but not pythonw.exe (python silent console not working)

2019-10-20 Thread Eryk Sun


Eryk Sun  added the comment:

> Let me know if you are unable to reproduce it.

x64 pythonw.exe and pyw.exe (3.7.5, 2019-10-14) work for me in Windows 
10.0.18362. I have them installed for all users, respectively in "C:\Program 
Files\Python37" and "C:\Windows". 

Try running `pythonw.exe -m idlelib` and `pythonw.exe -m turtle`. If nothing 
runs, try it with python.exe, just to make sure tcl/tk and IDLE are installed.

> How do I have multiple MINOR versions of python together? 
> e.g. 3.7.3, 3.7.4, 3.7.5?  Can they be placed in separate 
> folders?

The standard distribution supports one major-version installation for the 
system and another per user. You can use the nuget packages to test against 
multiple minor versions.

https://docs.python.org/3/using/windows.html#the-nuget-org-packages

It seems that nuget packages can also be installed via PowerShell 6. However, 
the "Version" parameter of Visual Studio's Install-Package changes to 
"RequiredVersion" in PowerShell 6.

--
nosy: +eryksun

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



[issue38533] v3.7.5 py script run ok with python.exe but not pythonw.exe (python silent console not working)

2019-10-20 Thread Jon


Jon  added the comment:

@paul.moore  all scripts failed.  it's like pyw.exe does not run at all (or 
quits shortly after.  i have about 5 proprietary scripts.

going back to 3.7.4 everything works as before.   I do suspect there is 
something wrong with the way that 3.7.5 was compiled for pythonW.exe


 python/pw.exe works fine for both 3.7.4 and 3.7.5 (x86 and x64 versions)
pythonW/pyW.exe works fine for 3.7.4 but not 3.7.5 (x86 and x64 versions)

This is the first time i've ever had this issue.  python 3.6.x.

I originally thought it was a win10 issue because I am setting up a new 
computer and using 3.7.5 for the first time.  (other computer had 3.7.4).

I will ask my programmer to give some sample code.  But really any existing 
script you have should work for testing 3.7.5 pythonw.exe , particularly if it 
requires a couple of non-core modules to run.

Let me know if you are unable to reproduce it.

--

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



[issue38533] v3.7.5 py script run ok with python.exe but not pythonw.exe (python silent console not working)

2019-10-20 Thread Paul Moore


Paul Moore  added the comment:

Can you give an example of a script that fails? If you try to print (or 
otherwise use the standard IO streams) pythonw will fail, because there are no 
stdio streams for a GUI executable - and the traceback, which goes to stderr by 
default, will be lost.

This is my best guess as to your issue here, but without a reproducible 
example, it's hard to say anything useful.

--

___
Python tracker 

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



[issue38533] v3.7.5 py script run ok with python.exe but not pythonw.exe (python silent console not working)

2019-10-20 Thread Jon


Change by Jon :


--
title: v3.7.5 py script run ok with python.exe but not pythonw.exe (python 
console not working) -> v3.7.5 py script run ok with python.exe but not 
pythonw.exe (python silent console not working)

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



[issue38533] v3.7.5 py script run ok with python.exe but not pythonw.exe (python console not working)

2019-10-20 Thread Jon


Change by Jon :


--
title: v3.7.5 py script run ok with python.exe but not pythonw.exe (python 
console) -> v3.7.5 py script run ok with python.exe but not pythonw.exe (python 
console not working)

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



[issue38533] v3.7.5 py script run ok with python.exe but not pythonw.exe (python console)

2019-10-20 Thread Jon


Jon  added the comment:

I installed v3.7.4 x86 and scripts work with `pythonw.exe` and `pyw.exe`

I also tested v3.7.4 x64 bit and scripts also work ok.  So that is some good 
news.

This proves that pythonw (python console) for 3.7.5 is not working for some 
unknown reasons.

It is not related to Win10 (thankfully, as that would be an entirely different 
beast)

Will revert to 3.7.4 and stick with it until further notice.

---

That's about 7 hours of my life I will not get back, but I hope it will help 
someone.

--
title: py script runs with python.exe but not pythonw.exe (python console) -> 
v3.7.5 py script run ok with python.exe but not pythonw.exe (python console)

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



[issue38533] py script runs with python.exe but not pythonw.exe (python console)

2019-10-19 Thread Jon


Jon  added the comment:

by the way, just to be sure, I am actually running the python.exe / py.exe / 
pythonw.exe / pyw.exe from the full file path just to be sure.  e.g.

%LOCALAPPDATA%\Programs\Python\Launcher\pyw.exe  test.py

--

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



[issue38533] py script runs with python.exe but not pythonw.exe (python console)

2019-10-19 Thread Jon


New submission from Jon :

3.7.5.  Any py script that I run with python.exe or py.exe executes just fine.  
But if I try to run any py script with pythonW.exe or pyW.exe it will not run.  

I don't know where the logging for the python executable is located.

On the same machine, java.exe and javaW.exe work properly. (jar file runs 
exactly the same with either executable.  Only the cmd/console window is 
suppressed with "w" exe.



I am trying to isolate whether or not python 3.7.5 is to blame or this new 
windows 10 x64 1809 LTSC machine is to blame.

I have tested in both python 3.7.5 x86 and x64 versions.  the "W" console 
version does not run any py scripts.

On my previous laptop (win 8.1 x64) and (win2012 r2 x64 server, no problems) 
with 3.7.4 32 bit.

---

How do I have multiple MINOR versions of python together?  e.g. 3.7.3, 3.7.4, 
3.7.5?  Can they be placed in separate folders?

--
components: Windows
messages: 354982
nosy: 4evermaat, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: py script runs with python.exe but not pythonw.exe (python console)
type: behavior
versions: Python 3.7

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



[issue13582] IDLE and pythonw.exe stderr problem

2019-05-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Good question.  There are two issues when starting IDLE with pythonw.exe, so 
that sys.__stderr__ and sys.stderr are initially None.

1. None.write is an attribute error that crashes Python.  Therefore, don't do 
that. Instead use print.  By default, and when 'file=None' is given directly or 
by reference, print writes to sys.stdout if it exists or gives up otherwise.

I checked for possible (None).write code and did not find any except where 
commented out.  These should be deleted or converted to prints.  Possible None 
files are passed to traceback.print_exception and traceback.print_stack and 
these both use print, not write.

All but two of the stderr crash issues Roger listed in msg149414 are closed, 
and the last two either should be or should have a different problem.

Still relevant is

2. Unprinted messages cannot be read by the user.  So display them in a text 
widget.

Open question 1: backup to print?, default display method?, or both (when 
possible)?  Ned implies that both would be good on Mac, and maybe
same would be true everywhere.

Open question 2: what patch?  I need to consider Roger's patch in relation to 
idlelib changes since, including new PseudoFiles, changes to text viewer, and 
new query module.

The above is about sys in the IDLE GUI process.  The user code process is 
started with sys.executable, and sys.stdout and sys.stderr are replaced with 
Pseudofiles that direct output to the idle process shell.  The value of 
sys.__stdout__ and __stderr__ depend on sys.executable.  If None, prints will 
go to sys.stdout and hence Shell, and writes raise AttributeError, which also 
appears in the Shell.  If normal, prints and writes go to the console.  I 
should check if enough of this is in the docs.

It might be a good idea to wrap both processes in a top-level try-except to 
attempt to display any unexpected internal error.


I will clean the nosy list as this issue does not involve Steve Dower and many 
others are long inactive.

--
nosy:  -Todd.Rovito, amaury.forgeotdarc, devplayer, roger.serwy, steve.dower
versions: +Python 3.8 -Python 3.6

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



[issue13582] IDLE and pythonw.exe stderr problem

2019-05-06 Thread anthony shaw


anthony shaw  added the comment:

Revisiting this issue as it's still open. The original patch was for 3.3a0, 
there have been many changes to both IDLE and the Windows build since, 
including the recent IDLE entry point in the new Windows installer.

Steve, Terry, please could you review to check if this issue is still relevant 
or can be closed off.

--
nosy: +anthonypjshaw, cheryl.sabella, steve.dower

___
Python tracker 

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



Re: pythonw.exe error

2017-10-30 Thread Rustom Mody
On Monday, October 30, 2017 at 10:11:49 PM UTC+5:30, Igor Korot wrote:
> Hi,
> 
> 
> 
> On Oct 30, 2017 11:27 AM, "George Kalamaras via Python-list" wrote:
> 
> When I am running IDLE return to me Missing python36.dll error
> 
> Στάλθηκε από την Αλληλογραφία για Windows 10
> 
> 
> Could you please translate this from Greek?

Google translate tells me this is "Sent from mail for Windows 10"

IOW its probably a mail auto-footer of the OP, not the error message
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: pythonw.exe error

2017-10-30 Thread Igor Korot
Hi,



On Oct 30, 2017 11:27 AM, "George Kalamaras via Python-list" <
python-list@python.org> wrote:

When I am running IDLE return to me Missing python36.dll error

Στάλθηκε από την Αλληλογραφία για Windows 10


Could you please translate this from Greek?

Thank you.


--
https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


pythonw.exe error

2017-10-30 Thread George Kalamaras via Python-list
When I am running IDLE return to me Missing python36.dll error

Στάλθηκε από την Αλληλογραφία για Windows 10

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue13582] IDLE and pythonw.exe stderr problem

2017-06-29 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
assignee:  -> terry.reedy
stage: test needed -> patch review
versions: +Python 3.6, Python 3.7 -Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue22819] Python3.4: xml.sax.saxutils.XMLGenerator.__init__ fails with pythonw.exe

2015-02-10 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
resolution:  - not a bug
status: pending - closed

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



[issue22819] Python3.4: xml.sax.saxutils.XMLGenerator.__init__ fails with pythonw.exe

2014-11-27 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
status: open - pending

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



[issue22819] Python3.4: xml.sax.saxutils.XMLGenerator.__init__ fails with pythonw.exe

2014-11-08 Thread Edward K. Ream

New submission from Edward K. Ream:

In Python3.2 xml.sax.saxutils.XMLGenerator.__init__ succeeds if the out 
keyword argument is not given and sys.stdout is None, which will typically be 
the case when using pythonw.exe.

Alas, on Python3.4, the ctor throws an exception in this case.

This is a major compatibility issue, and is completely unnecessary: the ctor 
should work as before.  An easy fix: allocate a file-like object as the out 
stream, or just do what is done in Python 3.2 ;-)

--
components: Library (Lib)
messages: 230844
nosy: Edward.K..Ream
priority: normal
severity: normal
status: open
title: Python3.4: xml.sax.saxutils.XMLGenerator.__init__ fails with pythonw.exe
type: crash
versions: Python 3.4

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



[issue22819] Python3.4: xml.sax.saxutils.XMLGenerator.__init__ fails with pythonw.exe

2014-11-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In any case XMLGenerator is not usable if the out keyword argument is not 
given and sys.stdout is None. Just the exception will be raised later. I 
consider early failure as a feature, not a bug.

--
nosy: +serhiy.storchaka

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



[issue22819] Python3.4: xml.sax.saxutils.XMLGenerator.__init__ fails with pythonw.exe

2014-11-08 Thread R. David Murray

R. David Murray added the comment:

Agreed.  I was going to ask what it was that 3.2 did that was useful.

--
nosy: +r.david.murray

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



[issue22819] Python3.4: xml.sax.saxutils.XMLGenerator.__init__ fails with pythonw.exe

2014-11-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

FYI the code was changed in issue1470548.

--

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



[issue22730] ensurepip should work with pythonw.exe

2014-10-26 Thread Steve Dower

New submission from Steve Dower:

I'd like to be able to run ensurepip in the 3.5 installer with pythonw.exe, to 
avoid having the console window appear.

Unfortunately, pip requires a valid value for sys.__stdout__. This patch adds a 
dummy value for __stdout__ that allows pip to be installed/uninstalled with 
pythonw.

I see no reason not to check this into default now, so just seeking a quick 
review from the module owners. I can also backport it to 3.4 if that's thought 
to be worthwhile, but I don't think the installer for 3.4 will be updated to 
use pythonw, so it probably doesn't matter.

--
assignee: steve.dower
components: Installation
files: ensurepip.patch
keywords: patch
messages: 230032
nosy: dstufft, ncoghlan, steve.dower
priority: normal
severity: normal
status: open
title: ensurepip should work with pythonw.exe
versions: Python 3.5
Added file: http://bugs.python.org/file37020/ensurepip.patch

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



[issue22730] ensurepip should work with pythonw.exe

2014-10-26 Thread Donald Stufft

Donald Stufft added the comment:

This looks OK to me.

I'm not a Windows person are there changes in pip that would make sense to make 
it work without this patch?

--
nosy: +Marcus.Smith, pmoore

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



[issue22730] ensurepip should work with pythonw.exe

2014-10-26 Thread Steve Dower

Steve Dower added the comment:

I think the only thing pip could do is to stop using print(), which is not a 
reasonable request.

It may be reasonable to change pythonw to use dummy IO streams by default, but 
that may cause programs to print() messages expecting the user to see them. 
It's also likely a breaking change for many programs, so I do think handling 
the ensurepip case like this is best.

Just realised that I probably ought to make the same fix for __stderr__, in 
case pip succeeds but tries to write a warning there that causes the installer 
to detect a failure. Assume an equivalent line of code to set stderr/__stderr__ 
if needed.

--

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



[issue22730] ensurepip should work with pythonw.exe

2014-10-26 Thread Donald Stufft

Donald Stufft added the comment:

The development version of pip switches things over to using the Python logging 
framework instead of a homegrown one which more or less relies on print(). 
Probably we could detect if we don't have a stdout and just not output 
anything? People can pass a parameter to redirect it to a log file or whatever 
too.

--

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



[issue22730] ensurepip should work with pythonw.exe

2014-10-26 Thread Steve Dower

Steve Dower added the comment:

That change sounds like it'll be enough, and I'd be surprised if the logging 
module doesn't already handle the case with no streams.

(Aside: it'd be nice for ensurepip to have a log file parameter that can be 
passed through.)

I'll hold off on merging this in now, though I'll keep it in my branch until we 
get a pip update.

--
resolution:  - wont fix
status: open - closed

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



[issue22730] ensurepip should work with pythonw.exe

2014-10-26 Thread Paul Moore

Paul Moore added the comment:

This looks reasonable to me.

--

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



[issue22730] ensurepip should work with pythonw.exe

2014-10-26 Thread Paul Moore

Paul Moore added the comment:

Wait, sorry I misread the discussion (long day here). If we can do this in pip 
yes that would be better. It looks like we can detect when we're being run via 
pythonw by checking if sys.stdout is None.

--

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



[issue22384] Tk.report_callback_exception kills process when run with pythonw.exe

2014-09-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Error messages are already silenced if sys.stderr is None or closed.

 sys.stderr.close()
 1/0
 

 sys.stderr = None
 1/0
 

I think that such things as _Errbox are application level solutions. 
report_callback_exception() is designed to be overwritten for this purpose. 
Application can decide to pop up message box always, not only when sys.stderr 
is None, or tracebacks to a log, or add application icon and scrollbar on 
message box, or output error on special area on main windows.

Definitely it would be good to add something like _Errbox to IDLE. But this 
will be other issue. This issue is only about crashing of default 
implementation, and if my patch fixes it, I want to commit it and close the 
issue.

--

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



[issue22384] Tk.report_callback_exception kills process when run with pythonw.exe

2014-09-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Since traceback.print_exception already uses print statememts, your patch *is* 
sufficient to trap the remaining stderr exception. Go ahead.

The doctring for report_callback_exception calls it an 'internal function'.  To 
me, that implies 'ignore this' rather than 'override this'.  I suggest changing 
the docstring to

Report callback exception on sys.stderr.

Applications may want to override this internal function, and should when 
sys.stderr is None.


--

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



[issue22384] Tk.report_callback_exception kills process when run with pythonw.exe

2014-09-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

And yes, I am thinking about a broader fix for Idle -- replacing stderr None 
with something writable.

--

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



[issue22384] Tk.report_callback_exception kills process when run with pythonw.exe

2014-09-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 994a16b51544 by Serhiy Storchaka in branch '2.7':
Issue #22384: An exception in Tkinter callback no longer crashes the program
https://hg.python.org/cpython/rev/994a16b51544

New changeset c62fad86fac3 by Serhiy Storchaka in branch '3.4':
Issue #22384: An exception in Tkinter callback no longer crashes the program
https://hg.python.org/cpython/rev/c62fad86fac3

New changeset 7191b14ca312 by Serhiy Storchaka in branch 'default':
Issue #22384: An exception in Tkinter callback no longer crashes the program
https://hg.python.org/cpython/rev/7191b14ca312

--
nosy: +python-dev

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



[issue22384] Tk.report_callback_exception kills process when run with pythonw.exe

2014-09-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for suggested docstring Terry. There is related question on 
StackOverflow:

http://stackoverflow.com/questions/4770993/silent-exceptions-in-python-tkinter-should-i-make-them-louder-how

--

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



[issue22384] Tk.report_callback_exception kills process when run with pythonw.exe

2014-09-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Aivar for helpful report.

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

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



[issue22384] Tk.report_callback_exception kills process when run with pythonw.exe

2014-09-13 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
keywords: +needs review
nosy: +terry.reedy

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



[issue22384] Tk.report_callback_exception kills process when run with pythonw.exe

2014-09-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

In a pythonw process, stdout and stderr are initially None unless and until 
changed.  (This is something we need to do for the Idle process itself.)  
Writing to None generates an AttributeError. Uncaught exceptions stop the 
Python process.

The patch works, for this particular case, in the sense of preventing process 
termination.  Print suppresses the exception-reporting exception (after trying 
sys.stdout as a backup).  It still fails at delivering the original exception 
message and traceback. 'Click', and nothing happens.

A developer need to see the specific message and users should at least know 
that something is wrong. The following alternate delivers the message in 
addition to suppressing the AttributeError. It is a a copy and paste 
replacement for the existing def report_callback_exception statement. (It was 
easier for me to experiment with my installed, non-repository Pythons).

class _Errbox:
def __init__(self):
self.txt=[]
from tkinter.messagebox import showerror
self.showerror = showerror
def write(self, txt):
self.txt.append(txt)
def show(self):
self.showerror(
title=Exception in Tkinter callback,
message=''.join(self.txt))
self.txt = []
def report_callback_exception(self, exc, val, tb):
Internal function. It reports exception on sys.stderr.
import traceback
try:
sys.stderr.write(Exception in Tkinter callback\n)
efile = sys.stderr
except AttributeError:
efile = self._Errbox()
sys.last_type = exc
sys.last_value = val
sys.last_traceback = tb
traceback.print_exception(exc, val, tb, file=efile)
if isinstance(efile, self._Errbox):
efile.show()

I checked and this is the only direct .write in the file. There is only one 
other print (to the default sys.stdout).

--

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



Re: pythonw.exe has stopped working

2014-09-12 Thread Rahul Bhagat
On Friday, 12 September 2014 11:18:25 UTC+5:30, Rahul Bhagat  wrote:
 Hello Folks,
 
 
 
 I'm using RIDE -- Robot Framework Test Data Editor
 
 RIDE 1.3 running on Python 2.7.6. 
 
 
 
 When I click on some of my test case the RIDE GUI hangs and gives bellow 
 error message.
 
 
 
 
 
 [Window Title]
 
 pythonw.exe
 
 
 
 [Main Instruction]
 
 pythonw.exe has stopped working
 
 
 
 [Content]
 
 A problem caused the program to stop working correctly. Windows will close 
 the program and notify you if a solution is available.
 
 
 
 [Close program]
 
 
 
 
 
 It's strange that while it's able to open other test cases but fails on one 
 particular test case. The distinguishing  fact about the test case is that it 
 is a big one using lots of keywords.
 
 
 
 I know it might work if I split my test case but have any of you encountered 
 this problem and knows how to fix it ? some fix like providing more memory or 
 specifying some parameter when pythonw.exe starts?
 
 
 
 
 
 Thank you very much  in advance.
 
 
 
 Cheers,
 
 
 
 Rahul.



UPDATE:


Additional Windows Log


Problem signature:
  Problem Event Name:   APPCRASH
  Application Name: pythonw.exe
  Application Version:  0.0.0.0
  Application Timestamp:527fcf67
  Fault Module Name:wxmsw28uh_core_vc.dll
  Fault Module Version: 2.8.12.1
  Fault Module Timestamp:   4e21188a
  Exception Code:   c005
  Exception Offset: 0002516e
  OS Version:   6.1.7601.2.1.0.256.48
  Locale ID:1033
  Additional Information 1: af6f
  Additional Information 2: af6f3f0509d68fb0a703e2e9a01d8095
  Additional Information 3: 14ba
  Additional Information 4: 14ba7bfab2274826d4d9f81374905fca

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288clcid=0x0409

If the online privacy statement is not available, please read our privacy 
statement offline:
  C:\Windows\system32\en-US\erofflps.txt
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: pythonw.exe has stopped working

2014-09-12 Thread Steven D'Aprano
rahuldbha...@gmail.com wrote:

 It's strange that while it's able to open other test cases but fails on
 one particular test case. The distinguishing  fact about the test case is
 that it is a big one using lots of keywords.

Sounds like you've run out of memory, and Windows has killed the process.

 I know it might work if I split my test case but have any of you
 encountered this problem and knows how to fix it ? some fix like providing
 more memory or specifying some parameter when pythonw.exe starts?

Install more memory?

It might help if you show us the code that crashes.


-- 
Steven

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: pythonw.exe has stopped working

2014-09-12 Thread Marko Rauhamaa
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info:

 rahuldbha...@gmail.com wrote:
 encountered this problem and knows how to fix it ? some fix like
 providing more memory or specifying some parameter when pythonw.exe
 starts?

 Install more memory?

 It might help if you show us the code that crashes.

Reminds me of a QA column from my university's CS student newsletter in
the 80's. It went something like this:

   Q. I finally managed to save enough money to buy a home computer. I
  read the user manual and wrote my first BASIC program as follows:

 20 GOTO 20

  I started the program with the RUN command, and it has been
  running since. What do I do now?

  I am new to computers, so no tech jargon, please.

   A. You can't expect shorter latencies in a computer in this price
  range. What we suggest, at a bare minimum, is a RAM upgrade to at
  least 64 kilobytes. The CPU might need to be replaced with the
  recently released 8 MHz model as well. [...]


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: pythonw.exe has stopped working

2014-09-12 Thread Terry Reedy

On 9/12/2014 1:48 AM, rahuldbha...@gmail.com wrote:



Hello Folks,

I'm using RIDE -- Robot Framework Test Data Editor RIDE 1.3 running
on Python 2.7.6.

When I click on some of my test case the RIDE GUI hangs and gives
bellow error message.


Run RIDE with python, not pythonw, from a command prompt, and you should 
be error messages from python.



--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


pythonw.exe has stopped working

2014-09-11 Thread rahuldbhagat


Hello Folks,

I'm using RIDE -- Robot Framework Test Data Editor
RIDE 1.3 running on Python 2.7.6. 

When I click on some of my test case the RIDE GUI hangs and gives bellow error 
message.


[Window Title]
pythonw.exe

[Main Instruction]
pythonw.exe has stopped working

[Content]
A problem caused the program to stop working correctly. Windows will close the 
program and notify you if a solution is available.

[Close program]


It's strange that while it's able to open other test cases but fails on one 
particular test case. The distinguishing  fact about the test case is that it 
is a big one using lots of keywords.

I know it might work if I split my test case but have any of you encountered 
this problem and knows how to fix it ? some fix like providing more memory or 
specifying some parameter when pythonw.exe starts?


Thank you very much  in advance.

Cheers,

Rahul.

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue22384] Tk.report_callback_exception kills process when run with pythonw.exe

2014-09-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

May be this patch would help.

--
assignee:  - serhiy.storchaka
keywords: +patch
nosy: +serhiy.storchaka
stage:  - patch review
type: crash - behavior
versions: +Python 2.7, Python 3.5
Added file: 
http://bugs.python.org/file36600/tkinter_report_callback_exception.patch

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



[issue22384] Tk.report_callback_exception kills process when run with pythonw.exe

2014-09-10 Thread Aivar Annamaa

New submission from Aivar Annamaa:

Seems that the statement 'sys.stderr.write(Exception in Tkinter callback\n)' 
in Tk.report_callback_exception fails when the program is run with pythonw.exe, 
and brings down the whole process.

A simple sample is attached.

--
files: demo.py
messages: 226712
nosy: Aivar.Annamaa
priority: normal
severity: normal
status: open
title: Tk.report_callback_exception kills process when run with pythonw.exe
Added file: http://bugs.python.org/file36594/demo.py

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



[issue22384] Tk.report_callback_exception kills process when run with pythonw.exe

2014-09-10 Thread Aivar Annamaa

Changes by Aivar Annamaa aivar.anna...@gmail.com:


--
components: +Tkinter
type:  - crash
versions: +Python 3.4

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



Re: How to tell Script to use pythonw.exe ?

2014-05-07 Thread cube345
On Tuesday, July 2, 2013 9:20:12 PM UTC-4, goldtech wrote:
 Hi,
 
 
 
 I want to run a .py file script using pythonw.exe so the DOS box will not 
 open. Is there a way from inside the script to say run me with pythonw.exe 
 and not python.exe?
 
 
 
 Thanks

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue13582] IDLE and pythonw.exe stderr problem

2014-02-26 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Idle start up seems unnecessarily fragmented into multiple files.
  idlelib/__main__.py 
  idlelib/idle.py
  idlelib/idlew.py
can all be started from the command line by name with either python or pythonw 
or run once by import. idlelib/__main__.py can also be started by 'python(w) -m 
idlelib'.

I checked that in Command Prompt
  C:\Programs\Python34python lib/idlelib/idle.py
  C:\Programs\Python34python lib/idlelib/idle.pyw
  C:\Programs\Python34pythonw lib/idlelib/idle.py
  C:\Programs\Python34pythonw lib/idlelib/idle.pyw
all do the same thing except that the first two caused a new console python 
icon to appear on the taskbar.

All three files contain
  import idlelib.PyShell
  idlelib.PyShell.main()
which are equivalent to
  from idlelib.PyShell import main; main()
PyShell can also by run by 'python(w) -m idlelip.PyShell' though I believe that 
is somewhat 'deprecated'.

idle.py also has a path addition that seems obsolete. I believe the addition 
was intended for developing idle with installed python and a subrepository 
consisting of idlelib/*. Subrepositories were possible with svn but are not 
with hg. In any case, proper development testing ultimately requires testing 
revised idle with current tkinter.py and compiled _tkinter.c. I suppose that 
the addition would still work to let someone clone the repository and run the 
repository Lib/*.py, etc, with installed binaries, but that seems ultimately 
chancy.

idle.pyw (which is also called by idle.bat) has additions for a scenario that I 
don't understand: idle.pyw is present and running but apparently not in 
idlelib, Idle is 'not installed', but PyShell and the rest of idlelib are 
somewhere on sys.path. There is nothing that I see as pythonw specific. I think 
this file should be dropped and any needed path manipulations added to idle.py.

A single start up file (idle.py) should first import tkinter (and _tkinter) as 
in the patch, but in try;except. If the import fails print to stderr if there 
is one (a console) or use subprocess to start python in a console to display 
the message. Ditto for creating root. Once that succeeds, I think stderr or the 
idle process should be replaces  unconditionally. A message box as in the patch 
is one possibility. An error log window is another. The latter could accumulate 
all non-fatal error messages to be edited and saved if the user wishes. I think 
the arg parsing code in PyShell that decides whether to open a Shell or an 
Editor should be moved to the startup file. Ditto for any other configuration 
stuff that precedes opening one or the other.

--

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



[issue13582] IDLE and pythonw.exe stderr problem

2013-07-06 Thread Todd Rovito

Todd Rovito added the comment:

Terry,
   Bottom line I can't seem to get this patch to do anything for me.  Before 
the patch is applied IDLE seems to be handling warnings and exceptions just 
fine in PyShell on the Mac.  I get no crash and the output matches the normal 
console.  Here is a small test program I wrote:
import warnings

def fxn():
# user warnings are not ignored by default and will cause a dump of 
information
# to standard error.
warnings.warn(User warning: Warn on purpose for IDLE, UserWarning)

if __name__ == __main__:
fxn()
print(the program should not terminate with the warning, but keep on 
running)
a = 10 * 1000
print(a)

# exception testing each of these will stop the program
# divide by zero
b = 10 * (1/0)
print(b)
# variable not defined
c = 4 + spam*3
print(c)
# can't convert 'int' object o str implicitly
d = '2' + 2
print(d)

Then I wanted to make sure I was executing the patched code so I made sure I 
called idle.pyw (normally I wouldn't do that I would use idle.py).  After I 
called the correct script I changed the code to force std error to ErrorNotify 
class around line 101:
import sys

##if 0: # For testing
##sys.__stderr__ = None
##sys.stderr = None

if sys.__stderr__ is None:
sys.__stderr__ = ErrorNotify()

if sys.stderr is None:
sys.stderr = ErrorNotify()

if sys.__stdout__ is None:
sys.__stdout__ = ErrorNotify(devnull=True)

if sys.stdout is None:
sys.stdout = ErrorNotify(devnull=True)

sys.__stderr__ = ErrorNotify()
sys.stderr = ErrorNotify()

I would expect after this code runs any message sent to stderr would go through 
the ErrorNotify class and a widget should appear with the stderr output.  Even 
after this change I can't get the error widget to appear.  I have not given up 
yet but I wanted to provide a status update.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13582
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-04 Thread Wayne Werner

On Wed, 3 Jul 2013, Dennis Lee Bieber wrote:


Consider that the Powershell default is to /prevent/ execution of
script files unless some security settings have been changed; even local
script files need to be signed to be executed.


Protip: No they don't - wrap it in a cmd/bat file and have it launch 
powershell[1]:


powershell -ExecutionPolicy Bypass -File ...


\o/

Microsoft security at it again! (reminds me a bit of just pushing 
Cancel to log into windows 98, I think it was)


-W

[1]: http://stackoverflow.com/q/728143/344286
--
http://mail.python.org/mailman/listinfo/python-list


Re: DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-04 Thread Andrew Berg
On 2013.07.04 09:08, Wayne Werner wrote:
 powershell -ExecutionPolicy Bypass -File ...
 
 
 \o/
 
 Microsoft security at it again! (reminds me a bit of just pushing 
 Cancel to log into windows 98, I think it was)
From an MSDN page linked in one of the answers:
 Now, why is
 
 PowerShell.exe –ExecutionPolicy Bypass –File c:\temp\bad-script.ps1
 
 not a security bug? Ultimately, if bad code has the ability to run this code, 
 it already has control of the machine.
http://blogs.msdn.com/b/powershell/archive/2008/09/30/powershell-s-security-guiding-principles.aspx

If an attacker can run code, he/she already has the capability to well, run 
code.
-- 
CPython 3.3.2 | Windows NT 6.2.9200 / FreeBSD 9.1
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-04 Thread Chris Angelico
On Fri, Jul 5, 2013 at 8:12 AM, Andrew Berg robotsondr...@gmail.com wrote:
 On 2013.07.04 09:08, Wayne Werner wrote:
 powershell -ExecutionPolicy Bypass -File ...


 \o/

 Microsoft security at it again! (reminds me a bit of just pushing
 Cancel to log into windows 98, I think it was)
 From an MSDN page linked in one of the answers:
 Now, why is

 PowerShell.exe –ExecutionPolicy Bypass –File c:\temp\bad-script.ps1

 not a security bug? Ultimately, if bad code has the ability to run this 
 code, it already has control of the machine.
 http://blogs.msdn.com/b/powershell/archive/2008/09/30/powershell-s-security-guiding-principles.aspx

 If an attacker can run code, he/she already has the capability to well, run 
 code.

Well, the whole point of sandboxing is to allow some code and not
other - look at web browser scripts. You can run your JavaScript code
on someone else's machine without the capability to run arbitrary
code.

What this proves is that PowerShell is not a sandboxing environment.
It has just two states: Trusted and untrusted. Untrusted code may not
run. Trusted code has full access as though the administrator typed
the commands by hand.

Unix has measures to prevent a running process from having full
control over the system, but even there, privilege escalation attacks
(usually involving some application that runs as root) have been
known. Restricting a running binary (as opposed to creating an
interpreted and very slow language) is a distinctly hard problem.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-03 Thread Tim Golden
On 03/07/2013 02:34, Andrew Berg wrote:
 DOS is long
 dead, and is much, much different under the hood from the console
 subsystem in modern versions of Windows.


While this is clearly true, it's by no means unusual for people to refer
to the DOS Box or talk about DOS commands etc. even when they're
quite well aware of the history of Windows and its Console subsystem.
It's just quicker than saying Console Window or something.

I mention this because it seems to get called out every time someone
uses the term DOS on this and other Python lists and it can smack
slightly of pedantry.

TJG
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-03 Thread Chris Angelico
On Wed, Jul 3, 2013 at 5:34 PM, Tim Golden m...@timgolden.me.uk wrote:
 On 03/07/2013 02:34, Andrew Berg wrote:
 DOS is long
 dead, and is much, much different under the hood from the console
 subsystem in modern versions of Windows.


 While this is clearly true, it's by no means unusual for people to refer
 to the DOS Box or talk about DOS commands etc. even when they're
 quite well aware of the history of Windows and its Console subsystem.
 It's just quicker than saying Console Window or something.

 I mention this because it seems to get called out every time someone
 uses the term DOS on this and other Python lists and it can smack
 slightly of pedantry.

I would avoid the term DOS Box in reference to cmd.exe though,
because DOSBox is an emulator. (Also because I have an OS/2 heritage,
where a DOS Window is command.com in a virtual x86 windowed session,
while an OS/2 Window is the native OS/2 command interpreter.)

But in general usage, calling them DOS commands is sloppy but
unambiguous. I wouldn't be concerned one way or the other.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-03 Thread Andrew Berg
On 2013.07.03 02:34, Tim Golden wrote:
 While this is clearly true, it's by no means unusual for people to refer
 to the DOS Box or talk about DOS commands etc. even when they're
 quite well aware of the history of Windows and its Console subsystem.
 It's just quicker than saying Console Window or something.
 
 I mention this because it seems to get called out every time someone
 uses the term DOS on this and other Python lists and it can smack
 slightly of pedantry.
It's not as ambiguous (or as common) as it used to be, but it has always 
bothered me when someone refers to the Win32 console as DOS. I try
not to be rude about it, but I really would like to prevent those who are not 
very familiar with Windows or its history from associating the
limits and internal behavior of MS-DOS with the console subsystem of Windows 
NT. Especially with the anti-Windows sentiment that seems to be
getting more popular (not that it's entirely without merit, but that's another 
topic for another day on another list), I'd rather see
operating systems judged on things that are actually true and not miscellaneous 
FUD spread by ignorance and confusion. I realize it can come
off as pedantic, but what may be obvious to those with of us with a lot of 
experience with different operating systems over the years can
easily slip past a novice.

BTW, there are several short and unambiguous terms one can use to refer to the 
Windows CLI environment (or parts thereof): cmd, command
prompt, command line, terminal, console, etc.. Also, I don't think I've ever 
encountered anyone who prefers to call it DOS even though they
know it's not correct, but if you say it's not unusual, then they're obviously 
out there, and I'll keep that in mind before jumping in to
correct them.
-- 
CPython 3.3.2 | Windows NT 6.2.9200 / FreeBSD 9.1
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-03 Thread Tim Golden
On 03/07/2013 09:28, Andrew Berg wrote:
 On 2013.07.03 02:34, Tim Golden wrote:
 While this is clearly true, it's by no means unusual for people to
 refer to the DOS Box or talk about DOS commands etc. even when
 they're quite well aware of the history of Windows and its Console
 subsystem. It's just quicker than saying Console Window or
 something.
 
 I mention this because it seems to get called out every time
 someone uses the term DOS on this and other Python lists and it
 can smack slightly of pedantry.

 I really would like to prevent those who are not very familiar with
 Windows or its history from associating the limits and internal
 behavior of MS-DOS with the console subsystem of Windows NT.
 Especially with the anti-Windows sentiment that seems to be getting
 more popular (not that it's entirely without merit, but that's
 another topic for another day on another list), I'd rather see 
 operating systems judged on things that are actually true and not
 miscellaneous FUD spread by ignorance and confusion. 

We can certainly agree on this. I can't count the number of emails I've
deleted as too hot-headed in response to dismissive comments about
Windows as a platform. Some of them, at least, appear to be from people
who last actually used Windows back in the 9x days when the command
window was very limited indeed.

I realize it can
 come off as pedantic, but what may be obvious to those with of us
 with a lot of experience with different operating systems over the
 years can easily slip past a novice.

I suppose I view it in the same light as people (very few, thankfully,
in my experience) who go out of their way to correct MB to MiB when
talking about disk sizes. Or -- and I'm definitely guilty of this -- of
pointing out that London telephone numbers are all 020 plus eight digits
and *not* 0207 or 0208 plus seven digits. Whenever I do that I'm aware
that I'm technically in the right but that, for all practical purposes,
it's a needless precision.

Obviously, if it were clearly a source of confusion in some context I'd
clarify what needed to be clarified.


TJG
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-03 Thread Tim Chase
On 2013-07-03 09:51, Tim Golden wrote:
 We can certainly agree on this. I can't count the number of emails
 I've deleted as too hot-headed in response to dismissive comments
 about Windows as a platform. Some of them, at least, appear to be
 from people who last actually used Windows back in the 9x days when
 the command window was very limited indeed.

I guess one of my biggest frustrations with the cmd.exe (and
command.com) interpreters is that argument processing is left to the
application, so each application may do it slightly differently:

  C:\temp\ find weather *.py
  FIND: Parameter format not correct
  C:\temp\ find weather *.py
  -- WFD.PY
  weather = Weather(lat, lon)
  C:\temp\ findstr weather *.py
  wfd.py: weather = Weather(lat, lon)
  C:\temp\ findstr weather *.py
  wfd.py: weather = Weather(lat, lon)

And more maddeningly:

  C:\temp\ start file.txt
  ... opens the file correctly in Notepad
  C:\temp\ start file with space.txt
  ... opens a new dos box with the name file with space.txt rather
  than opening the file
  C:\temp\ start  file with space.txt
  ... opens the file correctly in Notepad

It's the little inconsistencies like this that wear daily on me.  That
and the lack of built-in utilities, so I'm regularly adding GNU tools
on new boxes.

-tkc




-- 
http://mail.python.org/mailman/listinfo/python-list


Re: DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-03 Thread Tim Golden
On 03/07/2013 13:50, Tim Chase wrote:
 On 2013-07-03 09:51, Tim Golden wrote:
 We can certainly agree on this. I can't count the number of emails
 I've deleted as too hot-headed in response to dismissive comments
 about Windows as a platform. Some of them, at least, appear to be
 from people who last actually used Windows back in the 9x days when
 the command window was very limited indeed.
 
 I guess one of my biggest frustrations with the cmd.exe (and
 command.com) interpreters is that argument processing is left to the
 application, so each application may do it slightly differently:

Goodness, I doubt if you'll find anyone who can seriously make a case
that the Windows command prompt is all it might be. I'm not a Powershell
user myself but people speak highly of it. Or, as you say, you can use
the GNU tools either natively or via cygwin. Not my cup of tea, but
that's the way of tools: one man's meat...

More to the point, I've got no problem with informed criticism (although
there's little point in grumbling just for the sake of it). The problem
I have is with criticisms which are years out of date, or which appear
to be fuelled by prejudice more than by experience.

TJG

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-03 Thread Steven D'Aprano
On Wed, 03 Jul 2013 14:00:49 +0100, Tim Golden wrote:

 Goodness, I doubt if you'll find anyone who can seriously make a case
 that the Windows command prompt is all it might be. I'm not a Powershell
 user myself but people speak highly of it.

I understand that Powershell is aimed more for batch use rather than 
interactive use.


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-03 Thread Jeff Schwab

On 2013-07-03 13:19:26 +, Steven D'Aprano said:


On Wed, 03 Jul 2013 14:00:49 +0100, Tim Golden wrote:


Goodness, I doubt if you'll find anyone who can seriously make a case
that the Windows command prompt is all it might be. I'm not a Powershell
user myself but people speak highly of it.


I understand that Powershell is aimed more for batch use rather than
interactive use.


Not sure what gave that impression.  PS comes with handy Unix-like 
aliases by default.  I used it interactively every day for years, and 
recommend it over either cmd or Cygwin.


--
http://mail.python.org/mailman/listinfo/python-list


Re: DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-03 Thread Chris Angelico
On Wed, Jul 3, 2013 at 10:50 PM, Tim Chase
python.l...@tim.thechases.com wrote:
 On 2013-07-03 09:51, Tim Golden wrote:
 We can certainly agree on this. I can't count the number of emails
 I've deleted as too hot-headed in response to dismissive comments
 about Windows as a platform. Some of them, at least, appear to be
 from people who last actually used Windows back in the 9x days when
 the command window was very limited indeed.

 I guess one of my biggest frustrations with the cmd.exe (and
 command.com) interpreters is that argument processing is left to the
 application, so each application may do it slightly differently:

   C:\temp\ find weather *.py
   FIND: Parameter format not correct
   C:\temp\ find weather *.py
   -- WFD.PY
   weather = Weather(lat, lon)
   C:\temp\ findstr weather *.py
   wfd.py: weather = Weather(lat, lon)
   C:\temp\ findstr weather *.py
   wfd.py: weather = Weather(lat, lon)

 And more maddeningly:

   C:\temp\ start file.txt
   ... opens the file correctly in Notepad
   C:\temp\ start file with space.txt
   ... opens a new dos box with the name file with space.txt rather
   than opening the file
   C:\temp\ start  file with space.txt
   ... opens the file correctly in Notepad

 It's the little inconsistencies like this that wear daily on me.  That
 and the lack of built-in utilities, so I'm regularly adding GNU tools
 on new boxes.

The issue you have there is mainly that the quotes are serving double
purpose. Yes, they delimit and thus can be used to surround a file
name with spaces in it, but they're also significant to a couple of
apps (FIND uses them to indicate the search string, START looks for a
quoted argument to use as the title). I'm not entirely sure how it's
done under the covers; C code looking at argc/argv sees quoted
arguments without their quotes, exactly as I would expect on Unix, and
yet the convention is to notice the quotes.

The issue with START is 100% understandable and 100% annoying.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to tell Script to use pythonw.exe ?

2013-07-03 Thread Νίκος

Στις 3/7/2013 6:43 πμ, ο/η Tim Roberts έγραψε:

goldtech leeg...@operamail.com wrote:


I just changed the file extension of the script file from .py to .pyw
and it uses pythonw.exe. I didn't read it anywhere, just intuited it
and tried it. Python has some very smart people working the language...


While your statement is true, that's not what happened here.

Windows has long had the ability to associate a file extension with a
handler.  If you start a command shell, the assoc command tells you the
program type associated with an extension, and the ftype command tells
you the command line that will be executed for that program type.  On my
box:

C:\tmpassoc .py
.py=Python

C:\tmpftype Python
Python=C:\Apps\Python27\Python.exe %1 %*

C:\tmpassoc .pyw
.pyw=Python.NoConFile

C:\tmpftype Python.NoConFile
Python.NoConFile=C:\Apps\Python27\Pythonw.exe %1 %*

You can create your own, if you want.  If you want files with a .script
extension to run PythonW, you can type:

 assoc .script=Python.NoConFile

My associations are broken, bt i only care for open web pages with 
Chrome instead of IE, so i sued your method:



C:\Windows\system32assoc .html=Chrome
.html=Chrome

C:\Windows\system32ftype 
Chrome=C:\Users\Ferrous\AppData\Local\Google\Chrome\Application\chrome.exe 
%1


Chrome=C:\Users\Ferrous\AppData\Local\Google\Chrome\Application\chrome.exe 
%1


but still when i click a link IE keeps popping up isntead of Chrome.
Any ideas why?
--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


Re: How to tell Script to use pythonw.exe ?

2013-07-03 Thread Benjamin Kaplan
On Jul 3, 2013 8:27 AM, Νίκος ni...@superhost.gr wrote:

 Στις 3/7/2013 6:43 πμ, ο/η Tim Roberts έγραψε:

 goldtech leeg...@operamail.com wrote:


 I just changed the file extension of the script file from .py to .pyw
 and it uses pythonw.exe. I didn't read it anywhere, just intuited it
 and tried it. Python has some very smart people working the language...


 While your statement is true, that's not what happened here.

 Windows has long had the ability to associate a file extension with a
 handler.  If you start a command shell, the assoc command tells you the
 program type associated with an extension, and the ftype command tells
 you the command line that will be executed for that program type.  On my
 box:

 C:\tmpassoc .py
 .py=Python

 C:\tmpftype Python
 Python=C:\Apps\Python27\Python.exe %1 %*

 C:\tmpassoc .pyw
 .pyw=Python.NoConFile

 C:\tmpftype Python.NoConFile
 Python.NoConFile=C:\Apps\Python27\Pythonw.exe %1 %*

 You can create your own, if you want.  If you want files with a .script
 extension to run PythonW, you can type:

  assoc .script=Python.NoConFile

 My associations are broken, bt i only care for open web pages with Chrome
instead of IE, so i sued your method:


 C:\Windows\system32assoc .html=Chrome
 .html=Chrome

 C:\Windows\system32ftype
Chrome=C:\Users\Ferrous\AppData\Local\Google\Chrome\Application\chrome.exe
%1


Chrome=C:\Users\Ferrous\AppData\Local\Google\Chrome\Application\chrome.exe
%1

 but still when i click a link IE keeps popping up isntead of Chrome.
 Any ideas why?

Because your links don't open files. They send requests to an http server
for data. And IE is the program designated to send http requests. Just use
the browser's make this the default button.
 --
 What is now proved was at first only imagined
 --
 http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to tell Script to use pythonw.exe ?

2013-07-03 Thread Νίκος

Στις 3/7/2013 7:36 μμ, ο/η Benjamin Kaplan έγραψε:


On Jul 3, 2013 8:27 AM, Νίκος ni...@superhost.gr
mailto:ni...@superhost.gr wrote:
 
  Στις 3/7/2013 6:43 πμ, ο/η Tim Roberts έγραψε:
 
  goldtech leeg...@operamail.com mailto:leeg...@operamail.com wrote:
 
 
  I just changed the file extension of the script file from .py to .pyw
  and it uses pythonw.exe. I didn't read it anywhere, just intuited it
  and tried it. Python has some very smart people working the language...
 
 
  While your statement is true, that's not what happened here.
 
  Windows has long had the ability to associate a file extension with a
  handler.  If you start a command shell, the assoc command tells
you the
  program type associated with an extension, and the ftype command tells
  you the command line that will be executed for that program type.  On my
  box:
 
  C:\tmpassoc .py
  .py=Python
 
  C:\tmpftype Python
  Python=C:\Apps\Python27\Python.exe %1 %*
 
  C:\tmpassoc .pyw
  .pyw=Python.NoConFile
 
  C:\tmpftype Python.NoConFile
  Python.NoConFile=C:\Apps\Python27\Pythonw.exe %1 %*
 
  You can create your own, if you want.  If you want files with a .script
  extension to run PythonW, you can type:
 
   assoc .script=Python.NoConFile
 
  My associations are broken, bt i only care for open web pages with
Chrome instead of IE, so i sued your method:
 
 
  C:\Windows\system32assoc .html=Chrome
  .html=Chrome
 
  C:\Windows\system32ftype
Chrome=C:\Users\Ferrous\AppData\Local\Google\Chrome\Application\chrome.exe
%1
 
 
Chrome=C:\Users\Ferrous\AppData\Local\Google\Chrome\Application\chrome.exe
%1
 
  but still when i click a link IE keeps popping up isntead of Chrome.
  Any ideas why?

Because your links don't open files. They send requests to an http
server for data. And IE is the program designated to send http requests.
Just use the browser's make this the default button.


I dont understand you. I explicitly state via cmd to have the .html 
files opened with Chrome instead of IE.



Tried it with the way you said and evben with open with.. but all that 
fails.


some seriosu damaged must have happened and assoc are refusing to change.


--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


Re: DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-03 Thread Ian Kelly
On Wed, Jul 3, 2013 at 4:11 PM, Dennis Lee Bieber wlfr...@ix.netcom.com wrote:
 On 03 Jul 2013 13:19:26 GMT, Steven D'Aprano
 steve+comp.lang.pyt...@pearwood.info declaimed the following:

On Wed, 03 Jul 2013 14:00:49 +0100, Tim Golden wrote:

 Goodness, I doubt if you'll find anyone who can seriously make a case
 that the Windows command prompt is all it might be. I'm not a Powershell
 user myself but people speak highly of it.

I understand that Powershell is aimed more for batch use rather than
interactive use.

 In one respect: no...

 Consider that the Powershell default is to /prevent/ execution of
 script files unless some security settings have been changed; even local
 script files need to be signed to be executed.

IOW, it's aimed at *secure* batch use for paranoid sysadmins.

According to microsoft.com:


Windows PowerShell® is a task-based command-line shell and scripting
language designed especially for system administration. Built on the
.NET Framework, Windows PowerShell® helps IT professionals and power
users control and automate the administration of the Windows operating
system and applications that run on Windows.


Which would seem to indicate that it targets both interactive and
scripting uses.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to tell Script to use pythonw.exe ?

2013-07-03 Thread alex23

On 4/07/2013 2:50 AM, Νίκος wrote:

I dont understand you. I explicitly state via cmd to have the .html
files opened with Chrome instead of IE.
Tried it with the way you said and evben with open with.. but all that
fails.
some seriosu damaged must have happened and assoc are refusing to change.


This list is for discussing Python, not your concerns du jour with
various operating systems.

Please take this to comp.os.ms-windows.misc instead.

--
http://mail.python.org/mailman/listinfo/python-list


[issue13582] IDLE and pythonw.exe stderr problem

2013-07-03 Thread Dev Player

Dev Player added the comment:

I may be mistaken but I thought, as of not too long ago, that pythonw.exe is no 
longer needed by current versions. 2.7.5

--
nosy: +devplayer

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13582
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13582] IDLE and pythonw.exe stderr problem

2013-07-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

No change. pythonw.exe is still present and in use.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13582
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



How to tell Script to use pythonw.exe ?

2013-07-02 Thread goldtech
Hi,

Using Windows

I want to run a .py file script using pythonw.exe so the DOS box will not open. 
Is there a way from inside the script to say run me with pythonw.exe and not 
python.exe?

Thanks
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to tell Script to use pythonw.exe ?

2013-07-02 Thread Andrew Berg
On 2013.07.02 20:20, goldtech wrote:
 Using Windows
 
 I want to run a .py file script using pythonw.exe so the DOS box will not 
 open. Is there a way from inside the script to say run me with pythonw.exe 
 and not python.exe?
Use the .pyw extension instead of .py.
Also, just FYI, DOS is long dead, and is much, much different under the hood 
from the console subsystem in modern versions of Windows.

-- 
CPython 3.3.2 | Windows NT 6.2.9200 / FreeBSD 9.1
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to tell Script to use pythonw.exe ?

2013-07-02 Thread goldtech
I just changed the file extension of the script file from .py to .pyw and it 
uses pythonw.exe. I didn't read it anywhere, just intuited it and tried it. 
Python has some very smart people working the language...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to tell Script to use pythonw.exe ?

2013-07-02 Thread Steven D'Aprano
On Tue, 02 Jul 2013 18:20:12 -0700, goldtech wrote:

 Hi,
 
 Using Windows
 
 I want to run a .py file script using pythonw.exe so the DOS box will
 not open. Is there a way from inside the script to say run me with
 pythonw.exe and not python.exe?

I don't believe so, because by the time the script is even opened, it is 
too late. I'm not an expert about Windows, but as I understand it, the 
process that occurs when you double-click the file is:

* Windows inspects the file extension and sees it is .py

* Windows checks the registry for the file extension association and 
finds python.exe

* Windows calls python.exe with the path to the script as argument

* finally python.exe opens the script.


Instead, you can use .pyw as the file extension, which should do what you 
want.



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to tell Script to use pythonw.exe ?

2013-07-02 Thread Tim Roberts
goldtech leeg...@operamail.com wrote:

I just changed the file extension of the script file from .py to .pyw
and it uses pythonw.exe. I didn't read it anywhere, just intuited it
and tried it. Python has some very smart people working the language...

While your statement is true, that's not what happened here.

Windows has long had the ability to associate a file extension with a
handler.  If you start a command shell, the assoc command tells you the
program type associated with an extension, and the ftype command tells
you the command line that will be executed for that program type.  On my
box:

C:\tmpassoc .py
.py=Python

C:\tmpftype Python
Python=C:\Apps\Python27\Python.exe %1 %*

C:\tmpassoc .pyw
.pyw=Python.NoConFile

C:\tmpftype Python.NoConFile
Python.NoConFile=C:\Apps\Python27\Pythonw.exe %1 %*

You can create your own, if you want.  If you want files with a .script
extension to run PythonW, you can type:

assoc .script=Python.NoConFile
-- 
Tim Roberts, t...@probo.com
Providenza  Boekelheide, Inc.
-- 
http://mail.python.org/mailman/listinfo/python-list


[issue13582] IDLE and pythonw.exe stderr problem

2013-06-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Todd, do you have a Mac to test this on?

This patch treat sending messages to a widget as a backup option. In 18318 I 
propose we make Idle a true gui app, with all messages other than 'No tkinter' 
handled by the gui. Console writing, when available, would then be a secondary 
option for those who want it. But in the meanwhile, I would like this or 
something like it applied.

--
nosy: +Todd.Rovito

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13582
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13582] IDLE and pythonw.exe stderr problem

2013-06-30 Thread Todd Rovito

Todd Rovito added the comment:

Yes I have a Mac and I am glad to help, so I gave it a test run tonight.  The 
first thing I did was apply the patch  then I ran idle from the console like so:
./python.exe Lib/idlelib/idle.py

For testing I used a simple print command to print to stderr:
sys.stderr.write(spam/n)

which I got the output of
spam/n6

I also tried to use the newer print function:
print(fatal error, file=sys.stderr)

Python 3.4 on the Mac behaved exactly the same way with or without the patch.  
I got the stderr output in the Python shell and nothing appeared in the 
console.  With the patch applied I saw no dialog box to capture the stderr 
output.  Maybe I didn't perform the test correctly?

Another thing to consider is for Mac IDLE runs in a special mode via 
macosxSupport.py which I turn on by forcing runningAsOSXApp() to always return 
True.  Even after setting runningAsOSXApp() to true a dialog box does not 
appear when writing to stderr.

Maybe I am not testing this patch correctly? Let me know if I can do anything 
else to help, thanks.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13582
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13582] IDLE and pythonw.exe stderr problem

2013-06-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Print in the user process goes to shell window. You need to stimulate (or just 
add) print or warn in the idle process, which normally goes to console, or 
nowhere. It is hard (intentionally, I am sure) to dynamically manipulate idle 
process code. Roger said try adding a raise Exception to a constructor for 
one of the extensions. I would start with a warning in PyShell. See doc or 
test_warnings for an example warnings call.

--
stage:  - test needed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13582
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13582] IDLE and pythonw.exe stderr problem

2013-06-30 Thread Gabriel Genellina

Changes by Gabriel Genellina ggenell...@gmail.com:


--
nosy: +ggenellina

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13582
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18298] pythonw.exe fails with redirected stderr

2013-06-26 Thread anatoly techtonik

anatoly techtonik added the comment:

I am not using pythonw.exe, it is the option users prefer to run the program. 

pythonw.exe is a binary, how do you propose to patch that? Or is it translated 
to .exe with RPython?


Can you be more specific  what shell  does not work correctly, what exactly 
does not work correctly, and what is the backward-incompatible behaviour that 
you want to avoid?

pythonw.exe is meant to suppresses the terminal window on startup (console 
window to be exact), but not to kill vital streams for an application. I posted 
links Spyder IDE source to show how it should be done.

--
resolution: wont fix - 
status: closed - open

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18298
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18298] pythonw.exe fails with redirected stderr

2013-06-26 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

RPython... let's be serious. The code of pythonw.exe is very simple, see 
PC/WinMain.c.

No, pythonw.exe is not meant to suppresses the terminal window on startup. 
This is only a consequence of being a windows application. There is a lot of 
documentation about this, for example:
http://comsci.liu.edu/~murali/win32gui/Win32Apps.htm

- python.exe is a regular console application, with a main() function.
- pythonw.exe is a gui application, with a WinMain() function; as a 
consequence, stdout/stderr won't work properly.

Again, it's a won't fix for 2.7, unless someone comes with a patch. But this 
has already been tried, and be careful, different versions of the msvcrt differ 
in behavior here.

--
resolution:  - wont fix
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18298
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18298] pythonw.exe fails with redirected stdett

2013-06-25 Thread anatoly techtonik

New submission from anatoly techtonik:

---cut test.py---
print(-1-)

open(-2-, w).write(-3-)
---cut test.py---


 C:\Python27\pythonw.exe test.py  -4-
 type -4-
-1-

 C:\Python27\pythonw.exe test.py 2 -4-
 type -4-
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr

 C:\Python27\python.exe test.py 2 -4-
-1-
type -4-



This may also affect subprocess calls under pythonw.exe  I am running Python 
2.7.3

--
messages: 191839
nosy: techtonik
priority: normal
severity: normal
status: open
title: pythonw.exe fails with redirected stdett
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18298
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18298] pythonw.exe fails with redirected stderr

2013-06-25 Thread anatoly techtonik

Changes by anatoly techtonik techto...@gmail.com:


--
components: +Windows

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18298
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18298] pythonw.exe fails with redirected stderr

2013-06-25 Thread anatoly techtonik

Changes by anatoly techtonik techto...@gmail.com:


--
title: pythonw.exe fails with redirected stdett - pythonw.exe fails with 
redirected stderr

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18298
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18298] pythonw.exe fails with redirected stderr

2013-06-25 Thread anatoly techtonik

anatoly techtonik added the comment:

This subprocess.communicate() call fails with pythonw.exe

--cut testhg.py--
import subprocess

hg = hg
output, _err = subprocess.Popen([hg, 'id', '-nib'],
   stdout=subprocess.PIPE).communicate()
open(-hg-, w).write(output)
--cut testhg.py--


When testhg.py is run with python.exe from cmd.exe session, the -hg- file is 
created ok. When pythonw.exe is used, nothing happens. When redirecting stderr 
from pythonw.exe with:

C:\Python27\pythonw.exe testhg.py 21

1 contains the following stacktrace:
Traceback (most recent call last):
  File testhg.py, line 5, in module
stdout=subprocess.PIPE).communicate()
  File C:\Python27\lib\subprocess.py, line 672, in __init__
errread, errwrite) = self._get_handles(stdin, stdout, stderr)
  File C:\Python27\lib\subprocess.py, line 787, in _get_handles
p2cread = self._make_inheritable(p2cread)
  File C:\Python27\lib\subprocess.py, line 826, in _make_inheritable
_subprocess.DUPLICATE_SAME_ACCESS)
WindowsError: [Error 6] The handle is invalid

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18298
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18298] pythonw.exe fails with redirected stderr

2013-06-25 Thread anatoly techtonik

anatoly techtonik added the comment:

This was meant to be a separate issue. :/

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18298
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18298] pythonw.exe fails with redirected stderr

2013-06-25 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Yes, in pythonw.exe the C stderr is not really usable, and this leads to 
unpredictable results.
It's difficult to fix in python2 though; python3 has fixed this issue, but in a 
way that cannot be backported.

Some workarounds:
- don't use pythonw.exe in a console, it's meant to be a *windows* application, 
without standard streams. I'm actually surprised of the behavior of your first 
example.

- use python3, where pythonw will set sys.stderr to None, and prints will be 
silently discarded.

--
nosy: +amaury.forgeotdarc
resolution:  - wont fix
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18298
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18298] pythonw.exe fails with redirected stderr

2013-06-25 Thread anatoly techtonik

anatoly techtonik added the comment:

It is not about modifying Python in general, it is about patching pythonw.exe 
or subprocess or documenting how to make subprocess calls compatible with 
pythonw.exe


don't use pythonw.exe in a console

And how to debug the issue? Maybe the only solution in not using pythonw.exe at 
all if you want *windows* app solution, and do custom management of hidden 
windows.

http://code.google.com/p/spyderlib/source/browse/CHANGELOG
http://code.google.com/p/spyderlib/source/browse/spyderlib/utils/windows.py

--
resolution: wont fix - 
status: closed - open

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18298
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18298] pythonw.exe fails with redirected stderr

2013-06-25 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

The proper solution if you use pythonw.exe is to define sys.stdout/sys.stderr 
yourself in pythonw.exe::
sys.stdout = open('c:/temp/output.txt', 'w')

IOW, do the redirect from inside the program, don't rely on the shell which (by 
design?) does not work correctly with /subsytem:windows binaries.
Again, this is a workaround for 2.7, because no backward-compatible fix could 
be found.

--
resolution:  - wont fix
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18298
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13582] IDLE and pythonw.exe stderr problem

2013-06-15 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
versions: +Python 3.4 -Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13582
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17658] pythonw.exe crashes on opening IDLE

2013-05-25 Thread Roger Serwy

Roger Serwy added the comment:

I'm closing this issue due since it's root problem is a misconfigured 
environment variable.

--
resolution:  - works for me
status: pending - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17658
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17658] pythonw.exe crashes on opening IDLE

2013-05-25 Thread Roger Serwy

Roger Serwy added the comment:

s/it's/its

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17658
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17658] pythonw.exe crashes on opening IDLE

2013-05-20 Thread Roger Serwy

Roger Serwy added the comment:

Patrick, does removing PYTHONPATH from your environment variables fix this 
problem?

--
nosy: +roger.serwy
status: open - pending

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17658
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17658] pythonw.exe crashes on opening IDLE

2013-04-08 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Hum, do you have any environment variable that refer to Python27?
In a terminal window (cmd.exe), try the following command:
  set | findstr /i python

--
nosy: +amaury.forgeotdarc

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17658
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   3   >