Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #372: Forced to support NT servers; sysadmins quit.


comp / comp.lang.python / Re: Crash when launching python

SubjectAuthor
* Re: Crash when launching pythonBarry Scott
`* Re: Crash when launching pythonGreg Ewing
 `- Re: Crash when launching pythonBarry

1
Subject: Re: Crash when launching python
From: Barry Scott
Newsgroups: comp.lang.python
Date: Wed, 4 Sep 2024 19:48 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: barry@barrys-emacs.org (Barry Scott)
Newsgroups: comp.lang.python
Subject: Re: Crash when launching python
Date: Wed, 4 Sep 2024 20:48:21 +0100
Lines: 37
Message-ID: <mailman.35.1725480605.2917.python-list@python.org>
References: <CAASeUHqhP-TKjWkNqb_2o59a6hH6BRYa_kuNZn-gZ3wzC45NXQ@mail.gmail.com>
<C9833F78-4583-45F1-A7D6-7D450D4963DB@barrys-emacs.org>
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\))
Content-Type: text/plain;
charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de Xgdg/jtdXx6uFr8afAHn8gEz2xdhkamu/J/cV8QonZMA==
Cancel-Lock: sha1:AuSv6Ki1yggI9s8o73c53y2op6M= sha256:gnESYOVss0T92AGz3ozbQjvi4MrgVQ8k5Owk0Xt1NCM=
Return-Path: <barry@barrys-emacs.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.005
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:python': 0.06;
'debug': 0.07; 'debugging': 0.07; 'subject:when': 0.07; 'cc:addr
:python-list': 0.09; 'console,': 0.09; 'from:addr:barry': 0.09;
'received:217.70': 0.09; 'received:217.70.178': 0.09;
'received:gandi.net': 0.09; 'received:mail.gandi.net': 0.09;
'terminal': 0.09; 'cc:no real name:2**0': 0.14; '"show': 0.16;
'barry': 0.16; 'can:': 0.16; 'from:addr:barrys-emacs.org': 0.16;
'from:name:barry scott': 0.16; 'message-id:@barrys-emacs.org':
0.16; 'option.': 0.16; 'stdout': 0.16; 'tracebacks': 0.16;
'useful.': 0.16; 'wrote:<span': 0.16; 'wrote:': 0.16; 'python':
0.16; 'cc:addr:python.org': 0.20; 'version': 0.23; 'code': 0.23;
'cannot': 0.25; 'cc:2**0': 0.25; 'email addr:python.org&gt;':
0.28; 'assume': 0.32; 'python-list': 0.32; 'sep': 0.32; '0);':
0.33; 'rgb(0,': 0.33; 'package': 0.34; 'header:In-Reply-To:1':
0.34; 'files': 0.36; 'display': 0.36; 'main': 0.37; 'using': 0.37;
'edit': 0.39; 'use': 0.39; 'font-family:': 0.60; 'inline': 0.61;
'skip:h 10': 0.61; 'display:': 0.62; 'none;': 0.62; 'font-
weight:': 0.62; '0px;': 0.63; 'your': 0.64; 'text-indent:': 0.64;
'look': 0.65; 'normal;': 0.66; 'received:217': 0.67; 'skip:! 10':
0.67; 'float:': 0.74; 'email name:&lt;python-list': 0.84;
'happened.': 0.84; 'right-click': 0.84; '400;': 0.89; '13px;':
0.91; 'none;">': 0.91
In-Reply-To: <CAASeUHqhP-TKjWkNqb_2o59a6hH6BRYa_kuNZn-gZ3wzC45NXQ@mail.gmail.com>
X-Mailer: Apple Mail (2.3776.700.51)
X-GND-Sasl: barry@barrys-emacs.org
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <C9833F78-4583-45F1-A7D6-7D450D4963DB@barrys-emacs.org>
X-Mailman-Original-References: <CAASeUHqhP-TKjWkNqb_2o59a6hH6BRYa_kuNZn-gZ3wzC45NXQ@mail.gmail.com>
View all headers

> On 4 Sep 2024, at 16:27, Guenther Sohler via Python-list <python-list@python.org> wrote:
>
> Is it possible to turn on debugging and to display on the console, where
> python is loading files from ?
>

I assume you have a .app that is then packaged into a .dmg.

It will be the .app that you need to either build with a debug version of your code
or after building the .app edit the debug code into it.

Do you know that .app files are a tree of files?
You can right-click on an .app in Finder and it will have a "Show Package Context" option.

Or using the terminal and you can:
cd <appname>.app/Contents

then have a look around.

Beware that you cannot use print to stdout for a .app as its stdin/stdout do not go anywhere useful.
What I do is use code like this in the main function:

sys.stdout = open( '/home/barry/debug.log', 'w', 1 )
sys.stderr = sys.stdout

