TypeError: not all arguments converted during string formatting

Imported from database lib/webnotes/../conf/Framework.sql
Installing app...
Traceback (most recent call last):
  File "./lib/wnf.py", line 803, in <module>
    main()
  File "./lib/wnf.py", line 23, in main
    run(fn, parsed_args)
  File "./lib/wnf.py", line 43, in run
    out = globals().get(fn)(**args)
  File "./lib/wnf.py", line 34, in new_fn
    return fn(*args, **new_kwargs)
  File "./lib/wnf.py", line 230, in reinstall
    install(webnotes.conf.db_name, site=site, verbose=verbose, force=True)
  File "./lib/wnf.py", line 34, in new_fn
    return fn(*args, **new_kwargs)
  File "./lib/wnf.py", line 224, in install
    inst.install(db_name, source_sql=source_sql, verbose=verbose, force=force, admin_password=admin_password)
  File "lib/webnotes/install_lib/install.py", line 88, in install
    self.install_app(verbose=verbose)
  File "lib/webnotes/install_lib/install.py", line 104, in install_app
    sync_for("lib", force=True, sync_everything=True, verbose=verbose)
  File "lib/webnotes/model/sync.py", line 20, in sync_for
    return walk_and_sync(get_path(folder), force, sync_everything, verbose=verbose)
  File "lib/webnotes/model/sync.py", line 45, in walk_and_sync
    if import_file(module_name, doctype, name, force=force) and verbose:
  File "lib/webnotes/modules/import_file.py", line 30, in import_file
    ret = import_file_by_path(path, force)
  File "lib/webnotes/modules/import_file.py", line 51, in import_file_by_path
    import_doclist(doclist)
  File "lib/webnotes/modules/import_file.py", line 101, in import_doclist
    new_bean.insert()
  File "lib/webnotes/model/bean.py", line 260, in insert
    return self.save()
  File "lib/webnotes/model/bean.py", line 302, in save
    self.save_main()
  File "lib/webnotes/model/bean.py", line 359, in save_main
    self.doc.save(check_links = False, ignore_fields = self.ignore_fields)
  File "lib/webnotes/model/doc.py", line 210, in save
    r = self._insert(make_autoname=make_autoname, keep_timestamps = keep_timestamps)
  File "lib/webnotes/model/doc.py", line 301, in _insert
    self.name = validate_name(self.doctype, self.name, self._meta.name_case)
  File "lib/webnotes/model/doc.py", line 688, in validate_name
    if webnotes.conn.sql('select name from `tab%s` where name=%s' % (doctype,'%s'), name):
  File "lib/webnotes/db.py", line 97, in sql
    self._cursor.execute(query, values)
  File "/usr/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 187, in execute
    query = query % tuple([db.literal(item) for item in args])
TypeError: not all arguments converted during string formatting



May I know what problems happen? Thanks!



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
I faced this when I fresh install the system.

On Tuesday, 7 January 2014 02:32:21 UTC+8, Kenneth K wrote:
Imported from database lib/webnotes/../conf/Framework.sql
Installing app...
Traceback (most recent call last):
  File "./lib/wnf.py", line 803, in <module>
    main()
  File "./lib/wnf.py", line 23, in main
    run(fn, parsed_args)
  File "./lib/wnf.py", line 43, in run
    out = globals().get(fn)(**args)
  File "./lib/wnf.py", line 34, in new_fn
    return fn(*args, **new_kwargs)
  File "./lib/wnf.py", line 230, in reinstall
    install(webnotes.conf.db_name, site=site, verbose=verbose, force=True)
  File "./lib/wnf.py", line 34, in new_fn
    return fn(*args, **new_kwargs)
  File "./lib/wnf.py", line 224, in install
    inst.install(db_name, source_sql=source_sql, verbose=verbose, force=force, admin_password=admin_password)
  File "lib/webnotes/install_lib/install.py", line 88, in install
    self.install_app(verbose=verbose)
  File "lib/webnotes/install_lib/install.py", line 104, in install_app
    sync_for("lib", force=True, sync_everything=True, verbose=verbose)
  File "lib/webnotes/model/sync.py", line 20, in sync_for
    return walk_and_sync(get_path(folder), force, sync_everything, verbose=verbose)
  File "lib/webnotes/model/sync.py", line 45, in walk_and_sync
    if import_file(module_name, doctype, name, force=force) and verbose:
  File "lib/webnotes/modules/import_file.py", line 30, in import_file
    ret = import_file_by_path(path, force)
  File "lib/webnotes/modules/import_file.py", line 51, in import_file_by_path
    import_doclist(doclist)
  File "lib/webnotes/modules/import_file.py", line 101, in import_doclist
    new_bean.insert()
  File "lib/webnotes/model/bean.py", line 260, in insert
    return self.save()
  File "lib/webnotes/model/bean.py", line 302, in save
    self.save_main()
  File "lib/webnotes/model/bean.py", line 359, in save_main
    self.doc.save(check_links = False, ignore_fields = self.ignore_fields)
  File "lib/webnotes/model/doc.py", line 210, in save
    r = self._insert(make_autoname=make_autoname, keep_timestamps = keep_timestamps)
  File "lib/webnotes/model/doc.py", line 301, in _insert
    self.name = validate_name(self.doctype, self.name, self._meta.name_case)
  File "lib/webnotes/model/doc.py", line 688, in validate_name
    if webnotes.conn.sql('select name from `tab%s` where name=%s' % (doctype,'%s'), name):
  File "lib/webnotes/db.py", line 97, in sql
    self._cursor.execute(query, values)
  File "/usr/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 187, in execute
    query = query % tuple([db.literal(item) for item in args])
