Code

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#14998 closed (fixed)

'/'.join should use os.path.join

Reported by: CarlFK Owned by: nobody
Component: Contrib apps Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

http://code.djangoproject.com/browser/django/trunk/django/contrib/staticfiles/utils.py#L23

static_files = [location and '/'.join([location, fn]

Shouldn't that use os.path.join()?

Attachments (0)

Change History (4)

comment:1 Changed 3 years ago by russellm

  • milestone set to 1.3
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Yes.

comment:2 Changed 3 years ago by jezdez

Hm, it's actually not required since the path will be consumed by a storage class (http://code.djangoproject.com/browser/django/trunk/django/contrib/staticfiles/management/commands/collectstatic.py?rev=14592#L97) which calls os.path.normpath, converting all forward slashes to backward slashes. I agree it could be changed to always return platform specific relative paths of course, but I see this more as a cosmetic problem.

comment:3 Changed 3 years ago by Alex

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [15128].

comment:4 Changed 3 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.