Appengine SDK 1.7.3 not detecting updated files - python

I just updated to SDK 1.7.3 running on Linux. At the same time I switched to the SQLite datastore stub, suggested by the depreciation message.
After this, edits to source files are not always detected, and I have to stop and restart the SDK after updating, probably one time in ten. Is anyone else seeing this? Any ideas on how to prevent it?
UPDATE: Changes to python source files are not being detected. I haven't made any modifications to yaml files, and I believe that jinja2 template file modifications are being detected properly.
UPDATE: I added some logging to the dev appserver and found that the file I'm editing is not being monitored. Continuing to trace what is happening.

A similiar issue happens with appcfg.py in SDK 1.73, where it skips uploading some files sometimes. It looks like this only happens if appcfg.py is run under python 2.7.
The workaround is to simply run appcfg.py under python 2.5. Then the upload works reliably.
The code uploaded can still be 2.7 specific - it is only necessary to revert 2.5 in the step of running the uploader function in appcfg.py.

I've seen this after the 1.7.3 update too, on Mac. I didn't change anything with the datastore. I'd say one in ten is about right.
edit:
There's a solution here that involves adding "self._dirty = True" to google/appengine/tools/dev_appserver.py
http://code.google.com/p/googleappengine/issues/detail?id=8383
Seems to work for some, haven't seen the problem since.

Related

GitHub Coptilot does not work in NeoVim when editing Python

I have Arch Linux and so the latest NeoVim release is installed (0.7.0 at this moment). About a month I started using GitHub Copilot and it worked well in Bash, SH, JS and others. Yesterday I wanted to rewrite some program in Python but Copilot didn't work. Tried it in different files and languages - works everywhere but not Python! :Copilot status shows "Copilot: Enabled and online", but gives no suggestions. :Copilot panel shows "Synthesizing 0/10 solutions (Duplicates hidden)". :Copilot log contains nothing. I remember that some time ago it worked as expected but now it does not. I don't have any ideas why is that happening. As an Arch user I reject VisualStudio Code and other IDEs and prefer working in terminal. Anything that may help?
Edit: just discovered that opening a file without .py and printing #!/usr/bin/env python3 works for Copilot, but in this case there's no syntax highlight. Reopening with :edit adds colors but breaks Copilot
I've just solved it on my machine. I used nvm to set my NodeJS back to v16.13.0. reloaded neovim. Copilot now working as expected.
Copilot was not working on NodeJS v18.0.0.
What's annoying is tim-pope doesn't have the issues section active on the repo. So I'm sure others will run into this. Let me know if this solves it for you.

Getting "Premature end of script headers" on Dreamhost Python Webpage

I have a webpage made in Python Flask with Python 2.7 (I know), hosted on Dreamhost. Up until a few days ago I had absolutely no problems. Then, I started getting a permission error on my page. I don't know what happened, but I got with Dreamhost live chat and they solved it by doing a chmod 755 to my files. Everything was working again, but on further inspection, all the parts that generate a PDF document in my webpage have stopped working. The error that I am getting in the error logs is "Premature end of script headers".
This error only appears whenever I try to generate a PDF. The code works perfectly on my local environment, but it does not work on the hosting. I got with the people of Dreamhost again and they said that it was nothing on their side. Which is weird considering that the code that was ALREADY WORKING was not changed at all. I tried debugging on my part but I am not getting any errors.
I have tried pretty much everything I can think of to solve this situation but I have been unsuccessful. The course of action is to change this hosting (it was a mistake on my part to use Dreamhost in the first place, I know. But when I made this I was just starting and I had very little knowledge). But I need a quicker solution for the moment, and I was wondering if anyone has had this problem and could maybe help me out with this.
To elaborate, I am using Python 2.7, the library that is used for the PDF creation is Flask-Weasyprint (0.5). I tried running the wsgi file myself, and I am getting the following message:
/path/to/local/lib/python2.7/site-packages/WeasyPrint-0.39-py2.7.egg/weasyprint/text.py:29: UserWarning: There are known rendering problems with Cairo <= 1.14.0
warnings.warn('There are known rendering problems with Cairo <= 1.14.0')
/path/to/local/lib/python2.7/site-packages/WeasyPrint-0.39-py2.7.egg/weasyprint/fonts.py:46: UserWarning: #font-face support needs Pango >= 1.38
warnings.warn('#font-face support needs Pango >= 1.38')
I know that I should change to Python 3. When I made this web app, Dreamhost only accepted Python 2 and I barely had any knowledge of creating VPS or something like that. It is my plan to change hosting soon to a virtual machine and to run the project in Python 3. But I need a solution for this now before I go on.
Any help will be appreciated. If you need more details please let me know.
This may be due to the Passenger file not including your project directory in its path. One solution is adding the following to your passenger_wsgi.py file:
sys.path.append(os.getcwd()+"/<project_name>")

Kodi Plugin structure is incorrect

I'm having a trouble packaging Kodi plugin under MAC. I took as an example a simple video plugin and wanted to start with a simple renaming before doing further development. At this stage, import of plugin constantly fails when I do
Install from Zip in Kodi
I've resolved all issue related to specific MAC zip content, by writing my own python ZIP script, which omits all MAC related files. Thus, now I can unzip and zip a working plugin and successfully import it in Kodi. However, i'm still having Addon does not have correct structure.
Here is a link to my custom plugin.
What strikes me the most is that simple renaming causes all these issues. You might know any debugging tool for Kodi plugins? I will greatly appreciate any assistance, since I have put already 3 days in it.
Thanks!
Eventually, there seems to be a bug in Kodi, whenever you try to load a plugin with an incorrect structure, all subsequent loads will fails as well, even if the structure the updated plugin is correct. You should restart KODI to resolve this.
Cheers!

Flask mega tutorial part 5 error

Im going through the Microblog tutorial for Flask designed by Miguel.
I made it to part 4 without any issues. Everything ran in the end of part 4.
I started having issues in part 5. After a couple of tries and trying to troubleshoot with the comments in the page, I was not able to finish the exercise.
Thinking it was me, I deleted all of my project and replaced them with the zip downloadable in the page for the exercise. I still get the same error, so the problem is not the code itself.
I get the following error when running views.py:
Link to image on imgur (couldn't post it here due to not having enough reputation)
Here are the libraries I have installed:
Link to image on imgur (couldn't post it here due to not having enough reputation)
My setup:
I am using Pycharm to run the files. This machine runs Windows and I found that Pycharm is the most efficient way to run things without dealing with issues with the cmd line.
Python 3.4
virtualenv created by Pycharm
the code can be found on github: github.com/pdgonzalez872/microblog
Potential cause of the problem:
The problem may be with the path that I have set up (but why did it work until part 4?)
The code itself (maybe something was updated in flask/other libraries since the post?)
views.py isn't meant to be launched separately, there is run.py file to start the project.
Also, it uses relative imports (those with dots before module names), which don't work when you use them in a script passed to the interpreter and used as main. Sorry, I can't explain it well, but maybe you will be interested in those links:
https://docs.python.org/2/tutorial/modules.html#intra-package-references
How to do relative imports in Python?

Python3/MacOSX integration into pycharm

I have had trouble setting up the pycharm ide on my macosx10.7 with python3..
I have scoured every resource available and tried hundreds of approaches, at this point I must accept my incompetence and seek help via this channel.
In my research, I notice a lack of ground-up explanations on python integration into macosx and how to configure pycharm to import modules, run code within the editor, etc. If i ever solve this I will make a very detailed tutorial.
I have imported python3 successfully, it looks like it is linked appropriately from /sys/lib/frameworks to /usr/lib ...etc -- version control is working just fine.
I think my issue is either in setting environmental variables (tried the program to fix this and tried macports) and in the script needed to execute. it will catch errors throughout but final product does not run in python and returns printout of :
/Library/Frameworks/Python.framework/Versions/3.2/bin/python3.2 /Users/anon/Desktop/pythonpractice/Py_Ex/classes.py
Process finished with exit code 0
i really need to get this configuration sound for my python programming class. please help (I've been through every line of pycharm website) .. preferably is there a way to map it via terminal? thanks for anyone who took the time to read this.
Summary of the discussion above:
Python 3.2.2 installation was broken on this Mac, installing ActiveState Python 3.2.2 from scratch and configuring it in PyCharm has fixed the problem.
Python path to be used in PyCharm settings: /Library/Frameworks/Python.framework/Versions/3.2/bin/python3
Incompatible third-party plug-ins may break PyCharm, uninstall/disable them in Preferences | Plugins.
Ensure the latest PyCharm version is installed.
User's code depends on the graphics.py module which was not in the project or in the PYTHONPATH. Putting it into the project has solved the problem.
Most likely the wrong Run/Debug configuration was used in PyCharm, the easiest way to run or debug such scripts is by using the editor context menu Run and Debug actions. PyCharm creates the configuration automatically and debugging works fine as shown of the screenshot:
If one wants to configure and debug it, he can use the code.zip file to get started.
Sorry for the comments mess above, but it was not possible to move it into chat as user had only 1 reputation point, hence not able to use the chat feature of StackOverflow.

Categories