question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot replace with multiple lines

See original GitHub issue

It seems that bumpversion doesn’t work with multiline string.

Here is my CHANGELOG.md:

## Unreleased ##

  - xxxx

## 0.0.2 -- 2015-12-08 ##

  - yyyy

And here is my .bumpversion.cfg:

[bumpversion:file:CHANGELOG.md]
search = ## Unreleased ##
replace = ## Unreleased ##

  ## {new_version} - {utcnow:%Y-%m-%d} ##

After running bumpversion, the expected changelog is:

## Unreleased ##

## 0.0.3 -- 2015-12-09 ##

  - xxxx

## 0.0.2 -- 2015-12-08 ##

  - yyyy

But the actual content is:

## Unreleased ##
## 0.0.3 -- 2015-12-09 ##

  - xxxx

## 0.0.2 -- 2015-12-08 ##

  - yyyy

And .bumpversion.cfg is changed:

[bumpversion:file:CHANGELOG.md]
search = ## Unreleased ##
replace = ## Unreleased ##
        ## {new_version} - {utcnow:%Y-%m-%d} ##

Bumpversion removes the empty line.

How to replace current version with multiline string?

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:5
  • Comments:5

github_iconTop GitHub Comments

1reaction
dochangcommented, Jan 14, 2016

Yes, RawConfigParser in py2 doesn’t recognize empty lines in multiple lines.

Instead of wrapping RawConfigParser, shall we switch to another parser, e.g., a toml parser?

0reactions
aiguofercommented, Mar 26, 2018

Just in case this is helpful to someone that finds this:

  • I figured out it works fine with no spacing if you use rst instead of md.
  • You should put this in .bumpversion.cfg instead of setup.cfg if you plan on building in python 3
Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiple line replacing doesn't work? - Community - Notepad++
The 'Replace with' field does not allow you to paste multiple lines of text. It gets cut off after the first line. You...
Read more >
How to multi-line "Replace in files..." in Notepad++
It's easy to do multiline replace in Notepad++. You have to use \n to represent the newline in ... Restart N++ and press...
Read more >
Replace multi line long text in multiple files (notepad++ or ...
I tried ToolBucket plugin for notepad++ but it can not replace in all files inside a folder, need to open all files in...
Read more >
Visual Studio 2019 how to add the Find and Replace Multi Lines
If you want Multiline Search and Replace in vs2019, try to customize search syntax by using .NET regular expressions and I believe the...
Read more >
replacing multiple lines with multiple lines in ascii file
Learn more about replace string, multiple lines MATLAB. ... I can not do it one line at the time because the single lines...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found