Comments (7)
I have been facing a similar issue with basic queries.
Here's what my function looks like:
def getTaskAppCount(Object):
myClassName = "EarnNowTaskApplication"
myClass = Object.factory(myClassName)
all_scores = myClass.Query.all()
print(type(all_scores))
for score in all_scores:
# do something
return someValue
The function fails with:
if _is_illegal_header_value(values[i]):
TypeError: expected string or bytes-like object
What am I doing wrong?
from parsepy.
Hey guys @Dhanesh95 @fuzunspm
Sorry I've really dropped the ball on this project. I inherited it from the previous maintained because he didn't use it / have time for it anymore, and now I'm in the same position! Embarrassing, I'm sorry.
Since parse-server has been open sourced, there has been a lot of changes to it. It might make sense to start a fresh project targeting latest python3 / asyncio and the latest parse.
That said, I am unable to reproduce these bugs. I tried in both python3 (3.6) and python2. I'm running against parse-server 2.7.1.
Could you please put together a single file that reproduces the bug and paste it here? And let me know exactly which versions of Python and parse-server you are running.
Googling for this "is_illegal_header_value" turns up some other projects having issues with Python 3.5+ related to \n
in header values: Evernote/evernote-sdk-python3#16 which stems from a fix to https://bugs.python.org/issue22928
But I don't see anywhere in this project that is inserting \n
into header values (at least at a quick glance). And as I said I cannot reproduce this bug. Are you sure you are not including a newline somewhere? Perhaps in some of your environment variables used to configure parse?
from parsepy.
Are you running on windows?
from parsepy.
I tried reproducing this in a bunch of scenarios:
- Python3 / Python2
- Master key / logged in as user
- GET queries
- POST save objects
- Proxy / no proxy
(One thing -- I am running parse_server behind nginx, and not so easy for me to change that in my current setup. Maybe this is the issue, idk.)
Unable to reproduce. Here is the code I'm using:
Logged in user:
import os
os.environ["PARSE_API_ROOT"] = "http://localhost:9595/api/parse"
from parse_rest.datatypes import Function, Object, GeoPoint, File
from parse_rest.connection import register
from parse_rest.query import QueryResourceDoesNotExist
from parse_rest.connection import ParseBatcher
from parse_rest.connection import SessionToken
from parse_rest.core import ResourceRequestBadRequest, ParseError
from parse_rest.user import User
from parse_rest.connection import SessionToken, register
from pprint import pprint
APPLICATION_ID = 'appID'
REST_API_KEY = 'restAPIKey'
register(APPLICATION_ID, REST_API_KEY)
class Fund(Object):
pass
u = User.login('[email protected]', 'test')
print(u.sessionToken)
with SessionToken(u.sessionToken):
funds = Fund.Query.all()
for fund in funds:
print(fund)
fund2 = Fund(fundName='test name')
fund2.save()
Master key:
import os
os.environ["PARSE_API_ROOT"] = "http://localhost:9595/api/parse"
from parse_rest.datatypes import Function, Object, GeoPoint, File
from parse_rest.connection import register
from parse_rest.query import QueryResourceDoesNotExist
from parse_rest.connection import ParseBatcher
from parse_rest.connection import SessionToken
from parse_rest.core import ResourceRequestBadRequest, ParseError
from parse_rest.user import User
from parse_rest.connection import SessionToken, register
from pprint import pprint
APPLICATION_ID = 'appID'
REST_API_KEY = 'restAPIKey'
MASTER_KEY = 'masterKey'
register(APPLICATION_ID, REST_API_KEY, master_key=MASTER_KEY)
class Fund(Object):
pass
funds = Fund.Query.all()
for fund in funds:
print(fund)
fund2 = Fund(fundName='test name')
fund2.save()
from parsepy.
Bunch more info here: https://www.google.com/search?q=%22_is_illegal_header_value%22
from parsepy.
@milesrichardson Thanks a ton for your quick response!
It works now. Turns out it was an incorrect environment variable. Sorry for the false alarm!
I was extremely happy to find out about this project today and I'm sorry to hear that you have dropped the ball. Thanks a lot for your efforts.
from parsepy.
It still works for 99% of use cases as far as I know. I wouldn't be scared to use it. I'm also happy to review any PRs for bugs you encounter. Just don't have time to add new features.
from parsepy.
Related Issues (20)
- Incorrect URLs for AWS hosted files HOT 2
- Fix for file uploads HOT 4
- parse-py not pointing to the self-hosted server HOT 2
- Nodechef.com returns only last object with valid data HOT 4
- Ability to access config options. HOT 2
- datetime type in User class HOT 1
- Regex matching for string types does not appear to function HOT 1
- How To Retrieve Objects based on Other Unique Columns
- Cannot use Master Key with a logged in user
- Query constraints
- Batch save isn't working properly HOT 2
- Query Nested attributes HOT 1
- Query for string in array
- SSL: CERTIFICATE_VERIFY_FAILED
- get ACL in an object HOT 1
- Trouble Registering With Bitnami Parse-Server AWS Image HOT 1
- Distinct Queries
- urllib.error.URLError: <urlopen error unknown url type: b'http>, HOT 1
- Proposing a PR to fix a few small typos
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parsepy.