Skip to content

Python3 incompatibilities in module manipulations #1401

@holajsh

Description

@holajsh

Play Version (1.5.x / etc)

1.7.0

Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)

Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal

JDK (Oracle 1.8.0_72, OpenJDK 1.8.x, Azul Zing)

openjdk version "11.0.14.1" 2022-02-08
OpenJDK Runtime Environment (build 11.0.14.1+1-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.14.1+1-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)

Expected Behavior

Running play new-module test should create the new module

Actual Behavior

Running play new-module test is failing:

$ play new-module test
~        _            _
~  _ __ | | __ _ _  _| |
~ | '_ \| |/ _' | || |_|
~ |  __/|_|\____|\__ (_)
~ |_|            |__/
~
~ play! 1.6.1, https://www.playframework.com
~
~ The new module will be created in /home/jsh/devel/play-modules/test
~
Traceback (most recent call last):
  File "/home/jsh/devel/play1/play", line 168, in <module>
    status = cmdloader.commands[play_command].execute(command=play_command, app=play_app, args=remaining_args, env=play_env, cmdloader=cmdloader)
  File "/home/jsh/devel/play1/framework/pym/play/commands/modulesrepo.py", line 61, in execute
    new(app, args, env)
  File "/home/jsh/devel/play1/framework/pym/play/commands/modulesrepo.py", line 242, in new
    replaceAll(os.path.join(app.path, 'conf/routes'), r'%MODULE_LOWERCASE%', string.lower(application_name))
AttributeError: module 'string' has no attribute 'lower'

Moreover the resources/module-skel/commands.py file should be updated to be compatible with python3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions