Skip to content

Fix for msvcrt import error (issue #526) - #527

Merged
lipis merged 1 commit into
gae-init:masterfrom
davidstackio:msvcrt-fix
Jun 9, 2016
Merged

lipis merged 1 commit into
gae-init:masterfrom
davidstackio:msvcrt-fix

Conversation

@davidstackio

Copy link
Copy Markdown
Contributor

Fixes issue #526

Comment thread main/appengine_config.py
else:
if os.name == 'nt':
os.name = None
sys.platform = ''

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the SO question there is nothing about sys.platform.. why is that?

@davidstackio davidstackio Jun 9, 2016 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because in that question it was for Django and only os.name was used to check if the os was windows. In this case, Click uses both sys.platform and os.name to check if the os is Windows. Using only os.name doesn't work (EDIT: having only the line os.name = None in this code doesn't work).

See
https://github.com/pallets/click/search?utf8=%E2%9C%93&q=sys.platform&type=Code
and
https://github.com/pallets/click/search?utf8=%E2%9C%93&q=nt&type=Code

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on mine.. it works like this.. thanks!

Maybe we should file an issue on click for that matter.. WDYT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem!

Yeah, we probably should file an issue with Click as it is a part of Flask now, and I'm sure we're not the only ones who are going to run into this issue with App Engine...in which case, it would probably be good to file one with Flask too.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dhstack Will you do that..? and post here the issue numbers so we could vote/subscribe..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Flask issue:
pallets/flask#1901

Click issue:
pallets/click#594

@lipis
lipis merged commit 7abca84 into gae-init:master Jun 9, 2016
lipis added a commit that referenced this pull request Jun 9, 2016
* 'master' of github.com:gae-init/gae-init:
  Fix for msvcrt import error (issue #526) (#527)
topless added a commit to topless/gae-init that referenced this pull request Jun 29, 2016
* master:
  Version 5.0.2
  Moved coffeescript, less and uglify-js to npm devDependencies. (gae-init#541)
  Fixed single page test (gae-init#540)
  Fixed jumping in filter test for -1 option (gae-init#536)
  Change fontawesome icon for 'Versions' link (gae-init#535)
  Update flask-oauthlib and webargs (gae-init#533)
  Flask 0.11.1
  Added no-promote example in README.md
  Fix for msvcrt import error (issue gae-init#526) (gae-init#527)
  Config API under /admin/ (gae-init#524)
  Print progress while updating (gae-init#523)
  Removed unused
  Pre-release version 5.0.1
  Refactor magic.py
  Version 5.0.0
  Flask 0.11

# Conflicts:
#	main/api/v1/auth.py
#	main/api/v1/config.py
#	main/auth/auth.py
#	main/control/admin.py
#	main/control/feedback.py
#	main/templates/admin/admin.html
@yassirasad

Copy link
Copy Markdown

I am facing same issue, it's annoying . I'm new to Flask on App Engine.

First dev_appserver.py app.yaml command was not running, it opens dev_appserver.py source code in editor. -> I changed associate file for .py to default python.exe, now working, but to open source code of .py file, now I have to right click and open with any editor (annoying).

Secondly it gives error dev_appserver: too few argumunets -> added /* in registry setting (No idea what it does). working now.

Now this Click thing. -.> installed Click 5.1 using pip, still issue is there.
raise ImportError('No module named %s' % fullname)
ImportError: No module named msvcrt
This fixed by your code.

Now another issue-
from flask import Flask
ImportError: No module named flask

thogh flask is installed lib folder as well as in \env\Lib\site-packages.

Please help.

rbubley pushed a commit to rbubley/gae-init that referenced this pull request Oct 30, 2018
rbubley pushed a commit to rbubley/gae-init that referenced this pull request Oct 30, 2018
* 'master' of github.com:gae-init/gae-init:
  Fix for msvcrt import error (issue gae-init#526) (gae-init#527)
lipis pushed a commit that referenced this pull request Oct 31, 2018
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 8.0.3 to 8.0.4.
<details>
<summary>Release notes</summary>

*Sourced from [lint-staged's releases](https://github.com/okonet/lint-staged/releases).*

> ## v8.0.4
> ## [8.0.4](http://git+https/github.com/okonet/lint-staged/compare/v8.0.3...v8.0.4) (2018-10-31)
> 
> 
> ### Bug Fixes
> 
> * **package:** update staged-git-files to version 1.1.2 ([ce434d3](http://git+https/github.com/okonet/lint-staged/commit/ce434d3))
</details>
<details>
<summary>Commits</summary>

- [`5e165a3`](lint-staged/lint-staged@5e165a3) Merge pull request [#513](https://github-redirect.dependabot.com/okonet/lint-staged/issues/513) from okonet/greenkeeper/staged-git-files-1.1.2
- [`07fd087`](lint-staged/lint-staged@07fd087) Merge branch 'master' into greenkeeper/staged-git-files-1.1.2
- [`00047de`](lint-staged/lint-staged@00047de) docs: fix typo ([#527](https://github-redirect.dependabot.com/okonet/lint-staged/issues/527))
- [`bedba5a`](lint-staged/lint-staged@bedba5a) refactor: Use object spread ([#524](https://github-redirect.dependabot.com/okonet/lint-staged/issues/524))
- [`c4e8a2d`](lint-staged/lint-staged@c4e8a2d) chore(package): update lockfile yarn.lock
- [`ce434d3`](lint-staged/lint-staged@ce434d3) fix(package): update staged-git-files to version 1.1.2
- See full diff in [compare view](lint-staged/lint-staged@v8.0.3...v8.0.4)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=lint-staged&package-manager=npm_and_yarn&previous-version=8.0.3&new-version=8.0.4)](https://dependabot.com/compatibility-score.html?dependency-name=lint-staged&package-manager=npm_and_yarn&previous-version=8.0.3&new-version=8.0.4)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants