Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' object has no attribute 'group' #30

Closed
mpolidori opened this issue Nov 24, 2018 · 5 comments
Closed

AttributeError: 'NoneType' object has no attribute 'group' #30

mpolidori opened this issue Nov 24, 2018 · 5 comments
Assignees
Labels

Comments

@mpolidori
Copy link

I'm getting an AttributeError with certain commands (rm -r and mkdir -m for example). Same error with the py.test commands. I found that If I remove env={"MANWIDTH": "80"}, the error disappears.

python manly.py mkdir -m
Traceback (most recent call last):
  File "manly.py", line 191, in <module>
    main()
  File "manly.py", line 180, in main
    title, output = manly(args.command)
  File "manly.py", line 151, in manly
    re.search(r"(?<=^NAME\n\s{5}).+", manpage, re.MULTILINE).group(0).strip()
AttributeError: 'NoneType' object has no attribute 'group'

So far I have tested this on 2 laptops. Unfortunately, they're both Arch Linux, so I haven't had a chance to test another distro yet.

I'm not sure if there's any other information I should provide. I don't know where to begin troubleshooting because I don't fully understand all of the changes in the new version yet.

If it's an Arch specific issue, this can probably be closed, and I'll attempt to find a workaround so I can update my AUR package fork to 0.4.0 (which is currently working with version 0.3.4). I can just remove env={"MANWIDTH": "80"}, but I agree that setting it to 80 greatly improves readability, especially in large or full screen terminals.

@Summertime Summertime added the bug label Nov 26, 2018
@Summertime Summertime self-assigned this Nov 26, 2018
@Summertime
Copy link
Collaborator

Sorry about that, I've set it up to pass the full environment again so the issue should be resolved in the current master branch!

@mpolidori
Copy link
Author

It's resolved. Thanks!

@Summertime
Copy link
Collaborator

for the sake of building testcases to avoid this in the future, if you have the time available, could you post the outputs of env -i man mkdir > manly_envless_rm and env > manly_env ? (after redacting any sensitive information from the two files, of course!)

@mpolidori
Copy link
Author

When I run env -i man mkdir > manly_envless_rm, I receive this error:

man: nroff: Bad system call (core dumped)
man: command exited with status 159: (cd /usr/share/man && /usr/lib/man-db/zsoelim) | (cd /usr/share/man && /usr/lib/man-db/manconv -f UTF-8:ISO-8859-1 -t ANSI_X3.4-1968//IGNORE) | (cd /usr/share/man && tbl) | (cd /usr/share/man && nroff -mandoc -rLL=84n -rLT=84n -Tascii)

And nothing is in the resulting file. I tested commands other than mkdir with the same result on both of my laptops. Again, they're both using the same distro, so I'm not sure if it's specific to that.

I searched a bit and read that the error could be an issue with groff files. I tried:

pacman -Qk groff
groff: 603 total files, 0 missing files

All looks good. I'm not sure where to go from there, but I'll keep searching.

With env > manly_env, this is the result:

XDG_MENU_PREFIX=gnome-
LANG=en_US.UTF-8
DISPLAY=:0
INVOCATION_ID=55d1738560a24a2893478f845a5bfffd
COLORTERM=truecolor
DESKTOP_AUTOSTART_ID=10667bd5539cab117154333333212010000000005730007
XDG_VTNR=1
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
XDG_SESSION_ID=1
USER=p
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/66976504_5973_4e4f_9773_8e158d434f74
PWD=/home/p
HOME=/home/p
JOURNAL_STREAM=9:19243
GTK_MODULES=canberra-gtk-module
MAIL=/var/spool/mail/p
WINDOWPATH=1
VTE_VERSION=5402
SHELL=/bin/bash
TERM=xterm-256color
XDG_CURRENT_DESKTOP=GNOME
GNOME_TERMINAL_SERVICE=:1.65
SHLVL=2
XDG_SEAT=seat0
LOGNAME=p
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
XDG_RUNTIME_DIR=/run/user/1000
XAUTHORITY=/home/p/.Xauthority
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
SESSION_MANAGER=local/gladia:@/tmp/.ICE-unix/573,unix/gladia:/tmp/.ICE-unix/573
_=/usr/bin/env

I don't believe any of the above info is sensitive information, but correct me if I'm wrong.

@DeadlySquad13
Copy link

DeadlySquad13 commented Apr 30, 2024

Hello! Thanks for cool and manly utility!
Unfortunately, I get the same error on ArchLinux.

ds13@salt:.../Projects/--personal/Programming_dotfiles.bootstrap$ manly notify-send -it

Traceback (most recent call last):
  File "/usr/bin/manly", line 204, in <module>
    main()
  File "/usr/bin/manly", line 193, in main
    title, output = manly(args.command)
                    ^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/manly", line 164, in manly
    re.search(r"(?<=^NAME\n\s{5}).+", manpage, re.MULTILINE).group(0).strip()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'group'

ds13@salt:.../Projects/--personal/Programming_dotfiles.bootstrap$ manly --version

manly 0.4.1
Copyright (c) 2017 Carl Bordum Hansen.
MIT License: see LICENSE.

Written by Carl Bordum Hansen and Mark Jameson.

I tried installing it both via pipx and yay - the result is the same. I see that this issue is resolved but what is the fix to problem?

P.S. Sorry for reviving old issue, haven't noticed that it was created 5 years ago - created separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants