all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#14366: 24.3; Python os.getlogin does not work
@ 2013-05-08  3:19 rajanikanth
  2013-05-08  7:06 ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: rajanikanth @ 2013-05-08  3:19 UTC (permalink / raw)
  To: 14366


Run python using:

M-x run-python (I used python 3.3.1). Once Python starts, run the
following:

import os
os.getlogin() and see the error

import os
>>> os.getlogin()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
FileNotFoundError: [Errno 2] No such file or directory

The above can be reproduced by running python in an emacs Shell too.

This does not happen when I run Python from normal shell (without
emacs):

Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.getlogin()
'rajanikanth'




In GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu)
 of 2013-05-07 on ubuntu
System Description:	Ubuntu 13.04

Configured using:
 `configure '--prefix=/home/rajanikanth/EMACS-24/' '--without-x''

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Inferior Python

Minor modes in effect:
  compilation-shell-minor-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
ESC [ > 1 ; 3 4 0 2 ; 0 c ESC x r u n - p y t h o n 
RET RET RET RET e x i t ( ) RET C-x 0 C-u ESC x r u 
n - p y t h o n RET DEL DEL DEL 3 . 3 TAB - i RET y 
i m p o r t SPC o s RET o s . g e t l o g i n ( ) RET 
ESC x r e p o r t - b u TAB RET

Recent messages:
("./emacs")
For information about GNU Emacs and the GNU system, type C-h C-a.
Sent python-shell-completion-setup-code
Sent python-ffap-setup-code
Sent python-eldoc-setup-code
Make dedicated process? (y or n)  y
Sent python-shell-completion-setup-code
Sent python-ffap-setup-code
Sent python-eldoc-setup-code

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils compile tool-bar python rx easymenu comint
regexp-opt ring ansi-color time-date ediff-hook vc-hooks lisp-float-type
tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow
timer jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer loaddefs button faces cus-face macroexp files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process multi-tty emacs)





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

* bug#14366: 24.3; Python os.getlogin does not work
  2013-05-08  3:19 bug#14366: 24.3; Python os.getlogin does not work rajanikanth
@ 2013-05-08  7:06 ` Glenn Morris
  2013-05-08 22:29   ` Rajanikanth Jammalamadaka
  0 siblings, 1 reply; 3+ messages in thread
From: Glenn Morris @ 2013-05-08  7:06 UTC (permalink / raw)
  To: rajanikanth; +Cc: 14366

rajanikanth@gmail.com wrote:

>>>> os.getlogin()
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> FileNotFoundError: [Errno 2] No such file or directory

Works for me. Found various old Python bugs related to this:

http://bugs.python.org/issue584566
http://bugs.python.org/issue1750013

> System Description:	Ubuntu 13.04





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

* bug#14366: 24.3; Python os.getlogin does not work
  2013-05-08  7:06 ` Glenn Morris
@ 2013-05-08 22:29   ` Rajanikanth Jammalamadaka
  0 siblings, 0 replies; 3+ messages in thread
From: Rajanikanth Jammalamadaka @ 2013-05-08 22:29 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 14366

[-- Attachment #1: Type: text/plain, Size: 425 bytes --]

> > FileNotFoundError: [Errno 2] No such file or directory
>
> Works for me. Found various old Python bugs related to this:
>
> http://bugs.python.org/issue584566
> http://bugs.python.org/issue1750013
>
> > System Description:   Ubuntu 13.04
>

Thanks. Please close it. I will use pwd which is the recommended module:

>>> pwd.getpwuid(os.getuid())[0]
pwd.getpwuid(os.getuid())[0]
'rajanikanth'

Thanks,
Raj

-- 
Rajanikanth

[-- Attachment #2: Type: text/html, Size: 1180 bytes --]

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

end of thread, other threads:[~2013-05-08 22:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-08  3:19 bug#14366: 24.3; Python os.getlogin does not work rajanikanth
2013-05-08  7:06 ` Glenn Morris
2013-05-08 22:29   ` Rajanikanth Jammalamadaka

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.