• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Gallopsled / pwntools / 1

29 May 2020 09:05AM UTC coverage: 0.0% (-72.4%) from 72.414%
1

push

github

layderv
__str__ to __bytes__ in python2

0 of 8 new or added lines in 2 files covered. (0.0%)

11301 existing lines in 133 files now uncovered.

0 of 15497 relevant lines covered (0.0%)

0.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/pwnlib/commandline/errno.py
UNCOV
1
from __future__ import absolute_import, print_function
×
2

UNCOV
3
import argparse
×
UNCOV
4
import os
×
UNCOV
5
import errno
×
6

UNCOV
7
from pwnlib.commandline import common
×
8

UNCOV
9
parser = common.parser_commands.add_parser(
×
10
    'errno',
11
    help = 'Prints out error messages'
12
)
13

UNCOV
14
parser.add_argument(
×
15
    'error', help='Error message or value', type=str
16
)
17

UNCOV
18
def main(args):
×
19
  try:
×
20
    value = int(args.error, 0)
×
21

22
    if value < 0:
×
23
      value = -value
×
24

25
    if 0x100000000 - value < 0x200:
×
26
      value = 0x100000000 - value
×
27

28
    if value not in errno.errorcode:
×
29
      print("No errno for %s" % value)
×
30
      return
×
31

32
    name = errno.errorcode[value]
×
33

34
  except ValueError:
×
35
    name = args.error.upper()
×
36

37
    if not hasattr(errno, name):
×
38
      print("No errno for %s" % name)
×
39
      return
×
40

41
    value = getattr(errno, name)
×
42

43

44
  print('#define', name, value)
×
45
  print(os.strerror(value))
×
46

UNCOV
47
if __name__ == '__main__':
×
48
    pwnlib.commandline.common.main(__file__)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc