Skip to content

bpo-38361: syslog: fixed making default "ident" from sys.argv[0]#16557

Merged
miss-islington merged 2 commits into
python:masterfrom
vaclavbartos:syslog_ident_fix
Jan 14, 2020
Merged

bpo-38361: syslog: fixed making default "ident" from sys.argv[0]#16557
miss-islington merged 2 commits into
python:masterfrom
vaclavbartos:syslog_ident_fix

Conversation

@vaclavbartos

@vaclavbartos vaclavbartos commented Oct 3, 2019

Copy link
Copy Markdown
Contributor

The default value of "ident" parameter should be sys.argv[0] with leading path
components stripped, but it contained the last slash, i.e. '/program' instead
of 'program'.

BPO issue: https://bugs.python.org/issue38361

https://bugs.python.org/issue38361

Automerge-Triggered-By: @gvanrossum

The default value of "ident" parameter should be sys.argv[0] with leading path
components stripped, but it contained the last slash, i.e. '/program' instead
of 'program'.
@the-knights-who-say-ni

Copy link
Copy Markdown

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@vaclavbartos

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@vaclavbartos vaclavbartos changed the title bpo-NNNN: syslog: fixed making default "ident" from sys.argv[0] bpo-38361: syslog: fixed making default "ident" from sys.argv[0] Oct 3, 2019
@brandtbucher brandtbucher added the type-bug An unexpected behavior, bug, or error label Oct 3, 2019
@brandtbucher

Copy link
Copy Markdown
Member

Thanks for your time @vaclavbartos, and welcome to CPython! 😎

This looks like a good change. I assume you’ve already seen the bot’s message about the CLA?

@brandtbucher brandtbucher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though this is a fairly trivial fix, I still think you should make a NEWS entry, since it changes logging output. Just something simple, like:

Fixed an issue where ``ident`` could include a leading path separator when :func:`syslog.openlog` was called without arguments.

And while a regression test or two are always good to include, it looks like this module has almost no test coverage currently due to platform issues. So, probably not necessary in this case.

@vaclavbartos

Copy link
Copy Markdown
Contributor Author

OK, I added the News entry. I signed the CLA yesterday and it's checked now.

Regarding tests - as you noted, it would be quite difficult to implement them, since there is currently no other way to read ident than to emit a syslog message, read it from a syslog file and parse ident from it - which is highly platfrom dependent.

@brandtbucher

Copy link
Copy Markdown
Member

This module doesn't have any experts with GitHub accounts, and hasn't had any real changes in almost a decade. Given that this is a fairly trivial change, perhaps another core dev could look at it?

CC @vstinner

@gvanrossum gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this looks good. I agree that this looks like a mis-translation of the original code, apparently introduced in revision d63a3b8.

@gvanrossum

Copy link
Copy Markdown
Member

Should we backport this to 3.8? Then the behavior would be different in 3.8.1 than in 3.8.0.

@brandtbucher

Copy link
Copy Markdown
Member

Even though it's a bug fix, I'm leaning "no". Logging output shouldn't change between minor versions, and I don't know of anyone who sees this as a must-have.

It's just another reason 3.9 will be better than 3.8.

@brandtbucher

Copy link
Copy Markdown
Member

Going through some of my old reviews and saw that this was still unmerged. @gvanrossum, is this waiting for anything?

@gvanrossum

Copy link
Copy Markdown
Member

Sorry! It should be merged now.

@brandtbucher

Copy link
Copy Markdown
Member

Congrats on your first CPython contribution @vaclavbartos! 🍾

Looking forward to seeing more from you in the future.

shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
…honGH-16557)

The default value of "ident" parameter should be sys.argv[0] with leading path
components stripped, but it contained the last slash, i.e. '/program' instead
of 'program'.

BPO issue: https://bugs.python.org/issue38361


https://bugs.python.org/issue38361
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants