Hi,

It's good to know some people started using debmake.

On Thu, Nov 13, 2014 at 11:33:25AM +0100, Andrew Shadura wrote:
> Package: debmake
> Version: 4.1.7-1
> Severity: normal
> 
> Hi, I don't know the reason for this, but os.getlogin() fails here:
> 
> Traceback (most recent call last):
>   File "/usr/bin/debmake", line 28, in <module>
>     debmake.main()
>   File "/usr/lib/python3/dist-packages/debmake/__init__.py", line 107, in main
>     para = debmake.para.para(para)
>   File "/usr/lib/python3/dist-packages/debmake/para.py", line 47, in para
>     debfullname = pwd.getpwnam(os.getlogin())[4].split(',')[0]
> FileNotFoundError: [Errno 2] No such file or directory
> 
> It's been reported in other places as well, and it seems the underlying
> OS call fails for a reason. pwd.getpwuid(os.getuid())[0], however, gives
> the expected result reliably.

What authentication do you use to login to your account?
What x-terminal do you use?

Can you do the same as follows to see your side of situation?

$ echo $TERM
xterm
s -l /etc/alternatives/x-terminal-emulator
lrwxrwxrwx 1 root root 31 Oct  7 21:47 /etc/alternatives/x-terminal-emulator -> 
/usr/bin/gnome-terminal.wrapper
$ python3
Python 3.4.2 (default, Nov 13 2014, 07:01:52) 
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pwd
>>> import os
>>> pwd.getpwuid(os.getuid())
pwd.struct_passwd(pw_name='osamu', pw_passwd='x', pw_uid=1000, pw_gid=1000, 
pw_gecos='Osamu Aoki,,,', pw_dir='/home/osamu', pw_shell='/bin/bash')
>>> pwd.getpwuid(os.getuid())[4]
'Osamu Aoki,,,'
>>> pwd.getpwnam(os.getlogin())[4].split(',')[0]
'Osamu Aoki'
>>> os.environ.get("USER")
'osamu'
>>> ^D
$ id
uid=1000(osamu) gid=1000(osamu) 
groups=1000(osamu),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),102(netdev),110(lpadmin),113(scanner),118(bluetooth)
$ grep osamu /etc/passwd
osamu:x:1000:1000:Osamu Aoki,,,:/home/osamu:/bin/bash
$ cat /etc/nsswitch.conf 
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat
gshadow:        files

hosts:          files myhostname mdns4_minimal [NOTFOUND=return] dns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

(If you feel like mangling user name, please do so before posting reply)

> [0] http://lists.gnu.org/archive/html/bug-gnu-emacs/2013-05/msg00227.html
This is a report on bugs found in the System Description:   Ubuntu 13.04
This seems to be old issue.

The issue seems to be that some x-terminals ( gterm in
this case ) do not register themselves with utmp, which
this function uses.  I have two workarounds, one of
reverting back to using:

try:
     user=os.getlogin()
except:
     user=os.environ.get("USER")

Interesting.  Maybe I should do this as a work around.
 
> -- System Information:
> Debian Release: wheezy/sid
>   APT prefers unstable
>   APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')

Why bother scanning 'stable'?  It wastes time.

> Architecture: i386 (i686)
> Kernel: Linux 3.12-1-686-pae (SMP w/4 CPU cores)

Wow, not on amd64 and have big MEM SMP system.
 
> Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) (ignored: 
> LC_ALL set to en_GB.UTF-8)
> Shell: /bin/sh linked to /bin/mksh

Wow again.  It is not against policy but ...

> Versions of packages debmake depends on:
> ii  devscripts   2.14.5
> ii  dpkg-dev     1.17.10
> ii  python3      3.4.2-1
> pn  python3:any  <none>
> ii  rsync        3.0.7-2
> 
> Versions of packages debmake recommends:
> ii  build-essential  11.6
> ii  curl             7.21.2-4
> ii  strace           4.5.18-1
> ii  wget             1.15-1+b1
> 
> Versions of packages debmake suggests:
> ii  autotools-dev     20120608.1
> ii  ccache            3.0.1-1
> ii  cmake             2.8.12.1-1.1
> ii  cowbuilder        0.70
> ii  dh-autoreconf     7
> ii  dh-python         1.20131021-1
> pn  eatmydata         <none>
      Configuring this for testing/sid was headach ...
> pn  gem2deb           <none>
> ii  git               1:1.7.10.4-1
> ii  git-buildpackage  0.4.65
> ii  gitk              1:1.7.10.4-1
> pn  javahelper        <none>
> ii  lintian           2.5.22.1
> ii  mc                3:4.7.0.9-2
> ii  pbuilder          0.215
> ii  quilt             0.50-2
> ii  rpm2cpio          4.8.1-5
> 
> -- no debconf information
> 
> -- debsums errors found:
> debsums: changed file /usr/lib/python3/dist-packages/debmake/para.py (from 
> debmake package)

Can you post your patch? You have edited this file.

Regards,

Osamu


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to