TypeError: not all arguments converted during string formatting



May I know what problems happen? Thanks!



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Hi Kenneth,

It is a recent issue. With the release of Python-MySQL 1.2.5, it does not allow strings as values, but only tuples and dict.

As an immediate solution, please run:
pip install --upgrade MySQL-python==1.2.4

Thanks,
Anand.


On Tue, Jan 7, 2014 at 12:11 AM, Kenneth K <ke...@yahoo.com.hk> wrote:
I faced this when I fresh install the system.


On Tuesday, 7 January 2014 02:32:21 UTC+8, Kenneth K wrote:
Imported from database lib/webnotes/../conf/Framework.sql

Installing app…
Traceback (most recent call last):
File "./lib/wnf.py", line 803, in <module>
main()
File "./lib/wnf.py", line 23, in main
run(fn, parsed_args)
File "./lib/wnf.py", line 43, in run

out = globals().get(fn)(**args)<br>  File &quot;./lib/wnf.py&quot;, line 34, in new_fn<br>    return fn(*args, **new_kwargs)<br>  File &quot;./lib/wnf.py&quot;, line 230, in reinstall<br>    install(webnotes.conf.db_name, site=site, verbose=verbose, force=True)<br>

File "./lib/wnf.py", line 34, in new_fn
return fn(*args, **new_kwargs)
File "./lib/wnf.py", line 224, in install
inst.install(db_name, source_sql=source_sql, verbose=verbose, force=force, admin_password=admin_password)

File "lib/webnotes/install_lib/install.py", line 88, in install
self.install_app(verbose=verbose)
File "lib/webnotes/install_lib/install.py", line 104, in install_app

sync_for(&quot;lib&quot;, force=True, sync_everything=True, verbose=verbose)<br>  File &quot;lib/webnotes/model/sync.py&quot;, line 20, in sync_for<br>    return walk_and_sync(get_path(folder)<u></u>, force, sync_everything, verbose=verbose)<br>

File "lib/webnotes/model/sync.py", line 45, in walk_and_sync
if import_file(module_name, doctype, name, force=force) and verbose:
File "lib/webnotes/modules/import_file.py", line 30, in import_file

ret = import_file_by_path(path, force)<br>  File &quot;lib/webnotes/modules/import_<u></u>file.py&quot;, line 51, in import_file_by_path<br>    import_doclist(doclist)<br>  File &quot;lib/webnotes/modules/import_<u></u>file.py&quot;, line 101, in import_doclist<br>

new_bean.insert()<br>  File &quot;lib/webnotes/model/bean.py&quot;, line 260, in insert<br>    return self.save()<br>  File &quot;lib/webnotes/model/bean.py&quot;, line 302, in save<br>    self.save_main()<br>  File &quot;lib/webnotes/model/bean.py&quot;, line 359, in save_main<br>

self.doc.save(check_links = False, ignore_fields = self.ignore_fields)<br>  File &quot;lib/webnotes/model/doc.py&quot;, line 210, in save<br>    r = self._insert(make_autoname=<u></u>make_autoname, keep_timestamps = keep_timestamps)<br>

File "lib/webnotes/model/doc.py", line 301, in _insert
self.name = validate_name(self.doctype, self.name, self._meta.name_case)

File "lib/webnotes/model/doc.py", line 688, in validate_name
if webnotes.conn.sql('select name from tab%s where name=%s' % (doctype,'%s'), name):
File "lib/webnotes/db.py", line 97, in sql

self._cursor.execute(query, values)<br>  File &quot;/usr/local/lib/python2.7/<u></u>site-packages/MySQLdb/cursors.<u></u>py&quot;, line 187, in execute<br>    query = query % tuple([db.literal(item) for item in args])<br>

TypeError: not all arguments converted during string formatting



May I know what problems happen? Thanks!



Note:



If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.



    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.




Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.