Skip to content

Commit f668288

Browse files
committed
Fix bad escape in some docstrings
1 parent 43fd2b3 commit f668288

7 files changed

Lines changed: 16 additions & 16 deletions

File tree

tests/test_handle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ def test_remote_handle_type_and_name(proc32_64):
3131
remote_handle = [x for x in proc32_64.handles if x.value == file_handle_vlue][0]
3232
assert remote_handle.pid == proc32_64.pid
3333
assert remote_handle.type == "File"
34-
assert remote_handle.name.startswith("\Device\HarddiskVolume")
34+
assert remote_handle.name.startswith(r"\Device\HarddiskVolume")
3535
assert remote_handle.name.endswith(TEST_FILE_FOR_HANDLE[2:]) # Remove volume letter
3636
assert remote_handle.infos

tests/test_object_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def test_multiple_access_type(objname):
3232

3333

3434
def test_complex_object_path():
35-
obj = objmanager["\\KnownDLLs\\kernel32.dll"]
35+
obj = objmanager[r"\KnownDLLs\kernel32.dll"]
3636
assert obj.name == "kernel32.dll"
3737
assert obj.fullname == "\\KnownDLLs\\kernel32.dll"
3838
assert obj.path == "\\KnownDLLs"
@@ -41,9 +41,9 @@ def test_complex_object_path():
4141

4242

4343
def test_link_object():
44-
obj = objmanager["\\KnownDLLs\\KnownDLLPath"]
44+
obj = objmanager[r"\KnownDLLs\KnownDLLPath"]
4545
assert obj.type == "SymbolicLink"
46-
assert obj.target.lower() == "c:\windows\system32"
46+
assert obj.target.lower() == r"c:\windows\system32"
4747

4848
# Test unicode string in Kernel object using an ALPC port
4949

windows/debug/symbols.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
def set_dbghelp_path(path):
16-
"""Set the path of the ``dbghelp.dll`` file to use. It allow to configure a different version of the DLL handling PDB downloading.
16+
r"""Set the path of the ``dbghelp.dll`` file to use. It allow to configure a different version of the DLL handling PDB downloading.
1717
1818
If ``path`` is a directory, the final ``dbghelp.dll`` will be computed as
1919
``path\<current_process_bitness>\dbghelp.dll``.
@@ -124,7 +124,7 @@ class SymbolInfoA(gdef.SYMBOL_INFO, SymbolInfoBase):
124124
CHAR_TYPE = gdef.CHAR
125125

126126
class SymbolInfoW(gdef.SYMBOL_INFOW, SymbolInfoBase):
127-
"""Represent a Symbol.
127+
r"""Represent a Symbol.
128128
This class in based on the class `SYMBOL_INFO <https://docs.microsoft.com/en-us/windows/win32/api/dbghelp/ns-dbghelp-symbol_info>`_
129129
with the handling on displacement embeded into it.s
130130
@@ -326,7 +326,7 @@ def type(self):
326326

327327
@property
328328
def pdb(self):
329-
"""The local path of the loaded PDB if present
329+
r"""The local path of the loaded PDB if present
330330
331331
Exemple:
332332
>>> sh = windows.debug.symbols.VirtualSymbolHandler()
@@ -455,7 +455,7 @@ def symbol_from_name(self, name):
455455
return sym
456456

457457
def resolve(self, name_or_addr):
458-
"""Resolve ``name_or_addr``.
458+
r"""Resolve ``name_or_addr``.
459459
460460
If its an int -> Return the :class:`SymbolInfo` at the address.
461461
If its a string -> Return the :class:`SymbolInfo` corresponding to the symbol name
@@ -504,7 +504,7 @@ def simple_aggregator(info, size, ctx):
504504
return True
505505

506506
def search(self, mask, mod=0, tag=0, options=gdef.SYMSEARCH_ALLITEMS, callback=None):
507-
"""Search the symbols matching ``mask`` (``Windbg`` like).
507+
r"""Search the symbols matching ``mask`` (``Windbg`` like).
508508
509509
:return: [:class:`SymbolInfo`] -- A list of :class:`SymbolInfo`
510510

windows/utils/winutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ def __exit__(self, exc_type, exc_value, traceback):
626626

627627

628628
class DisableWow64FsRedirection(object):
629-
"""
629+
r"""
630630
A context manager that disable the SysWow64 Filesystem Redirection ::
631631
632632
if is_process_32_bits:

windows/winobject/object_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,13 @@ def get(self, name):
166166
raise KeyError("Could not find WinObject <{0}> under <{1}>".format(name, self.fullname))
167167

168168
def __getitem__(self, name):
169-
"""Query object ``name`` from the directory, split and subquery on ``\\``::
169+
r"""Query object ``name`` from the directory, split and subquery on ``\``::
170170
171171
>>> obj
172172
<KernelObject "\Windows" (type="Directory")>
173173
>>> obj["WindowStations"]["WinSta0"]
174174
<KernelObject "\Windows\WindowStations" (type="Directory")>
175-
>>> obj["WindowStations\\WinSta0"]
175+
>>> obj[r"WindowStations\\WinSta0"]
176176
<KernelObject "\Windows\WindowStations" (type="Directory")>
177177
178178
:rtype: :class:`KernelObject`

windows/winobject/system.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def threads(self):
8787

8888
@property
8989
def logicaldrives(self):
90-
"""List of logical drives [C:\, ...]
90+
"""List of logical drives [C:\\, ...]
9191
9292
:type: [:class:`~windows.winobject.volume.LogicalDrive`] -- A list of LogicalDrive
9393
"""
@@ -621,7 +621,7 @@ def enumerate_threads_generator():
621621

622622
@staticmethod
623623
def enumerate_threads():
624-
return [WinThread._from_THREADENTRY32(th) for th in System.enumerate_threads_generator()]
624+
return [process.WinThread._from_THREADENTRY32(th) for th in System.enumerate_threads_generator()]
625625

626626

627627
def enumerate_threads_setup_owners(self):

windows/winobject/wmi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,11 +474,11 @@ def __repr__(self):
474474
return """<{0} "{1}"{2}>""".format(type(self).__name__, self.name, null)
475475

476476
class WmiManager(dict):
477-
"""The main WMI class exposed, used to list and access differents WMI namespace, can be used as a dict to access
477+
r"""The main WMI class exposed, used to list and access differents WMI namespace, can be used as a dict to access
478478
:class:`WmiNamespace` by name
479479
480480
Example:
481-
>>> windows.system.wmi["root\\SecurityCenter2"]
481+
>>> windows.system.wmi[r"root\SecurityCenter2"]
482482
<WmiNamespace "root\SecurityCenter2">
483483
"""
484484
DEFAULT_NAMESPACE = "root\\cimv2" #: The default namespace for :func:`select` & :func:`query`

0 commit comments

Comments
 (0)