cms-dev / cms-dev/cms

ImportUser with the Italian format is unable to handle directories

Open
#621 0 comments 0 reactions 1 assignee View on GitHub

@lw is already working on this.

Since Jun 17, 2016.

import_export yamlimporter
Dominant language
Python
Stars
1k
Forks
412
Avg merge
6d 10h
Merged PRs (30d)
3

Description

Try running cmsImportUser with no parameters inside a directory containing a valid contest (e.g. con_test). It will fail saying that contest.yaml is missing.

As far as I can tell the same happens with arguments pointing to directories.

The reason for that is a combination of os.path.abspath in ImportUser.py, which strips trailing slashes if present, and of os.path.dirname in italy_yaml.py's get_user, which strips the last component of the path. This means that with input /foo/bar/ the file is searched in /foo/contest.yaml.

I will fix that shortly, I'm just posting here to gather feedback, if any.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.