sublime text 2 phpcs plugin python error - plugins

I am using Sublime Text 2 with some plugins. I can't seem to work with the Phpcs plugin, because after saving the file, it gives me an ugly error:
Writing file /Applications/XAMPP/xamppfiles/htdocs/myProject/application/libraries/Authentication.php with encoding UTF-8
Exception in thread Thread-15:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 532, in __bootstrap_inner
self.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 484, in run
self.__target(*self.__args, **self.__kwargs)
File "./phpcs.py", line 398, in run
File "./phpcs.py", line 128, in get_errors
File "./phpcs.py", line 194, in execute
File "./phpcs.py", line 197, in parse_report
File "./phpcs.py", line 149, in shell_out
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 623, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1141, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
I have also tried to look into the respective files, but I don't know python at all so I don;t know what to do :-/
Could You please help ?

I ended up using SublimeLinter plugin that provides the showing-potential-errors feature that I wanted from the phpcs plugin.
The plugin is located in THIS GITHUB REPO.
Hope this helps anybody who is having a problem using the phpcs library.
#daniel: Thanks for help

Related

Running the Tensorflow2 upgrade Script triggers an encoding error

I am currently trying to upgrade a script to be compatible with tensorflow2 by using the jupyter notebook that is provided in https://www.tensorflow.org/guide/upgrade, so that I can run it in google colab, however when I run this cell (from an Anaconda environment in windows):
!tf_upgrade_v2 \
--infile D:/Multiclass.py\
--outfile /tmp/upgraded_Multiclass_CNN_V01_31012020Copy.py
I get an encoding error:
Traceback (most recent call last):
File "d:\programdata\miniconda3\envs\env_dlexp1\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "d:\programdata\miniconda3\envs\env_dlexp1\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\ProgramData\Miniconda3\envs\Env_DLexp1\Scripts\tf_upgrade_v2.exe\__main__.py", line 7, in <module>
File "C:\Users\user\AppData\Roaming\Python\Python37\site-packages\tensorflow_core\tools\compatibility\tf_upgrade_v2_main.py", line 139, in main
args.input_file, output_file, upgrade)
File "C:\Users\user\AppData\Roaming\Python\Python37\site-packages\tensorflow_core\tools\compatibility\tf_upgrade_v2_main.py", line 40, in process_file
upgrader.process_file(in_filename, out_filename)
File "C:\Users\user\AppData\Roaming\Python\Python37\site-packages\tensorflow_core\tools\compatibility\ast_edits.py", line 900, in process_file
temp_file)
File "C:\Users\user\AppData\Roaming\Python\Python37\site-packages\tensorflow_core\tools\compatibility\ast_edits.py", line 958, in process_opened_file
lines = in_file.readlines()
File "d:\programdata\miniconda3\envs\env_dlexp1\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 14: character maps to <undefined>
I would normally change the encoding to utf-8 by doing this: open(path, mode, encoding='UTF8')
,but in this case I am clueless. I am not a programmer, so my proficiency is very limited. Please help me understand this error.
Try editing with open in line 918 of function process_file in ast_edits.py and specify encoding='utf-8', so that in the function process_opened_file the file can be read with utf-8.

Librabbitmq 2.0.0 with Python 3 gives TypeError: can't pickle memoryview objects

I am using the latest master branch of the git repo https://github.com/celery/librabbitmq and installing librabbitmq==2.0.0 for Python 3.6 by following the instructions in the readme
Using the development version
You can clone the repository by doing the following:
$ git clone git://github.com/celery/librabbitmq.git
Then install it by doing the following:
$ cd librabbitmq
$ make install # or make develop
This works fine (after installing certain binaries for c compliation in the OS), but when I then make a small a+b add task and call it with add.delay(2,2) it fails with the following error. I looked up and saw that Celery 4 uses json as serializer, so clearly it is not because if pickle serialization
Changing from librabbitmq to pyamqp broker works normally
Same exact situation in both MacOS and Ubuntu 16
[2018-04-30 23:40:02,956: CRITICAL/MainProcess] Unrecoverable error:
SystemError(' returned a result with an error set',) Traceback (most
recent call last): File
"/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/kombu/messaging.py",
line 624, in _receive_callback
return on_m(message) if on_m else self.receive(decoded, message) File
"/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/celery/worker/consumer/consumer.py",
line 570, in on_task_received
callbacks, File "/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/celery/worker/strategy.py",
line 145, in task_message_handler
handle(req) File "/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/celery/worker/worker.py",
line 221, in _process_task_sem
return self._quick_acquire(self._process_task, req) File "/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/kombu/async/semaphore.py",
line 62, in acquire
callback(*partial_args, **partial_kwargs) File "/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/celery/worker/worker.py",
line 226, in _process_task
req.execute_using_pool(self.pool) File "/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/celery/worker/request.py",
line 531, in execute_using_pool
correlation_id=task_id, File "/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/celery/concurrency/base.py",
line 155, in apply_async
**options) File "/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/billiard/pool.py",
line 1486, in apply_async
self._quick_put((TASK, (result._job, None, func, args, kwds))) File
"/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/celery/concurrency/asynpool.py",
line 813, in send_job
body = dumps(tup, protocol=protocol) TypeError: can't pickle memoryview objects
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File
"/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/celery/worker/worker.py",
line 203, in start
self.blueprint.start(self) File "/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/celery/bootsteps.py",
line 119, in start
step.start(parent) File "/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/celery/bootsteps.py",
line 370, in start
return self.obj.start() File "/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/celery/worker/consumer/consumer.py",
line 320, in start
blueprint.start(self) File "/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/celery/bootsteps.py",
line 119, in start
step.start(parent) File "/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/celery/worker/consumer/consumer.py",
line 596, in start
c.loop(*c.loop_args()) File "/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/celery/worker/loops.py",
line 88, in asynloop
next(loop) File "/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/kombu/async/hub.py",
line 354, in create_loop
cb(*cbargs) File "/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/kombu/transport/base.py",
line 236, in on_readable
reader(loop) File "/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/kombu/transport/base.py",
line 218, in _read
drain_events(timeout=0) File "/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/librabbitmq-2.0.0-py3.6-macosx-10.6-intel.egg/librabbitmq/init.py",
line 227, in drain_events
self._basic_recv(timeout) SystemError: returned a result with an error set
This library is not recommended to use as rabbitmq broker with celery. Instead please try py-amqp. this is more maintained and less buggy.

Archlinux: obmenu won't start

I'm on openbox at Arch Linux and recently installed my system.
I want to use obmenu to configure the menu.
But for some reason, it is not working.
Error at startup:
Traceback (most recent call last):
File "/usr/bin/obmenu", line 582, in <module>
app.init()
File "/usr/bin/obmenu", line 489, in init
self.menu.loadMenu(self.menu_path)
File "/usr/lib/python2.7/site-packages/obxml.py", line 153, in loadMenu
self.dom = xml.dom.minidom.parseString(fil.read())
File "/usr/lib/python2.7/xml/dom/minidom.py", line 1928, in parseString
return expatbuilder.parseString(string)
File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 940, in parseString
return builder.parseString(string)
File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 223, in parseString
parser.Parse(string, True)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 167, column 27
What is going wrong?
I already solved it. My menu contained an Formatting Mistake!
First you have to remove
rm ~/.config/openbox/menu.xml
and then
cp /etc/xdg/openbox/menu.xml ~/.config/openbox
after that obmenu will work.
Look at the http://obmenu.sourceforge.net/doc.html.
The problem is that you have menu.xml which does't have correct syntax. Evan empty file is wrong.

Cant't deploy after update new version parseconsole.exe

today I've updated my parseconsole.exe and I can't deploy my code when yesterday I could.
I've try to do another develop but the same error happens, this is the trace:
> parse new WebContent
Creating directory C:\Users\NOTEBOOK\Documents\docs\Parse\Works_pars
e_luna\Prueba_node\WebContent\config
Creating config file C:\Users\NOTEBOOK\Documents\docs\Parse\Works_pa
rse_luna\Prueba_node\WebContent\config\global.json
Creating directory C:\Users\NOTEBOOK\Documents\docs\Parse\Works_pars
e_luna\Prueba_node\WebContent\cloud
Writing out sample file C:\Users\NOTEBOOK\Documents\docs\Parse\Works
_parse_luna\Prueba_node\WebContent\cloud\main.js
Creating directory C:\Users\NOTEBOOK\Documents\docs\Parse\Works_pars
e_luna\Prueba_node\WebContent\public
Writing out sample file C:\Users\NOTEBOOK\Documents\docs\Parse\Works
_parse_luna\Prueba_node\WebContent\public\index.html
Email: xxxxxx
Password:
1: prueba
2: prueba_cloud
Select an App: 2
PS C:\Users\NOTEBOOK\Documents\docs\Parse\Works_parse_luna\Prueba_no
de> cd WebContent
PS C:\Users\NOTEBOOK\Documents\docs\Parse\Works_parse_luna\Prueba_no
de\WebContent> parse deploy
Uploading source files
Traceback (most recent call last):
File "<string>", line 6, in <module>
File ".\build\pyi.win32\parse\out00-PYZ.pyz\main", line 695, in main
File ".\build\pyi.win32\parse\out00-PYZ.pyz\main", line 206, in handle_deploy
File ".\build\pyi.win32\parse\out00-PYZ.pyz\parse", line 332, in deploy
File ".\build\pyi.win32\parse\out00-PYZ.pyz\parse", line 231, in upload_source
_files
File ".\build\pyi.win32\parse\out00-PYZ.pyz\parse", line 39, in post
File ".\build\pyi.win32\parse\out00-PYZ.pyz\urllib2", line 126, in urlopen
File ".\build\pyi.win32\parse\out00-PYZ.pyz\urllib2", line 391, in open
File ".\build\pyi.win32\parse\out00-PYZ.pyz\urllib2", line 409, in _open
File ".\build\pyi.win32\parse\out00-PYZ.pyz\urllib2", line 369, in _call_chain
File ".\build\pyi.win32\parse\out00-PYZ.pyz\urllib2", line 1178, in https_open
File ".\build\pyi.win32\parse\out00-PYZ.pyz\urllib2", line 1142, in do_open
File ".\build\pyi.win32\parse\out00-PYZ.pyz\httplib", line 914, in request
File ".\build\pyi.win32\parse\out00-PYZ.pyz\httplib", line 954, in _send_request
File ".\build\pyi.win32\parse\out00-PYZ.pyz\httplib", line 759, in send
File ".\build\pyi.win32\parse\out00-PYZ.pyz\ssl", line 203, in sendall
File ".\build\pyi.win32\parse\out00-PYZ.pyz\ssl", line 174, in send
TypeError: write() argument 1 must be string or read-only buffer, not bytearray
thaks for your help
After reading https://stackoverflow.com/a/26982677/2211980, it seems that Parse has released a new version. I've just downloaded it from: https://www.parse.com/downloads/windows/console/parse.zip.
There is a deprecated warning but after seeing exactly the same errors as yours yesterday, I can now deploy, thankfully.
I know this thread is old but it may help newcomers in the future,
Parse announed that they made a change that require everyone to manually download the newest version of their CLI as of today (7.2.2015) the current version is 2.1.2 you can download it directly from the Parse.com
or if you like I made a repo containing the files for it, CLI Repo
Hope it helps.
Now there is a new version that is working.
Parse CLI v3.0.2
https://github.com/ParsePlatform/parse-cli/releases/

Error when creating virtualenv folder

I am working through the book Test Driven Devlopement, and am currently having a problem when I try to create a virtualenv folder using:
virtualenv --python=python3 ../virtualenv
I keep on getting this output:
Traceback (most recent call last):
File "C:\Python33\lib\runpy.py", line 160, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:\Python33\lib\runpy.py", line 73, in _run_code
exec(code, run_globals)
File "C:\Python33\Scripts\virtualenv.exe\__main__.py", line 9, in <module>
File "C:\Python33\lib\site-packages\virtualenv.py", line 774, in main
interpreter = resolve_interpreter(options.python)
File "C:\Python33\lib\site-packages\virtualenv.py", line 1575, in resolve_interpreter
python_versions = get_installed_pythons()
File "C:\Python33\lib\site-packages\virtualenv.py", line 93, in get_installed_pythons
path = winreg.QueryValue(python_core, "%s\\InstallPath" % ver)
FileNotFoundError: [WinError 2] The system cannot find the file specified
You are on windows: ../virutalenv is for unix
On unix, you are telling virtualenv to create a virtualenv directory in the directory up one level (previous) also windows uses backslash instead of slash.
Try to find a tutorial that is windows oriented, or if you can get your hand on a unix/linux machine, or maybe install cygwin.