Windows: pdb command fails

Bug #963253 reported by Richard Stanton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-mode.el
Fix Committed
Medium
Unassigned

Bug Description

Running M-x pdb doesn't work on my Windows machine, primarily because Windows (at least using the default shell) doesn't automatically know what to do when you give it a .py command at the command line.

For example, here's the suggested command when I run pdb on a file c:\projects/run.py:

c:/python27/Lib/pdb.py run.py

If I accept this, I get an error "Spawning child process: Invalid argument"

A work-around to get it to work is to replace the suggested command with

c:\python27\python -i c:/python27/Lib/pdb.py c:/projects/run.py

(note that I not only have to add the python command, but also fully qualify the script file, since otherwise it complains it can't find the file).

Revision history for this message
Andreas Roehler (a-roehler) wrote :

assume the path is required for security reasons

Revision history for this message
Andreas Roehler (a-roehler) wrote :

BTW M-x pdb as command is not provided by python-mode

maybe we should care for that though

I'll flag that incomplete - it will expire unless some opinion drops in

Changed in python-mode:
status: New → Incomplete
Revision history for this message
Richard Stanton (a-stanton) wrote : RE: [Bug 963253] Re: pdb command fails under Windows

> BTW M-x pdb as command is not provided by python-mode
>
> maybe we should care for that though
>
> I'll flag that incomplete - it will expire unless some opinion drops in

I'd vote for python-mode handling the pdb command, at least to the extent of making sure that it works (e.g., by passing fully qualified path names where needed). It seems a pretty integral part of working with python files.

Changed in python-mode:
importance: Undecided → Medium
assignee: nobody → Andreas Roehler (a-roehler)
status: Incomplete → New
Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: pdb command fails under Windows

you could give it another try.

get some strange errors now from my batch-tests - which not occur when running manually

Changed in python-mode:
milestone: none → 6.1.2
Changed in python-mode:
status: New → Incomplete
importance: Medium → Undecided
assignee: Andreas Roehler (a-roehler) → nobody
milestone: 6.1.2 → none
Revision history for this message
Richard Stanton (a-stanton) wrote :

Hi Andreas:

I do think this is a significant issue for Windows users, and one that can be quite simply fixed. I think we just need two options:

1) The command to be executed when "M-x pdb" is typed - not usually needed, but for Windows machines running EPD, this could be set to, say, "c:\python27\python -i c:/python27/Lib/pdb.py"

2) Another option for whether or not to add the full path name before the name of the script file to be debugged. Again, not usually necessary, but under Windows this seems to be required to get things to work.

Otherwise, once we've got the command line set up right, pdb seems to run fine under Windows.

Changed in python-mode:
status: Incomplete → New
Changed in python-mode:
assignee: nobody → Andreas Roehler (a-roehler)
milestone: none → 6.0.8
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Andreas Roehler (a-roehler) wrote :

the case given, you could try

(setq gud-pdb-command-name "c:\python27\python -i c:/python27/Lib/pdb.py")

or alternatively

(push "c:\python27\python -i c:/python27/Lib/pdb.py" gud-pdb-history)

should this work, it would indicate a solution

Andreas

Changed in python-mode:
milestone: 6.0.8 → 6.1.0
Changed in python-mode:
status: In Progress → Incomplete
Changed in python-mode:
milestone: 6.0.11 → 6.0.12
Changed in python-mode:
milestone: 6.0.12 → 6.1.0
Revision history for this message
Andreas Roehler (a-roehler) wrote :

Hi Richard,

is this report still valid?

Andreas

Revision history for this message
Richard Stanton (a-stanton) wrote : RE: [Bug 963253] Re: pdb command fails under Windows

Yes, the problem is still the same.

> -----Original Message-----
> From: <email address hidden> [mailto:<email address hidden>] On Behalf
> Of Andreas Roehler
> Sent: Thursday, October 18, 2012 2:32 AM
> To: Richard Stanton
> Subject: [Bug 963253] Re: pdb command fails under Windows
>
> Hi Richard,
>
> is this report still valid?
>
> Andreas
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/963253
>
> Title:
> pdb command fails under Windows
>
> Status in An Emacs mode for editing Python code:
> Incomplete
>
> Bug description:
> Running M-x pdb doesn't work on my Windows machine, primarily because
> Windows (at least using the default shell) doesn't automatically know
> what to do when you give it a .py command at the command line.
>
> For example, here's the suggested command when I run pdb on a file
> c:\projects/run.py:
>
> c:/python27/Lib/pdb.py run.py
>
> If I accept this, I get an error "Spawning child process: Invalid
> argument"
>
> A work-around to get it to work is to replace the suggested command
> with
>
> c:\python27\python -i c:/python27/Lib/pdb.py c:/projects/run.py
>
> (note that I not only have to add the python command, but also fully
> qualify the script file, since otherwise it complains it can't find
> the file).
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/python-mode/+bug/963253/+subscriptions

Changed in python-mode:
status: Incomplete → New
Changed in python-mode:
milestone: 6.1.0 → 6.1.1
Changed in python-mode:
milestone: 6.1.1 → 6.2
Changed in python-mode:
milestone: 6.2 → 6.1.4
Revision history for this message
Andreas Roehler (a-roehler) wrote :

Sorry, can't fix within a reasonable time/effort. Let's see if someone can help. Re-signing this.

Cheers,
Andreas

summary: - pdb command fails under Windows
+ Windows: pdb command fails
Changed in python-mode:
milestone: 6.2.0 → none
assignee: Andreas Roehler (a-roehler) → nobody
importance: Medium → Critical
importance: Critical → Medium
Revision history for this message
Andreas Roehler (a-roehler) wrote :

Please re-open if not done.

Changed in python-mode:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.