update.py saves files with CRLF EOL style on Windows

Bug #1075230 reported by Alessandro Pilotti
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo-incubator
Fix Released
Low
Alessandro Pilotti
Grizzly
Fix Released
Low
Alessandro Pilotti

Bug Description

By executing on Windows:

python update.py ..\python-novaclient

As detailed in:

http://wiki.openstack.org/CommonLibrary

File are saved with CRLF EOL convention and need no be converted to UNIX EOL before commit.

Mark McLoughlin (markmc)
affects: openstack-common → oslo
Revision history for this message
Mark McLoughlin (markmc) wrote :

Here's the code responsible

  def _replace(path, pattern, replacement):
      with open(path, "r+") as f:
          lines = f.readlines()
          f.seek(0)
          f.truncate()
          for line in lines:
              f.write(re.sub(pattern, replacement, line))

Changed in oslo:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Mark McLoughlin (markmc) wrote :
Changed in oslo:
status: Confirmed → In Progress
Mark McLoughlin (markmc)
Changed in oslo:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in oslo:
milestone: none → grizzly-2
status: Fix Committed → Fix Released
Mark McLoughlin (markmc)
Changed in oslo:
assignee: nobody → Alessandro Pilotti (alexpilotti)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.