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

mpeterv / Penlight
81%
master: 84%

Build:
Build:
LAST BUILD BRANCH: add-import-into-checks
DEFAULT BRANCH: master
Repo Added 10 Sep 2015 08:57AM UTC
Files 38
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH fix-normpath
branch: fix-normpath
CHANGE BRANCH
x
Reset
  • fix-normpath
  • add-import-into-checks
  • class-overwrite-error
  • coverage
  • fix-fnmatch
  • fix-lapp-callback
  • fix-path-tmpname
  • fix-sip
  • lex-string-lineno
  • master
  • memoize
  • pretty-number
  • pretty-read-function
  • quote-string-brackets
  • read-error-fname-prefix
  • sip-docs
  • utils-quote-arg
  • writefile-bin-mode

pending completion
34

push

travis-ci

mpeterv
Fix path.normpath

Rewrite path.normpath to first split out path anchor
(drive or UNC path start or '/', '//' or '\') and then iterate
over parts of remaining relative path.

This fixes issues with normpath not working correctly (comparing
to Python's os.path.normpath) in these cases:

* When a path part starts with '..':
    os.path.normpath("A/..B") == "A/..B"
    pl.path.normpath("A/..B") == "B"
* When a path starts with './':
    os.path.normpath("./A") == "A"
    pl.path.normpath("./A") == "./A"
* When a path ends with '/.':
    os.path.normpath("A/.") == "A"
    pl.path.normpath("A/.") == "A/."
* When a path ends with '/':
    os.path.normpath("A/") == "A"
    pl.path.normpath("A/") == "A/"
* When a path starts with '//':
    os.path.normpath("//") == "//"
    pl.path.normpath("//") == "/"

After this commit the only category of mismatches with Python's normpath
is paths starting with '/..': Python collapses that to '/'.

On Windows this commit fixes "C:\.." being normalized to ".".
Fixes #184.

28 of 28 new or added lines in 1 file covered. (100.0%)

4414 of 5472 relevant lines covered (80.67%)

750.41 hits per line

Relevant lines Covered
Build:
Build:
5472 RELEVANT LINES 4414 COVERED LINES
750.41 HITS PER LINE
Source Files on fix-normpath
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
34 fix-normpath Fix path.normpath Rewrite path.normpath to first split out path anchor (drive or UNC path start or '/', '//' or '\') and then iterate over parts of remaining relative path. This fixes issues with normpath not working correctly (comparing to Pyth... push 17 Jul 2016 11:35AM UTC mpeterv travis-ci pending completion  
See All Builds (30)
  • Repo on GitHub
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

© 2025 Coveralls, Inc