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

Refactor win cwd cmdline #738

Merged
merged 3 commits into from
Jan 26, 2016

Conversation

fbenkstein
Copy link
Collaborator

As discussed this creates a common function for Process.cwd and Process.cwdline on Windows.

@giampaolo
Copy link
Owner

Appveyor failure: https://ci.appveyor.com/project/giampaolo/psutil/build/367/job/13xvsqt4e09p6i60

        path = cext.proc_cwd(self.pid)
    WindowsError: [Error 299] Only part of a ReadProcessMemory or WriteProcessMemory request was completed

Move cwd extraction code from _psutil_windows.c to process_info.c
so its closer to psutil_get_cmdline which accesses the process'
memory in a similar way.
@fbenkstein
Copy link
Collaborator Author

Appveyor failure seems unrelated.

@giampaolo
Copy link
Owner

Mmmm are you sure? I don't recall ever seeing that error.

@fbenkstein
Copy link
Collaborator Author

The first error was definitely caused by my change. I made an update and now I'm only seing:

ERROR: test_prog_w_funky_name (__main__.TestProcess)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_psutil.py", line 1802, in test_prog_w_funky_name
    self.assertEqual(p.cmdline(), cmdline)
  File "C:\Python27-x64\lib\site-packages\psutil-3.5.0-py2.7-win-amd64.egg\psutil\__init__.py", line 603, in cmdline
    return self._proc.cmdline()
  File "C:\Python27-x64\lib\site-packages\psutil-3.5.0-py2.7-win-amd64.egg\psutil\_pswindows.py", line 290, in wrapper
    raise NoSuchProcess(self.pid, self._name)
NoSuchProcess: psutil.NoSuchProcess process no longer exists (pid=1884, name='psuz8b8nufoo bar )')

https://ci.appveyor.com/project/giampaolo/psutil/build/370/job/khsp57dfqvvbomj1#L418

Frank Benkstein added 2 commits January 26, 2016 10:37
Move the core code of psutil_get_cmdline into a separate function
psutil_get_parameters that uses a returncode and an output parameter.
Move core code of psutil_get_cwd into psutil_get_parameters so the
common code between psutil_get_cmdline and psutil_get_cwd can be
shared.
@fbenkstein
Copy link
Collaborator Author

Seems ready now.

@giampaolo
Copy link
Owner

Can you please update HISTORY.rst describing what has been fixed here?

@fbenkstein
Copy link
Collaborator Author

This isn't actually fixing anything it's just shuffling code around and consolidating. The real fix comes in #739.

giampaolo added a commit that referenced this pull request Jan 26, 2016
@giampaolo giampaolo merged commit caf49c3 into giampaolo:master Jan 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants