Gradle wrapper task generates wrong zipStorePath in wrapper properties

When updating the gradle wrapper by changing the task

task wrapper( type: Wrapper ) {
        gradleVersion = '2.14.1'
        archiveBase = Wrapper.PathBase.PROJECT
        archivePath = 'gradle/wrapper/dists'
    }

to

task wrapper( type: Wrapper ) {
        gradleVersion = '3.1'
        archiveBase = Wrapper.PathBase.PROJECT
        archivePath = 'gradle/wrapper/dists'
        distributionBase = Wrapper.PathBase.PROJECT
        distributionPath = 'gradle/wrapper/dists'
    }

, executing ./gradlew wrapper generates the following gradle-wrapper.properties:

distributionBase=PROJECT
distributionPath=gradle/wrapper/dists
zipStoreBase=PROJECT
zipStorePath=../../gradle/wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-bin.zip

while we would expect the zipStorePath to be just “gradle/wrapper/dists”.

Is this a bug or did we misconfigure the task somehow?