unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* Error running python interpreter under emacs on windows XP
@ 2007-10-08  9:16 Geoff Gole
  2007-10-08 11:46 ` Jason Rumney
  0 siblings, 1 reply; 3+ messages in thread
From: Geoff Gole @ 2007-10-08  9:16 UTC (permalink / raw)
  To: bug-gnu-emacs

Starting the python interpreter under emacs 22 on windows XP currently
results in an error. A python instance inferior to emacs fails to load
scripts in PYTHONPATH that a standalone python loads happily:

(python running under emacs)
M-x run-python
>>> import emacs
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named emacs
>>>

(python running under cmd.exe)
>>> import emacs
>>>

This is possibly due to path handling in the function run-python in
python.el. At line 1354:

                (cons (concat "PYTHONPATH=" data-directory
---->                         (if path (concat ":" path)))
                      process-environment)))

Since ":" won't work as a path delimiter under windows, perhaps this
is the issue. A potential fix is to replace ":" with

(if (or (eq system-type 'ms-dos)
        (eq system-type 'windows-nt))
    ";"
  ":")

Evaluating a temporary copy of run-python with the above replacement
seems to fix the issue on my system:

(python running under emacs, with above fix)
M-x run-python
>>> import emacs
>>>

This behaviour is consistent between my usual setup and an emacs -q session.

Using Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32
bit (Intel)] on win32

In GNU Emacs 22.0.990.1 (i386-mingw-nt5.1.2600)
 of 2007-05-23 on LENNART-69DE564 (patched)
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --cflags -Ic:/g/include'

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ENA
  locale-coding-system: cp1252
  default-enable-multibyte-characters: t

Major mode: Inferior Python

Minor modes in effect:
  server-mode: t
  binds: t
  compilation-shell-minor-mode: t
  delete-selection-mode: t
  encoded-kbd-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  noticeable-minibuffer-prompts-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-x r u n - p y t h o n <return> <C-down-mouse-1> i
m p o r t SPC e m a c s <return> M-x r e p o r t -
e m a c s - b u g <return>

Recent messages:
init-elisp-mode loaded: Emacs-lisp specific customisation
init-lisp-mode-common loaded: Customisation for lisp languages
init-lisp-interaction-mode loaded: Lisp-interaction specific customisation
For information about the GNU Project and its goals, type C-h C-p.
Loading python...done
Fontifying *Python*... (regexps..........)
Loading python...done
Quit
Loading emacsbug...done
call-interactively: End of buffer




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Error running python interpreter under emacs on windows XP
  2007-10-08  9:16 Error running python interpreter under emacs on windows XP Geoff Gole
@ 2007-10-08 11:46 ` Jason Rumney
  2007-10-08 11:53   ` Jason Rumney
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Rumney @ 2007-10-08 11:46 UTC (permalink / raw)
  To: Geoff Gole; +Cc: bug-gnu-emacs

Geoff Gole wrote:
> Since ":" won't work as a path delimiter under windows, perhaps this
> is the issue. A potential fix is to replace ":" with
>
> (if (or (eq system-type 'ms-dos)
>         (eq system-type 'windows-nt))
>     ";"
>   ":")
>   

I think a better fix is to use `path-separator' here.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Error running python interpreter under emacs on windows XP
  2007-10-08 11:46 ` Jason Rumney
@ 2007-10-08 11:53   ` Jason Rumney
  0 siblings, 0 replies; 3+ messages in thread
From: Jason Rumney @ 2007-10-08 11:53 UTC (permalink / raw)
  To: Geoff Gole; +Cc: bug-gnu-emacs

Jason Rumney wrote:
> Geoff Gole wrote:
>   
>> Since ":" won't work as a path delimiter under windows, perhaps this
>> is the issue. A potential fix is to replace ":" with
>>
>> (if (or (eq system-type 'ms-dos)
>>         (eq system-type 'windows-nt))
>>     ";"
>>   ":")
>>   
>>     
>
> I think a better fix is to use `path-separator' here.
>   

In fact that has already been done:

2007-07-28  Konstantin Novitsky  <knovitsk@Bear.com>  (tiny change)

    * progmodes/python.el (run-python): Fix path separator under w32.


Thanks for the report, anyway.






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-08 11:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-08  9:16 Error running python interpreter under emacs on windows XP Geoff Gole
2007-10-08 11:46 ` Jason Rumney
2007-10-08 11:53   ` Jason Rumney

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).