changeset 6836 | c016dc1a8e91 |
parent 6762 | f67d1468ac50 |
parent 6835 | 08d9e0f974d9 |
child 6839 | 01db3e101362 |
6834:cbdfd08eabc9 | 6836:c016dc1a8e91 |
---|---|
1498 |
1498 |
1499 if not text and "b" not in mode: |
1499 if not text and "b" not in mode: |
1500 mode += "b" # for that other OS |
1500 mode += "b" # for that other OS |
1501 |
1501 |
1502 nlink = -1 |
1502 nlink = -1 |
1503 if mode[0] != "r": |
1503 if mode not in ("r", "rb"): |
1504 try: |
1504 try: |
1505 nlink = nlinks(f) |
1505 nlink = nlinks(f) |
1506 except OSError: |
1506 except OSError: |
1507 nlink = 0 |
1507 nlink = 0 |
1508 d = os.path.dirname(f) |
1508 d = os.path.dirname(f) |