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

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

Merged
merged 2 commits into from Jan 14, 2020

Conversation

@vaclavbartos
Copy link
Contributor

vaclavbartos commented Oct 3, 2019

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

This comment has been minimized.

Copy link

the-knights-who-say-ni commented Oct 3, 2019

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

This comment has been minimized.

Copy link
Member

brandtbucher commented Oct 3, 2019

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?

Copy link
Member

brandtbucher left a comment

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

This comment has been minimized.

Copy link
Contributor Author

vaclavbartos commented Oct 4, 2019

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

This comment has been minimized.

Copy link
Member

brandtbucher commented Oct 4, 2019

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

Copy link
Member

gvanrossum left a comment

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

@gvanrossum

This comment has been minimized.

Copy link
Member

gvanrossum commented Oct 23, 2019

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

@brandtbucher

This comment has been minimized.

Copy link
Member

brandtbucher commented Oct 23, 2019

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

This comment has been minimized.

Copy link
Member

brandtbucher commented Jan 14, 2020

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

@miss-islington miss-islington merged commit f04750b into python:master Jan 14, 2020
4 checks passed
4 checks passed
Azure Pipelines PR #20191004.14 succeeded
Details
bedevere/issue-number Issue number 38361 found
Details
bedevere/news News entry found in Misc/NEWS.d
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@gvanrossum

This comment has been minimized.

Copy link
Member

gvanrossum commented Jan 14, 2020

Sorry! It should be merged now.

@brandtbucher

This comment has been minimized.

Copy link
Member

brandtbucher commented Jan 14, 2020

Congrats on your first CPython contribution @vaclavbartos! 🍾

Looking forward to seeing more from you in the future.

petdance added a commit to petdance/cpython that referenced this pull request Jan 17, 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
petdance added a commit to petdance/cpython that referenced this pull request Jan 17, 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
petdance added a commit to petdance/cpython that referenced this pull request Jan 17, 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
Projects
None yet
6 participants
You can’t perform that action at this time.