Code Monkey home page Code Monkey logo

dict4ini's People

Stargazers

 avatar

Forkers

pylixm kaffa

dict4ini's Issues

TypeError when trying to iterate an empty key

What steps will reproduce the problem?
from dict4ini import DictIni
ini = DictIni()
print 'foo' in ini

What is the expected output? What do you see instead?
It should return a boolean, but returns a TypeError:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Programming\Python25\lib\site-packages\dict4ini\dict4ini.py", 
line 94, in __getitem__
    self._root.setorder(self.get_full_keyname(name))
  File "C:\Programming\Python25\lib\site-packages\dict4ini\dict4ini.py", 
line 178, in get_full_keyname
    return self._section_delimeter.join(self._section + [key])
TypeError: sequence item 0: expected string, int found


What version of the product are you using? On what operating system?
I am using Python 2.5, dict4ini v0.9.2.2, and running on Windows XP SP2

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 4 Aug 2007 at 6:50

maximum recursion depth exceeded while calling a Python object

What steps will reproduce the problem?

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?
dict4ini-0.9.9-py2.6

Please provide any additional information below.

  File "build\bdist.win32\egg\dict4ini\dict4ini.py", line 223, in __contains__
    return name in self
RuntimeError: maximum recursion depth exceeded while calling a Python object

Original issue reported on code.google.com by [email protected] on 29 Oct 2012 at 3:47

support multi-level name read access

it doesn't support get the value by multi-level name:

    d = DictIni()
    d.a.b.c = 123
    d.a['x/y'] = 123
    assert(d.a.b.c == 123)
    assert(d.a.b['c'] == 123)
    assert(d.a['b/c'] == 123)
    assert(d['a/b/c'] == 123)
    assert(d.a.x.y == 123)
    assert(d.a.x['y'] == 123)
    assert(d.a['x/y'] == 123)
    assert(d['a/x/y'] == 123)

Original issue reported on code.google.com by [email protected] on 3 Nov 2009 at 8:53

UnicodeEncodeError

C:\Python25\Lib\dict4ini>C:\Python25\python.exe dict4ini.py
{}
{'a': 'b', 'c': {'d': (1, 2, 'b asf "aaa')}, 'b': 3, 'm': {'m': 'testing'},
'p':
 '\\?', 's': {'a': 1, 't': u'\u4e2d\u56fd'}, 't': {'m': {'p': '3'}}}
Traceback (most recent call last):
  File "dict4ini.py", line 508, in <module>
    d.save()
  File "dict4ini.py", line 235, in save
    f.write(self._savedict([], self._items, encoding))
  File "dict4ini.py", line 247, in _savedict
    buf.append(self._savedict(sec, value, encoding))
  File "dict4ini.py", line 254, in _savedict
    default.append(self._format % (key, self.uni_str(value, encoding)))
  File "dict4ini.py", line 429, in uni_str
    return self.protect_value(uni_prt(a, encoding))
  File "dict4ini.py", line 479, in uni_prt
    s.append('u"%s"' % t.encode(encoding))
  File "C:\Python25\lib\encodings\cp1252.py", line 12, in encode
    return codecs.charmap_encode(input,errors,encoding_table)
UnicodeEncodeError: 'charmap' codec can't encode characters in position
0-1: character maps to <undefined>

Original issue reported on code.google.com by [email protected] on 15 Feb 2008 at 10:52

dict4ini didn't paser the comment at same line with value

i paser supervisor.conf ini file through dict4ini,the file's format like belows:

; Sample supervisor config file.

[unix_http_server]
file=/tmp/supervisor.sock   ; (the path to the socket file)
;chmod=0700                 ; sockef file mode (default 0700)
;chown=nobody:nogroup       ; socket file uid:gid owner
;username=user              ; (default is no username (open server))
;password=123               ; (default is no password (open server))

[inet_http_server]         ; inet (TCP) server disabled by default
port=127.0.0.1:9001        ; (ip_address:port specifier, *:port for all iface)
;username=user              ; (default is no username (open server))
;password=123               ; (default is no password (open server))

it will contain the comment at same line with value,here is the detail code


In [10]: x=dict4ini.DictIni("supervisord.conf",commentdelimeter=";")

In [11]: x.inet_http_server.port
Out[11]: {}

In [12]: x.unix_http_server
Out[12]: {'file': '/tmp/supervisor.sock   ; (the path to the socket file)'}

In [13]: x.inet_http_server
Out[13]: {'port': {}}

In [14]: help(dict4ini.Dict4Ini)

you can see the `file` key has the wrong value,it contains comment content

also the `port` key didn't get any value


Original issue reported on code.google.com by FREDERICK.Mao on 24 Sep 2010 at 3:53

0.9.7版本的Encrypt options无效

dict4ini 0.9.7
Python 2.6.5

验证Example 8 Encrypt options的时候,文件中并未正常加密。

看了一下程序,是因为用import hashlib来代替了import 
sha,但是hashlib.new与sha.new略有不同,所以。。。。。。

Original issue reported on code.google.com by [email protected] on 17 Apr 2011 at 3:48

unicode problem?

What steps will reproduce the problem?

Windows XP SP3 zh_CN
Python 2.6.6 on win32
dict4ini 0.9.6

>>> import dict4ini
>>> d = dict4ini.DictIni("test.ini")

>>> p = {'client': {'root': u'C:\\tmp\\\u540c\u6b65\u6587\u4ef6'}}
>>> d.update(p)
>>> d.save()
### ok

>>> p = {'client': {u'root': u'C:\\tmp\\\u540c\u6b65\u6587\u4ef6'}}
>>> d.update(p)
>>> d.save()
### UnicodeDecodeError
and all data in test.ini has gone!

Original issue reported on code.google.com by [email protected] on 17 Jan 2011 at 7:47

可否支持读取嵌套列表

现在dict4ini可以保存嵌套列表,

例如:[[1,2,3],[1,2,4]] 保存效果为1,2,3,,1,2,4,,

但是读取的时候,就变成了[1, 2, 3, '', 1, 2, 4, '']

能否还原呢?

Original issue reported on code.google.com by [email protected] on 3 May 2012 at 12:53

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.