Comments (5)
as is iniconfig is not unicode aware, so this one is a really tricky one to fix
its def not on my own roadmap
from iniconfig.
@RonnyPfannschmidt what about doing strip as (in case the content read from the file is of type unicode):
>>> from unicodedata import name
>>> import sys
>>> import re
>>> spaces = u''.join(re.findall(r'\s', u''.join(unichr(c) for c in xrange(sys.maxunicode+1)), re.UNICODE))
>>> 'envlist '.strip(spaces)
u'envlist'
>>> name(u'\xA0')
'NO-BREAK SPACE
>>> u'envlist\xA0'.strip(spaces)
u'envlist'
>>>
from iniconfig.
An alternative solution would be to try to avoid such configs by either warning when such lines are detected.
from iniconfig.
i am fine with any consistent solution - i just don't dont have the time/motivation to do the complete dance of ensuring its consistent
right now iniconfig is not unicode aware and works in terms of native strings and ascii whitespace
note that your example generates the spaces in a pretty expensive manner
from iniconfig.
@gaborbernat with the new release unicode support is in but unicode whitespace is not yet considered
from iniconfig.
Related Issues (20)
- Missing 1.0.1 changelog HOT 2
- Packaging version issue with latest release 1.1.0 HOT 7
- Building wheel for iniconfig failed: Permission denied HOT 5
- publish wheels HOT 17
- Can't install 1.1.1 via pipenv for python 3.7+ HOT 3
- Outdated readme HOT 1
- Project copyright? HOT 3
- handle indented starting lines HOT 3
- Occurred 'cp949' error in IniConfig class HOT 6
- Continuous fuzzing by way of OSS-Fuzz HOT 4
- OSS-Fuzz issue 49779 HOT 4
- OSS-Fuzz issue 49798 HOT 1
- Maybe `utf-8` is the best choise for solve decode error.
- Is class IniConfig support char code option?
- Specify encoding explictly in the `IniConfig` constructor HOT 4
- Please make a new release HOT 2
- Comments included in values HOT 7
- Missing tests from the pypi tarball.
- A
- Avoid using setup_requires parameter in setup.py HOT 3
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 iniconfig.