Now you can use print(); look in the debug.log to see what happened.
Also any tracebacks will end up in the debug.log.

Barry

Subject: Re: Crash when launching python
From: Greg Ewing
Newsgroups: comp.lang.python
Date: Thu, 5 Sep 2024 01:25 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: greg.ewing@canterbury.ac.nz (Greg Ewing)
Newsgroups: comp.lang.python
Subject: Re: Crash when launching python
Date: Thu, 5 Sep 2024 13:25:08 +1200
Lines: 11
Message-ID: <ljsfjmF5sa2U1@mid.individual.net>
References: <CAASeUHqhP-TKjWkNqb_2o59a6hH6BRYa_kuNZn-gZ3wzC45NXQ@mail.gmail.com>
<C9833F78-4583-45F1-A7D6-7D450D4963DB@barrys-emacs.org>
<mailman.35.1725480605.2917.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net CJfc/EEQgZTMVZeMqQMTmAukTAQokBu+1xOlwlS++WQiHpaRBQ
Cancel-Lock: sha1:Vn+MXedYuACpA/LpnJ3EQyYGB0c= sha256:NaXf28EtQe1V/1XEhkz8Y5iB6+rLClHmiGiarOheZ+o=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:91.0)
Gecko/20100101 Thunderbird/91.3.2
Content-Language: en-US
In-Reply-To: <mailman.35.1725480605.2917.python-list@python.org>
View all headers

On 5/09/24 7:48 am, Barry Scott wrote:
> Beware that you cannot use print to stdout for a .app as its stdin/stdout do not go anywhere useful.

You can invoke the executable inside the package from the Terminal.

Normally it's in the <appname>.app/Contents/MacOS subdirectory. The name
varies, but there's usually just one executable file in there. Run that
from a shell and you should see anything written to stdout or stderr.

--
Greg

Subject: Re: Crash when launching python
From: Barry
Newsgroups: comp.lang.python
Date: Thu, 5 Sep 2024 13:51 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: barry@barrys-emacs.org (Barry)
Newsgroups: comp.lang.python
Subject: Re: Crash when launching python
Date: Thu, 5 Sep 2024 14:51:01 +0100
Lines: 15
Message-ID: <mailman.36.1725544287.2917.python-list@python.org>
References: <ljsfjmF5sa2U1@mid.individual.net>
<2C9E37C8-ECEF-4015-84A9-279598A28AA1@barrys-emacs.org>
Mime-Version: 1.0 (1.0)
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de Ni7As1XZ670cpOLIVA39iAdztlnm5tx/NLtJwsQgdMtA==
Cancel-Lock: sha1:cnxxBLMXHAiDO3FwamNL/605xAM= sha256:5nqg2OGg4fOOCCC9rbaq6eqG1iA+GfS0awNWPfQ6hEo=
Return-Path: <barry@barrys-emacs.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:python': 0.06;
'subject:when': 0.07; 'cc:addr:python-list': 0.09;
'from:addr:barry': 0.09; 'macos': 0.09; 'received:217.70': 0.09;
'received:217.70.178': 0.09; 'received:gandi.net': 0.09;
'received:mail.gandi.net': 0.09; 'cc:no real name:2**0': 0.14;
'barry': 0.16; 'executable': 0.16; 'expects': 0.16; 'from:addr
:barrys-emacs.org': 0.16; 'greg': 0.16; 'gui.': 0.16; 'launching':
0.16; 'message-id:@barrys-emacs.org': 0.16; 'recall': 0.16;
'stdout': 0.16; 'wrote:': 0.16; 'cc:addr:python.org': 0.20;
'written': 0.22; 'code': 0.23; 'run': 0.23; 'anything': 0.25;
'cc:2**0': 0.25; 'normally': 0.26; 'python-list': 0.32; 'sep':
0.32; 'but': 0.32; 'header:In-Reply-To:1': 0.34; "it's": 0.37;
'file': 0.38; 'should': 0.40; "there's": 0.61; 'received:217':
0.67
In-Reply-To: <ljsfjmF5sa2U1@mid.individual.net>
X-Mailer: iPad Mail (21G93)
X-GND-Sasl: barry@barrys-emacs.org
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <2C9E37C8-ECEF-4015-84A9-279598A28AA1@barrys-emacs.org>
X-Mailman-Original-References: <ljsfjmF5sa2U1@mid.individual.net>
View all headers

> On 5 Sep 2024, at 02:32, Greg Ewing via Python-list <python-list@python.org> wrote:
>
> Normally it's in the <appname>.app/Contents/MacOS subdirectory. The name
> varies, but there's usually just one executable file in there. Run that
> from a shell and you should see anything written to stdout or stderr.

I recall that does not always work for app code that expects the macOS options that are passed in when launching from GUI.

Barry

1

rocksolid light 0.9.8
clearnet tor