Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zip file - Windows paths #1358

Open
pgpgpg opened this issue Jan 22, 2018 · 2 comments
Open

Zip file - Windows paths #1358

pgpgpg opened this issue Jan 22, 2018 · 2 comments

Comments

@pgpgpg
Copy link

@pgpgpg pgpgpg commented Jan 22, 2018

Context

When deploying a Django app (over 50mb) from a Windows 10 machine the tarball retains the Windows directory separators '\\', when deployed to Lambda this causes the error "No module named 'django.core.wsgi': ModuleNotFoundError"

Expected Behavior

  1. tarball should keep Unix directory separators

Actual Behavior

  1. tarball retains Windows directory separators

Possible Fix

In core.py, line 683 can be replaced with:

tarinfo = tarfile.TarInfo(posixpath.join(root.replace(temp_project_path, '').lstrip(os.sep).replace('\\', '/'), filename))

Which fixed it for me but is quite hacky and probably not that robust.

Steps to Reproduce

1.zappa deploy dev on Windows 10 machine with app over 50mb

Your Environment

  • Zappa version used: 0.45.1
  • Operating System and Python version: Windows 10, Python 3.6
  • Your zappa_settings.py:
{
    "dev": {
        "aws_region": "us-east-2",
        "django_settings": "<redacted>",
        "profile_name": "default",
        "project_name": "<redacted>",
        "runtime": "python3.6",
        "s3_bucket": "<redacted>",
        "exclude": ["*.env", "*.jpg", "*.png", "media*", "archive*", "node_*", ],
        "slim_handler": true,
        "timeout_seconds": 300,
    }
}
@rgov
Copy link
Contributor

@rgov rgov commented Jan 29, 2018

Generally uses of os.path.join should be audited, good point.

drummonds added a commit to drummonds/Zappa that referenced this issue Mar 6, 2019
Replace windows path separator with posix separator in Zip files Miserlou#1358
@serhii73
Copy link

@serhii73 serhii73 commented Jul 11, 2019

Is no longer relevant? Maybe better to close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.