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

Don't chdir when running as a daemon #1547

Merged
merged 3 commits into from Jan 11, 2017

Conversation

3 participants
@webknjaz
Member

webknjaz commented Jan 9, 2017

Fixes #1546

@jaraco do you know the purpose of that os.chdir('/')?

@webknjaz

This comment has been minimized.

Show comment
Hide comment
@webknjaz

webknjaz Jan 10, 2017

Member

@jaraco Do you agree with removing chdir (7d54519)? This is the only question stopping me from merging this PR.

Member

webknjaz commented Jan 10, 2017

@jaraco Do you agree with removing chdir (7d54519)? This is the only question stopping me from merging this PR.

@webknjaz

This comment has been minimized.

Show comment
Hide comment
@webknjaz

webknjaz Jan 10, 2017

Member

there's also an option to chdir to _module__file__base instead.

Member

webknjaz commented Jan 10, 2017

there's also an option to chdir to _module__file__base instead.

webknjaz added some commits Jan 7, 2017

Convert cherryd script into console_script
Also:
* remove ``cherrypy/cherryd``
* run cherryd as cherrypy.__main__ module to support Python 2.6
Fix autoreload for cherryd loaded as a module
Also:
* raise RuntimeError when trying to reconstruct `-c`
* run cherryd as cherrypy.__main__ module to support Python 2.6

Ref: #1545
Ref: python/cpython@418baf9

@webknjaz webknjaz requested a review from jaraco Jan 11, 2017

if is_module:
"""It's containing `-m -m` sequence of arguments"""
if is_command and c_ind < m_ind:
"""There's `-c -c` before `-m`"""

This comment has been minimized.

@codacy-bot
@codacy-bot
# ... and substitute it with the original module path:
_argv.insert(m_ind, original_module)
elif is_command:
"""It's containing just `-c -c` sequence of arguments"""

This comment has been minimized.

@codacy-bot
@codacy-bot
# Survive module argument here
original_module = sys.argv[0]
if not os.access(original_module, os.R_OK):
"""There's no such module exist"""

This comment has been minimized.

@codacy-bot
@codacy-bot
c_ind = None
if is_module:
"""It's containing `-m -m` sequence of arguments"""

This comment has been minimized.

@codacy-bot
@codacy-bot
@codacy-bot

This comment has been minimized.

Show comment
Hide comment
@codacy-bot

codacy-bot Jan 11, 2017

Codacy Here is an overview of what got changed by this pull request:

Issues
======
- Added 5
           

Complexity increasing per file
==============================
- cherrypy/process/wspbus.py  4
         

See the complete overview on Codacy

codacy-bot commented Jan 11, 2017

Codacy Here is an overview of what got changed by this pull request:

Issues
======
- Added 5
           

Complexity increasing per file
==============================
- cherrypy/process/wspbus.py  4
         

See the complete overview on Codacy

doesn't work as it's impossible to reconstruct the `-c`'s contents.
Ref: https://github.com/cherrypy/cherrypy/issues/1545
"""

This comment has been minimized.

@codacy-bot
@codacy-bot

@jaraco jaraco merged commit 2ce092b into master Jan 11, 2017

4 of 5 checks passed

codacy/pr Not so good... This pull request quality could be better.
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

jaraco added a commit that referenced this pull request Jan 13, 2017

jaraco added a commit that referenced this pull request Jan 13, 2017

@jaraco jaraco deleted the bugfix/daemon-as-a-module branch Dec 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment