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

os.getlogin Errno 6 #26

Open
yamsu opened this issue Sep 17, 2024 · 5 comments
Open

os.getlogin Errno 6 #26

yamsu opened this issue Sep 17, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@yamsu
Copy link

yamsu commented Sep 17, 2024

I use md2pptx, hence, this felt like the right templating tool, if that an appropriate classification, to use. Great work!

Unfortunately, running mdpre on a Ubuntu terminal resulted in the following error:

mdpre < presentation.mdp > presentation.md

Error

mdpre Markdown Preprocessor v0.6.8 (8 March, 2024)
==================================================
- opened <stdout> for writing
Traceback (most recent call last):
  File "~/usr/bin/mdpre", line 1432, in <module>
    setupStandardVariables()
  File "~/usr/bin/mdpre", line 1190, in setupStandardVariables
    input_file.insert(0, "=def userid " + os.getlogin() + " ")

The solution was to use os.getenv('LOGNAME'), as os.getlogin() seems to have documented issue:
dblossom-marist/PerfMon#20

@MartinPacker
Copy link
Owner

Thank you for this. Running on Mac I would never have seen it. Do you know if this solution works outside of Linux? I'd like to code a general solution, rather than a Linux-specific one. (But branching code, based on platform is a possibility. Yeuch!)

One tip: I always use the -v for "verbose" on the command line. It doesn't affect this bug, though.

@MartinPacker
Copy link
Owner

MartinPacker commented Sep 17, 2024

Candidate fix - using username = os.getenv('USER') or os.getenv('LOGNAME') or os.getenv('USERNAME') - coded. Have one other (minor) issue to fix before shipping v0.6.9. Other issue is Issue 27 - for which there is a candidate fix.

@MartinPacker MartinPacker added the bug Something isn't working label Sep 17, 2024
@MartinPacker
Copy link
Owner

Shipped in v0.6.9.

Keeping issue open for a few days.

@yamsu
Copy link
Author

yamsu commented Sep 17, 2024

Thanks for the quick update. I can confirm that v0.6.9 works on Ubuntu!

@MartinPacker
Copy link
Owner

Great! Will leave open for a few days in case any Windows user has a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants